summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElijah Newren <newren gmail com>2006-04-08 17:47:36 +0000
committerElijah Newren <newren@src.gnome.org>2006-04-08 17:47:36 +0000
commit54a41b6517756845fe81edb1d9edc5dd56d3d0e6 (patch)
tree4129b78d749f6c67f1b49ecdea54c533bd680856
parent571a7515b2e5e10033d6aad40275d3cc2943748d (diff)
downloadlibwnck-54a41b6517756845fe81edb1d9edc5dd56d3d0e6.tar.gz
Patch from Leszek Matok to ensure we get notification of
2006-04-08 Elijah Newren <newren gmail com> Patch from Leszek Matok to ensure we get notification of demands-attent/urgent windows on other workspaces immediately. Fixes #336142. * libwnck/tasklist.c (tasklist_include_window_impl): gather out common functionality for special casing whether to include the window in different lists, (tasklist_include_in_skipped_list): rename from tasklist_include_window_ignoring_skip_taskbar() to be more precise and use tasklist_include_window_impl(), (wnck_tasklist_include_window): use_tasklist_include_window_impl() now, (wnck_task_state_changed): check whether we need to update the list of tasks due to a state change of a task on another workspace.
-rw-r--r--ChangeLog16
-rw-r--r--libwnck/tasklist.c51
2 files changed, 58 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index ae85f25..b4e2b3c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2006-04-08 Elijah Newren <newren gmail com>
+
+ Patch from Leszek Matok to ensure we get notification of
+ demands-attent/urgent windows on other workspaces immediately.
+ Fixes #336142.
+
+ * libwnck/tasklist.c (tasklist_include_window_impl): gather out
+ common functionality for special casing whether to include the
+ window in different lists, (tasklist_include_in_skipped_list):
+ rename from tasklist_include_window_ignoring_skip_taskbar() to be
+ more precise and use tasklist_include_window_impl(),
+ (wnck_tasklist_include_window): use_tasklist_include_window_impl()
+ now, (wnck_task_state_changed): check whether we need to update
+ the list of tasks due to a state change of a task on another
+ workspace.
+
2006-04-04 Gora Mohanty <gmohanty@cvs.gnome.org>
* configure.in: Added 'or' (Oriya) to ALL_LINGUAS.
diff --git a/libwnck/tasklist.c b/libwnck/tasklist.c
index deb31ef..a69705d 100644
--- a/libwnck/tasklist.c
+++ b/libwnck/tasklist.c
@@ -1803,12 +1803,17 @@ wnck_tasklist_free_tasks (WnckTasklist *tasklist)
* This function determines if a window should be included in the tasklist.
*/
static gboolean
-tasklist_include_window_ignoring_skip_taskbar (WnckTasklist *tasklist,
- WnckWindow *win)
+tasklist_include_window_impl (WnckTasklist *tasklist,
+ WnckWindow *win,
+ gboolean check_for_skipped_list)
{
WnckWorkspace *active_workspace;
int x, y, w, h;
+ if (!check_for_skipped_list &&
+ wnck_window_get_state (win) & WNCK_WINDOW_STATE_SKIP_TASKLIST)
+ return FALSE;
+
if (tasklist->priv->monitor_num != -1)
{
wnck_window_get_geometry (win, &x, &y, &w, &h);
@@ -1818,6 +1823,12 @@ tasklist_include_window_ignoring_skip_taskbar (WnckTasklist *tasklist,
return FALSE;
}
+ /* Remainder of checks aren't relevant for checking if the window should
+ * be in the skipped list.
+ */
+ if (check_for_skipped_list)
+ return TRUE;
+
if (tasklist->priv->include_all_workspaces)
return TRUE;
@@ -1839,12 +1850,19 @@ tasklist_include_window_ignoring_skip_taskbar (WnckTasklist *tasklist,
}
static gboolean
-wnck_tasklist_include_window (WnckTasklist *tasklist, WnckWindow *win)
+tasklist_include_in_skipped_list (WnckTasklist *tasklist, WnckWindow *win)
{
- if (wnck_window_get_state (win) & WNCK_WINDOW_STATE_SKIP_TASKLIST)
- return FALSE;
+ return tasklist_include_window_impl (tasklist,
+ win,
+ TRUE /* check_for_skipped_list */);
+}
- return tasklist_include_window_ignoring_skip_taskbar (tasklist, win);
+static gboolean
+wnck_tasklist_include_window (WnckTasklist *tasklist, WnckWindow *win)
+{
+ return tasklist_include_window_impl (tasklist,
+ win,
+ FALSE /* check_for_skipped_list */);
}
static void
@@ -1917,7 +1935,7 @@ wnck_tasklist_update_lists (WnckTasklist *tasklist)
class_group_task->windows = g_list_prepend (class_group_task->windows, win_task);
}
- else if (tasklist_include_window_ignoring_skip_taskbar (tasklist, win))
+ else if (tasklist_include_in_skipped_list (tasklist, win))
{
skipped_window *skipped = g_new0 (skipped_window, 1);
skipped->window = g_object_ref (win);
@@ -2170,8 +2188,9 @@ wnck_tasklist_window_changed_geometry (WnckWindow *window,
* the tasklist itself changed monitor.
*/
win_task = g_hash_table_lookup (tasklist->priv->win_hash, window);
- show = wnck_tasklist_include_window(tasklist, window);
- if (((win_task == NULL && !show) || (win_task != NULL && show)) && !monitor_changed)
+ show = wnck_tasklist_include_window (tasklist, window);
+ if (((win_task == NULL && !show) || (win_task != NULL && show)) &&
+ !monitor_changed)
return;
/* Don't keep any stale references */
@@ -2832,6 +2851,20 @@ wnck_task_state_changed (WnckWindow *window,
return;
}
+ if ((changed_mask & WNCK_WINDOW_STATE_DEMANDS_ATTENTION) ||
+ (changed_mask & WNCK_WINDOW_STATE_URGENT))
+ {
+ WnckWorkspace *active_workspace =
+ wnck_screen_get_active_workspace (tasklist->priv->screen);
+
+ if (active_workspace &&
+ active_workspace != wnck_window_get_workspace (window))
+ {
+ wnck_tasklist_update_lists (tasklist);
+ gtk_widget_queue_resize (GTK_WIDGET (tasklist));
+ }
+ }
+
if ((changed_mask & WNCK_WINDOW_STATE_MINIMIZED) ||
(changed_mask & WNCK_WINDOW_STATE_DEMANDS_ATTENTION) ||
(changed_mask & WNCK_WINDOW_STATE_URGENT))