summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Kareh <[email protected]>2019-05-21 15:09:36 -0400
committerVictor Kareh <[email protected]>2019-06-05 10:49:37 -0400
commit7bcd852276e8d7e941144760c836e9eefffb1107 (patch)
tree9417569bcc41efe52dcde9dd38d586df704e0282
parent8d113709ecf09bfccf80572f863b196957d1b481 (diff)
downloadmarco-7bcd852276e8d7e941144760c836e9eefffb1107.tar.bz2
marco-7bcd852276e8d7e941144760c836e9eefffb1107.tar.xz
theme: Make meta_frame_draw_theme take a GtkStyleContext instead of a widget
The style context of the widget is rarely what we want. We won't fix this to be a MetaFrames style context yet; this just changes the internal API. https://bugzilla.gnome.org/show_bug.cgi?id=690317 upstream commit: https://gitlab.gnome.org/GNOME/metacity/commit/76aa0704
-rw-r--r--src/ui/frames.c8
-rw-r--r--src/ui/preview-widget.c2
-rw-r--r--src/ui/theme-viewer.c2
-rw-r--r--src/ui/theme.c50
-rw-r--r--src/ui/theme.h15
5 files changed, 21 insertions, 56 deletions
diff --git a/src/ui/frames.c b/src/ui/frames.c
index c7d0a20d..1aefa4b7 100644
--- a/src/ui/frames.c
+++ b/src/ui/frames.c
@@ -2542,17 +2542,19 @@ meta_frames_paint_to_drawable (MetaFrames *frames,
meta_prefs_get_button_layout (&button_layout);
scale = gdk_window_get_scale_factor (frame->window);
- meta_theme_draw_frame_with_style (meta_theme_get_current (),
+ meta_theme_draw_frame (meta_theme_get_current (),
frame->style,
cr,
type,
flags,
- w / scale, h / scale,
+ w / scale,
+ h / scale,
frame->layout,
frame->text_height,
&button_layout,
button_states,
- mini_icon, icon);
+ mini_icon,
+ icon);
}
static gboolean
diff --git a/src/ui/preview-widget.c b/src/ui/preview-widget.c
index 2928d3b1..e40db6c6 100644
--- a/src/ui/preview-widget.c
+++ b/src/ui/preview-widget.c
@@ -222,7 +222,7 @@ meta_preview_draw (GtkWidget *widget,
if (preview->theme)
{
meta_theme_draw_frame (preview->theme,
- widget,
+ gtk_widget_get_style_context (widget),
cr,
preview->type,
preview->flags,
diff --git a/src/ui/theme-viewer.c b/src/ui/theme-viewer.c
index 5903f990..8de8a521 100644
--- a/src/ui/theme-viewer.c
+++ b/src/ui/theme-viewer.c
@@ -1086,7 +1086,7 @@ run_theme_benchmark (void)
cr = cairo_create (pixmap);
meta_theme_draw_frame (global_theme,
- widget,
+ gtk_widget_get_style_context (widget),
cr,
META_FRAME_TYPE_NORMAL,
get_flags (widget),
diff --git a/src/ui/theme.c b/src/ui/theme.c
index 299f1cc2..0c595fe4 100644
--- a/src/ui/theme.c
+++ b/src/ui/theme.c
@@ -5525,19 +5525,19 @@ meta_theme_get_title_scale (MetaTheme *theme,
}
void
-meta_theme_draw_frame_with_style (MetaTheme *theme,
- GtkStyleContext *style_gtk,
- cairo_t *cr,
- MetaFrameType type,
- MetaFrameFlags flags,
- int client_width,
- int client_height,
- PangoLayout *title_layout,
- int text_height,
- const MetaButtonLayout *button_layout,
- MetaButtonState button_states[META_BUTTON_TYPE_LAST],
- GdkPixbuf *mini_icon,
- GdkPixbuf *icon)
+meta_theme_draw_frame (MetaTheme *theme,
+ GtkStyleContext *style_gtk,
+ cairo_t *cr,
+ MetaFrameType type,
+ MetaFrameFlags flags,
+ int client_width,
+ int client_height,
+ PangoLayout *title_layout,
+ int text_height,
+ const MetaButtonLayout *button_layout,
+ MetaButtonState button_states[META_BUTTON_TYPE_LAST],
+ GdkPixbuf *mini_icon,
+ GdkPixbuf *icon)
{
MetaFrameGeometry fgeom;
MetaFrameStyle *style;
@@ -5570,30 +5570,6 @@ meta_theme_draw_frame_with_style (MetaTheme *theme,
}
void
-meta_theme_draw_frame (MetaTheme *theme,
- GtkWidget *widget,
- cairo_t *cr,
- MetaFrameType type,
- MetaFrameFlags flags,
- int client_width,
- int client_height,
- PangoLayout *title_layout,
- int text_height,
- const MetaButtonLayout *button_layout,
- MetaButtonState button_states[META_BUTTON_TYPE_LAST],
- GdkPixbuf *mini_icon,
- GdkPixbuf *icon)
-{
- meta_theme_draw_frame_with_style (theme,
- gtk_widget_get_style_context (widget),
- cr,
- type, flags, client_width, client_height,
- title_layout, text_height,
- button_layout, button_states,
- mini_icon, icon);
-}
-
-void
meta_theme_draw_frame_by_name (MetaTheme *theme,
GtkWidget *widget,
cairo_t *cr,
diff --git a/src/ui/theme.h b/src/ui/theme.h
index 2e4a425c..b341418b 100644
--- a/src/ui/theme.h
+++ b/src/ui/theme.h
@@ -1032,7 +1032,7 @@ double meta_theme_get_title_scale (MetaTheme *theme,
MetaFrameFlags flags);
void meta_theme_draw_frame (MetaTheme *theme,
- GtkWidget *widget,
+ GtkStyleContext *style_gtk,
cairo_t *cr,
MetaFrameType type,
MetaFrameFlags flags,
@@ -1059,19 +1059,6 @@ void meta_theme_draw_frame_by_name (MetaTheme *theme,
GdkPixbuf *mini_icon,
GdkPixbuf *icon);
-void meta_theme_draw_frame_with_style (MetaTheme *theme,
- GtkStyleContext *style_gtk,
- cairo_t *cr,
- MetaFrameType type,
- MetaFrameFlags flags,
- int client_width,
- int client_height,
- PangoLayout *title_layout,
- int text_height,
- const MetaButtonLayout *button_layout,
- MetaButtonState button_states[META_BUTTON_TYPE_LAST],
- GdkPixbuf *mini_icon,
- GdkPixbuf *icon);
void meta_theme_get_frame_borders (MetaTheme *theme,
MetaFrameType type,