]> Dogcows Code - chaz/openbox/blobdiff - src/Window.cc
use the raw screen size not the strut adjusted size to determine max_height and width...
[chaz/openbox] / src / Window.cc
index 7ca881ac4a7e938fba2d57fcdf98e7b73c1c0006..0a8452791f9922ba28fc59b63ddb7131b5efe062 100644 (file)
@@ -906,12 +906,18 @@ void BlackboxWindow::getWMNormalHints(void) {
   long icccm_mask;
   XSizeHints sizehint;
 
-  const Rect& screen_area = screen->availableArea();
-
   client.min_width = client.min_height =
     client.width_inc = client.height_inc = 1;
   client.base_width = client.base_height = 0;
+
+  /*
+    use the full screen, not the strut modified size. otherwise when the
+    availableArea changes max_width/height will be incorrect and lead to odd
+    rendering bugs.
+  */
+  const Rect& screen_area = screen->getRect();
   client.max_width = screen_area.width();
+
   client.max_height = screen_area.height();
   client.min_aspect_x = client.min_aspect_y =
     client.max_aspect_x = client.max_aspect_y = 1;
@@ -1119,8 +1125,8 @@ void BlackboxWindow::getTransientInfo(void) {
   client.transient_for = 0;
 
   Window trans_for;
-  if (!XGetTransientForHint(blackbox->getXDisplay(), client.window,
-                            &trans_for)) {
+  if (! XGetTransientForHint(blackbox->getXDisplay(), client.window,
+                             &trans_for)) {
     // transient_for hint not set
     return;
   }
@@ -1442,10 +1448,12 @@ void BlackboxWindow::maximize(unsigned int button) {
     blackbox_attrib.flags &= ! (AttribMaxHoriz | AttribMaxVert);
     blackbox_attrib.attrib &= ! (AttribMaxHoriz | AttribMaxVert);
 
-    // when a resize is begun, maximize(0) is called to clear any maximization
-    // flags currently set.  Otherwise it still thinks it is maximized.
-    // so we do not need to call configure() because resizing will handle it
-    if (!flags.resizing)
+    /*
+      when a resize is begun, maximize(0) is called to clear any maximization
+      flags currently set.  Otherwise it still thinks it is maximized.
+      so we do not need to call configure() because resizing will handle it
+    */
+    if (! flags.resizing)
       configure(blackbox_attrib.premax_x, blackbox_attrib.premax_y,
                 blackbox_attrib.premax_w, blackbox_attrib.premax_h);
 
@@ -1499,7 +1507,8 @@ void BlackboxWindow::maximize(unsigned int button) {
 
   configure(frame.changing.x(), frame.changing.y(),
             frame.changing.width(), frame.changing.height());
-  screen->getWorkspace(blackbox_attrib.workspace)->raiseWindow(this);
+  if (flags.focused)
+    screen->getWorkspace(blackbox_attrib.workspace)->raiseWindow(this);
   redrawAllButtons();
   setState(current_state);
 }
@@ -1767,7 +1776,7 @@ void BlackboxWindow::restoreAttributes(void) {
                                blackbox->getBlackboxAttributesAtom(),
                                &atom_return, &foo, &nitems, &ulfoo,
                                (unsigned char **) &net);
-  if (ret != Success || !net || nitems != PropBlackboxAttributesElements)
+  if (ret != Success || ! net || nitems != PropBlackboxAttributesElements)
     return;
 
   if (net->flags & AttribShaded &&
@@ -2432,7 +2441,7 @@ void BlackboxWindow::buttonReleaseEvent(XButtonEvent *re) {
 
 
 void BlackboxWindow::motionNotifyEvent(XMotionEvent *me) {
-  if (!flags.resizing && (me->state & Button1Mask) &&
+  if (! flags.resizing && (me->state & Button1Mask) &&
       (functions & Func_Move) &&
       (frame.title == me->window || frame.label == me->window ||
        frame.handle == me->window || frame.window == me->window)) {
@@ -2640,8 +2649,10 @@ void BlackboxWindow::restore(bool remap) {
   XSetWindowBorderWidth(blackbox->getXDisplay(), client.window, client.old_bw);
 
   XEvent ev;
-  if (! XCheckTypedWindowEvent(blackbox->getXDisplay(), client.window,
-                               ReparentNotify, &ev)) {
+  if (XCheckTypedWindowEvent(blackbox->getXDisplay(), client.window,
+                             ReparentNotify, &ev)) {
+    remap = True;
+  } else {
     // according to the ICCCM - if the client doesn't reparent to
     // root, then we have to do it for them
     XReparentWindow(blackbox->getXDisplay(), client.window,
@@ -2752,7 +2763,7 @@ void BlackboxWindow::upsize(void) {
 
   if (decorations & Decor_Border) {
     frame.border_w = screen->getBorderWidth();
-    if (!isTransient())
+    if (! isTransient())
       frame.mwm_border_w = screen->getFrameWidth();
     else
       frame.mwm_border_w = 0;
This page took 0.027429 seconds and 4 git commands to generate.