summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Spilsbury <sam.spilsbury@canonical.com>2011-02-13 17:37:37 +0800
committerSam Spilsbury <sam.spilsbury@canonical.com>2011-02-13 17:37:37 +0800
commit08615b56f6b8796193962a6cbeba3d93132b6c00 (patch)
tree325dd833a54fc61d31c8a984d40169801490c319
parente21400f6b3996a5f55ed1c29a822df5a941ac86c (diff)
downloadunity-window-decorator-08615b56f6b8796193962a6cbeba3d93132b6c00.tar.gz
unity-window-decorator-08615b56f6b8796193962a6cbeba3d93132b6c00.tar.bz2
Be a little bit smarter about that - also make the parent appear
unfocused when the dialog goes out of focus
-rw-r--r--src/metacity.c24
-rw-r--r--src/wnck.c19
2 files changed, 42 insertions, 1 deletions
diff --git a/src/metacity.c b/src/metacity.c
index 1cdf246..2095619 100644
--- a/src/metacity.c
+++ b/src/metacity.c
@@ -482,8 +482,30 @@ meta_get_decoration_geometry (decor_t *d,
if (d->actions & WNCK_WINDOW_ACTION_SHADE)
*flags |= (MetaFrameFlags ) META_FRAME_ALLOWS_SHADE;
- if (d->active || g_slist_length (d->transient_windows) > 1)
+ if (d->active)
*flags |= (MetaFrameFlags ) META_FRAME_HAS_FOCUS;
+ else if (g_slist_length (d->transient_windows) > 1)
+ {
+ GSList *transient_windows = d->transient_windows;
+
+ for (; transient_windows;
+ transient_windows = transient_windows->next)
+ {
+ if (!transient_windows->data)
+ continue;
+
+ decor_t *d_transient = g_object_get_data (transient_windows->data, "decor");
+
+ if (d_transient)
+ {
+ if (d_transient->active)
+ {
+ *flags |= (MetaFrameFlags ) META_FRAME_HAS_FOCUS;
+ break;
+ }
+ }
+ }
+ }
if ((d->state & META_MAXIMIZED) == META_MAXIMIZED)
*flags |= (MetaFrameFlags ) META_FRAME_MAXIMIZED;
diff --git a/src/wnck.c b/src/wnck.c
index 0fae48e..b008c47 100644
--- a/src/wnck.c
+++ b/src/wnck.c
@@ -539,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);
+ }
+
}
}
@@ -599,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);
+ }
}
}
}