X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fevent.c;h=7d24640c4e6d2bbb9c533a9e2ea5bc6effb26f0b;hb=41aeb42af13774c11e5a23e51bf56fa053678b5a;hp=44e0f5328ed269cb46133264e8007e680b4a3704;hpb=5148b839fefe16b54f26bc0d2c7a500127cf2725;p=chaz%2Fopenbox diff --git a/openbox/event.c b/openbox/event.c index 44e0f532..7d24640c 100644 --- a/openbox/event.c +++ b/openbox/event.c @@ -43,6 +43,7 @@ #include "stacking.h" #include "extensions.h" #include "translate.h" +#include "ping.h" #include #include @@ -102,8 +103,8 @@ static void focus_delay_client_dest(ObClient *client, gpointer data); Time event_curtime = CurrentTime; Time event_last_user_time = CurrentTime; /*! The serial of the current X event */ -gulong event_curserial; +static gulong event_curserial; static gboolean focus_left_screen = FALSE; /*! A list of ObSerialRanges which are to be ignored for mouse enter events */ static GSList *ignore_serials = NULL; @@ -269,7 +270,8 @@ static void event_hack_mods(XEvent *e) magic. Our X core protocol stuff won't work, so we use this to find what the modifier state is instead. */ if (XkbGetState(ob_display, XkbUseCoreKbd, &xkb_state) == Success) - e->xkey.state = xkb_state.compat_state; + e->xkey.state = + modkeys_only_modifier_masks(xkb_state.compat_state); else #endif { @@ -767,6 +769,9 @@ static void event_handle_root(XEvent *e) ob_restart(); else if (e->xclient.data.l[0] == 3) ob_exit(0); + } else if (msgtype == prop_atoms.wm_protocols) { + if ((Atom)e->xclient.data.l[0] == prop_atoms.net_wm_ping) + ping_got_pong(e->xclient.data.l[1]); } break; case PropertyNotify: @@ -1914,7 +1919,7 @@ static void focus_delay_client_dest(ObClient *client, gpointer data) client, FALSE); } -void event_halt_focus_delay() +void event_halt_focus_delay(void) { /* ignore all enter events up till the event which caused this to occur */ if (event_curserial) event_ignore_enter_range(1, event_curserial); @@ -1923,8 +1928,7 @@ void event_halt_focus_delay() gulong event_start_ignore_all_enters(void) { - XSync(ob_display, FALSE); - return LastKnownRequestProcessed(ob_display); + return NextRequest(ob_display); } static void event_ignore_enter_range(gulong start, gulong end) @@ -1943,13 +1947,12 @@ static void event_ignore_enter_range(gulong start, gulong end) r->start, r->end); /* increment the serial so we don't ignore events we weren't meant to */ - XSync(ob_display, FALSE); + PROP_ERASE(screen_support_win, motif_wm_hints); } void event_end_ignore_all_enters(gulong start) { - XSync(ob_display, FALSE); - event_ignore_enter_range(start, LastKnownRequestProcessed(ob_display)); + event_ignore_enter_range(start, NextRequest(ob_display)); } static gboolean is_enter_focus_event_ignored(XEvent *e)