diff options
| author | Dana Jansens <danakj@orodu.net> | 2007-03-02 02:23:00 +0000 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2007-03-02 02:23:00 +0000 |
| commit | 78af5d15e9dd94959786811e9eddfa1e5024067c (patch) | |
| tree | 99609d208f06c9a97108fc881d736baa5912e547 /openbox/event.c | |
| parent | 2b99b62abf3441bc69c7c189da05a709edbb49f3 (diff) | |
this includes a number of things since my magnificent return....
1. some random compiling/style cleanups
2. some bigfixes
- mislogic in per-window-settings and focusing new windows
- use client_can_focus rather than checking variables for directional focus
- MAYBE fix all those lock-ups forever. using event_curtime (a new variable) now instead of event_lasttime. event_lasttime is still used however when the event being processed did not have a time associated with it. this may or may not be a problem, and will be seen.
3. um.. i forget
4. oh yeah, 3rd party docks are now treated like the internal ob dock irt focus. that is, clicking on them won't pass them focus. this is going to be ratified as expected behavior in the wm-spec just now. if docks/panels want focus they can request it with _net_active_window, and then they can have all the focus they want! one day alt-tabbing around dock windows might be nice. but not until the ob dock is moved out into a separate application. going to have to add a wmapp selection and stuff for that though... ugly. who uses wmdockapps anymore !? someone must.. *sigh*
Diffstat (limited to 'openbox/event.c')
| -rw-r--r-- | openbox/event.c | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/openbox/event.c b/openbox/event.c index 21185be9..c74e15ae 100644 --- a/openbox/event.c +++ b/openbox/event.c @@ -86,7 +86,12 @@ static gboolean menu_hide_delay_func(gpointer data); (e)->xfocus.detail == NotifyAncestor || \ (e)->xfocus.detail > NotifyNonlinearVirtual) -Time event_lasttime = 0; +/* The most recent time at which an event with a timestamp occured. */ +static Time event_lasttime = 0; +/* The time for the current event being processed + (it's the event_lasttime for events without times, if this is a bug then + use CurrentTime instead, but it seems ok) */ +Time event_curtime = CurrentTime; /*! The value of the mask for the NumLock modifier */ guint NumLockMask; @@ -251,8 +256,14 @@ static void event_set_lasttime(XEvent *e) break; } - if (t > event_lasttime) + if (t > event_lasttime) { event_lasttime = t; + event_curtime = event_lasttime; + } else if (t == 0) { + event_curtime = event_lasttime; + } else { + event_curtime = t; + } } #define STRIP_MODS(s) \ @@ -919,7 +930,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); + client_activate(client, FALSE, TRUE); break; case ClientMessage: /* validate cuz we query stuff off the client here */ @@ -973,8 +984,15 @@ static void event_handle_client(ObClient *client, XEvent *e) ob_debug("net_close_window for 0x%lx\n", client->window); client_close(client); } else if (msgtype == prop_atoms.net_active_window) { - ob_debug("net_active_window for 0x%lx\n", client->window); - client_activate(client, FALSE); + ob_debug("net_active_window for 0x%lx source=%s\n", + client->window, + (e->xclient.data.l[0] == 0 ? "unknown" : + (e->xclient.data.l[0] == 1 ? "application" : + (e->xclient.data.l[0] == 2 ? "user" : "INVALID")))); + /* 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)); } else if (msgtype == prop_atoms.net_wm_moveresize) { ob_debug("net_wm_moveresize for 0x%lx\n", client->window); if ((Atom)e->xclient.data.l[2] == |
