diff options
author | Ilya Fedin <fedin-ilja2010@ya.ru> | 2022-07-04 20:36:38 +0400 |
---|---|---|
committer | Ilya Fedin <fedin-ilja2010@ya.ru> | 2022-07-06 20:41:31 +0400 |
commit | edee40a179021323ebc0f7aafff506be3d34ef55 (patch) | |
tree | 423ca01e9e8c624c50a10e7bdea80c7bd886cea6 /src/plugins/platformthemes | |
parent | 6eda4919f252c53f313441afbedb4d0f98e94c9a (diff) |
QGtk3Theme: Use GDK X11-specific API only built with X11
And respect xlib config option
Pick-to: 6.4 6.3 6.2
Change-Id: I596097259ed008357e739c3cfe41ab2fc4e18db7
Reviewed-by: Dmitry Shachnev <mitya57@gmail.com>
Reviewed-by: Liang Qi <liang.qi@qt.io>
Diffstat (limited to 'src/plugins/platformthemes')
-rw-r--r-- | src/plugins/platformthemes/gtk3/CMakeLists.txt | 9 | ||||
-rw-r--r-- | src/plugins/platformthemes/gtk3/qgtk3dialoghelpers.cpp | 7 |
2 files changed, 14 insertions, 2 deletions
diff --git a/src/plugins/platformthemes/gtk3/CMakeLists.txt b/src/plugins/platformthemes/gtk3/CMakeLists.txt index 62e752bd92..03756688ee 100644 --- a/src/plugins/platformthemes/gtk3/CMakeLists.txt +++ b/src/plugins/platformthemes/gtk3/CMakeLists.txt @@ -1,7 +1,10 @@ # Generated from gtk3.pro. qt_find_package(GTK3) # special case -qt_find_package(X11) # special case + +if(QT_FEATURE_xlib) + qt_find_package(X11) # special case +endif() ##################################################################### ## QGtk3ThemePlugin Plugin: @@ -24,6 +27,10 @@ qt_internal_add_plugin(QGtk3ThemePlugin Qt::CorePrivate Qt::Gui Qt::GuiPrivate +) + +qt_internal_extend_target(QGtk3ThemePlugin CONDITION QT_FEATURE_xlib + LIBRARIES X11::X11 # special case ) diff --git a/src/plugins/platformthemes/gtk3/qgtk3dialoghelpers.cpp b/src/plugins/platformthemes/gtk3/qgtk3dialoghelpers.cpp index 1fb6a22b31..9826d1f4b1 100644 --- a/src/plugins/platformthemes/gtk3/qgtk3dialoghelpers.cpp +++ b/src/plugins/platformthemes/gtk3/qgtk3dialoghelpers.cpp @@ -17,9 +17,12 @@ #undef signals #include <gtk/gtk.h> #include <gdk/gdk.h> -#include <gdk/gdkx.h> #include <pango/pango.h> +#if QT_CONFIG(xlib) && defined(GDK_WINDOWING_X11) +#include <gdk/gdkx.h> +#endif + // The size of the preview we display for selected image files. We set height // larger than width because generally there is more free space vertically // than horizontally (setting the preview image will always expand the width of @@ -105,12 +108,14 @@ bool QGtk3Dialog::show(Qt::WindowFlags flags, Qt::WindowModality modality, QWind GdkWindow *gdkWindow = gtk_widget_get_window(gtkWidget); if (parent) { +#if QT_CONFIG(xlib) && defined(GDK_WINDOWING_X11) if (GDK_IS_X11_WINDOW(gdkWindow)) { GdkDisplay *gdkDisplay = gdk_window_get_display(gdkWindow); XSetTransientForHint(gdk_x11_display_get_xdisplay(gdkDisplay), gdk_x11_window_get_xid(gdkWindow), parent->winId()); } +#endif } if (modality != Qt::NonModal) { |