[mutter] display: Add signals for plugins to know when a grab op begins/ends
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] display: Add signals for plugins to know when a grab op begins/ends
- Date: Tue, 13 Mar 2012 04:42:55 +0000 (UTC)
commit efc90173b1c2c32d1db598af53e30b6da5a66f88
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Fri Feb 10 10:27:14 2012 -0500
display: Add signals for plugins to know when a grab op begins/ends
https://bugzilla.gnome.org/show_bug.cgi?id=670658
src/core/display.c | 32 ++++++++++++++++++++++++++++++++
1 files changed, 32 insertions(+), 0 deletions(-)
---
diff --git a/src/core/display.c b/src/core/display.c
index 713114a..267903c 100644
--- a/src/core/display.c
+++ b/src/core/display.c
@@ -51,6 +51,8 @@
#include <meta/compositor.h>
#include <X11/Xatom.h>
#include <X11/cursorfont.h>
+#include "mutter-enum-types.h"
+
#ifdef HAVE_SOLARIS_XINERAMA
#include <X11/extensions/xinerama.h>
#endif
@@ -135,6 +137,8 @@ enum
WINDOW_CREATED,
WINDOW_DEMANDS_ATTENTION,
WINDOW_MARKED_URGENT,
+ GRAB_OP_BEGIN,
+ GRAB_OP_END,
LAST_SIGNAL
};
@@ -258,6 +262,28 @@ meta_display_class_init (MetaDisplayClass *klass)
G_TYPE_NONE, 1,
META_TYPE_WINDOW);
+ display_signals[GRAB_OP_BEGIN] =
+ g_signal_new ("grab-op-begin",
+ G_TYPE_FROM_CLASS (klass),
+ G_SIGNAL_RUN_LAST,
+ 0,
+ NULL, NULL, NULL,
+ G_TYPE_NONE, 3,
+ META_TYPE_SCREEN,
+ META_TYPE_WINDOW,
+ META_TYPE_GRAB_OP);
+
+ display_signals[GRAB_OP_END] =
+ g_signal_new ("grab-op-end",
+ G_TYPE_FROM_CLASS (klass),
+ G_SIGNAL_RUN_LAST,
+ 0,
+ NULL, NULL, NULL,
+ G_TYPE_NONE, 3,
+ META_TYPE_SCREEN,
+ META_TYPE_WINDOW,
+ META_TYPE_GRAB_OP);
+
g_object_class_install_property (object_class,
PROP_FOCUS_WINDOW,
g_param_spec_object ("focus-window",
@@ -3702,6 +3728,9 @@ meta_display_begin_grab_op (MetaDisplay *display,
{
meta_window_refresh_resize_popup (display->grab_window);
}
+
+ g_signal_emit (display, display_signals[GRAB_OP_BEGIN], 0,
+ screen, display->grab_window, display->grab_op);
return TRUE;
}
@@ -3716,6 +3745,9 @@ meta_display_end_grab_op (MetaDisplay *display,
if (display->grab_op == META_GRAB_OP_NONE)
return;
+ g_signal_emit (display, display_signals[GRAB_OP_END], 0,
+ display->grab_screen, display->grab_window, display->grab_op);
+
if (display->grab_window != NULL)
display->grab_window->shaken_loose = FALSE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]