Skip to content

Commit

Permalink
fix(wayland-warn): Make Wayland warning a compile-time option
Browse files Browse the repository at this point in the history
Tweak the GUI startup warning regarding Wayland to be a compile-time
flag. This is enabled by default, but can be disabled.

Signed-off-by: Dom Rodriguez <[email protected]>
  • Loading branch information
shymega committed Feb 22, 2024
1 parent 7da1843 commit d688171
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ option(INPUTLEAP_BUILD_TESTS "Build the tests" ON)
option(INPUTLEAP_USE_EXTERNAL_GTEST "Use external installation of Google Test framework" OFF)
option(INPUTLEAP_BUILD_X11 "Build with XWindows support" ON)
option(INPUTLEAP_BUILD_LIBEI "Build with libei support" OFF)
option(INPUTLEAP_WAYLAND_WARN_USER "Warn upon GUI start about Wayland support" ON)

set (CMAKE_EXPORT_COMPILE_COMMANDS ON)
set (CMAKE_CXX_STANDARD 14)
Expand Down Expand Up @@ -66,6 +67,11 @@ if (INPUTLEAP_BUILD_GUI)
set(REQUIRED_QT_VERSION 6.2)
endif()

if (INPUTLEAP_WAYLAND_WARN_USER)
add_definitions(-DINPUTLEAP_WAYLAND_WARN_USER=1)
set(INPUTLEAP_WAYLAND_WARN_USER 1)
endif()

find_package(Qt${QT_DEFAULT_MAJOR_VERSION} COMPONENTS Core REQUIRED)
get_target_property(qmake_executable Qt${QT_DEFAULT_MAJOR_VERSION}::qmake IMPORTED_LOCATION)
get_filename_component(_qt_bin_dir "${qmake_executable}" DIRECTORY)
Expand Down
3 changes: 2 additions & 1 deletion src/gui/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ void copy_qsettings(const QSettings &src, QSettings &dst)

int main(int argc, char* argv[])
{
#if (defined(WINAPI_XWINDOWS) || \
#if (defined(INPUTLEAP_WAYLAND_WARN_USER) && \
defined(WINAPI_XWINDOWS) || \
(defined(HAVE_LIBPORTAL_INPUTCAPTURE) || \
defined(HAVE_LIBPORTAL_SESSION_CONNECT_TO_EIS)))
const auto platformType = QGuiApplication::platformName();
Expand Down

0 comments on commit d688171

Please sign in to comment.