summary refs log tree commit diff
path: root/client.c
diff options
context:
space:
mode:
authorokan <okan>2011-09-13 08:41:57 +0000
committerokan <okan>2011-09-13 08:41:57 +0000
commit796b32123d88fd5946c97fb79ad551600c772f62 (patch)
tree87deac6c6d1d3bfdb5ce66a880776ce63b37dd5b /client.c
parentb96caa16e6a6406a0f837637cd5529f0d778b927 (diff)
downloadcwm-796b32123d88fd5946c97fb79ad551600c772f62.tar.gz
cwm-796b32123d88fd5946c97fb79ad551600c772f62.tar.xz
cwm-796b32123d88fd5946c97fb79ad551600c772f62.zip
add WM_TRANSIENT_FOR event support: moves dialogs, toolbars and such to
the group of the main application window; based on a diff from Alexander
Polakov with CLIENT_IGNORE flag suggestion from oga@.

ok oga@
Diffstat (limited to 'client.c')
-rw-r--r--client.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/client.c b/client.c
index e7783a4..711aeba 100644
--- a/client.c
+++ b/client.c
@@ -113,6 +113,8 @@ client_new(Window win, struct screen_ctx *sc, int mapped)
 
 	XAddToSaveSet(X_Dpy, cc->win);
 
+	client_transient(cc);
+
 	/* Notify client of its configuration. */
 	xu_configure(cc);
 
@@ -869,6 +871,21 @@ client_freehints(struct client_ctx *cc)
 		XFree(cc->app_class);
 }
 
+void
+client_transient(struct client_ctx *cc)
+{
+	struct client_ctx	*tc;
+	Window			 trans;
+
+	if (XGetTransientForHint(X_Dpy, cc->win, &trans)) {
+		if ((tc = client_find(trans)) && tc->group) {
+			group_movetogroup(cc, tc->group->shortcut - 1);
+			if (tc->flags & CLIENT_IGNORE)
+				cc->flags |= CLIENT_IGNORE;
+		}
+	}
+}
+
 static int
 client_inbound(struct client_ctx *cc, int x, int y)
 {