summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/media-keys/acme.h4
-rw-r--r--plugins/media-keys/msd-media-keys-manager.c24
2 files changed, 27 insertions, 1 deletions
diff --git a/plugins/media-keys/acme.h b/plugins/media-keys/acme.h
index b209b74..8ab55fe 100644
--- a/plugins/media-keys/acme.h
+++ b/plugins/media-keys/acme.h
@@ -58,6 +58,7 @@ enum {
LOGOUT_KEY,
RFKILL_KEY,
BLUETOOTH_RFKILL_KEY,
+ DISPLAY_KEY,
HANDLED_KEYS,
};
@@ -99,7 +100,8 @@ static struct {
{ ON_SCREEN_KEYBOARD_KEY, "on-screen-keyboard", NULL, NULL },
{ LOGOUT_KEY, "logout", NULL, NULL },
{ RFKILL_KEY, NULL, "XF86WLAN", NULL },
- { BLUETOOTH_RFKILL_KEY, NULL, "XF86Bluetooth", NULL }
+ { BLUETOOTH_RFKILL_KEY, NULL, "XF86Bluetooth", NULL },
+ { DISPLAY_KEY, NULL, "XF86Display", NULL }
};
#endif /* __ACME_H__ */
diff --git a/plugins/media-keys/msd-media-keys-manager.c b/plugins/media-keys/msd-media-keys-manager.c
index ab31a9d..a4e958a 100644
--- a/plugins/media-keys/msd-media-keys-manager.c
+++ b/plugins/media-keys/msd-media-keys-manager.c
@@ -918,6 +918,27 @@ do_rfkill_action (MsdMediaKeysManager *manager,
data->property, new_state ? "true" : "false");
}
+static void
+do_display_osd_action (MsdMediaKeysManager *manager)
+{
+ GdkDisplay *display;
+ int n_monitors;
+
+ display = gdk_display_get_default ();
+ n_monitors = gdk_display_get_n_monitors (display);
+
+ dialog_init (manager);
+ if (n_monitors > 1)
+ msd_media_keys_window_set_action_custom (MSD_MEDIA_KEYS_WINDOW (manager->priv->dialog),
+ "video-joined-displays-symbolic",
+ _("Changing Screen Layout"));
+ else
+ msd_media_keys_window_set_action_custom (MSD_MEDIA_KEYS_WINDOW (manager->priv->dialog),
+ "video-single-display-symbolic",
+ _("No External Display"));
+ dialog_show (manager);
+}
+
static gint
find_by_application (gconstpointer a,
gconstpointer b)
@@ -1179,6 +1200,9 @@ do_action (MsdMediaKeysManager *manager,
case BLUETOOTH_RFKILL_KEY:
do_rfkill_action (manager, TRUE);
break;
+ case DISPLAY_KEY:
+ do_display_osd_action (manager);
+ break;
default:
g_assert_not_reached ();
}