[gnome-shell/eos3.8: 3/255] shell-wm: add a new stop signal



commit 907dadaaa06c7fa72fcf8cb96be53f0397c636c0
Author: Cosimo Cecchi <cosimo endlessm com>
Date:   Wed Dec 26 17:28:22 2018 -0800

    shell-wm: add a new stop signal
    
    By implementing the new "stop" virtual method of MetaPlugin.
    
    https://phabricator.endlessm.com/T24406

 src/gnome-shell-plugin.c |  7 +++++++
 src/shell-wm-private.h   |  2 ++
 src/shell-wm.c           | 14 ++++++++++++++
 3 files changed, 23 insertions(+)
---
diff --git a/src/gnome-shell-plugin.c b/src/gnome-shell-plugin.c
index 2e491646ca..d1ae409dd5 100644
--- a/src/gnome-shell-plugin.c
+++ b/src/gnome-shell-plugin.c
@@ -164,6 +164,12 @@ get_shell_wm (void)
   return wm;
 }
 
+static void
+gnome_shell_plugin_stop (MetaPlugin *plugin)
+{
+  _shell_wm_stop (get_shell_wm ());
+}
+
 static void
 gnome_shell_plugin_minimize (MetaPlugin         *plugin,
                             MetaWindowActor    *actor)
@@ -359,6 +365,7 @@ gnome_shell_plugin_class_init (GnomeShellPluginClass *klass)
   MetaPluginClass *plugin_class  = META_PLUGIN_CLASS (klass);
 
   plugin_class->start            = gnome_shell_plugin_start;
+  plugin_class->stop             = gnome_shell_plugin_stop;
   plugin_class->map              = gnome_shell_plugin_map;
   plugin_class->minimize         = gnome_shell_plugin_minimize;
   plugin_class->unminimize       = gnome_shell_plugin_unminimize;
diff --git a/src/shell-wm-private.h b/src/shell-wm-private.h
index 1363087ad0..d782e87098 100644
--- a/src/shell-wm-private.h
+++ b/src/shell-wm-private.h
@@ -58,6 +58,8 @@ MetaCloseDialog * _shell_wm_create_close_dialog (ShellWM     *wm,
 MetaInhibitShortcutsDialog * _shell_wm_create_inhibit_shortcuts_dialog (ShellWM     *wm,
                                                                         MetaWindow  *window);
 
+void _shell_wm_stop (ShellWM *wm);
+
 G_END_DECLS
 
 #endif /* __SHELL_WM_PRIVATE_H__ */
diff --git a/src/shell-wm.c b/src/shell-wm.c
index a11e41904c..1e579ad8c2 100644
--- a/src/shell-wm.c
+++ b/src/shell-wm.c
@@ -35,6 +35,7 @@ enum
   CONFIRM_DISPLAY_CHANGE,
   CREATE_CLOSE_DIALOG,
   CREATE_INHIBIT_SHORTCUTS_DIALOG,
+  STOP,
 
   LAST_SIGNAL
 };
@@ -170,6 +171,13 @@ shell_wm_class_init (ShellWMClass *klass)
                   0,
                   NULL, NULL, NULL,
                   G_TYPE_NONE, 0);
+  shell_wm_signals[STOP] =
+    g_signal_new ("stop",
+                  G_TYPE_FROM_CLASS (klass),
+                  G_SIGNAL_RUN_LAST,
+                  0,
+                  NULL, NULL, NULL,
+                  G_TYPE_NONE, 0);
   /**
    * ShellWM::create-close-dialog:
    * @wm: The WM
@@ -442,6 +450,12 @@ _shell_wm_create_inhibit_shortcuts_dialog (ShellWM    *wm,
   return dialog;
 }
 
+void
+_shell_wm_stop (ShellWM *wm)
+{
+  g_signal_emit (wm, shell_wm_signals[STOP], 0);
+}
+
 /**
  * shell_wm_new:
  * @plugin: the #MetaPlugin


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]