diff options
author | raveit65 <[email protected]> | 2019-09-25 13:23:08 +0200 |
---|---|---|
committer | raveit65 <[email protected]> | 2019-10-03 11:29:05 +0200 |
commit | c5451156715c8b5e9c4a6810b51f1c114d431d53 (patch) | |
tree | c18dbbbddedeb7efb24df5cb93ea602165d10e10 /applets | |
parent | 88f1176c39d073746ce94d10ee469a3423dab641 (diff) | |
download | mate-power-manager-c5451156715c8b5e9c4a6810b51f1c114d431d53.tar.bz2 mate-power-manager-c5451156715c8b5e9c4a6810b51f1c114d431d53.tar.xz |
brightness-applet: use GdkSeat operations
Diffstat (limited to 'applets')
-rw-r--r-- | applets/brightness/brightness-applet.c | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/applets/brightness/brightness-applet.c b/applets/brightness/brightness-applet.c index ebf9914..fdcb366 100644 --- a/applets/brightness/brightness-applet.c +++ b/applets/brightness/brightness-applet.c @@ -663,9 +663,7 @@ gpm_applet_popup_cb (GpmBrightnessApplet *applet, GdkEventButton *event) gint orientation, x, y; GdkWindow *window; GdkDisplay *display; - GdkDeviceManager *device_manager; - GdkDevice *pointer; - GdkDevice *keyboard; + GdkSeat *seat; /* react only to left mouse button */ if (event->button != 1) { @@ -736,17 +734,15 @@ gpm_applet_popup_cb (GpmBrightnessApplet *applet, GdkEventButton *event) /* grab input */ window = gtk_widget_get_window (GTK_WIDGET (applet->popup)); display = gdk_window_get_display (window); - device_manager = gdk_display_get_device_manager (display); - pointer = gdk_device_manager_get_client_pointer (device_manager); - keyboard = gdk_device_get_associated_device (pointer); - gdk_device_grab (pointer, window, - GDK_OWNERSHIP_NONE, TRUE, - GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK, - NULL, GDK_CURRENT_TIME); - gdk_device_grab (keyboard, window, - GDK_OWNERSHIP_NONE, TRUE, - GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK, - NULL, GDK_CURRENT_TIME); + seat = gdk_display_get_default_seat (display); + gdk_seat_grab (seat, + window, + GDK_SEAT_CAPABILITY_ALL, + TRUE, + NULL, + NULL, + NULL, + NULL); return TRUE; } |