diff options
author | raveit65 <[email protected]> | 2016-08-08 00:12:45 +0200 |
---|---|---|
committer | raveit65 <[email protected]> | 2016-09-01 21:31:38 +0200 |
commit | 547cf089c1593156c8e5c0f767cf7a553039701e (patch) | |
tree | ef221f1781e580d00e9609653a3877cfc1a93936 | |
parent | 8cbf2ce21fa9ed77c428186990469b4b9c73d181 (diff) | |
download | mate-panel-547cf089c1593156c8e5c0f767cf7a553039701e.tar.bz2 mate-panel-547cf089c1593156c8e5c0f767cf7a553039701e.tar.xz |
GTK+-3.20 panel-applet: use GtkSeat instead of deprecated device pointer
-rw-r--r-- | libmate-panel-applet/mate-panel-applet.c | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/libmate-panel-applet/mate-panel-applet.c b/libmate-panel-applet/mate-panel-applet.c index 8fdfe275..a3d6774d 100644 --- a/libmate-panel-applet/mate-panel-applet.c +++ b/libmate-panel-applet/mate-panel-applet.c @@ -936,6 +936,23 @@ mate_panel_applet_button_event (GtkWidget *widget, socket_window = gtk_plug_get_socket_window (GTK_PLUG (widget)); if (event->type == GDK_BUTTON_PRESS) { +#if GTK_CHECK_VERSION (3, 0, 0) +#if GTK_CHECK_VERSION (3, 20, 0) + GdkDisplay *display; + GdkSeat *seat; + + xevent.xbutton.type = ButtonPress; + + display = gdk_display_get_default (); + seat = gdk_display_get_default_seat (display); + + /* X does an automatic pointer grab on button press + * if we have both button press and release events + * selected. + * We don't want to hog the pointer on our parent. + */ + gdk_seat_ungrab (seat); +#else xevent.xbutton.type = ButtonPress; /* X does an automatic pointer grab on button press @@ -943,9 +960,16 @@ mate_panel_applet_button_event (GtkWidget *widget, * selected. * We don't want to hog the pointer on our parent. */ -#if GTK_CHECK_VERSION (3, 0, 0) gdk_device_ungrab (event->device, GDK_CURRENT_TIME); +#endif #else + xevent.xbutton.type = ButtonPress; + + /* X does an automatic pointer grab on button press + * if we have both button press and release events + * selected. + * We don't want to hog the pointer on our parent. + */ gdk_display_pointer_ungrab (gtk_widget_get_display (widget), GDK_CURRENT_TIME); |