[compiz/f14/master] - add more upstream gdk fixes

leigh123linux leigh123linux at fedoraproject.org
Tue Nov 30 13:33:37 UTC 2010


commit 6180183d056a68d7e043b98e626eb4b9a5f164a5
Author: leigh scott <leigh123linux at googlemail.com>
Date:   Tue Nov 30 13:33:46 2010 +0000

    - add more upstream gdk fixes

 compiz.spec                   |    7 ++-
 gdk_drawable_deprecated.patch |  184 +++++++++++++++++++++++++++++++++++++++++
 2 files changed, 190 insertions(+), 1 deletions(-)
---
diff --git a/compiz.spec b/compiz.spec
index 028f6a2..2170e35 100644
--- a/compiz.spec
+++ b/compiz.spec
@@ -13,7 +13,7 @@ URL:            http://www.go-compiz.org
 License:        GPLv2+ and LGPLv2+ and MIT
 Group:          User Interface/Desktops
 Version:        0.8.6
-Release:        5%{?dist}
+Release:        6%{?dist}
 
 Summary:        OpenGL window and compositing manager
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -67,6 +67,7 @@ Patch116: compiz-0.8.6-pixmap-size-calculation.patch
 #upstream patches
 #http://gitweb.compiz.org/?p=compiz/core;a=commit;h=5ea5e2130c56d405fcccd63932918fc49ca1f1b9
 Patch117: gdk_display_deprecated.patch
+Patch118: gdk_drawable_deprecated.patch
 
 %description
 Compiz is one of the first OpenGL-accelerated compositing window
@@ -139,6 +140,7 @@ and other kde integration related stuff.
 %patch115 -p1 -b .focus-denied-stacking
 %patch116 -p1 -b .pixmap-calculation
 %patch117 -p1 -b .gdk_display_deprecated
+%patch118 -p1 -b .gdk_drawable_deprecated
 
 %build
 rm -rf $RPM_BUILD_ROOT
@@ -315,6 +317,9 @@ rm -rf $RPM_BUILD_ROOT
 
 
 %changelog
+* Tue Nov 30 2010 leigh scott <leigh123linux at googlemail.com> - 0.8.6-6
+- add more upstream gdk fixes
+
 * Tue Nov 30 2010 leigh scott <leigh123linux at googlemail.com> - 0.8.6-5
 - Don't rely on deprecated gdk symbol gdk_display.
 
diff --git a/gdk_drawable_deprecated.patch b/gdk_drawable_deprecated.patch
new file mode 100644
index 0000000..cf7acfb
--- /dev/null
+++ b/gdk_drawable_deprecated.patch
@@ -0,0 +1,184 @@
+From: Danny Baumann <dannybaumann at web.de>
+Date: Mon, 6 Sep 2010 09:25:02 +0000 (+0200)
+Subject: Replace old gdk_draw_drawable method calls with cairo equivalents.
+X-Git-Url: http://gitweb.compiz.org/?p=compiz%2Fcore;a=commitdiff_plain;h=777e5ecdb197105f770e7bcedd83eb54c53457f3
+
+Replace old gdk_draw_drawable method calls with cairo equivalents.
+---
+
+diff --git a/gtk/window-decorator/gtk-window-decorator.c b/gtk/window-decorator/gtk-window-decorator.c
+index 18b907e..adb20d5 100644
+--- a/gtk/window-decorator/gtk-window-decorator.c
++++ b/gtk/window-decorator/gtk-window-decorator.c
+@@ -380,7 +380,7 @@ typedef struct _decor {
+     guint	      button_states[BUTTON_NUM];
+     GdkPixmap	      *pixmap;
+     GdkPixmap	      *buffer_pixmap;
+-    GdkGC	      *gc;
++    cairo_t           *cr;
+     decor_layout_t    border_layout;
+     decor_context_t   *context;
+     decor_shadow_t    *shadow;
+@@ -918,6 +918,17 @@ button_state_paint (cairo_t	  *cr,
+ }
+ 
+ static void
++copy_to_front_buffer (decor_t *d)
++{
++    if (!d->buffer_pixmap)
++	return;
++
++    cairo_set_operator (d->cr, CAIRO_OPERATOR_SOURCE);
++    gdk_cairo_set_source_pixmap (d->cr, d->buffer_pixmap, 0, 0);
++    cairo_paint (d->cr);
++}
++
++static void
+ draw_window_decoration (decor_t *d)
+ {
+     cairo_t       *cr;
+@@ -1298,16 +1309,7 @@ draw_window_decoration (decor_t *d)
+ 
+     cairo_destroy (cr);
+ 
+-    if (d->buffer_pixmap)
+-	gdk_draw_drawable  (d->pixmap,
+-			    d->gc,
+-			    d->buffer_pixmap,
+-			    0,
+-			    0,
+-			    0,
+-			    0,
+-			    d->width,
+-			    d->height);
++    copy_to_front_buffer (d);
+ 
+     if (d->prop_xid)
+     {
+@@ -2103,16 +2105,7 @@ meta_draw_window_decoration (decor_t *d)
+ 	XRenderFreePicture (xdisplay, src);
+     }
+ 
+-    if (d->buffer_pixmap)
+-	gdk_draw_drawable  (d->pixmap,
+-			    d->gc,
+-			    d->buffer_pixmap,
+-			    0,
+-			    0,
+-			    0,
+-			    0,
+-			    d->width,
+-			    d->height);
++    copy_to_front_buffer (d);
+ 
+     if (d->prop_xid)
+     {
+@@ -2361,18 +2354,9 @@ draw_switcher_background (decor_t *d)
+ 				      alpha);
+ 
+     cairo_stroke (cr);
+-
+     cairo_destroy (cr);
+ 
+-    gdk_draw_drawable (d->pixmap,
+-		       d->gc,
+-		       d->buffer_pixmap,
+-		       0,
+-		       0,
+-		       0,
+-		       0,
+-		       d->width,
+-		       d->height);
++    copy_to_front_buffer (d);
+ 
+     pixel = ((((a * style->bg[GTK_STATE_NORMAL].blue ) >> 24) & 0x0000ff) |
+ 	     (((a * style->bg[GTK_STATE_NORMAL].green) >> 16) & 0x00ff00) |
+@@ -2439,15 +2423,7 @@ draw_switcher_foreground (decor_t *d)
+ 
+     cairo_destroy (cr);
+ 
+-    gdk_draw_drawable  (d->pixmap,
+-			d->gc,
+-			d->buffer_pixmap,
+-			0,
+-			0,
+-			0,
+-			0,
+-			d->width,
+-			d->height);
++    copy_to_front_buffer (d);
+ }
+ 
+ static void
+@@ -3512,15 +3488,15 @@ update_window_decoration_size (WnckWindow *win)
+     if (d->buffer_pixmap)
+ 	g_object_unref (G_OBJECT (d->buffer_pixmap));
+ 
+-    if (d->gc)
+-	g_object_unref (G_OBJECT (d->gc));
+-
+     if (d->picture)
+ 	XRenderFreePicture (xdisplay, d->picture);
+ 
++    if (d->cr)
++	cairo_destroy (d->cr);
++
+     d->pixmap	     = pixmap;
+     d->buffer_pixmap = buffer_pixmap;
+-    d->gc	     = gdk_gc_new (pixmap);
++    d->cr            = gdk_cairo_create (pixmap);
+ 
+     d->picture = picture;
+ 
+@@ -3642,6 +3618,7 @@ update_switcher_window (WnckWindow *win,
+     {
+ 	g_object_ref (G_OBJECT (switcher_pixmap));
+ 	d->pixmap = switcher_pixmap;
++	d->cr = gdk_cairo_create (switcher_pixmap);
+     }
+ 
+     if (!d->buffer_pixmap && switcher_buffer_pixmap)
+@@ -3729,9 +3706,6 @@ update_switcher_window (WnckWindow *win,
+ 
+     if (width == d->width && height == d->height)
+     {
+-	if (!d->gc)
+-	    d->gc = gdk_gc_new (d->pixmap);
+-
+ 	if (!d->picture)
+ 	    d->picture =
+ 		XRenderCreatePicture (xdisplay,
+@@ -3765,8 +3739,8 @@ update_switcher_window (WnckWindow *win,
+     if (d->buffer_pixmap)
+ 	g_object_unref (G_OBJECT (d->buffer_pixmap));
+ 
+-    if (d->gc)
+-	g_object_unref (G_OBJECT (d->gc));
++    if (d->cr)
++	cairo_destroy (d->cr);
+ 
+     if (d->picture)
+ 	XRenderFreePicture (xdisplay, d->picture);
+@@ -3782,7 +3756,7 @@ update_switcher_window (WnckWindow *win,
+ 
+     d->pixmap	     = pixmap;
+     d->buffer_pixmap = buffer_pixmap;
+-    d->gc	     = gdk_gc_new (pixmap);
++    d->cr            = gdk_cairo_create (pixmap);
+ 
+     d->picture = XRenderCreatePicture (xdisplay, GDK_PIXMAP_XID (buffer_pixmap),
+ 				       xformat, 0, NULL);
+@@ -3817,10 +3791,10 @@ remove_frame_window (WnckWindow *win)
+ 	d->buffer_pixmap = NULL;
+     }
+ 
+-    if (d->gc)
++    if (d->cr)
+     {
+-	g_object_unref (G_OBJECT (d->gc));
+-	d->gc = NULL;
++	cairo_destroy (d->cr);
++	d->cr = NULL;
+     }
+ 
+     if (d->picture)


More information about the scm-commits mailing list