File optional-wayland.patch of Package qterminal

diff -ruN qterminal-2.0.1/CMakeLists.txt qterminal-2.0.1.optional-wayland/CMakeLists.txt
--- qterminal-2.0.1/CMakeLists.txt	2024-06-27 13:21:53.000000000 -0400
+++ qterminal-2.0.1.optional-wayland/CMakeLists.txt	2024-09-13 02:53:39.024025921 -0400
@@ -31,7 +31,7 @@
 find_package(Qt6Gui ${QT_MINIMUM_VERSION} REQUIRED)
 find_package(Qt6LinguistTools ${QT_MINIMUM_VERSION} REQUIRED)
 find_package(Qt6Widgets ${QT_MINIMUM_VERSION} REQUIRED)
-find_package(LayerShellQt ${SHELLQT_MINIMUM_VERSION} REQUIRED)
+find_package(LayerShellQt ${SHELLQT_MINIMUM_VERSION})
 if(UNIX)
     find_package(Qt6DBus ${QT_MINIMUM_VERSION} REQUIRED)
     find_package(Qt6 COMPONENTS Core REQUIRED)
@@ -209,8 +209,12 @@
     Qt6::Gui
     Qt6::Widgets
     qtermwidget6
-    LayerShellQtInterface
 )
+if (LAYERSHELLQT_FOUND)
+    add_definitions(-DUSE_LAYERSHELLQT)
+    target_link_libraries(${EXE_NAME} LayerShellQtInterface)
+endif()
+
 if(QXT_FOUND)
     target_link_libraries(${EXE_NAME} ${QXT_CORE_LIB} ${QXT_GUI_LIB})
 endif()
diff -ruN qterminal-2.0.1/src/mainwindow.cpp qterminal-2.0.1.optional-wayland/src/mainwindow.cpp
--- qterminal-2.0.1/src/mainwindow.cpp	2024-06-27 13:21:53.000000000 -0400
+++ qterminal-2.0.1.optional-wayland/src/mainwindow.cpp	2024-09-13 02:57:06.570410322 -0400
@@ -44,8 +44,10 @@
 #include "qterminalapp.h"
 #include "dbusaddressable.h"
 
+#ifdef USE_LAYERSHELLQT
 #include <LayerShellQt/Shell>
 #include <LayerShellQt/Window>
+#endif
 
 typedef std::function<bool(MainWindow&, QAction *)> checkfn;
 Q_DECLARE_METATYPE(checkfn)
@@ -171,6 +173,7 @@
 
 void MainWindow::enableDropMode()
 {
+#ifdef USE_LAYERSHELLQT
     if (QGuiApplication::platformName() == QStringLiteral("wayland"))
     {
         winId();
@@ -185,6 +188,7 @@
             }
         }
     }
+#endif
 
     setWindowFlags(Qt::Dialog | Qt::WindowStaysOnTopHint | Qt::CustomizeWindowHint);
 
openSUSE Build Service is sponsored by