[mutter] Added MetaWindow::window-type property
- From: Tomas Frydrych <tomasf src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [mutter] Added MetaWindow::window-type property
- Date: Tue, 4 Aug 2009 07:06:24 +0000 (UTC)
commit 897814a1530abc50aebb201c31cbffd29e531856
Author: Tomas Frydrych <tf linux intel com>
Date: Tue Aug 4 08:06:30 2009 +0100
Added MetaWindow::window-type property
Read-only property for querying the type of MetaWindow.
http://bugzilla.gnome.org/show_bug.cgi?id=588230
src/core/window.c | 23 ++++++++++++++++++++++-
1 files changed, 22 insertions(+), 1 deletions(-)
---
diff --git a/src/core/window.c b/src/core/window.c
index 168ca0e..fba5240 100644
--- a/src/core/window.c
+++ b/src/core/window.c
@@ -42,6 +42,7 @@
#include "group.h"
#include "window-props.h"
#include "constraints.h"
+#include "mutter-enum-types.h"
#include <X11/Xatom.h>
#include <string.h>
@@ -135,6 +136,7 @@ enum {
PROP_MINI_ICON,
PROP_DECORATED,
PROP_FULLSCREEN,
+ PROP_WINDOW_TYPE
};
enum
@@ -197,6 +199,9 @@ meta_window_get_property(GObject *object,
case PROP_FULLSCREEN:
g_value_set_boolean (value, win->fullscreen);
break;
+ case PROP_WINDOW_TYPE:
+ g_value_set_enum (value, win->type);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -266,6 +271,15 @@ meta_window_class_init (MetaWindowClass *klass)
FALSE,
G_PARAM_READABLE));
+ g_object_class_install_property (object_class,
+ PROP_WINDOW_TYPE,
+ g_param_spec_enum ("window-type",
+ "Window Type",
+ "The type of the window",
+ MUTTER_TYPE_WINDOW_TYPE,
+ META_WINDOW_NORMAL,
+ G_PARAM_READABLE));
+
window_signals[WORKSPACE_CHANGED] =
g_signal_new ("workspace-changed",
G_TYPE_FROM_CLASS (object_class),
@@ -6503,6 +6517,7 @@ recalc_window_type (MetaWindow *window)
if (old_type != window->type)
{
gboolean old_decorated = window->decorated;
+ GObject *object = G_OBJECT (window);
recalc_window_features (window);
@@ -6520,8 +6535,14 @@ recalc_window_type (MetaWindow *window)
meta_window_grab_keys (window);
+ g_object_freeze_notify (object);
+
if (old_decorated != window->decorated)
- g_object_notify (G_OBJECT (window), "decorated");
+ g_object_notify (object, "decorated");
+
+ g_object_notify (object, "window-type");
+
+ g_object_thaw_notify (object);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]