summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElijah Newren <newren@gmail.com>2005-10-03 20:02:31 +0000
committerElijah Newren <newren@src.gnome.org>2005-10-03 20:02:31 +0000
commit12daca5cb1ef51f3af34eb3c3a988e068c408dff (patch)
treec438ccde14dcf165df7316fd269d6b7c6f808073
parent1a8c2aa027da40cca627d937ddda55256b9cddc8 (diff)
downloadmetacity-12daca5cb1ef51f3af34eb3c3a988e068c408dff.tar.gz
Patch from Ross Cohen to make alt-esc (show windows instantly) actually
2005-10-03 Elijah Newren <newren@gmail.com> Patch from Ross Cohen to make alt-esc (show windows instantly) actually show minimized windows too. Fixes #107072. * src/keybindings.c (process_tab_grab): initialize tab_unminimized to FALSE for the target window when starting the grab, when advancing through the list check to find the previous window and re-minimize it if it was tab-unminimized, unminimize the new window we're alt-esc'ing to if it's minimized, (do_choose_window): raise and unminimize the initial window as well in alt-esc'ing * src/window.h (struct _MetaWindow): add a tab_unminimized field * src/window.c (meta_window_new_with_attrs): initialize tab_unminimized to false
-rw-r--r--ChangeLog17
-rw-r--r--src/keybindings.c38
-rw-r--r--src/window.c1
-rw-r--r--src/window.h1
4 files changed, 56 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 2eff8953..beaa51d2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,22 @@
2005-10-03 Elijah Newren <newren@gmail.com>
+ Patch from Ross Cohen to make alt-esc (show windows instantly)
+ actually show minimized windows too. Fixes #107072.
+
+ * src/keybindings.c (process_tab_grab): initialize tab_unminimized
+ to FALSE for the target window when starting the grab, when
+ advancing through the list check to find the previous window and
+ re-minimize it if it was tab-unminimized, unminimize the new
+ window we're alt-esc'ing to if it's minimized, (do_choose_window):
+ raise and unminimize the initial window as well in alt-esc'ing
+
+ * src/window.h (struct _MetaWindow): add a tab_unminimized field
+
+ * src/window.c (meta_window_new_with_attrs): initialize
+ tab_unminimized to false
+
+2005-10-03 Elijah Newren <newren@gmail.com>
+
Branched for Gnome 2.13. :-)
* configure.in: bump version to 2.13.0. Add UNSTABLE warning.
diff --git a/src/keybindings.c b/src/keybindings.c
index c9af2404..92139471 100644
--- a/src/keybindings.c
+++ b/src/keybindings.c
@@ -2434,6 +2434,8 @@ process_tab_grab (MetaDisplay *display,
if (target_window)
{
+ target_window->tab_unminimized = FALSE;
+
meta_topic (META_DEBUG_KEYBINDINGS,
"Activating target window\n");
@@ -2501,6 +2503,13 @@ process_tab_grab (MetaDisplay *display,
if (key_used)
{
+ Window prev_xwindow;
+ MetaWindow *prev_window;
+ prev_xwindow =
+ (Window) meta_ui_tab_popup_get_selected (screen->tab_popup);
+ prev_window =
+ meta_display_lookup_x_window (display, prev_xwindow);
+
meta_topic (META_DEBUG_KEYBINDINGS,
"Key pressed, moving tab focus in popup\n");
@@ -2525,14 +2534,25 @@ process_tab_grab (MetaDisplay *display,
target_window =
meta_display_lookup_x_window (display, target_xwindow);
+ if (prev_window && prev_window->tab_unminimized)
+ {
+ prev_window->tab_unminimized = FALSE;
+ meta_window_minimize (prev_window);
+ }
+
if (target_window)
{
meta_window_raise (target_window);
+ target_window->tab_unminimized = target_window->minimized;
+ meta_window_unminimize (target_window);
}
}
}
else
{
+ Window prev_xwindow;
+ MetaWindow *prev_window;
+
/* end grab */
meta_topic (META_DEBUG_KEYBINDINGS,
"Ending tabbing/cycling, uninteresting key pressed\n");
@@ -2541,6 +2561,17 @@ process_tab_grab (MetaDisplay *display,
"Syncing to old stack positions.\n");
meta_stack_set_positions (screen->stack,
screen->display->grab_old_window_stacking);
+
+ prev_xwindow =
+ (Window) meta_ui_tab_popup_get_selected (screen->tab_popup);
+ prev_window =
+ meta_display_lookup_x_window (display, prev_xwindow);
+
+ if (prev_window && prev_window->tab_unminimized)
+ {
+ meta_window_minimize (prev_window);
+ prev_window->tab_unminimized = FALSE;
+ }
}
return key_used;
@@ -3099,7 +3130,12 @@ do_choose_window (MetaDisplay *display,
meta_ui_tab_popup_set_showing (screen->tab_popup,
TRUE);
else
- meta_window_raise (initial_selection);
+ {
+ meta_window_raise (initial_selection);
+ initial_selection->tab_unminimized =
+ initial_selection->minimized;
+ meta_window_unminimize (initial_selection);
+ }
}
}
}
diff --git a/src/window.c b/src/window.c
index 8789f3e1..764bf3b5 100644
--- a/src/window.c
+++ b/src/window.c
@@ -437,6 +437,7 @@ meta_window_new_with_attrs (MetaDisplay *display,
window->shaded = FALSE;
window->initially_iconic = FALSE;
window->minimized = FALSE;
+ window->tab_unminimized = FALSE;
window->iconic = FALSE;
window->mapped = attrs->map_state != IsUnmapped;
/* if already mapped, no need to worry about focus-on-first-time-showing */
diff --git a/src/window.h b/src/window.h
index a934bed0..0f27df61 100644
--- a/src/window.h
+++ b/src/window.h
@@ -124,6 +124,7 @@ struct _MetaWindow
/* Minimize is the state controlled by the minimize button */
guint minimized : 1;
+ guint tab_unminimized : 1;
/* Whether the window is mapped; actual server-side state
* see also unmaps_pending