client_iconify(client, TRUE, TRUE);
frame_adjust_focus(client->frame, FALSE);
break;
- case EnterNotify:
+ case LeaveNotify:
+ con = frame_context(client, e->xcrossing.window);
switch (con) {
case OB_FRAME_CONTEXT_MAXIMIZE:
+ client->frame->max_hover = FALSE;
+ frame_adjust_state(client->frame);
+ break;
case OB_FRAME_CONTEXT_ALLDESKTOPS:
+ client->frame->desk_hover = FALSE;
+ frame_adjust_state(client->frame);
+ break;
case OB_FRAME_CONTEXT_SHADE:
+ client->frame->shade_hover = FALSE;
+ frame_adjust_state(client->frame);
+ break;
case OB_FRAME_CONTEXT_ICONIFY:
+ client->frame->iconify_hover = FALSE;
+ frame_adjust_state(client->frame);
+ break;
case OB_FRAME_CONTEXT_CLOSE:
- g_message("hi");
+ client->frame->close_hover = FALSE;
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) {
- /* move it to the top of the focus order */
- guint desktop = client->desktop;
- if (desktop == DESKTOP_ALL) desktop = screen_desktop;
- focus_order[desktop] = g_list_remove(focus_order[desktop],
- client);
- focus_order[desktop] = g_list_prepend(focus_order[desktop],
- client);
- } else if (config_focus_follow) {
+ break;
+ case EnterNotify:
+ con = frame_context(client, e->xcrossing.window);
+ switch (con) {
+ case OB_FRAME_CONTEXT_MAXIMIZE:
+ client->frame->max_hover = TRUE;
+ frame_adjust_state(client->frame);
+ break;
+ case OB_FRAME_CONTEXT_ALLDESKTOPS:
+ client->frame->desk_hover = TRUE;
+ frame_adjust_state(client->frame);
+ break;
+ case OB_FRAME_CONTEXT_SHADE:
+ client->frame->shade_hover = TRUE;
+ frame_adjust_state(client->frame);
+ break;
+ case OB_FRAME_CONTEXT_ICONIFY:
+ client->frame->iconify_hover = TRUE;
+ frame_adjust_state(client->frame);
+ break;
+ case OB_FRAME_CONTEXT_CLOSE:
+ client->frame->close_hover = TRUE;
+ frame_adjust_state(client->frame);
+ break;
+ case OB_FRAME_CONTEXT_FRAME:
+ if (client_normal(client)) {
+ if (ob_state() == OB_STATE_STARTING) {
+ /* move it to the top of the focus order */
+ guint desktop = client->desktop;
+ if (desktop == DESKTOP_ALL) desktop = screen_desktop;
+ focus_order[desktop] = g_list_remove(focus_order[desktop],
+ client);
+ focus_order[desktop] = g_list_prepend(focus_order[desktop],
+ client);
+ } else if (config_focus_follow) {
#ifdef DEBUG_FOCUS
- ob_debug("EnterNotify on %lx, focusing window\n",
- client->window);
+ ob_debug("EnterNotify on %lx, focusing window\n",
+ client->window);
#endif
- client_focus(client);
+ client_focus(client);
+ }
}
+ break;
+ default:
+ break;
}
break;
case ConfigureRequest:
/* if we are iconic (or shaded (fvwm does this)) ignore the event */
if (client->iconic || client->shaded) return;
- if (e->xconfigurerequest.value_mask & CWBorderWidth)
- client->border_width = e->xconfigurerequest.border_width;
-
/* resize, then move, as specified in the EWMH section 7.7 */
if (e->xconfigurerequest.value_mask & (CWWidth | CWHeight |
- CWX | CWY)) {
+ CWX | CWY |
+ CWBorderWidth)) {
int x, y, w, h;
ObCorner corner;
- Rect *a;
+
+ if (e->xconfigurerequest.value_mask & CWBorderWidth)
+ client->border_width = e->xconfigurerequest.border_width;
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:
corner = OB_CORNER_TOPLEFT;
}
- client_configure(client, corner, x, y, w, h, FALSE, TRUE);
+ client_configure_full(client, corner, x, y, w, h, FALSE, TRUE,
+ TRUE);
}
if (e->xconfigurerequest.value_mask & CWStackMode) {
} 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;
if (e->xclient.data.l[0] & 1 << 10)
w = e->xclient.data.l[3];
else
- w = client->area.y;
+ w = client->area.width;
if (e->xclient.data.l[0] & 1 << 11)
h = e->xclient.data.l[4];
else
- h = client->area.y;
+ h = client->area.height;
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);
client_update_protocols(client);
client_setup_decor_and_functions(client);
}
- else if (msgtype == prop_atoms.net_wm_strut)
+ else if (msgtype == prop_atoms.net_wm_strut) {
client_update_strut(client);
+ }
else if (msgtype == prop_atoms.net_wm_icon ||
msgtype == prop_atoms.kwm_win_icon)
client_update_icons(client);
/* will call the menu_hide() for each submenu as well */
if (!it)
- menu_hide(menu_visible->data);
+ menu_control_keyboard_nav(ob_keycode(OB_KEY_ESCAPE));
break;
case MotionNotify: