summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Müllner <fmuellner@gnome.org>2016-01-18 19:31:20 +0100
committerFlorian Müllner <fmuellner@gnome.org>2016-01-20 18:25:16 +0100
commit5ef7363a742ce841a9b8fc399e1fe10602d3c605 (patch)
tree6f5a5d804faa3f75f1a3ae39456480d049cf6a3f
parent2b2086b21e9b871c5c5ae9c3be0a062387af1000 (diff)
downloadmutter-5ef7363a742ce841a9b8fc399e1fe10602d3c605.tar.gz
theme: Update style context hierarchy (again)
GtkWindow actually uses two CSS nodes, 'window' and 'decoration'. Simulate that by using two separate style contexts for the frame.
-rw-r--r--src/ui/frames.c4
-rw-r--r--src/ui/theme-private.h1
-rw-r--r--src/ui/theme.c11
3 files changed, 13 insertions, 3 deletions
diff --git a/src/ui/frames.c b/src/ui/frames.c
index 961ecac66..5b3710ba4 100644
--- a/src/ui/frames.c
+++ b/src/ui/frames.c
@@ -1366,6 +1366,10 @@ meta_ui_frame_get_mask (MetaUIFrame *frame,
borders.invisible.left / scale,
borders.invisible.top / scale,
frame_rect.width / scale, frame_rect.height / scale);
+ gtk_render_background (frame->style_info->styles[META_STYLE_ELEMENT_TITLEBAR], cr,
+ borders.invisible.left / scale,
+ borders.invisible.top / scale,
+ frame_rect.width / scale, borders.total.top / scale);
}
/* XXX -- this is disgusting. Find a better approach here.
diff --git a/src/ui/theme-private.h b/src/ui/theme-private.h
index c27c3f99a..3ebe06b2e 100644
--- a/src/ui/theme-private.h
+++ b/src/ui/theme-private.h
@@ -167,6 +167,7 @@ typedef enum
typedef enum
{
+ META_STYLE_ELEMENT_WINDOW,
META_STYLE_ELEMENT_FRAME,
META_STYLE_ELEMENT_TITLEBAR,
META_STYLE_ELEMENT_TITLE,
diff --git a/src/ui/theme.c b/src/ui/theme.c
index b844e5606..04b235a7d 100644
--- a/src/ui/theme.c
+++ b/src/ui/theme.c
@@ -1033,13 +1033,18 @@ meta_theme_create_style_info (GdkScreen *screen,
style_info = g_new0 (MetaStyleInfo, 1);
style_info->refcount = 1;
- style_info->styles[META_STYLE_ELEMENT_FRAME] =
+ style_info->styles[META_STYLE_ELEMENT_WINDOW] =
create_style_context (META_TYPE_FRAMES,
NULL,
provider,
- "decoration",
+ "window",
GTK_STYLE_CLASS_BACKGROUND,
- "window-frame",
+ NULL);
+ style_info->styles[META_STYLE_ELEMENT_FRAME] =
+ create_style_context (META_TYPE_FRAMES,
+ style_info->styles[META_STYLE_ELEMENT_WINDOW],
+ provider,
+ "decoration",
"ssd",
NULL);
style_info->styles[META_STYLE_ELEMENT_TITLEBAR] =