From f5f59cea71b42ac462a8d30122646b79462e6499 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Sat, 11 Oct 2003 08:21:51 +0000 Subject: [PATCH] raise windows when they change modality --- openbox/client.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/openbox/client.c b/openbox/client.c index 619531de..095eded3 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -1743,7 +1743,6 @@ static void client_calc_layer_recursive(ObClient *self, ObClient *orig, if (!raised && l != old) if (orig->frame) { /* only restack if the original window is managed */ - /* XXX add_non_intrusive ever? */ stacking_remove(CLIENT_AS_WINDOW(self)); stacking_add(CLIENT_AS_WINDOW(self)); } @@ -2441,6 +2440,7 @@ void client_set_state(ObClient *self, Atom action, long data1, long data2) gboolean undecorated = self->undecorated; gboolean max_horz = self->max_horz; gboolean max_vert = self->max_vert; + gboolean modal = self->modal; int i; if (!(action == prop_atoms.net_wm_state_add || @@ -2457,7 +2457,7 @@ void client_set_state(ObClient *self, Atom action, long data1, long data2) /* if toggling, then pick whether we're adding or removing */ if (action == prop_atoms.net_wm_state_toggle) { if (state == prop_atoms.net_wm_state_modal) - action = self->modal ? prop_atoms.net_wm_state_remove : + action = modal ? prop_atoms.net_wm_state_remove : prop_atoms.net_wm_state_add; else if (state == prop_atoms.net_wm_state_maximized_vert) action = self->max_vert ? prop_atoms.net_wm_state_remove : @@ -2493,8 +2493,7 @@ void client_set_state(ObClient *self, Atom action, long data1, long data2) if (action == prop_atoms.net_wm_state_add) { if (state == prop_atoms.net_wm_state_modal) { - /* XXX raise here or something? */ - self->modal = TRUE; + modal = TRUE; } else if (state == prop_atoms.net_wm_state_maximized_vert) { max_vert = TRUE; } else if (state == prop_atoms.net_wm_state_maximized_horz) { @@ -2517,7 +2516,7 @@ void client_set_state(ObClient *self, Atom action, long data1, long data2) } else { /* action == prop_atoms.net_wm_state_remove */ if (state == prop_atoms.net_wm_state_modal) { - self->modal = FALSE; + modal = FALSE; } else if (state == prop_atoms.net_wm_state_maximized_vert) { max_vert = FALSE; } else if (state == prop_atoms.net_wm_state_maximized_horz) { @@ -2564,6 +2563,12 @@ void client_set_state(ObClient *self, Atom action, long data1, long data2) client_shade(self, shaded); if (undecorated != self->undecorated) client_set_undecorated(self, undecorated); + if (modal != self->modal) { + self->modal = modal; + /* when a window changes modality, then its stacking order with its + transients needs to change */ + client_raise(self); + } client_calc_layer(self); client_change_state(self); /* change the hint to reflect these changes */ } -- 2.39.2