diff options
author | Zhang Xianwei <[email protected]> | 2018-11-23 08:57:05 +0800 |
---|---|---|
committer | raveit65 <[email protected]> | 2018-11-25 14:36:30 +0100 |
commit | d8eabb82c462258efc71a961918ba0829093e6a8 (patch) | |
tree | 4cc55a43c07f516b3415dd485d7acd3c48a35105 /plugins/media-keys/msd-media-keys-manager.c | |
parent | 62299ac839240f9816645523fb2b31bb7977864c (diff) | |
download | mate-settings-daemon-d8eabb82c462258efc71a961918ba0829093e6a8.tar.bz2 mate-settings-daemon-d8eabb82c462258efc71a961918ba0829093e6a8.tar.xz |
media-keys: Add support for display switch OSD
Some laptops have a display switch mode hotkey. This is bound by
default to XF86Display. Add OSD to give people a visual feed back.
Signed-off-by: Zhang Xianwei <[email protected]>
Diffstat (limited to 'plugins/media-keys/msd-media-keys-manager.c')
-rw-r--r-- | plugins/media-keys/msd-media-keys-manager.c | 24 |
1 files changed, 24 insertions, 0 deletions
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 (); } |