summaryrefslogtreecommitdiff
path: root/src/wnck.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/wnck.c')
-rw-r--r--src/wnck.c73
1 files changed, 66 insertions, 7 deletions
diff --git a/src/wnck.c b/src/wnck.c
index a42ccc1..b008c47 100644
--- a/src/wnck.c
+++ b/src/wnck.c
@@ -83,6 +83,7 @@ decorations_changed (WnckScreen *screen)
GdkDisplay *gdkdisplay;
GdkScreen *gdkscreen;
GList *windows;
+ Window select;
gdkdisplay = gdk_display_get_default ();
gdkscreen = gdk_display_get_default_screen (gdkdisplay);
@@ -96,6 +97,8 @@ decorations_changed (WnckScreen *screen)
if (minimal)
return;
+ /* Update all normal windows */
+
windows = wnck_screen_get_windows (screen);
while (windows != NULL)
{
@@ -115,6 +118,21 @@ decorations_changed (WnckScreen *screen)
update_window_decoration (WNCK_WINDOW (windows->data));
windows = windows->next;
}
+
+ /* Update switcher window */
+
+ if (switcher_window &&
+ get_window_prop (switcher_window->prop_xid,
+ select_window_atom, &select))
+ {
+ decor_t *d = switcher_window;
+ /* force size update */
+ d->context = NULL;
+ d->width = d->height = 0;
+ switcher_width = switcher_height = 0;
+
+ update_switcher_window (d->prop_xid, select);
+ }
}
void
@@ -438,7 +456,7 @@ remove_frame_window (WnckWindow *win)
draw_list = g_slist_remove (draw_list, d);
}
-static void
+void
connect_window (WnckWindow *win)
{
g_signal_connect_object (win, "name_changed",
@@ -521,6 +539,16 @@ active_window_changed (WnckScreen *screen)
* since the image would have changed */
if (!update_window_decoration_size (d->win))
queue_decor_draw (d);
+
+ /* Also update any parents of this window
+ * since they won't get a notification here
+ */
+ if (d->transient_parent)
+ {
+ decor_t *d_parent = g_object_get_data (d->transient_parent, "decor");
+ queue_decor_draw (d_parent);
+ }
+
}
}
@@ -581,6 +609,15 @@ active_window_changed (WnckScreen *screen)
* since the image would have changed */
if (!update_window_decoration_size (d->win))
queue_decor_draw (d);
+
+ /* Also update any parents of this window
+ * since they won't get a notification here
+ */
+ if (d->transient_parent)
+ {
+ decor_t *d_parent = g_object_get_data (d->transient_parent, "decor");
+ queue_decor_draw (d_parent);
+ }
}
}
}
@@ -634,6 +671,7 @@ window_opened (WnckScreen *screen,
d->cr = NULL;
d->buffer_pixmap = NULL;
d->picture = None;
+ d->transient_windows = g_slist_alloc ();
connect_window (win);
@@ -641,12 +679,7 @@ window_opened (WnckScreen *screen,
xid = wnck_window_get_xid (win);
- if (get_window_prop (xid, select_window_atom, &window))
- {
- d->prop_xid = wnck_window_get_xid (win);
- update_switcher_window (win, window);
- }
- else if (get_window_prop (xid, frame_input_window_atom, &window))
+ if (get_window_prop (xid, frame_input_window_atom, &window))
{
add_frame_window (win, window, FALSE);
}
@@ -654,6 +687,24 @@ window_opened (WnckScreen *screen,
{
add_frame_window (win, window, TRUE);
}
+
+ if (wnck_window_get_window_type (win) == WNCK_WINDOW_DIALOG)
+ {
+ Window parent;
+
+ if (get_window_prop (xid, XA_WM_TRANSIENT_FOR, &parent))
+ {
+ WnckWindow *p = wnck_window_get (parent);
+ decor_t *d = g_object_get_data (G_OBJECT (p), "decor");
+ decor_t *d_transient = g_object_get_data (G_OBJECT (win), "decor");
+
+ if (d)
+ {
+ d->transient_windows = g_slist_append (d->transient_windows, win);
+ d_transient->transient_parent = p;
+ }
+ }
+ }
}
static void
@@ -662,6 +713,14 @@ window_closed (WnckScreen *screen,
{
Display *xdisplay = GDK_DISPLAY_XDISPLAY (gdk_display_get_default ());
decor_t *d = g_object_get_data (G_OBJECT (win), "decor");
+ WnckWindow *parent = d->transient_parent;
+
+ if (parent)
+ {
+ decor_t *d_parent = g_object_get_data (G_OBJECT (parent), "decor");
+
+ d_parent->transient_windows = g_slist_remove (d_parent->transient_windows, win);
+ }
remove_frame_window (win);