diff options
author | Havoc Pennington <hp@pobox.com> | 2002-05-25 02:11:33 +0000 |
---|---|---|
committer | Havoc Pennington <hp@src.gnome.org> | 2002-05-25 02:11:33 +0000 |
commit | 4f706984936facaa784ef52560bffbd3ffa49f54 (patch) | |
tree | 036fbff8aee60c53747cff58218cd8e7cfa865d2 | |
parent | 30ff4540d09ed08b38223ba6d9a702dcf79e49d4 (diff) | |
download | metacity-4f706984936facaa784ef52560bffbd3ffa49f54.tar.gz |
change how focusing windows on initial map works, so that we only steal
2002-05-24 Havoc Pennington <hp@pobox.com>
* src/window.c (meta_window_show): change how focusing windows
on initial map works, so that we only steal focus from our
transient parent or from a panel/desktop, never from other
normal windows.
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | src/window.c | 25 |
2 files changed, 30 insertions, 2 deletions
@@ -1,5 +1,12 @@ 2002-05-24 Havoc Pennington <hp@pobox.com> + * src/window.c (meta_window_show): change how focusing windows + on initial map works, so that we only steal focus from our + transient parent or from a panel/desktop, never from other + normal windows. + +2002-05-24 Havoc Pennington <hp@pobox.com> + * src/window.c (meta_window_configure_request): modify to ignore PPosition and USPosition once the window has been placed diff --git a/src/window.c b/src/window.c index 2319def9..0208fbdb 100644 --- a/src/window.c +++ b/src/window.c @@ -1337,10 +1337,31 @@ meta_window_show (MetaWindow *window) /* don't focus these */ break; case META_WINDOW_NORMAL: + /* Focus only if the current focus is on a desktop element + * or nonexistent. + * + * (using display->focus_window is a bit of a race condition, + * but I have no idea how to avoid it) + */ + if (display->focus_window == NULL || + (display->focus_window && + (display->focus_window->type == META_WINDOW_DOCK || + display->focus_window->type == META_WINDOW_DESKTOP))) + meta_window_focus (window, + meta_display_get_current_time (window->display)); + break; case META_WINDOW_DIALOG: case META_WINDOW_MODAL_DIALOG: - meta_window_focus (window, - meta_display_get_current_time (window->display)); + /* Focus only if the transient parent has focus */ + /* (using display->focus_window is a bit of a race condition, + * but I have no idea how to avoid it) + */ + if (display->focus_window == NULL || + (display->focus_window && + meta_window_is_ancestor_of_transient (display->focus_window, + window))) + meta_window_focus (window, + meta_display_get_current_time (window->display)); break; } } |