if (client_should_show(self)) {
frame_show(self->frame);
show = TRUE;
- }
- /* According to the ICCCM (sec 4.1.3.1) when a window is not visible, it
- needs to be in IconicState. This includes when it is on another
- desktop!
- */
- client_change_wm_state(self);
+ /* According to the ICCCM (sec 4.1.3.1) when a window is not visible,
+ it needs to be in IconicState. This includes when it is on another
+ desktop!
+ */
+ client_change_wm_state(self);
+ }
return show;
}
frame_hide(self->frame);
hide = TRUE;
- }
- /* According to the ICCCM (sec 4.1.3.1) when a window is not visible, it
- needs to be in IconicState. This includes when it is on another
- desktop!
- */
- client_change_wm_state(self);
+ /* According to the ICCCM (sec 4.1.3.1) when a window is not visible,
+ it needs to be in IconicState. This includes when it is on another
+ desktop!
+ */
+ client_change_wm_state(self);
+ }
return hide;
}
{
if (!client_show(self))
client_hide(self);
-
- /* According to the ICCCM (sec 4.1.3.1) when a window is not visible, it
- needs to be in IconicState. This includes when it is on another
- desktop!
- */
- client_change_wm_state(self);
}
gboolean client_normal(ObClient *self) {
/* make the frame recalculate its dimentions n shit without changing
anything visible for real, this way the constraints below can work with
the updated frame dimensions. */
- frame_adjust_area(self->frame, TRUE, TRUE, TRUE);
+ frame_adjust_area(self->frame, FALSE, TRUE, TRUE);
/* work within the prefered sizes given by the window */
if (!(*w == self->area.width && *h == self->area.height)) {
/* find the frame's dimensions and move/resize it */
fmoved = moved;
fresized = resized;
+
+ /* if decorations changed, then readjust everything for the frame */
if (self->decorations != fdecor ||
self->max_horz != fhorz || self->max_vert != fvert)
{
fmoved = fresized = TRUE;
}
+
+ /* adjust the frame */
if (fmoved || fresized)
frame_adjust_area(self->frame, fmoved, fresized, FALSE);
self->client->area.height +
self->size.top + self->size.bottom));
- if (moved || resized) {
+ if ((moved || resized) && !fake) {
/* find the new coordinates, done after setting the frame.size, for
frame_client_gravity. */
self->area.x = self->client->area.x;
case NorthGravity:
case SouthGravity:
case CenterGravity:
- *x -= (self->size.left + w) / 2;
+ /* the middle of the client will be the middle of the frame */
+ *x -= (self->size.right - self->size.left) / 2;
break;
case NorthEastGravity:
case SouthEastGravity:
case EastGravity:
- *x -= (self->size.left + self->size.right + w) - 1;
+ /* the right side of the client will be the right side of the frame */
+ *x -= self->size.right + self->size.left;
break;
case ForgetGravity:
case StaticGravity:
+ /* the client's position won't move */
*x -= self->size.left;
break;
}
case CenterGravity:
case EastGravity:
case WestGravity:
- *y -= (self->size.top + h) / 2;
+ /* the middle of the client will be the middle of the frame */
+ *y -= (self->size.bottom - self->size.top) / 2;
break;
case SouthWestGravity:
case SouthEastGravity:
case SouthGravity:
- *y -= (self->size.top + self->size.bottom + h) - 1;
+ /* the bottom of the client will be the bottom of the frame */
+ *y -= self->size.bottom + self->size.top;
break;
case ForgetGravity:
case StaticGravity:
+ /* the client's position won't move */
*y -= self->size.top;
break;
}
case NorthGravity:
case CenterGravity:
case SouthGravity:
- *x += (self->size.left + w) / 2;
+ /* the middle of the client will be the middle of the frame */
+ *x += (self->size.right - self->size.left) / 2;
break;
case NorthEastGravity:
case EastGravity:
case SouthEastGravity:
- *x += (self->size.left + self->size.right + w) - 1;
+ /* the right side of the client will be the right side of the frame */
+ *x += self->size.right + self->size.left;
break;
case StaticGravity:
case ForgetGravity:
- *x += self->size.left;
+ /* the client's position won't move */
+ *x -= self->size.left;
break;
}
case WestGravity:
case CenterGravity:
case EastGravity:
- *y += (self->size.top + h) / 2;
+ /* the middle of the client will be the middle of the frame */
+ *y += (self->size.bottom - self->size.top) / 2;
break;
case SouthWestGravity:
case SouthGravity:
case SouthEastGravity:
- *y += (self->size.top + self->size.bottom + h) - 1;
+ /* the bottom of the client will be the bottom of the frame */
+ *y += self->size.bottom + self->size.top;
break;
case StaticGravity:
case ForgetGravity:
+ /* the client's position won't move */
*y += self->size.top;
break;
}
XMapWindow(display, win);
XFlush(display);
- XMoveResizeWindow(display, win, 960-1, 600-1, 600, 150);
+ XMoveResizeWindow(display, win, 1172-600, 668-150, 600, 150);
/*XResizeWindow(display, win, 600, 150);*/
XSelectInput(display, win, ExposureMask | StructureNotifyMask);