XEvent ce;
Atom msgtype;
int i=0;
+ ObFrameContext con;
switch (e->type) {
case ButtonPress:
frame_adjust_focus(client->frame, FALSE);
break;
case EnterNotify:
+ switch (con) {
+ case OB_FRAME_CONTEXT_MAXIMIZE:
+ case OB_FRAME_CONTEXT_ALLDESKTOPS:
+ case OB_FRAME_CONTEXT_SHADE:
+ case OB_FRAME_CONTEXT_ICONIFY:
+ case OB_FRAME_CONTEXT_CLOSE:
+ g_message("hi");
+ frame_adjust_state(client->frame);
+ break;
+ default:
+ break;
+ }
con = frame_context(client, e->xcrossing.subwindow);
if (client_normal(client)) {
if (ob_state() == OB_STATE_STARTING) {
CWX | CWY)) {
int x, y, w, h;
ObCorner corner;
- Rect *a;
x = (e->xconfigurerequest.value_mask & CWX) ?
e->xconfigurerequest.x : client->area.x;
h = (e->xconfigurerequest.value_mask & CWHeight) ?
e->xconfigurerequest.height : client->area.height;
- /* dont let windows move above/left into the strut unless they are
- bigger than the available area */
- a = screen_area(client->desktop);
- if (e->xconfigurerequest.value_mask & CWX &&
- w <= a->width && x < a->x)
- x = a->x;
- if (e->xconfigurerequest.value_mask & CWY &&
- h <= a->height && y < a->y)
- y = a->y;
+ {
+ int newx = x;
+ int newy = y;
+ client_find_onscreen(client, &newx, &newy, w, h, TRUE);
+ if (e->xconfigurerequest.value_mask & CWX)
+ x = newx;
+ if (e->xconfigurerequest.value_mask & CWY)
+ y = newy;
+ }
switch (client->gravity) {
case NorthEastGravity:
} else if (msgtype == prop_atoms.net_moveresize_window) {
int oldg = client->gravity;
int tmpg, x, y, w, h;
- Rect *a;
if (e->xclient.data.l[0] & 0xff)
tmpg = e->xclient.data.l[0] & 0xff;
h = client->area.y;
client->gravity = tmpg;
- /* get the frame position */
- frame_client_gravity(client->frame, &x, &y);
-
- /* dont let windows move above/left into the strut unless they are
- bigger than the available area */
- a = screen_area(client->desktop);
- if (e->xconfigurerequest.value_mask & CWX &&
- w <= a->width && x < a->x)
- x = a->x;
- if (e->xconfigurerequest.value_mask & CWY &&
- h <= a->height && y < a->y)
- y = a->y;
+ {
+ int newx = x;
+ int newy = y;
+ client_find_onscreen(client, &newx, &newy, w, h, TRUE);
+ if (e->xclient.data.l[0] & 1 << 8)
+ x = newx;
+ if (e->xclient.data.l[0] & 1 << 9)
+ y = newy;
+ }
- /* go back to the client position */
- frame_frame_gravity(client->frame, &x, &y);
-
client_configure(client, OB_CORNER_TOPLEFT,
x, y, w, h, FALSE, TRUE);