[Xfce4-commits] [apps/xfce4-terminal] 01/01: Use gdk_seat_(un)grab to resolve deprecation warnings

noreply at xfce.org noreply at xfce.org
Fri Oct 14 16:04:28 CEST 2016


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

f2404 pushed a commit to branch master
in repository apps/xfce4-terminal.

commit 0507599f1f33cafef77da8c72471977d6ce2ed66
Author: Igor <f2404 at yandex.ru>
Date:   Fri Oct 14 17:03:58 2016 +0300

    Use gdk_seat_(un)grab to resolve deprecation warnings
---
 terminal/terminal-window-dropdown.c | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/terminal/terminal-window-dropdown.c b/terminal/terminal-window-dropdown.c
index 926e5d9..a89e8b4 100644
--- a/terminal/terminal-window-dropdown.c
+++ b/terminal/terminal-window-dropdown.c
@@ -420,16 +420,24 @@ terminal_window_dropdown_focus_in_event (GtkWidget     *widget,
 static gboolean
 terminal_window_dropdown_can_grab (gpointer data)
 {
-  TerminalWindowDropdown *dropdown = TERMINAL_WINDOW_DROPDOWN (data);
-  GdkGrabStatus           status;
-  GdkWindow              *window;
+  GdkWindow    *window = gtk_widget_get_window (GTK_WIDGET (data));
+  GdkGrabStatus status;
 
-  window = gtk_widget_get_window (GTK_WIDGET (dropdown));
+#if GTK_CHECK_VERSION (3, 20, 0)
+  GdkSeat *seat = gdk_display_get_default_seat (gtk_widget_get_display (GTK_WIDGET (data)));
+  status = gdk_seat_grab (seat, window, GDK_SEAT_CAPABILITY_KEYBOARD, FALSE, NULL, NULL, NULL, NULL);
+#else
   status = gdk_keyboard_grab (window, FALSE, GDK_CURRENT_TIME);
+#endif
+
   if (status == GDK_GRAB_SUCCESS)
     {
       /* drop the grab */
+#if GTK_CHECK_VERSION (3, 20, 0)
+      gdk_seat_ungrab (seat);
+#else
       gdk_keyboard_ungrab (GDK_CURRENT_TIME);
+#endif
 
       return FALSE;
     }

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


More information about the Xfce4-commits mailing list