]> Pileus Git - ~andy/gtk/commitdiff
menu: replace gdk_draw_drawable() call with Cairo equivalent
authorBenjamin Otte <otte@redhat.com>
Wed, 14 Jul 2010 19:56:15 +0000 (21:56 +0200)
committerBenjamin Otte <otte@redhat.com>
Mon, 26 Jul 2010 14:42:47 +0000 (16:42 +0200)
gtk/gtkmenu.c

index 353493761841d24c8d55386d867a2f1b9aefb44d..39c83f2e8b0111a6007bd22ff1c2d963df76d794 100644 (file)
@@ -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,