aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--calmwm.h3
-rw-r--r--client.c19
-rw-r--r--xevents.c5
3 files changed, 24 insertions, 3 deletions
diff --git a/calmwm.h b/calmwm.h
index ec0fe45..3aaac3e 100644
--- a/calmwm.h
+++ b/calmwm.h
@@ -15,7 +15,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $OpenBSD: calmwm.h,v 1.141 2011/09/08 12:35:33 okan Exp $
+ * $OpenBSD: calmwm.h,v 1.142 2011/09/13 08:41:57 okan Exp $
*/
#ifndef _CALMWM_H_
@@ -328,6 +328,7 @@ void client_send_delete(struct client_ctx *);
void client_setactive(struct client_ctx *, int);
void client_setname(struct client_ctx *);
int client_snapcalc(int, int, int, int, int);
+void client_transient(struct client_ctx *);
void client_unhide(struct client_ctx *);
void client_vertmaximize(struct client_ctx *);
void client_warp(struct client_ctx *);
diff --git a/client.c b/client.c
index 327f966..2cb0b1e 100644
--- a/client.c
+++ b/client.c
@@ -15,7 +15,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $OpenBSD: client.c,v 1.90 2011/09/05 07:37:55 okan Exp $
+ * $OpenBSD: client.c,v 1.91 2011/09/13 08:41:57 okan Exp $
*/
#include <sys/param.h>
@@ -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)
{
diff --git a/xevents.c b/xevents.c
index 6b1ca9c..ce4378a 100644
--- a/xevents.c
+++ b/xevents.c
@@ -15,7 +15,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $OpenBSD: xevents.c,v 1.55 2011/08/22 16:34:34 oga Exp $
+ * $OpenBSD: xevents.c,v 1.56 2011/09/13 08:41:57 okan Exp $
*/
/*
@@ -191,6 +191,9 @@ xev_handle_propertynotify(XEvent *ee)
case XA_WM_NAME:
client_setname(cc);
break;
+ case XA_WM_TRANSIENT_FOR:
+ client_transient(cc);
+ break;
default:
/* do nothing */
break;