[rhythmbox] mmkeys: stop pretending there can be more than one screen
- From: Jonathan Matthew <jmatthew src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rhythmbox] mmkeys: stop pretending there can be more than one screen
- Date: Sun, 11 Sep 2016 10:44:10 +0000 (UTC)
commit 29d0163645bb9b7921d58d66d10d008cd5193d0b
Author: Jonathan Matthew <jonathan d14n org>
Date: Sun Sep 11 20:28:01 2016 +1000
mmkeys: stop pretending there can be more than one screen
plugins/mmkeys/rb-mmkeys-plugin.c | 36 +++++++++++++++++-------------------
1 files changed, 17 insertions(+), 19 deletions(-)
---
diff --git a/plugins/mmkeys/rb-mmkeys-plugin.c b/plugins/mmkeys/rb-mmkeys-plugin.c
index 9ea35eb..37d2eae 100644
--- a/plugins/mmkeys/rb-mmkeys-plugin.c
+++ b/plugins/mmkeys/rb-mmkeys-plugin.c
@@ -298,7 +298,7 @@ mmkeys_grab (RBMMKeysPlugin *plugin, gboolean grab)
GdkDisplay *display;
GdkScreen *screen;
GdkWindow *root;
- guint i, j;
+ guint j;
display = gdk_display_get_default ();
keycodes[0] = XKeysymToKeycode (GDK_DISPLAY_XDISPLAY (display), XF86XK_AudioPlay);
@@ -307,28 +307,26 @@ mmkeys_grab (RBMMKeysPlugin *plugin, gboolean grab)
keycodes[3] = XKeysymToKeycode (GDK_DISPLAY_XDISPLAY (display), XF86XK_AudioNext);
keycodes[4] = XKeysymToKeycode (GDK_DISPLAY_XDISPLAY (display), XF86XK_AudioPause);
- for (i = 0; i < gdk_display_get_n_screens (display); i++) {
- screen = gdk_display_get_screen (display, i);
+ screen = gdk_display_get_default_screen (display);
- if (screen != NULL) {
- root = gdk_screen_get_root_window (screen);
+ if (screen != NULL) {
+ root = gdk_screen_get_root_window (screen);
- for (j = 0; j < G_N_ELEMENTS (keycodes) ; j++) {
- if (keycodes[j] != 0) {
- if (grab)
- grab_mmkey (keycodes[j], root);
- else
- ungrab_mmkey (keycodes[j], root);
- }
+ for (j = 0; j < G_N_ELEMENTS (keycodes) ; j++) {
+ if (keycodes[j] != 0) {
+ if (grab)
+ grab_mmkey (keycodes[j], root);
+ else
+ ungrab_mmkey (keycodes[j], root);
}
-
- if (grab)
- gdk_window_add_filter (root, filter_mmkeys,
- (gpointer) plugin->shell_player);
- else
- gdk_window_remove_filter (root, filter_mmkeys,
- (gpointer) plugin->shell_player);
}
+
+ if (grab)
+ gdk_window_add_filter (root, filter_mmkeys,
+ (gpointer) plugin->shell_player);
+ else
+ gdk_window_remove_filter (root, filter_mmkeys,
+ (gpointer) plugin->shell_player);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]