[gnome-shell] shell-wm: Add a size-changed signal to handle the new plugin vfunc
- From: Rui Matos <rtcm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] shell-wm: Add a size-changed signal to handle the new plugin vfunc
- Date: Wed, 23 Nov 2016 18:00:34 +0000 (UTC)
commit 68b671a4f4ab94ed706093fdb474d78325b1e0f0
Author: Rui Matos <tiagomatos gmail com>
Date: Mon Sep 26 17:33:35 2016 +0200
shell-wm: Add a size-changed signal to handle the new plugin vfunc
https://bugzilla.gnome.org/show_bug.cgi?id=770345
src/gnome-shell-plugin.c | 10 ++++++++++
src/shell-wm-private.h | 2 ++
src/shell-wm.c | 16 ++++++++++++++++
3 files changed, 28 insertions(+), 0 deletions(-)
---
diff --git a/src/gnome-shell-plugin.c b/src/gnome-shell-plugin.c
index acd022a..ab5ebec 100644
--- a/src/gnome-shell-plugin.c
+++ b/src/gnome-shell-plugin.c
@@ -42,6 +42,8 @@ static void gnome_shell_plugin_minimize (MetaPlugin *plugin,
MetaWindowActor *actor);
static void gnome_shell_plugin_unminimize (MetaPlugin *plugin,
MetaWindowActor *actor);
+static void gnome_shell_plugin_size_changed (MetaPlugin *plugin,
+ MetaWindowActor *actor);
static void gnome_shell_plugin_size_change (MetaPlugin *plugin,
MetaWindowActor *actor,
MetaSizeChange which_change,
@@ -127,6 +129,7 @@ gnome_shell_plugin_class_init (GnomeShellPluginClass *klass)
plugin_class->map = gnome_shell_plugin_map;
plugin_class->minimize = gnome_shell_plugin_minimize;
plugin_class->unminimize = gnome_shell_plugin_unminimize;
+ plugin_class->size_changed = gnome_shell_plugin_size_changed;
plugin_class->size_change = gnome_shell_plugin_size_change;
plugin_class->destroy = gnome_shell_plugin_destroy;
@@ -273,6 +276,13 @@ gnome_shell_plugin_unminimize (MetaPlugin *plugin,
}
static void
+gnome_shell_plugin_size_changed (MetaPlugin *plugin,
+ MetaWindowActor *actor)
+{
+ _shell_wm_size_changed (get_shell_wm (), actor);
+}
+
+static void
gnome_shell_plugin_size_change (MetaPlugin *plugin,
MetaWindowActor *actor,
MetaSizeChange which_change,
diff --git a/src/shell-wm-private.h b/src/shell-wm-private.h
index 5b4089a..7e0399c 100644
--- a/src/shell-wm-private.h
+++ b/src/shell-wm-private.h
@@ -12,6 +12,8 @@ void _shell_wm_minimize (ShellWM *wm,
MetaWindowActor *actor);
void _shell_wm_unminimize (ShellWM *wm,
MetaWindowActor *actor);
+void _shell_wm_size_changed(ShellWM *wm,
+ MetaWindowActor *actor);
void _shell_wm_size_change(ShellWM *wm,
MetaWindowActor *actor,
MetaSizeChange which_change,
diff --git a/src/shell-wm.c b/src/shell-wm.c
index bc50fb6..0b3f925 100644
--- a/src/shell-wm.c
+++ b/src/shell-wm.c
@@ -21,6 +21,7 @@ enum
{
MINIMIZE,
UNMINIMIZE,
+ SIZE_CHANGED,
SIZE_CHANGE,
MAP,
DESTROY,
@@ -74,6 +75,14 @@ shell_wm_class_init (ShellWMClass *klass)
NULL, NULL, NULL,
G_TYPE_NONE, 1,
META_TYPE_WINDOW_ACTOR);
+ shell_wm_signals[SIZE_CHANGED] =
+ g_signal_new ("size-changed",
+ G_TYPE_FROM_CLASS (klass),
+ G_SIGNAL_RUN_LAST,
+ 0,
+ NULL, NULL, NULL,
+ G_TYPE_NONE, 1,
+ META_TYPE_WINDOW_ACTOR);
shell_wm_signals[SIZE_CHANGE] =
g_signal_new ("size-change",
G_TYPE_FROM_CLASS (klass),
@@ -330,6 +339,13 @@ _shell_wm_unminimize (ShellWM *wm,
}
void
+_shell_wm_size_changed (ShellWM *wm,
+ MetaWindowActor *actor)
+{
+ g_signal_emit (wm, shell_wm_signals[SIZE_CHANGED], 0, actor);
+}
+
+void
_shell_wm_size_change (ShellWM *wm,
MetaWindowActor *actor,
MetaSizeChange which_change,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]