X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fevent.c;h=6d1fa8dc39f92c41f12f95da3780408c250b3ba2;hb=baa4a878cda78cf7ef9a894b8937c72fa50c897a;hp=b978f563989e07e63a7e616bd2ce379884e979ba;hpb=7fdfb9dbf63a6d3b4d0e682b789bc541c8de09b7;p=chaz%2Fopenbox diff --git a/openbox/event.c b/openbox/event.c index b978f563..6d1fa8dc 100644 --- a/openbox/event.c +++ b/openbox/event.c @@ -597,9 +597,9 @@ static void event_handle_root(XEvent *e) } else if (msgtype == prop_atoms.net_showing_desktop) { screen_show_desktop(e->xclient.data.l[0] != 0); } else if (msgtype == prop_atoms.ob_control) { - if ((Atom)e->xclient.data.l[0] == 1) + if (e->xclient.data.l[0] == 1) ob_reconfigure(); - else if ((Atom)e->xclient.data.l[0] == 2) + else if (e->xclient.data.l[0] == 2) ob_restart(); } break; @@ -858,8 +858,13 @@ static void event_handle_client(ObClient *client, XEvent *e) client->frame->size.left + client->frame->size.right; gint fh = h + client->frame->size.top + client->frame->size.bottom; + /* make this rude for size-only changes but not for position + changes.. */ + gboolean moving = ((e->xconfigurerequest.value_mask & CWX) || + (e->xconfigurerequest.value_mask & CWY)); + client_find_onscreen(client, &newx, &newy, fw, fh, - FALSE); + !moving); if (e->xconfigurerequest.value_mask & CWX) x = newx; if (e->xconfigurerequest.value_mask & CWY) @@ -890,13 +895,17 @@ static void event_handle_client(ObClient *client, XEvent *e) switch (e->xconfigurerequest.detail) { case Below: case BottomIf: - client_lower(client); + /* Apps are so rude. And this is totally disconnected from + activation/focus. Bleh. */ + /*client_lower(client);*/ break; case Above: case TopIf: default: - client_raise(client); + /* Apps are so rude. And this is totally disconnected from + activation/focus. Bleh. */ + /*client_raise(client);*/ break; } } @@ -935,7 +944,7 @@ static void event_handle_client(ObClient *client, XEvent *e) it can happen now when the window is on another desktop, but we still don't want it! */ - client_activate(client, FALSE, TRUE); + client_activate(client, FALSE, TRUE, CurrentTime); break; case ClientMessage: /* validate cuz we query stuff off the client here */ @@ -997,9 +1006,11 @@ static void event_handle_client(ObClient *client, XEvent *e) /* XXX make use of data.l[1] and [2] ! */ client_activate(client, FALSE, (e->xclient.data.l[0] == 0 || - e->xclient.data.l[0] == 2)); + e->xclient.data.l[0] == 2), + e->xclient.data.l[1]); } else if (msgtype == prop_atoms.net_wm_moveresize) { - ob_debug("net_wm_moveresize for 0x%lx\n", client->window); + ob_debug("net_wm_moveresize for 0x%lx direction %d\n", + client->window, e->xclient.data.l[2]); if ((Atom)e->xclient.data.l[2] == prop_atoms.net_wm_moveresize_size_topleft || (Atom)e->xclient.data.l[2] == @@ -1029,6 +1040,9 @@ static void event_handle_client(ObClient *client, XEvent *e) e->xclient.data.l[1], e->xclient.data.l[3], e->xclient.data.l[2]); } + else if ((Atom)e->xclient.data.l[2] == + prop_atoms.net_wm_moveresize_cancel) + moveresize_end(TRUE); } else if (msgtype == prop_atoms.net_moveresize_window) { gint oldg = client->gravity; gint tmpg, x, y, w, h; @@ -1105,11 +1119,8 @@ static void event_handle_client(ObClient *client, XEvent *e) b == prop_atoms.wm_icon_name)) { continue; } - if ((a == prop_atoms.net_wm_icon || - a == prop_atoms.kwm_win_icon) - && - (b == prop_atoms.net_wm_icon || - b == prop_atoms.kwm_win_icon)) + if (a == prop_atoms.net_wm_icon && + b == prop_atoms.net_wm_icon) continue; XPutBackEvent(ob_display, &ce); @@ -1143,10 +1154,12 @@ static void event_handle_client(ObClient *client, XEvent *e) 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) { + else if (msgtype == prop_atoms.net_wm_icon) { client_update_icons(client); } + else if (msgtype == prop_atoms.net_wm_user_time) { + client_update_user_time(client, TRUE); + } else if (msgtype == prop_atoms.sm_client_id) { client_update_sm_client_id(client); } @@ -1238,7 +1251,8 @@ static void event_handle_menu(XEvent *ev) if (menu_can_hide) { if ((e = menu_entry_frame_under(ev->xbutton.x_root, ev->xbutton.y_root))) - menu_entry_frame_execute(e, ev->xbutton.state); + menu_entry_frame_execute(e, ev->xbutton.state, + ev->xbutton.time); else menu_frame_hide_all(); } @@ -1268,7 +1282,8 @@ static void event_handle_menu(XEvent *ev) else if (ev->xkey.keycode == ob_keycode(OB_KEY_RETURN)) { ObMenuFrame *f; if ((f = find_active_menu())) - menu_entry_frame_execute(f->selected, ev->xkey.state); + menu_entry_frame_execute(f->selected, ev->xkey.state, + ev->xkey.time); } else if (ev->xkey.keycode == ob_keycode(OB_KEY_LEFT)) { ObMenuFrame *f; if ((f = find_active_or_last_menu()) && f->parent)