From 0fa4954c46db11cdcea90934868f471a0cdea7fe Mon Sep 17 00:00:00 2001 From: Rob Adams Date: Thu, 29 May 2003 17:16:22 +0000 Subject: [PATCH] chdir to the user's home directory on startup. See #113755. 2003-05-29 Rob Adams * src/main.c (main): chdir to the user's home directory on startup. See #113755. * src/stack.c (get_standalone_layer): a window should be in the fullscreen layer if it or any of its transient descendants are focused or expecting the focus and it is either fullscreen or fullscreen sized. Fix for #104369. * src/stack.c (is_focused_foreach): foreach used by get_standalone_layer to find focused transient descendants. --- ChangeLog | 13 +++++++++++++ src/main.c | 3 +++ src/stack.c | 26 +++++++++++++++++++------- 3 files changed, 35 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3bea6eb19..e5b62a566 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2003-05-29 Rob Adams + + * src/main.c (main): chdir to the user's home directory on + startup. See #113755. + + * src/stack.c (get_standalone_layer): a window should be in the + fullscreen layer if it or any of its transient descendants are + focused or expecting the focus and it is either fullscreen or + fullscreen sized. Fix for #104369. + + * src/stack.c (is_focused_foreach): foreach used by + get_standalone_layer to find focused transient descendants. + 2003-05-20 Havoc Pennington * src/keybindings.c (meta_change_keygrab): the mask diff --git a/src/main.c b/src/main.c index 8ea67f574..f25b61cd4 100644 --- a/src/main.c +++ b/src/main.c @@ -112,6 +112,9 @@ main (int argc, char **argv) meta_set_debugging (TRUE); meta_set_syncing (g_getenv ("METACITY_SYNC") != NULL); + if (g_get_home_dir ()) + chdir (g_get_home_dir ()); + { char buf[256]; GDate d; diff --git a/src/stack.c b/src/stack.c index 5ad699c0a..31d6d76c6 100644 --- a/src/stack.c +++ b/src/stack.c @@ -217,11 +217,25 @@ window_is_fullscreen_size (MetaWindow *window) return FALSE; } +static gboolean +is_focused_foreach (MetaWindow *window, + void *data) +{ + if (window->has_focus || + (window == window->display->expected_focus_window)) + { + *((gboolean*) data) = TRUE; + return FALSE; + } + return TRUE; +} + /* Get layer ignoring any transient or group relationships */ static MetaStackLayer get_standalone_layer (MetaWindow *window) { MetaStackLayer layer; + gboolean focused_transient = FALSE; switch (window->type) { @@ -242,14 +256,12 @@ get_standalone_layer (MetaWindow *window) break; default: + meta_window_foreach_transient (window, + is_focused_foreach, + &focused_transient); -#if 0 - if (window->has_focus && - meta_prefs_get_focus_mode () == META_FOCUS_MODE_CLICK) - layer = META_LAYER_FOCUSED_WINDOW; -#endif - - if (window->has_focus && + if ((window->has_focus || focused_transient || + (window == window->display->expected_focus_window)) && (window->fullscreen || window_is_fullscreen_size (window))) layer = META_LAYER_FULLSCREEN; else if (window->wm_state_above)