core: Add MetaDisplay::pad-mode-switch signal

This signal provides the necessary information to let gnome-shell trigger
updates of pad leds/oleds whenever a pad group switches mode, and the
actions associated to buttons do too.

https://bugzilla.gnome.org/show_bug.cgi?id=776543
This commit is contained in:
Carlos Garnacho 2016-12-28 13:00:18 +01:00
parent 7e3fbfbdd2
commit 9950b4de75

View File

@ -132,6 +132,7 @@ enum
GL_VIDEO_MEMORY_PURGED,
SHOW_PAD_OSD,
SHOW_OSD,
PAD_MODE_SWITCH,
LAST_SIGNAL
};
@ -385,6 +386,14 @@ meta_display_class_init (MetaDisplayClass *klass)
0, NULL, NULL, NULL,
G_TYPE_NONE, 3, G_TYPE_INT, G_TYPE_STRING, G_TYPE_STRING);
display_signals[PAD_MODE_SWITCH] =
g_signal_new ("pad-mode-switch",
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
0, NULL, NULL, NULL,
G_TYPE_NONE, 3, CLUTTER_TYPE_INPUT_DEVICE,
G_TYPE_UINT, G_TYPE_UINT);
g_object_class_install_property (object_class,
PROP_FOCUS_WINDOW,
g_param_spec_object ("focus-window",
@ -3256,5 +3265,8 @@ meta_display_notify_pad_group_switch (MetaDisplay *display,
meta_display_show_osd (display, lookup_tablet_monitor (display, pad),
"input-tablet-symbolic", message->str);
g_signal_emit (display, display_signals[PAD_MODE_SWITCH], 0, pad,
n_group, n_mode);
g_string_free (message, TRUE);
}