[network-manager-applet/lr/gtk4: 35/43] nma/mobile-wizard: deal with the taskbar-hint in GTK4



commit 895ade96aad6eb046274ef1bc00df4aae70fb6ae
Author: Lubomir Rintel <lkundrak v3 sk>
Date:   Tue Sep 10 15:23:54 2019 +0200

    nma/mobile-wizard: deal with the taskbar-hint in GTK4

 src/libnma/nma-mobile-wizard.c  | 17 +++++++++++++++++
 src/libnma/nma-mobile-wizard.ui |  1 -
 2 files changed, 17 insertions(+), 1 deletion(-)
---
diff --git a/src/libnma/nma-mobile-wizard.c b/src/libnma/nma-mobile-wizard.c
index 44a59ce6..9a4e753b 100644
--- a/src/libnma/nma-mobile-wizard.c
+++ b/src/libnma/nma-mobile-wizard.c
@@ -12,6 +12,12 @@
 
 #include <stdlib.h>
 
+#if GTK_CHECK_VERSION(3,90,0)
+#include <gdk/x11/gdkx.h>
+#else
+#include <gdk/gdkx.h>
+#endif
+
 #include <NetworkManager.h>
 #include <nm-setting-gsm.h>
 #include <nm-setting-cdma.h>
@@ -1451,6 +1457,17 @@ static void
 nma_mobile_wizard_init (NMAMobileWizard *self)
 {
        gtk_widget_init_template (GTK_WIDGET (self));
+       gtk_widget_realize (GTK_WIDGET (self));
+
+       if (GDK_IS_X11_DISPLAY (gtk_widget_get_display (GTK_WIDGET (self)))) {
+#if GTK_CHECK_VERSION(3,90,0)
+               GdkSurface *surface = gtk_widget_get_surface (GTK_WIDGET (self));
+               gdk_x11_surface_set_skip_taskbar_hint (surface, TRUE);
+#else
+               GdkWindow *gdk_window = gtk_widget_get_window (GTK_WIDGET (self));
+               gdk_window_set_skip_taskbar_hint (gdk_window, TRUE);
+#endif
+       }
 }
 
 /**
diff --git a/src/libnma/nma-mobile-wizard.ui b/src/libnma/nma-mobile-wizard.ui
index 4c64f3c1..9138a9e0 100644
--- a/src/libnma/nma-mobile-wizard.ui
+++ b/src/libnma/nma-mobile-wizard.ui
@@ -50,7 +50,6 @@
     <property name="modal">True</property>
     <property name="window_position">center-always</property>
     <property name="type_hint">dialog</property>
-    <property name="skip_taskbar_hint">True</property>
     <property name="use_header_bar">1</property>
     <signal name="cancel" handler="assistant_cancel" swapped="no"/>
     <signal name="close" handler="assistant_closed" swapped="no"/>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]