summaryrefslogtreecommitdiff
path: root/src/ui/ui.c
diff options
context:
space:
mode:
authorOwen W. Taylor <otaylor@fishsoup.net>2014-03-05 15:23:46 -0500
committerAlberts Muktupāvels <alberts.muktupavels@gmail.com>2015-01-19 05:08:34 +0200
commitba8500663457ad9f18ebfdf405162c2cb5caf88f (patch)
tree20a35072aa9445b42b56c46c14852013348a192f /src/ui/ui.c
parent7e7f25f40ce3b15cbc63d6e8743215e287f08710 (diff)
downloadmetacity-ba8500663457ad9f18ebfdf405162c2cb5caf88f.tar.gz
Fix handling of dynamic updates to colors/font/etc.
Since the introduction of frame sync in GTK+, updates to titlebar font and colors haven't been working because GTK+ counts on the frame clock to do style updates, and the frame clock doesn't run for an unmapped GdkWindow. (It's possible that GtkStyleContext changes subsequent to the introduction of the frame clock were also needed to fully break things.) We actually need to map the MetaFrames GdkWindow and let the compositor code send out the frame sync messages in order to pick up style changes. Hopefully no bad side effects will occur from this - we make the window override-redirect, 1x1, and outside the bounds of the screen. https://bugzilla.gnome.org/show_bug.cgi?id=725751
Diffstat (limited to 'src/ui/ui.c')
-rw-r--r--src/ui/ui.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/ui/ui.c b/src/ui/ui.c
index e4a54f82..2cd8559e 100644
--- a/src/ui/ui.c
+++ b/src/ui/ui.c
@@ -277,9 +277,12 @@ meta_ui_new (Display *xdisplay,
g_assert (xdisplay == GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()));
ui->frames = meta_frames_new (XScreenNumberOfScreen (screen));
- /* This does not actually show any widget. MetaFrames has been hacked so
- * that showing it doesn't actually do anything. But we need the flags
- * set for GTK to deliver events properly. */
+ /* GTK+ needs the frame-sync protocol to work in order to properly
+ * handle style changes. This means that the dummy widget we create
+ * to get the style for title bars actually needs to be mapped
+ * and fully tracked as a MetaWindow. Horrible, but mostly harmless -
+ * the window is a 1x1 overide redirect window positioned offscreen.
+ */
gtk_widget_show (GTK_WIDGET (ui->frames));
g_object_set_data (G_OBJECT (gdisplay), "meta-ui", ui);