summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElijah Newren <newren@gmail.com>2005-10-03 19:06:17 +0000
committerElijah Newren <newren@src.gnome.org>2005-10-03 19:06:17 +0000
commitea4cd882853973755ad7bad704f822d3b5b4857d (patch)
tree9382a50e11b740abd83fbf253be6c25132626ca9
parent47f1a8634bc9a69f72589097cc2fa9886307af2a (diff)
downloadmetacity-ea4cd882853973755ad7bad704f822d3b5b4857d.tar.gz
Patch from Björn Lindqvist fix the workspace switcher tabpopup to display
2005-10-03 Elijah Newren <newren@gmail.com> Patch from Björn Lindqvist fix the workspace switcher tabpopup to display the right windows and to fix the pick-a-new-window-to-focus algorithm in order to not select windows that aren't showing. Fixes #170475. * src/tabpopup.c (meta_convert_meta_to_wnck, meta_select_workspace_expose_event): factor out conversion code from meta_select_workspace_expose_event() into the new meta_convert_meta_to_wnck() function * src/tabpopup.c (meta_select_workspace_expose_event): * src/workspace.c (focus_ancestor_or_mru_window): replace the buggy window->minimized logic with !meta_window_showing_on_its_workspace (window)
-rw-r--r--ChangeLog17
-rw-r--r--src/tabpopup.c57
-rw-r--r--src/workspace.c2
3 files changed, 54 insertions, 22 deletions
diff --git a/ChangeLog b/ChangeLog
index c3ae57ea..046e9199 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,22 @@
2005-10-03 Elijah Newren <newren@gmail.com>
+ Patch from Björn Lindqvist fix the workspace switcher tabpopup to
+ display the right windows and to fix the
+ pick-a-new-window-to-focus algorithm in order to not select
+ windows that aren't showing. Fixes #170475.
+
+ * src/tabpopup.c (meta_convert_meta_to_wnck,
+ meta_select_workspace_expose_event): factor out conversion code
+ from meta_select_workspace_expose_event() into the new
+ meta_convert_meta_to_wnck() function
+
+ * src/tabpopup.c (meta_select_workspace_expose_event):
+ * src/workspace.c (focus_ancestor_or_mru_window):
+ replace the buggy window->minimized logic with
+ !meta_window_showing_on_its_workspace (window)
+
+2005-10-03 Elijah Newren <newren@gmail.com>
+
Patch from Björn Lindqvist to have ancestors come along with the
transient when moving the window from one workspace to another.
Fixes #314977.
diff --git a/src/tabpopup.c b/src/tabpopup.c
index d3936b1f..80ad9724 100644
--- a/src/tabpopup.c
+++ b/src/tabpopup.c
@@ -808,6 +808,40 @@ meta_select_workspace_class_init (MetaSelectWorkspaceClass *klass)
widget_class->expose_event = meta_select_workspace_expose_event;
}
+/**
+ * meta_convert_meta_to_wnck() converts a MetaWindow to a
+ * WnckWindowDisplayInfo window that is used to build a thumbnail of a
+ * workspace.
+ **/
+static WnckWindowDisplayInfo
+meta_convert_meta_to_wnck (MetaWindow *window, MetaScreen *screen)
+{
+ WnckWindowDisplayInfo wnck_window;
+ wnck_window.icon = window->icon;
+ wnck_window.mini_icon = window->mini_icon;
+
+ wnck_window.is_active = FALSE;
+ if (window == window->display->expected_focus_window)
+ wnck_window.is_active = TRUE;
+
+ if (window->frame)
+ {
+ wnck_window.x = window->frame->rect.x;
+ wnck_window.y = window->frame->rect.y;
+ wnck_window.width = window->frame->rect.width;
+ wnck_window.height = window->frame->rect.height;
+ }
+ else
+ {
+ wnck_window.x = window->rect.x;
+ wnck_window.y = window->rect.y;
+ wnck_window.width = window->rect.width;
+ wnck_window.height = window->rect.height;
+ }
+ return wnck_window;
+}
+
+
static gboolean
meta_select_workspace_expose_event (GtkWidget *widget,
GdkEventExpose *event)
@@ -836,7 +870,7 @@ meta_select_workspace_expose_event (GtkWidget *widget,
workspace != workspace->screen->active_workspace;
if (window->skip_pager ||
- window->minimized ||
+ !meta_window_showing_on_its_workspace (window) ||
window->unmaps_pending ||
ignoreable_sticky)
{
@@ -844,26 +878,7 @@ meta_select_workspace_expose_event (GtkWidget *widget,
}
else
{
- windows[i].icon = window->icon;
- windows[i].mini_icon = window->mini_icon;
- windows[i].is_active =
- (window == window->display->expected_focus_window);
-
- if (window->frame)
- {
- windows[i].x = window->frame->rect.x;
- windows[i].y = window->frame->rect.y;
- windows[i].width = window->frame->rect.width;
- windows[i].height = window->frame->rect.height;
- }
- else
- {
- windows[i].x = window->rect.x;
- windows[i].y = window->rect.y;
- windows[i].width = window->rect.width;
- windows[i].height = window->rect.height;
- }
-
+ windows[i] = meta_convert_meta_to_wnck (window, workspace->screen);
i++;
}
tmp = tmp->next;
diff --git a/src/workspace.c b/src/workspace.c
index c880363d..6c158366 100644
--- a/src/workspace.c
+++ b/src/workspace.c
@@ -910,7 +910,7 @@ focus_ancestor_or_mru_window (MetaWorkspace *workspace,
MetaWindow* tmp_window;
tmp_window = ((MetaWindow*) tmp->data);
if (tmp_window != not_this_one &&
- !tmp_window->minimized &&
+ meta_window_showing_on_its_workspace (tmp_window) &&
tmp_window->type != META_WINDOW_DOCK &&
tmp_window->type != META_WINDOW_DESKTOP)
{