[gtk+/wip/background-rework: 9/26] menushell: don't call gtk_style_context_set_background()
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/background-rework: 9/26] menushell: don't call gtk_style_context_set_background()
- Date: Wed, 1 Jul 2015 21:05:41 +0000 (UTC)
commit 838812ab1e69e966a9a940aa04fa74781acadde6
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Wed Jun 3 18:21:16 2015 -0700
menushell: don't call gtk_style_context_set_background()
gtk/gtkmenushell.c | 18 +++++++++++++++---
1 files changed, 15 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtkmenushell.c b/gtk/gtkmenushell.c
index e1ba138..80044ef 100644
--- a/gtk/gtkmenushell.c
+++ b/gtk/gtkmenushell.c
@@ -66,6 +66,7 @@
#include "gtkmenuitemprivate.h"
#include "gtkmenushellprivate.h"
#include "gtkmnemonichash.h"
+#include "gtkrender.h"
#include "gtkwindow.h"
#include "gtkwindowprivate.h"
#include "gtkprivate.h"
@@ -133,6 +134,8 @@ static void gtk_menu_shell_screen_changed (GtkWidget *widget,
GdkScreen *previous_screen);
static gboolean gtk_menu_shell_grab_broken (GtkWidget *widget,
GdkEventGrabBroken *event);
+static gboolean gtk_menu_shell_draw (GtkWidget *widget,
+ cairo_t *cr);
static void gtk_menu_shell_add (GtkContainer *container,
GtkWidget *widget);
static void gtk_menu_shell_remove (GtkContainer *container,
@@ -198,6 +201,7 @@ gtk_menu_shell_class_init (GtkMenuShellClass *klass)
widget_class->enter_notify_event = gtk_menu_shell_enter_notify;
widget_class->leave_notify_event = gtk_menu_shell_leave_notify;
widget_class->screen_changed = gtk_menu_shell_screen_changed;
+ widget_class->draw = gtk_menu_shell_draw;
container_class->add = gtk_menu_shell_add;
container_class->remove = gtk_menu_shell_remove;
@@ -585,7 +589,6 @@ gtk_menu_shell_realize (GtkWidget *widget)
GdkWindow *window;
GdkWindowAttr attributes;
gint attributes_mask;
- GtkStyleContext *context;
gtk_widget_set_realized (widget, TRUE);
@@ -613,9 +616,18 @@ gtk_menu_shell_realize (GtkWidget *widget)
&attributes, attributes_mask);
gtk_widget_set_window (widget, window);
gtk_widget_register_window (widget, window);
+}
+
+static gboolean
+gtk_menu_shell_draw (GtkWidget *widget,
+ cairo_t *cr)
+{
+ gtk_render_background (gtk_widget_get_style_context (widget), cr,
+ 0, 0,
+ gtk_widget_get_allocated_width (widget),
+ gtk_widget_get_allocated_height (widget));
- context = gtk_widget_get_style_context (widget);
- gtk_style_context_set_background (context, window);
+ return GTK_WIDGET_CLASS (gtk_menu_shell_parent_class)->draw (widget, cr);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]