[Xfce4-commits] [xfce/xfce4-session] 01/01: Tell Gtk what version we're targeting

noreply at xfce.org noreply at xfce.org
Sat Apr 22 20:03:04 CEST 2017


This is an automated email from the git hooks/post-receive script.

eric pushed a commit to branch master
in repository xfce/xfce4-session.

commit 767bcd5ea34b74c8b830030c0dc994d6a3137925
Author: Eric Koegel <eric.koegel at gmail.com>
Date:   Sat Apr 22 15:41:57 2017 +0300

    Tell Gtk what version we're targeting
    
    This is awesome. Now Gtk will ignore stuff newer than 3.18 and
    not nag about it and warn if we use something too new. The previous
    3.20 ifdef code has been disabled for now.
---
 configure.ac.in                    |  8 ++++-
 xfce4-session/xfsm-logout-dialog.c | 60 ++++++++++++++++++--------------------
 2 files changed, 35 insertions(+), 33 deletions(-)

diff --git a/configure.ac.in b/configure.ac.in
index 675436e..197012f 100644
--- a/configure.ac.in
+++ b/configure.ac.in
@@ -102,7 +102,7 @@ XDT_I18N([@LINGUAS@])
 dnl Check for required packages
 XDT_CHECK_PACKAGE([LIBXFCE4UTIL], [libxfce4util-1.0], [4.12.0])
 XDT_CHECK_PACKAGE([LIBXFCE4UI], [libxfce4ui-2], [4.12.0])
-XDT_CHECK_PACKAGE([GTK], [gtk+-3.0], [3.10.0])
+XDT_CHECK_PACKAGE([GTK], [gtk+-3.0], [3.18.0])
 XDT_CHECK_PACKAGE([GIO], [gio-2.0], [2.42.0])
 XDT_CHECK_PACKAGE([GMODULE], [gmodule-2.0], [2.24.0])
 XDT_CHECK_PACKAGE([LIBWNCK], [libwnck-3.0], [3.10])
@@ -112,6 +112,12 @@ dnl Check for Polkit/PolicyKit
 XDT_CHECK_OPTIONAL_PACKAGE([POLKIT], [polkit-gobject-1], [0.102],
                            [polkit], [Polkit support])
 
+AC_DEFINE(GLIB_VERSION_MIN_REQUIRED, GLIB_VERSION_2_42, [Ignore post 2.42 deprecations])
+AC_DEFINE(GLIB_VERSION_MAX_ALLOWED, GLIB_VERSION_2_42, [Prevent post 2.42 APIs])
+
+AC_DEFINE(GDK_VERSION_MIN_REQUIRED, GDK_VERSION_3_18, [Ignore post 3.18 deprecations])
+AC_DEFINE(GDK_VERSION_MAX_ALLOWED, GDK_VERSION_3_18, [Prevent post 3.18 APIs])
+
 dnl Check for debugging support
 XDT_FEATURE_DEBUG([xfsm_debug_default])
 
diff --git a/xfce4-session/xfsm-logout-dialog.c b/xfce4-session/xfsm-logout-dialog.c
index 83863ea..1a19cc6 100644
--- a/xfce4-session/xfsm-logout-dialog.c
+++ b/xfce4-session/xfsm-logout-dialog.c
@@ -644,9 +644,8 @@ xfsm_logout_dialog_run (GtkDialog *dialog,
 {
   GdkWindow *window;
   gint       ret;
-#if !GTK_CHECK_VERSION (3, 20, 0)
   GdkDevice *device;
-#else
+#if 0 /* GTK_CHECK_VERSION (3, 20, 0) */
   GdkSeat   *seat;
 #endif
 
@@ -656,33 +655,32 @@ xfsm_logout_dialog_run (GtkDialog *dialog,
 
       window = gtk_widget_get_window (GTK_WIDGET (dialog));
 
-#if !GTK_CHECK_VERSION (3, 20, 0)
-          device = gtk_get_current_event_device ();
+      device = gtk_get_current_event_device ();
 
-          if (gdk_device_grab (device,
-                               window,
-                               GDK_OWNERSHIP_APPLICATION,
-                               FALSE,
-                               GDK_KEY_PRESS_MASK,
-                               NULL,
-                               GDK_CURRENT_TIME) != GDK_GRAB_SUCCESS)
-            {
-              g_critical ("Failed to grab the keyboard for logout window");
-            }
-#else
-          seat = gdk_device_get_seat (gtk_get_current_event_device ());
-
-          if (gdk_seat_grab (seat,
-                             window,
-                             GDK_SEAT_CAPABILITY_KEYBOARD,
-                             FALSE,
-                             NULL,
-                             gtk_get_current_event (),
-                             NULL,
-                             NULL) != GDK_GRAB_SUCCESS)
-            {
-              g_critical ("Failed to grab the keyboard for logout window");
-            }
+      if (gdk_device_grab (device,
+                           window,
+                           GDK_OWNERSHIP_APPLICATION,
+                           FALSE,
+                           GDK_KEY_PRESS_MASK,
+                           NULL,
+                           GDK_CURRENT_TIME) != GDK_GRAB_SUCCESS)
+        {
+          g_critical ("Failed to grab the keyboard for logout window");
+        }
+#if 0 /* GTK_CHECK_VERSION (3, 20, 0) */
+      seat = gdk_device_get_seat (gtk_get_current_event_device ());
+
+      if (gdk_seat_grab (seat,
+                         window,
+                         GDK_SEAT_CAPABILITY_KEYBOARD,
+                         FALSE,
+                         NULL,
+                         gtk_get_current_event (),
+                         NULL,
+                         NULL) != GDK_GRAB_SUCCESS)
+        {
+          g_critical ("Failed to grab the keyboard for logout window");
+        }
 #endif
 
 #ifdef GDK_WINDOWING_X11
@@ -697,10 +695,9 @@ xfsm_logout_dialog_run (GtkDialog *dialog,
 
   ret = gtk_dialog_run (dialog);
 
-#if !GTK_CHECK_VERSION (3, 20, 0)
   if (grab_input)
     gdk_device_ungrab (device, GDK_CURRENT_TIME);
-#else
+#if 0 /*GTK_CHECK_VERSION (3, 20, 0) */
     if (grab_input)
     gdk_seat_ungrab (seat);
 #endif
@@ -766,7 +763,6 @@ xfsm_logout_dialog (const gchar      *session_name,
        * the dialog when running it */
       for (;;)
         {
-#if !GTK_CHECK_VERSION (3, 20, 0)
           GdkDevice *device = gtk_get_current_event_device ();
 
           if (gdk_device_grab (device,
@@ -780,7 +776,7 @@ xfsm_logout_dialog (const gchar      *session_name,
               gdk_device_ungrab (device, GDK_CURRENT_TIME);
               break;
             }
-#else
+#if 0 /*GTK_CHECK_VERSION (3, 20, 0)*/
           GdkSeat *seat = gdk_device_get_seat (gtk_get_current_event_device ());
 
           if (gdk_seat_grab (seat,

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list