From 12f4f7c6b018204cfd62904fc2bdd202493e42b4 Mon Sep 17 00:00:00 2001 From: Rob Adams Date: Sat, 31 Jul 2004 21:26:05 +0000 Subject: [PATCH] Fix bug that caused windows to not be focused on unminimizing because of 2004-07-31 Rob Adams Fix bug that caused windows to not be focused on unminimizing because of user time support. * src/window.c (meta_window_new_with_attrs): initialize focus_despite_user_time bit (window_takes_focus_on_map): focus if focus_despite_user_time despite user time, interestingly enough (meta_window_show): reset focus_despite_user_time after showing * src/window.h (_MetaWindow): add focus_despite_user_time bit --- ChangeLog | 13 +++++++++++++ src/window.c | 7 +++++++ src/window.h | 1 + 3 files changed, 21 insertions(+) diff --git a/ChangeLog b/ChangeLog index 42d0fe1ad..1a72b326d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2004-07-31 Rob Adams + + Fix bug that caused windows to not be focused on unminimizing + because of user time support. + + * src/window.c (meta_window_new_with_attrs): initialize + focus_despite_user_time bit + (window_takes_focus_on_map): focus if focus_despite_user_time + despite user time, interestingly enough + (meta_window_show): reset focus_despite_user_time after showing + + * src/window.h (_MetaWindow): add focus_despite_user_time bit + 2004-07-31 Rob Adams Fix some support for EWMH hints, and fix USER_TIME support to diff --git a/src/window.c b/src/window.c index 17182ebd9..4885a3c95 100644 --- a/src/window.c +++ b/src/window.c @@ -456,6 +456,7 @@ meta_window_new_with_attrs (MetaDisplay *display, window->initial_workspace_set = FALSE; window->initial_timestamp_set = FALSE; window->net_wm_user_time_set = FALSE; + window->focus_despite_user_time = FALSE; window->calc_placement = FALSE; window->shaken_loose = FALSE; window->have_focus_click_grab = FALSE; @@ -1618,6 +1619,8 @@ window_takes_focus_on_map (MetaWindow *window) case META_WINDOW_NORMAL: case META_WINDOW_DIALOG: case META_WINDOW_MODAL_DIALOG: + if (window->focus_despite_user_time) + return TRUE; meta_topic (META_DEBUG_STARTUP, "COMPARISON:\n" @@ -1715,6 +1718,8 @@ meta_window_show (MetaWindow *window) meta_window_stack_just_below (window, window->display->focus_window); + window->focus_despite_user_time = FALSE; + if (!window->placed) { /* We have to recalc the placement here since other windows may @@ -1929,6 +1934,8 @@ meta_window_unminimize (MetaWindow *window) if (window->minimized) { window->minimized = FALSE; + window->focus_despite_user_time = TRUE; + meta_window_queue_calc_showing (window); meta_window_foreach_transient (window, diff --git a/src/window.h b/src/window.h index 183c58f16..0c7a0d51a 100644 --- a/src/window.h +++ b/src/window.h @@ -147,6 +147,7 @@ struct _MetaWindow /* whether net_wm_user_time has been set yet */ guint net_wm_user_time_set : 1; + guint focus_despite_user_time : 1; /* These are the flags from WM_PROTOCOLS */ guint take_focus : 1;