X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fevent.c;h=c529f15648e12dcb790b3866fcafe621a17ba272;hb=65d50861ada11f5409680de285f461f16e78c090;hp=0c594d6bcba135d02d133ee4806ced76e6d6f224;hpb=98304406432cda3a94c2a57f0812714a229ec77a;p=chaz%2Fopenbox diff --git a/openbox/event.c b/openbox/event.c index 0c594d6b..c529f156 100644 --- a/openbox/event.c +++ b/openbox/event.c @@ -577,9 +577,6 @@ static void event_process(const XEvent *ec, gpointer data) ObClient *c = client_fake_manage(e->xclient.window); gulong vals[4]; - /* adjust the decorations so we know the sizes */ - frame_adjust_area(c->frame, FALSE, TRUE, TRUE); - /* set the frame extents on the window */ vals[0] = c->frame->size.left; vals[1] = c->frame->size.right; @@ -593,7 +590,7 @@ static void event_process(const XEvent *ec, gpointer data) } } else if (e->type == ConfigureRequest) { - /* unhandled config5Aure requests must be used to configure the + /* unhandled configure requests must be used to configure the window directly */ XWindowChanges xwc; @@ -663,7 +660,7 @@ static void event_handle_root(XEvent *e) if (d > 0) screen_set_num_desktops(d); } else if (msgtype == prop_atoms.net_showing_desktop) { - screen_show_desktop(e->xclient.data.l[0] != 0, TRUE); + screen_show_desktop(e->xclient.data.l[0] != 0, NULL); } else if (msgtype == prop_atoms.openbox_control) { if (e->xclient.data.l[0] == 1) ob_reconfigure(); @@ -1026,50 +1023,13 @@ static void event_handle_client(ObClient *client, XEvent *e) ObWindow *win; win = g_hash_table_lookup(window_map, &e->xconfigurerequest.above); - if (WINDOW_IS_CLIENT(win)) + if (WINDOW_IS_CLIENT(win) && WINDOW_AS_CLIENT(win) != client) sibling = WINDOW_AS_CLIENT(win); } - switch (e->xconfigurerequest.detail) { - case Below: - ob_debug("ConfigureRequest Below for client %s sibling %s\n", - client->title, sibling ? sibling->title : "(all)"); - /* just lower it */ - stacking_lower(CLIENT_AS_WINDOW(client)); - break; - case BottomIf: - ob_debug("ConfigureRequest BottomIf for client %s sibling " - "%s\n", - client->title, sibling ? sibling->title : "(all)"); - /* if this client occludes sibling (or anything if NULL), then - lower it to the bottom */ - if (stacking_occluded(sibling, client)) - stacking_lower(CLIENT_AS_WINDOW(client)); - break; - case Above: - ob_debug("ConfigureRequest Above for client %s sibling %s\n", - client->title, sibling ? sibling->title : "(all)"); - /* activate it rather than just focus it */ - client_activate(client, FALSE, FALSE); - break; - case TopIf: - ob_debug("ConfigureRequest TopIf for client %s sibling %s\n", - client->title, sibling ? sibling->title : "(all)"); - if (stacking_occluded(client, sibling)) - /* activate it rather than just focus it */ - client_activate(client, FALSE, FALSE); - case Opposite: - ob_debug("ConfigureRequest Opposite for client %s sibling " - "%s\n", - client->title, sibling ? sibling->title : "(all)"); - if (stacking_occluded(client, sibling)) - /* activate it rather than just focus it */ - client_activate(client, FALSE, FALSE); - else if (stacking_occluded(sibling, client)) - stacking_lower(CLIENT_AS_WINDOW(client)); - default: - break; - } + /* activate it rather than just focus it */ + stacking_restack_request(client, sibling, + e->xconfigurerequest.detail, TRUE); } break; case UnmapNotify: @@ -1246,6 +1206,43 @@ static void event_handle_client(ObClient *client, XEvent *e) client_convert_gravity(client, grav, &x, &y, w, h); client_find_onscreen(client, &x, &y, w, h, FALSE); client_configure(client, x, y, w, h, FALSE, TRUE); + } else if (msgtype == prop_atoms.net_restack_window) { + if (e->xclient.data.l[0] != 2) { + ob_debug_type(OB_DEBUG_APP_BUGS, + "_NET_RESTACK_WINDOW sent for window %s with " + "invalid source indication %ld\n", + client->title, e->xclient.data.l[0]); + } else { + ObClient *sibling = NULL; + if (e->xclient.data.l[1]) { + ObWindow *win = g_hash_table_lookup(window_map, + &e->xclient.data.l[1]); + if (WINDOW_IS_CLIENT(win) && + WINDOW_AS_CLIENT(win) != client) + { + sibling = WINDOW_AS_CLIENT(win); + } + if (sibling == NULL) + ob_debug_type(OB_DEBUG_APP_BUGS, + "_NET_RESTACK_WINDOW sent for window %s " + "with invalid sibling 0x%x\n", + client->title, e->xclient.data.l[1]); + } + if (e->xclient.data.l[2] == Below || + e->xclient.data.l[2] == BottomIf || + e->xclient.data.l[2] == Above || + e->xclient.data.l[2] == TopIf || + e->xclient.data.l[2] == Opposite) + { + /* just raise, don't activate */ + stacking_restack_request(client, sibling, + e->xclient.data.l[2], FALSE); + } else + ob_debug_type(OB_DEBUG_APP_BUGS, + "_NET_RESTACK_WINDOW sent for window %s " + "with invalid detail %d\n", + client->title, e->xclient.data.l[2]); + } } break; case PropertyNotify: