[gtk+] menu: replace gdk_draw_drawable() call with Cairo equivalent
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] menu: replace gdk_draw_drawable() call with Cairo equivalent
- Date: Mon, 26 Jul 2010 14:51:50 +0000 (UTC)
commit 5fd0c28c7815c7a681ca44cf6c4dd9ae143885d3
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 3534937..39c83f2 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]