X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fevent.c;h=409641df650b82107182476eef55e0064aaf3f2b;hb=5e27544d073856731363c1be9b132074e13259f6;hp=f5b2ec4823127d464e843aaa883789537eefbafd;hpb=0453a1dbedddadddf31c8ca40e1326e7c34d6362;p=chaz%2Fopenbox diff --git a/openbox/event.c b/openbox/event.c index f5b2ec48..409641df 100644 --- a/openbox/event.c +++ b/openbox/event.c @@ -138,6 +138,10 @@ void event_shutdown(gboolean reconfig) { if (reconfig) return; +#ifdef USE_SM + IceRemoveConnectionWatch(ice_watch, NULL); +#endif + client_remove_destructor(focus_delay_client_dest); XFreeModifiermap(modmap); } @@ -390,11 +394,14 @@ static gboolean event_ignore(XEvent *e, ObClient *client) case LeaveNotify: /* NotifyUngrab occurs when a mouse button is released and the event is caused, like when lowering a window */ - /* NotifyVirtual occurs when ungrabbing the pointer */ + /* NotifyVirtual and NotifyAncestor occurs when ungrabbing the + pointer (Ancestor happens when the pointer is on a window border) */ if (e->xcrossing.mode == NotifyGrab || e->xcrossing.detail == NotifyInferior || (e->xcrossing.mode == NotifyUngrab && - e->xcrossing.detail == NotifyVirtual)) { + (e->xcrossing.detail == NotifyAncestor || + e->xcrossing.detail == NotifyNonlinearVirtual || + e->xcrossing.detail == NotifyVirtual))) { #ifdef DEBUG_FOCUS ob_debug("%sNotify mode %d detail %d on %lx IGNORED\n", (e->type == EnterNotify ? "Enter" : "Leave"), @@ -581,7 +588,9 @@ static void event_handle_client(ObClient *client, XEvent *e) /* Wheel buttons don't draw because they are an instant click, so it is a waste of resources to go drawing it. */ if (!(e->xbutton.button == 4 || e->xbutton.button == 5)) { - switch (frame_context(client, e->xbutton.window)) { + con = frame_context(client, e->xbutton.window); + con = mouse_button_frame_context(con, e->xbutton.button); + switch (con) { case OB_FRAME_CONTEXT_MAXIMIZE: client->frame->max_press = (e->type == ButtonPress); framerender_frame(client->frame); @@ -692,15 +701,7 @@ static void event_handle_client(ObClient *client, XEvent *e) 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) { + if (config_focus_follow) { #ifdef DEBUG_FOCUS ob_debug("EnterNotify on %lx, focusing window\n", client->window);