summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHavoc Pennington <hp@redhat.com>2003-09-27 02:40:09 +0000
committerHavoc Pennington <hp@src.gnome.org>2003-09-27 02:40:09 +0000
commit26c2ae81eab6aa18ca1baa085e9f9b50f3d1b8da (patch)
treebc47b259672075246a97cff62ec6a8b5b73f2039
parent922932d2401e47507dd7f845d66286aaf170f25b (diff)
downloadmetacity-26c2ae81eab6aa18ca1baa085e9f9b50f3d1b8da.tar.gz
when focus on root window becomes None, set it to something other than
2003-09-26 Havoc Pennington <hp@redhat.com> * 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
-rw-r--r--ChangeLog11
-rw-r--r--src/display.c24
2 files changed, 32 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 2a7f5ac7..da151241 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2003-09-26 Havoc Pennington <hp@redhat.com>
+
+ * 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 <padraig.obriain@sun.com>
* src/Makefile.am: Add -DMETACITY_LIBDIR to support loading of modules
diff --git a/src/display.c b/src/display.c
index b838d9fa..d9396b42 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: