X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;f=openbox%2Fclient.c;h=774582e3fa1847d77e6170c648686d57116ca955;hb=f55766cc555c87e26ea4cc973b6eb971771b411c;hp=8b008e9b2a424bba780a76adb3377b6eca6b25dd;hpb=c88e66b8fff4b51a26392a8a45647af8233d4d9f;p=chaz%2Fopenbox diff --git a/openbox/client.c b/openbox/client.c index 8b008e9b..774582e3 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -526,8 +526,9 @@ static void client_restore_session_state(ObClient *self) RECT_SET(self->area, self->session->x, self->session->y, self->session->w, self->session->h); self->positioned = TRUE; - XResizeWindow(ob_display, self->window, - self->session->w, self->session->h); + if (self->session->w > 0 && self->session->h > 0) + XResizeWindow(ob_display, self->window, + self->session->w, self->session->h); self->desktop = (self->session->desktop == DESKTOP_ALL ? self->session->desktop : @@ -1747,7 +1748,7 @@ gboolean client_should_show(ObClient *self) { if (self->iconic) return FALSE; else if (!(self->desktop == screen_desktop || - self->desktop == DESKTOP_ALL)) return FALSE; + self->desktop == DESKTOP_ALL)) return FALSE; else if (client_normal(self) && screen_showing_desktop) return FALSE; return TRUE; @@ -2208,8 +2209,18 @@ void client_maximize(ObClient *self, gboolean max, int dir, gboolean savearea) h = self->area.height; if (max) { - if (savearea) - self->pre_max_area = self->area; + if (savearea) { + if ((dir == 0 || dir == 1) && !self->max_horz) { /* horz */ + RECT_SET(self->pre_max_area, + self->area.x, self->pre_max_area.y, + self->area.width, self->pre_max_area.height); + } + if ((dir == 0 || dir == 2) && !self->max_vert) { /* vert */ + RECT_SET(self->pre_max_area, + self->pre_max_area.x, self->area.y, + self->pre_max_area.width, self->area.height); + } + } } else { Rect *a; @@ -2552,10 +2563,7 @@ gboolean client_can_focus(ObClient *self) if (!self->frame->visible) return FALSE; - if (!((self->can_focus || self->focus_notify) && - (self->desktop == screen_desktop || - self->desktop == DESKTOP_ALL) && - !self->iconic)) + if (!(self->can_focus || self->focus_notify)) return FALSE; /* do a check to see if the window has already been unmapped or destroyed