summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElijah Newren <newren@math.utah.edu>2004-10-04 20:39:21 +0000
committerElijah Newren <newren@src.gnome.org>2004-10-04 20:39:21 +0000
commit546fe7b5b301138af8e2fc252666c0545c933f38 (patch)
tree25f194924dce4e82815a4d791b1a2be87f6803bc
parent16b9aff47caeb5a346ce722d21c52cbde0b46458 (diff)
downloadmetacity-546fe7b5b301138af8e2fc252666c0545c933f38.tar.gz
When no window becomes focused, focus the default window instead of
2004-10-04 Elijah Newren <newren@math.utah.edu> * src/display.c (event_callback): When no window becomes focused, focus the default window instead of punting to the no_focus_window. Also, change the warning to a verbose message--this will happen frequently due to brain-damage in the X protocol. (see #125492)
-rw-r--r--ChangeLog8
-rw-r--r--src/display.c24
2 files changed, 11 insertions, 21 deletions
diff --git a/ChangeLog b/ChangeLog
index c8db6a9d..4666cba3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
2004-10-04 Elijah Newren <newren@math.utah.edu>
+ * src/display.c (event_callback): When no window becomes focused,
+ focus the default window instead of punting to the
+ no_focus_window. Also, change the warning to a verbose
+ message--this will happen frequently due to brain-damage in the X
+ protocol. (see #125492)
+
+2004-10-04 Elijah Newren <newren@math.utah.edu>
+
Fix a variety of focus race conditions in all focus modes, or at
least make them harder to trigger (fixes #152000)
diff --git a/src/display.c b/src/display.c
index 1214e8d4..ebf3065a 100644
--- a/src/display.c
+++ b/src/display.c
@@ -1838,28 +1838,10 @@ event_callback (XEvent *event,
if (event->type == FocusIn &&
event->xfocus.detail == NotifyDetailNone)
{
- XEvent property_event;
+ meta_topic (META_DEBUG_FOCUS,
+ "Focus got set to None, probably due to brain-damage in the X protocol (see bug 125492). Setting the default focus window.\n");
- /* 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 */
- /* Using the property XA_PRIMARY because it's safe;
- * nothing would use it as a property. The type
- * doesn't matter.
- */
- XChangeProperty (display->xdisplay,
- display->leader_window,
- XA_PRIMARY, XA_STRING, 8,
- PropModeAppend, NULL, 0);
- XWindowEvent (display->xdisplay,
- display->leader_window,
- PropertyChangeMask,
- &property_event);
- XSetInputFocus (display->xdisplay,
- display->no_focus_window,
- RevertToPointerRoot,
- property_event.xproperty.time);
+ meta_workspace_focus_default_window (screen->active_workspace, NULL, meta_display_thou_shalt_return_a_timestamp (display));
}
}
break;