summaryrefslogtreecommitdiff
path: root/mate-volume-control/gvc-stream-status-icon.c
diff options
context:
space:
mode:
authormonsta <[email protected]>2017-08-23 16:52:46 +0300
committermonsta <[email protected]>2017-09-08 14:50:17 +0300
commit6cea053786ea0de24deb995d8d9ffe5069327963 (patch)
tree55119e8af03c0b6de1b69ea430de1564053ea26b /mate-volume-control/gvc-stream-status-icon.c
parent11cc7bfa71bbeb9711292fedd70be149729915a6 (diff)
downloadmate-media-6cea053786ea0de24deb995d8d9ffe5069327963.tar.bz2
mate-media-6cea053786ea0de24deb995d8d9ffe5069327963.tar.xz
applet: make keyboard work in popup
fixes https://github.com/mate-desktop/mate-media/issues/94
Diffstat (limited to 'mate-volume-control/gvc-stream-status-icon.c')
-rw-r--r--mate-volume-control/gvc-stream-status-icon.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/mate-volume-control/gvc-stream-status-icon.c b/mate-volume-control/gvc-stream-status-icon.c
index e80d4fe..ca4d766 100644
--- a/mate-volume-control/gvc-stream-status-icon.c
+++ b/mate-volume-control/gvc-stream-status-icon.c
@@ -133,9 +133,12 @@ popup_dock (GvcStreamStatusIcon *icon, guint time)
do {
GdkDeviceManager *manager = gdk_display_get_device_manager (display);
+ GdkDevice *pointer = gdk_device_manager_get_client_pointer (manager);
+ GdkDevice *keyboard = gdk_device_get_associated_device (pointer);
+ GdkWindow *window = gtk_widget_get_window (icon->priv->dock);
- if (gdk_device_grab (gdk_device_manager_get_client_pointer (manager),
- gtk_widget_get_window (icon->priv->dock),
+ if (gdk_device_grab (pointer,
+ window,
GDK_OWNERSHIP_NONE,
TRUE,
GDK_BUTTON_PRESS_MASK |
@@ -146,6 +149,20 @@ popup_dock (GvcStreamStatusIcon *icon, guint time)
time) != GDK_GRAB_SUCCESS) {
gtk_grab_remove (icon->priv->dock);
gtk_widget_hide (icon->priv->dock);
+ break;
+ }
+
+ if (gdk_device_grab (keyboard,
+ window,
+ GDK_OWNERSHIP_NONE,
+ TRUE,
+ GDK_KEY_PRESS_MASK |
+ GDK_KEY_RELEASE_MASK,
+ NULL,
+ time) != GDK_GRAB_SUCCESS) {
+ gdk_device_ungrab (pointer, time);
+ gtk_grab_remove (icon->priv->dock);
+ gtk_widget_hide (icon->priv->dock);
}
} while (0);