X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;f=openbox%2Fevent.c;h=5c948783e4c9171a3a901d32da35817123b516e9;hb=e0170fe18192bf9e383b71578b57ff3fecfe0d70;hp=69b63ff1334887c766dac083e0eab748d7824bd4;hpb=9be1d64d366ba57c1fc986d3d2aee90654a268a8;p=chaz%2Fopenbox diff --git a/openbox/event.c b/openbox/event.c index 69b63ff1..5c948783 100644 --- a/openbox/event.c +++ b/openbox/event.c @@ -24,6 +24,7 @@ static void event_handle_root(XEvent *e); static void event_handle_client(Client *c, XEvent *e); Time event_lasttime = 0; +Time event_unfocustime = 0; /*! The value of the mask for the NumLock modifier */ unsigned int NumLockMask; @@ -246,10 +247,9 @@ void event_process(XEvent *e) case EnterNotify: case LeaveNotify: event_lasttime = e->xcrossing.time; - /* XXX this caused problems before... but i don't remember why. hah. - so back it is. if problems arise again, then try filtering on the - detail instead of the mode. */ - if (e->xcrossing.mode != NotifyNormal) return; + /* NotifyUngrab occurs when a mouse button is released and the event is + caused, like when lowering a window */ + if (e->xcrossing.mode == NotifyGrab) return; break; } @@ -298,7 +298,7 @@ static void event_handle_root(XEvent *e) msgtype = e->xclient.message_type; if (msgtype == prop_atoms.net_current_desktop) { unsigned int d = e->xclient.data.l[0]; - if (d <= screen_num_desktops) + if (d < screen_num_desktops) screen_set_desktop(d); } else if (msgtype == prop_atoms.net_number_of_desktops) { unsigned int d = e->xclient.data.l[0]; @@ -413,11 +413,9 @@ static void event_handle_client(Client *client, XEvent *e) client->ignore_unmaps--; break; } - g_message("UnmapNotify for %lx", client->window); client_unmanage(client); break; case DestroyNotify: - g_message("DestroyNotify for %lx", client->window); client_unmanage(client); break; case ReparentNotify: @@ -485,9 +483,9 @@ static void event_handle_client(Client *client, XEvent *e) } e->xclient = ce.xclient; } - if (e->xclient.data.l[0] >= 0 && - e->xclient.data.l[0] < screen_num_desktops) - client_set_desktop(client, e->xclient.data.l[0]); + if ((unsigned)e->xclient.data.l[0] < screen_num_desktops || + (unsigned)e->xclient.data.l[0] == DESKTOP_ALL) + client_set_desktop(client, (unsigned)e->xclient.data.l[0]); } else if (msgtype == prop_atoms.net_wm_state) { /* can't compress these */ g_message("net_wm_state %s %ld %ld for 0x%lx",