]> Dogcows Code - chaz/openbox/blobdiff - openbox/client.c
save premax values properly, individually for each direction
[chaz/openbox] / openbox / client.c
index 8b008e9b2a424bba780a76adb3377b6eca6b25dd..774582e3fa1847d77e6170c648686d57116ca955 100644 (file)
@@ -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
This page took 0.021864 seconds and 4 git commands to generate.