[mutter] theme: Update style context hierarchy (again)



commit a80905547014468bb8550348f1e7384dc1cea073
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 3b88f43..4296862 100644
--- a/src/ui/frames.c
+++ b/src/ui/frames.c
@@ -1362,6 +1362,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 c33d086..71ddf45 100644
--- a/src/ui/theme.c
+++ b/src/ui/theme.c
@@ -1033,15 +1033,20 @@ 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",
                           "ssd",
                           NULL);
+  style_info->styles[META_STYLE_ELEMENT_FRAME] =
+    create_style_context (META_TYPE_FRAMES,
+                          style_info->styles[META_STYLE_ELEMENT_WINDOW],
+                          provider,
+                          "decoration",
+                          NULL);
   style_info->styles[META_STYLE_ELEMENT_TITLEBAR] =
     create_style_context (GTK_TYPE_HEADER_BAR,
                           style_info->styles[META_STYLE_ELEMENT_FRAME],


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