summaryrefslogtreecommitdiff
path: root/src/window.c
diff options
context:
space:
mode:
authorCraig Black <blackc@speakeasy.net>2002-08-08 04:45:13 +0000
committerCraig Black <blackc@src.gnome.org>2002-08-08 04:45:13 +0000
commit7a598e55678de1dcfabfeb325abd1541bdc8c47a (patch)
tree853c87a61bbf70bd204233668f6f78b0b218623f /src/window.c
parentceb771aeb672f4bae5dfa98d44a388b27a373ded (diff)
downloadmetacity-7a598e55678de1dcfabfeb325abd1541bdc8c47a.tar.gz
metacity-7a598e55678de1dcfabfeb325abd1541bdc8c47a.tar.bz2
clear expected focus window on open
2002-08-07 Craig Black <blackc@speakeasy.net> * src/display.c: (meta_display_open): clear expected focus window on open * src/display.h: add expected_focus_window field * src/window.c: (meta_window_make_fullscreen), (meta_window_unmake_fullscreen): change meta_window_update_layer() to meta_stack_update_layer() so build works again. (meta_window_free), (meta_window_make_fullscreen), (meta_window_focus), (meta_window_notify_focus): keep track of expected focus window after sending WM_TAKE_FOCUS event, previously if a UnmapNotify event arrived before the FocusIn event we would lose focus, fixes #84564.
Diffstat (limited to 'src/window.c')
-rw-r--r--src/window.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/window.c b/src/window.c
index cc51234..f114517 100644
--- a/src/window.c
+++ b/src/window.c
@@ -812,6 +812,14 @@ meta_window_free (MetaWindow *window)
window->desc);
meta_screen_focus_top_window (window->screen, window);
}
+ else if (window->display->expected_focus_window == window)
+ {
+ meta_topic (META_DEBUG_FOCUS,
+ "Focusing top window since expected focus window freed %s\n",
+ window->desc);
+ window->display->expected_focus_window = NULL;
+ meta_screen_focus_top_window (window->screen, window);
+ }
else
{
meta_topic (META_DEBUG_FOCUS,
@@ -1632,7 +1640,7 @@ meta_window_make_fullscreen (MetaWindow *window)
window->fullscreen = TRUE;
- meta_window_update_layer (window);
+ meta_stack_update_layer (window->screen->stack, window);
meta_window_raise (window);
/* save size/pos as appropriate args for move_resize */
@@ -1661,7 +1669,7 @@ meta_window_unmake_fullscreen (MetaWindow *window)
window->fullscreen = FALSE;
- meta_window_update_layer (window);
+ meta_stack_update_layer (window->screen->stack, window);
meta_window_move_resize (window,
TRUE,
@@ -2798,6 +2806,7 @@ meta_window_focus (MetaWindow *window,
meta_window_send_icccm_message (window,
window->display->atom_wm_take_focus,
timestamp);
+ window->display->expected_focus_window = window;
}
meta_error_trap_pop (window->display);
@@ -3580,6 +3589,9 @@ meta_window_notify_focus (MetaWindow *window,
if (event->type == FocusIn)
{
+ if (window->display->expected_focus_window == window)
+ window->display->expected_focus_window = NULL;
+
if (window != window->display->focus_window)
{
meta_topic (META_DEBUG_FOCUS,