[gtk+/rendering-cleanup: 52/63] menu: replace gdk_draw_drawable() call with Cairo equivalent



commit a2350a5c8dec2d9e42b6ce751657f200c1b43d64
Author: Benjamin Otte <otte redhat com>
Date:   Wed Jul 14 21:56:15 2010 +0200

    menu: replace gdk_draw_drawable() call with Cairo equivalent

 gtk/gtkmenu.c |   18 ++++++++----------
 1 files changed, 8 insertions(+), 10 deletions(-)
---
diff --git a/gtk/gtkmenu.c b/gtk/gtkmenu.c
index f119c6f..6196ff8 100644
--- a/gtk/gtkmenu.c
+++ b/gtk/gtkmenu.c
@@ -1350,16 +1350,11 @@ gtk_menu_tearoff_bg_copy (GtkMenu *menu)
   if (menu->torn_off)
     {
       GdkPixmap *pixmap;
-      GdkGC *gc;
-      GdkGCValues gc_values;
+      cairo_t *cr;
 
       menu->tearoff_active = FALSE;
       menu->saved_scroll_offset = menu->scroll_offset;
       
-      gc_values.subwindow_mode = GDK_INCLUDE_INFERIORS;
-      gc = gdk_gc_new_with_values (widget->window,
-				   &gc_values, GDK_GC_SUBWINDOW);
-      
       gdk_drawable_get_size (menu->tearoff_window->window, &width, &height);
       
       pixmap = gdk_pixmap_new (menu->tearoff_window->window,
@@ -1367,10 +1362,13 @@ gtk_menu_tearoff_bg_copy (GtkMenu *menu)
 			       height,
 			       -1);
 
-      gdk_draw_drawable (pixmap, gc,
-			 menu->tearoff_window->window,
-			 0, 0, 0, 0, -1, -1);
-      g_object_unref (gc);
+      cr = gdk_cairo_create (pixmap);
+      /* Let's hope that function never notices we're not passing it a pixmap */
+      gdk_cairo_set_source_pixmap (cr,
+                                   menu->tearoff_window->window,
+                                   0, 0);
+      cairo_paint (cr);
+      cairo_destroy (cr);
 
       gtk_widget_set_size_request (menu->tearoff_window,
 				   width,



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