[gtk+/gtk-3-18] menushell: don't call gtk_render_background()



commit 4b7611bd93ee9a3df7bb01e5e9d5df2faace2455
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Mon Nov 2 16:05:07 2015 -0800

    menushell: don't call gtk_render_background()
    
    GtkMenu and GtkMenuBar, the two implementations of GtkMenuShell in GTK,
    already draw it.
    Furthermore, rendering a background here will overdraw any rendering
    that the subclass will do, such as arrows for scrolling menus.

 gtk/gtkmenushell.c |   15 ---------------
 1 files changed, 0 insertions(+), 15 deletions(-)
---
diff --git a/gtk/gtkmenushell.c b/gtk/gtkmenushell.c
index a56e934..2706afd 100644
--- a/gtk/gtkmenushell.c
+++ b/gtk/gtkmenushell.c
@@ -134,8 +134,6 @@ 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,
@@ -201,7 +199,6 @@ 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;
@@ -617,18 +614,6 @@ gtk_menu_shell_realize (GtkWidget *widget)
   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));
-
-  return GTK_WIDGET_CLASS (gtk_menu_shell_parent_class)->draw (widget, cr);
-}
-
 static void
 gtk_menu_shell_activate (GtkMenuShell *menu_shell)
 {


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