File optional-wayland.patch of Package lxqt-runner

diff -ruN lxqt-runner-2.0.0/CMakeLists.txt lxqt-runner-2.0.0.optional-wayland/CMakeLists.txt
--- lxqt-runner-2.0.0/CMakeLists.txt	2024-04-17 07:29:26.000000000 -0400
+++ lxqt-runner-2.0.0.optional-wayland/CMakeLists.txt	2024-09-12 23:22:18.808612780 -0400
@@ -38,7 +38,7 @@
 find_package(KF6WindowSystem ${KF6_MINIMUM_VERSION} REQUIRED)
 find_package(lxqt ${LXQT_MINIMUM_VERSION} REQUIRED)
 find_package(lxqt-globalkeys-ui ${LXQT_GLOBALKEYS_MINIMUM_VERSION} REQUIRED)
-find_package(LayerShellQt ${SHELLQT_MINIMUM_VERSION} REQUIRED)
+find_package(LayerShellQt ${SHELLQT_MINIMUM_VERSION})
 message(STATUS "Building with Qt${Qt6Core_VERSION}")
 
 include(LXQtPreventInSourceBuilds)
@@ -143,8 +143,13 @@
 target_link_libraries(${PROJECT_NAME}
     ${lxqt-runner_LIBRARIES}
     KF6::WindowSystem
-    LayerShellQtInterface
 )
+if (LAYERSHELLQT_FOUND)
+    add_definitions(-DUSE_LAYERSHELLQT)
+    target_link_libraries(${PROJECT_NAME}
+        LayerShellQtInterface
+    )
+endif()
 
 install(TARGETS
     ${PROJECT_NAME}
diff -ruN lxqt-runner-2.0.0/dialog.cpp lxqt-runner-2.0.0.optional-wayland/dialog.cpp
--- lxqt-runner-2.0.0/dialog.cpp	2024-04-17 07:29:26.000000000 -0400
+++ lxqt-runner-2.0.0.optional-wayland/dialog.cpp	2024-09-12 23:24:59.074919128 -0400
@@ -57,8 +57,10 @@
 #include <KWindowSystem>
 #include <KX11Extras>
 
+#ifdef USE_LAYERSHELLQT
 #include <LayerShellQt/Shell>
 #include <LayerShellQt/Window>
+#endif
 
 #define DEFAULT_SHORTCUT "Alt+F2"
 
@@ -206,6 +208,7 @@
 {
     if (QGuiApplication::platformName() == QSL("wayland"))
     {
+#ifdef USE_LAYERSHELLQT
         winId();
         if (QWindow *win = windowHandle())
         {
@@ -234,6 +237,7 @@
                 }
             }
         }
+#endif
     }
     else
     {
openSUSE Build Service is sponsored by