summaryrefslogtreecommitdiff
path: root/applets/notification_area/status-notifier/sn-item.c
diff options
context:
space:
mode:
authorColomban Wendling <[email protected]>2017-01-20 18:08:19 +0100
committerlukefromdc <[email protected]>2017-01-23 13:49:34 -0500
commit290a5d6fcdeed499cd6220c62d3e55b51c558a43 (patch)
treed255c9a61574e5a20ba433fadeae3e073ee2bae3 /applets/notification_area/status-notifier/sn-item.c
parentf173f6acf99fc98ac7f10b8bc2bb614581aea518 (diff)
downloadmate-panel-290a5d6fcdeed499cd6220c62d3e55b51c558a43.tar.bz2
mate-panel-290a5d6fcdeed499cd6220c62d3e55b51c558a43.tar.xz
status-notifier: Simplify compatibility code for GTK 3.20
Also, that part was quite fragile.
Diffstat (limited to 'applets/notification_area/status-notifier/sn-item.c')
-rw-r--r--applets/notification_area/status-notifier/sn-item.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/applets/notification_area/status-notifier/sn-item.c b/applets/notification_area/status-notifier/sn-item.c
index d102a6cc..3a849f91 100644
--- a/applets/notification_area/status-notifier/sn-item.c
+++ b/applets/notification_area/status-notifier/sn-item.c
@@ -190,8 +190,6 @@ sn_item_button_press_event (GtkWidget *widget,
{
SnItem *item;
SnItemPrivate *priv;
- GdkDisplay *display;
- GdkSeat *seat;
gint x;
gint y;
@@ -200,14 +198,16 @@ sn_item_button_press_event (GtkWidget *widget,
item = SN_ITEM (widget);
priv = sn_item_get_instance_private (item);
- display = gdk_display_get_default ();
- seat = gdk_display_get_default_seat (display);
sn_item_get_action_coordinates (item, &x, &y);
if (event->button == 2)
{
- gdk_seat_ungrab (seat);
+#if GTK_CHECK_VERSION (3, 20, 0)
+ gdk_seat_ungrab (gdk_device_get_seat (event->device));
+#else
+ gdk_device_ungrab (event->device, GDK_CURRENT_TIME);
+#endif
SN_ITEM_GET_CLASS (item)->secondary_activate (item, x, y);
}
else if (event->button == 3)
@@ -221,7 +221,11 @@ sn_item_button_press_event (GtkWidget *widget,
}
else
{
- gdk_seat_ungrab (seat);
+#if GTK_CHECK_VERSION (3, 20, 0)
+ gdk_seat_ungrab (gdk_device_get_seat (event->device));
+#else
+ gdk_device_ungrab (event->device, GDK_CURRENT_TIME);
+#endif
SN_ITEM_GET_CLASS (item)->context_menu (item, x, y);
}
}