X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fframe.c;h=3fd8b22a69e06bf01e59bbe450295f56d7850e71;hb=841a83fa6d710f76379c5173304b2f16dbb6dd5f;hp=953ed07d1e5c889037a13c7ba249ce2e8708094d;hpb=56307d60773d0eaf65b10414cd0e3ec0b2adc156;p=chaz%2Fopenbox diff --git a/openbox/frame.c b/openbox/frame.c index 953ed07d..3fd8b22a 100644 --- a/openbox/frame.c +++ b/openbox/frame.c @@ -2,7 +2,7 @@ frame.c for the Openbox window manager Copyright (c) 2006 Mikael Magnusson - Copyright (c) 2003 Ben Jansens + Copyright (c) 2003-2007 Dana Jansens This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -29,7 +29,8 @@ #include "moveresize.h" #include "render/theme.h" -#define PLATE_EVENTMASK (SubstructureRedirectMask | ButtonPressMask) +#define PLATE_EVENTMASK (SubstructureRedirectMask | ButtonPressMask | \ + FocusChangeMask) #define FRAME_EVENTMASK (EnterWindowMask | LeaveWindowMask | \ ButtonPressMask | ButtonReleaseMask | \ VisibilityChangeMask) @@ -237,18 +238,28 @@ void frame_show(ObFrame *self) self->visible = TRUE; XMapWindow(ob_display, self->client->window); XMapWindow(ob_display, self->window); + self->firstmap = TRUE; } } void frame_hide(ObFrame *self) { - if (self->visible) { - self->visible = FALSE; - self->client->ignore_unmaps += 2; - /* we unmap the client itself so that we can get MapRequest - events, and because the ICCCM tells us to! */ - XUnmapWindow(ob_display, self->window); - XUnmapWindow(ob_display, self->client->window); + if (self->visible || self->firstmap == FALSE) { + if (self->visible) { + self->visible = FALSE; + self->client->ignore_unmaps += 2; + /* we unmap the client itself so that we can get MapRequest + events, and because the ICCCM tells us to! */ + XUnmapWindow(ob_display, self->window); + XUnmapWindow(ob_display, self->client->window); + } else { + /* the frame wasn't visible, but the frame is being hidden now. + so we don't need to unmap the frame, but we do need to unmap + the client. */ + self->client->ignore_unmaps += 1; + XUnmapWindow(ob_display, self->client->window); + } + self->firstmap = TRUE; } } @@ -474,7 +485,7 @@ void frame_adjust_area(ObFrame *self, gboolean moved, vals[1] = self->size.right; vals[2] = self->size.top; vals[3] = self->size.bottom; - PROP_SETA32(self->client->window, kde_net_wm_frame_strut, + PROP_SETA32(self->client->window, net_frame_extents, cardinal, vals, 4); } @@ -530,11 +541,11 @@ void frame_grab_client(ObFrame *self, ObClient *client) req's) the ButtonPress is to catch clicks on the client border */ XSelectInput(ob_display, self->plate, PLATE_EVENTMASK); + frame_adjust_area(self, TRUE, TRUE, FALSE); + /* map the client so it maps when the frame does */ XMapWindow(ob_display, client->window); - frame_adjust_area(self, TRUE, TRUE, FALSE); - /* set all the windows for the frame in the window_map */ g_hash_table_insert(window_map, &self->window, client); g_hash_table_insert(window_map, &self->plate, client);