summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Andrieu <oandrieu@src.gnome.org>2005-07-19 10:18:04 +0000
committerOlivier Andrieu <oandrieu@src.gnome.org>2005-07-19 10:18:04 +0000
commit3786ff4386c392ed8c8535d011106d8783687de7 (patch)
treee2666844fa9d9bad3dcda8ff24e117b4b1b9e27f
parent99987e54befa94dcb26f7f20bcfbee9daceeee4e (diff)
downloadlibwnck-3786ff4386c392ed8c8535d011106d8783687de7.tar.gz
new setter function (patch from bug #133306).
* libwnck/window.[ch] (wnck_window_set_window_type): new setter function (patch from bug #133306).
-rw-r--r--ChangeLog5
-rw-r--r--libwnck/window.c57
-rw-r--r--libwnck/window.h2
3 files changed, 64 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index fc2d356..0d8f0f3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2005-07-19 Olivier Andrieu <oliv__a@users.sourceforge.net>
+
+ * libwnck/window.[ch] (wnck_window_set_window_type): new setter
+ function (patch from bug #133306).
+
2005-07-19 Matthias Clasen <mclasen@redhat.com>
* doc/tmpl/*.sgml: Add template files to cvs, to make
diff --git a/libwnck/window.c b/libwnck/window.c
index 86c3bb8..e2757e7 100644
--- a/libwnck/window.c
+++ b/libwnck/window.c
@@ -608,6 +608,63 @@ wnck_window_get_window_type (WnckWindow *window)
}
/**
+ * wnck_window_set_window_type:
+ * @window: a #WnckWindow
+ * @wintype: the #WnckWindowType type hint
+ *
+ * Sets the semantic type of the window.
+ *
+ **/
+void
+wnck_window_set_window_type (WnckWindow *window, WnckWindowType wintype)
+{
+ Atom atom;
+
+ g_return_if_fail (WNCK_IS_WINDOW (window));
+
+ switch (wintype) {
+ case WNCK_WINDOW_NORMAL:
+ atom = _wnck_atom_get ("_NET_WM_WINDOW_TYPE_NORMAL");
+ break;
+ case WNCK_WINDOW_DESKTOP:
+ atom = _wnck_atom_get ("_NET_WM_WINDOW_TYPE_DESKTOP");
+ break;
+ case WNCK_WINDOW_DOCK:
+ atom = _wnck_atom_get ("_NET_WM_WINDOW_TYPE_DOCK");
+ break;
+ case WNCK_WINDOW_DIALOG:
+ atom = _wnck_atom_get ("_NET_WM_WINDOW_TYPE_DIALOG");
+ break;
+ case WNCK_WINDOW_MODAL_DIALOG:
+ atom = _wnck_atom_get ("_NET_WM_WINDOW_TYPE_MODAL_DIALOG");
+ break;
+ case WNCK_WINDOW_TOOLBAR:
+ atom = _wnck_atom_get ("_NET_WM_WINDOW_TYPE_TOOLBAR");
+ break;
+ case WNCK_WINDOW_MENU:
+ atom = _wnck_atom_get ("_NET_WM_WINDOW_TYPE_MENU");
+ break;
+ case WNCK_WINDOW_UTILITY:
+ atom = _wnck_atom_get ("_NET_WM_WINDOW_TYPE_UTILITY");
+ break;
+ case WNCK_WINDOW_SPLASHSCREEN:
+ atom = _wnck_atom_get ("_NET_WM_WINDOW_TYPE_SPLASHSCREEN");
+ break;
+ default:
+ return;
+ }
+ _wnck_error_trap_push ();
+
+ XChangeProperty (gdk_display,
+ window->priv->xwindow,
+ _wnck_atom_get ("_NET_WM_WINDOW_TYPE"),
+ XA_ATOM, 32, PropModeReplace,
+ (guchar *)&atom, 1);
+
+ _wnck_error_trap_pop ();
+}
+
+/**
* wnck_window_is_minimized:
* @window: a #WnckWindow
*
diff --git a/libwnck/window.h b/libwnck/window.h
index fb92cf0..6e23e57 100644
--- a/libwnck/window.h
+++ b/libwnck/window.h
@@ -149,6 +149,8 @@ int wnck_window_get_pid (WnckWindow *window);
gint wnck_window_get_sort_order (WnckWindow *window);
WnckWindowType wnck_window_get_window_type (WnckWindow *window);
+void wnck_window_set_window_type (WnckWindow *window,
+ WnckWindowType wintype);
gboolean wnck_window_is_minimized (WnckWindow *window);
gboolean wnck_window_is_maximized_horizontally (WnckWindow *window);