ui: Add InhibitShortcutsDialog

https://bugzilla.gnome.org/show_bug.cgi?id=783342
This commit is contained in:
Florian Müllner
2017-07-14 03:15:17 +02:00
parent 942831f6ee
commit dff3e4e0b9
9 changed files with 152 additions and 1 deletions

View File

@@ -91,6 +91,9 @@ static const MetaPluginInfo *gnome_shell_plugin_plugin_info (MetaPlugin *plugi
static MetaCloseDialog * gnome_shell_plugin_create_close_dialog (MetaPlugin *plugin,
MetaWindow *window);
static MetaInhibitShortcutsDialog * gnome_shell_plugin_create_inhibit_shortcuts_dialog (MetaPlugin *plugin,
MetaWindow *window);
#define GNOME_TYPE_SHELL_PLUGIN (gnome_shell_plugin_get_type ())
#define GNOME_SHELL_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNOME_TYPE_SHELL_PLUGIN, GnomeShellPlugin))
#define GNOME_SHELL_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GNOME_TYPE_SHELL_PLUGIN, GnomeShellPluginClass))
@@ -153,6 +156,7 @@ gnome_shell_plugin_class_init (GnomeShellPluginClass *klass)
plugin_class->plugin_info = gnome_shell_plugin_plugin_info;
plugin_class->create_close_dialog = gnome_shell_plugin_create_close_dialog;
plugin_class->create_inhibit_shortcuts_dialog = gnome_shell_plugin_create_inhibit_shortcuts_dialog;
}
static void
@@ -436,3 +440,10 @@ gnome_shell_plugin_create_close_dialog (MetaPlugin *plugin,
{
return _shell_wm_create_close_dialog (get_shell_wm (), window);
}
static MetaInhibitShortcutsDialog *
gnome_shell_plugin_create_inhibit_shortcuts_dialog (MetaPlugin *plugin,
MetaWindow *window)
{
return _shell_wm_create_inhibit_shortcuts_dialog (get_shell_wm (), window);
}

View File

@@ -55,6 +55,9 @@ void _shell_wm_confirm_display_change (ShellWM *wm);
MetaCloseDialog * _shell_wm_create_close_dialog (ShellWM *wm,
MetaWindow *window);
MetaInhibitShortcutsDialog * _shell_wm_create_inhibit_shortcuts_dialog (ShellWM *wm,
MetaWindow *window);
G_END_DECLS
#endif /* __SHELL_WM_PRIVATE_H__ */

View File

@@ -34,6 +34,7 @@ enum
FILTER_KEYBINDING,
CONFIRM_DISPLAY_CHANGE,
CREATE_CLOSE_DIALOG,
CREATE_INHIBIT_SHORTCUTS_DIALOG,
LAST_SIGNAL
};
@@ -185,6 +186,22 @@ shell_wm_class_init (ShellWMClass *klass)
0,
NULL, NULL, NULL,
META_TYPE_CLOSE_DIALOG, 1, META_TYPE_WINDOW);
/**
* ShellWM::create-inhibit-shortcuts-dialog:
* @wm: The WM
* @window: The window to create the dialog for
*
* Creates an inhibit shortcuts dialog for the given window.
*
* Returns: (transfer full): The inhibit shortcuts dialog instance.
*/
shell_wm_signals[CREATE_INHIBIT_SHORTCUTS_DIALOG] =
g_signal_new ("create-inhibit-shortcuts-dialog",
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
0,
NULL, NULL, NULL,
META_TYPE_INHIBIT_SHORTCUTS_DIALOG, 1, META_TYPE_WINDOW);
}
void
@@ -414,6 +431,17 @@ _shell_wm_create_close_dialog (ShellWM *wm,
return dialog;
}
MetaInhibitShortcutsDialog *
_shell_wm_create_inhibit_shortcuts_dialog (ShellWM *wm,
MetaWindow *window)
{
MetaInhibitShortcutsDialog *dialog;
g_signal_emit (wm, shell_wm_signals[CREATE_INHIBIT_SHORTCUTS_DIALOG], 0, window, &dialog);
return dialog;
}
/**
* shell_wm_new:
* @plugin: the #MetaPlugin