diff --git a/ChangeLog b/ChangeLog index 2a7f5ac78..da151241a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2003-09-26 Havoc Pennington + + * src/display.c (event_callback): when focus on root window + becomes None, set it to something other than None so keybindings + keep working and print a warning about how some application sucks. + #84564 + (event_callback): Fix debug spew to print focus event details + properly + (meta_display_open): when setting initial focus, always use + RevertToPointerRoot and fix the focus if it's None or PointerRoot + 2003-09-26 Padraig O'Briain * src/Makefile.am: Add -DMETACITY_LIBDIR to support loading of modules diff --git a/src/display.c b/src/display.c index b838d9fa2..d9396b420 100644 --- a/src/display.c +++ b/src/display.c @@ -592,7 +592,12 @@ meta_display_open (const char *name) XGetInputFocus (display->xdisplay, &focus, &ret_to); /* Force a new FocusIn (does this work?) */ - XSetInputFocus (display->xdisplay, focus, ret_to, CurrentTime); + if (focus == None || focus == PointerRoot) + focus = display->no_focus_window; + + /* FIXME CurrentTime evil */ + XSetInputFocus (display->xdisplay, focus, RevertToPointerRoot, + CurrentTime); meta_error_trap_pop (display, FALSE); } @@ -1563,7 +1568,7 @@ event_callback (XEvent *event, "???", event->xany.window, meta_event_mode_to_string (event->xfocus.mode), - meta_event_detail_to_string (event->xfocus.mode)); + meta_event_detail_to_string (event->xfocus.detail)); } else if (meta_display_screen_for_root (display, event->xany.window) != NULL) @@ -1576,7 +1581,20 @@ event_callback (XEvent *event, "???", event->xany.window, meta_event_mode_to_string (event->xfocus.mode), - meta_event_detail_to_string (event->xfocus.mode)); + meta_event_detail_to_string (event->xfocus.detail)); + + if (event->type == FocusIn && + event->xfocus.detail == NotifyDetailNone) + { + /* FIXME _() gettextify on HEAD */ + meta_warning ("Working around an application which called XSetInputFocus (None) or with RevertToNone instead of RevertToPointerRoot, this is a minor bug in some application. If you can figure out which application causes this please report it as a bug against that application.\n"); + + /* Fix the problem */ + XSetInputFocus (display->xdisplay, + display->no_focus_window, + RevertToPointerRoot, + CurrentTime); /* CurrentTime FIXME */ + } } break; case KeymapNotify: