From 6c8d2d1e8e7add3260a0acdba4730e34c961bc46 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Tue, 16 Sep 2008 18:07:42 +0200 Subject: [PATCH] client: open transient windows on the same screen Signed-off-by: Julien Danjou --- client.c | 8 ++++---- property.c | 3 ++- structs.h | 2 ++ 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/client.c b/client.c index 0b44a60f..5e0dae12 100644 --- a/client.c +++ b/client.c @@ -404,6 +404,10 @@ client_manage(xcb_window_t w, xcb_get_geometry_reply_t *wgeom, int phys_screen, /* update hints */ property_update_wm_normal_hints(c, NULL); property_update_wm_hints(c, NULL); + property_update_wm_transient_for(c, NULL); + + if(c->transient_for) + screen = c->transient_for->screen; /* Try to load props if any */ client_loadprops(c, &globalconf.screens[screen]); @@ -433,10 +437,6 @@ client_manage(xcb_window_t w, xcb_get_geometry_reply_t *wgeom, int phys_screen, tag_client(c, tags->tab[i]); } - /* Check if it's a transient window, and manually set it floating. */ - if(!client_isfloating(c)) - property_update_wm_transient_for(c, NULL); - /* Push client in client list */ client_list_push(&globalconf.clients, c); client_ref(&c); diff --git a/property.c b/property.c index a83a846e..82558134 100644 --- a/property.c +++ b/property.c @@ -49,7 +49,8 @@ property_update_wm_transient_for(client_t *c, xcb_get_property_reply_t *reply) return; } - client_setfloating(c, true); + c->type = WINDOW_TYPE_DIALOG; + c->transient_for = client_getbywin(trans); } static int diff --git a/structs.h b/structs.h index 92040c33..13710390 100644 --- a/structs.h +++ b/structs.h @@ -333,6 +333,8 @@ struct client_t image_t *icon; /** Size hints */ xcb_size_hints_t size_hints; + /** Window it is transient for */ + client_t *transient_for; /** Next and previous clients */ client_t *prev, *next; };