[mutter/wip/fmuellner/theme-updates: 11/12] theme: Update style context hierarchy (again)



commit 5ef7363a742ce841a9b8fc399e1fe10602d3c605
Author: Florian Müllner <fmuellner gnome org>
Date:   Mon Jan 18 19:31:20 2016 +0100

    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.

 src/ui/frames.c        |    4 ++++
 src/ui/theme-private.h |    1 +
 src/ui/theme.c         |   11 ++++++++---
 3 files changed, 13 insertions(+), 3 deletions(-)
---
diff --git a/src/ui/frames.c b/src/ui/frames.c
index 961ecac..5b3710b 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 c27c3f9..3ebe06b 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 b844e56..04b235a 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] =


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]