From 39721116a92beca6f8874bb170218b36f9a74bd102e76239ef42f508b4e5c05c Mon Sep 17 00:00:00 2001 From: OBS User autobuild Date: Thu, 1 Apr 2010 14:04:24 +0000 Subject: [PATCH 1/8] Accepting request 36384 from GNOME:Factory checked in (request 36384) OBS-URL: https://build.opensuse.org/request/show/36384 OBS-URL: https://build.opensuse.org/package/show/GNOME:Factory/mutter?expand=0&rev=26 --- mutter-2.29.0.tar.bz2 | 3 + mutter-2.29.1.tar.bz2 | 3 - mutter-cogl_texture-deprecated.patch | 88 ++++++++++++++++++++++++++++ mutter.changes | 12 ---- mutter.spec | 7 ++- 5 files changed, 96 insertions(+), 17 deletions(-) create mode 100644 mutter-2.29.0.tar.bz2 delete mode 100644 mutter-2.29.1.tar.bz2 create mode 100644 mutter-cogl_texture-deprecated.patch diff --git a/mutter-2.29.0.tar.bz2 b/mutter-2.29.0.tar.bz2 new file mode 100644 index 0000000..91c0bef --- /dev/null +++ b/mutter-2.29.0.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7e4c1c46542f1251e9ec495729a3b753e5753ecd18fe35df586e474f6bf5ab90 +size 2001498 diff --git a/mutter-2.29.1.tar.bz2 b/mutter-2.29.1.tar.bz2 deleted file mode 100644 index ea9ee8f..0000000 --- a/mutter-2.29.1.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:175f3adcc5ad5c6f23772ca15c862f275fc3d9a9c3104e9146cf265847a4a10a -size 1981019 diff --git a/mutter-cogl_texture-deprecated.patch b/mutter-cogl_texture-deprecated.patch new file mode 100644 index 0000000..3dbd4a5 --- /dev/null +++ b/mutter-cogl_texture-deprecated.patch @@ -0,0 +1,88 @@ +Index: mutter-2.29.0/src/compositor/mutter-shaped-texture.c +=================================================================== +--- mutter-2.29.0.orig/src/compositor/mutter-shaped-texture.c ++++ mutter-2.29.0/src/compositor/mutter-shaped-texture.c +@@ -124,18 +124,18 @@ mutter_shaped_texture_dispose (GObject * + + if (priv->material != COGL_INVALID_HANDLE) + { +- cogl_material_unref (priv->material); ++ cogl_handle_unref (priv->material); + priv->material = COGL_INVALID_HANDLE; + } + if (priv->material_unshaped != COGL_INVALID_HANDLE) + { +- cogl_material_unref (priv->material_unshaped); ++ cogl_handle_unref (priv->material_unshaped); + priv->material_unshaped = COGL_INVALID_HANDLE; + } + #if 1 /* see comment in mutter_shaped_texture_paint */ + if (priv->material_workaround != COGL_INVALID_HANDLE) + { +- cogl_material_unref (priv->material_workaround); ++ cogl_handle_unref (priv->material_workaround); + priv->material_workaround = COGL_INVALID_HANDLE; + } + #endif +@@ -194,7 +194,7 @@ mutter_shaped_texture_dirty_mask (Mutter + if (mask_gl_target == GL_TEXTURE_RECTANGLE_ARB) + glDeleteTextures (1, &mask_gl_tex); + +- cogl_texture_unref (priv->mask_texture); ++ cogl_handle_unref (priv->mask_texture); + priv->mask_texture = COGL_INVALID_HANDLE; + } + } +Index: mutter-2.29.0/src/compositor/mutter-texture-tower.c +=================================================================== +--- mutter-2.29.0.orig/src/compositor/mutter-texture-tower.c ++++ mutter-2.29.0/src/compositor/mutter-texture-tower.c +@@ -131,7 +131,7 @@ free_texture (CoglHandle texture) + if (gl_target == GL_TEXTURE_RECTANGLE_ARB) + glDeleteTextures (1, &gl_tex); + +- cogl_texture_unref (texture); ++ cogl_handle_unref (texture); + } + + /** +@@ -180,7 +180,7 @@ mutter_texture_tower_set_base_texture (M + #endif + } + +- cogl_texture_unref (tower->textures[0]); ++ cogl_handle_unref (tower->textures[0]); + } + + tower->textures[0] = texture; +@@ -189,7 +189,7 @@ mutter_texture_tower_set_base_texture (M + { + int width, height; + +- cogl_texture_ref (tower->textures[0]); ++ cogl_handle_ref (tower->textures[0]); + + width = cogl_texture_get_width (tower->textures[0]); + height = cogl_texture_get_height (tower->textures[0]); +Index: mutter-2.29.0/src/compositor/tidy/tidy-texture-frame.c +=================================================================== +--- mutter-2.29.0.orig/src/compositor/tidy/tidy-texture-frame.c ++++ mutter-2.29.0/src/compositor/tidy/tidy-texture-frame.c +@@ -155,7 +155,7 @@ tidy_texture_frame_unrealize (ClutterAct + if (priv->material == COGL_INVALID_HANDLE) + return; + +- cogl_material_unref (priv->material); ++ cogl_handle_unref (priv->material); + priv->material = COGL_INVALID_HANDLE; + + CLUTTER_ACTOR_UNSET_FLAGS (self, CLUTTER_ACTOR_REALIZED); +@@ -415,7 +415,7 @@ tidy_texture_frame_dispose (GObject *gob + + if (priv->material) + { +- cogl_material_unref (priv->material); ++ cogl_handle_unref (priv->material); + priv->material = COGL_INVALID_HANDLE; + } + diff --git a/mutter.changes b/mutter.changes index 7507061..f22561f 100644 --- a/mutter.changes +++ b/mutter.changes @@ -1,15 +1,3 @@ -------------------------------------------------------------------- -Fri Mar 19 09:01:56 CET 2010 - dimstar@opensuse.org - -- Update to version 2.29.1: - + Support and require Clutter 1.2 - + Add meta_display_get_keybinding_action() - + Add meta_window_get_wm_class_instance() - + Remove workaround for bug fixed in intel driver Q2/2009 release - + Build fixes - + Updated translations. -- Drop upstreamed patch mutter-cogl_texture-deprecated.patch. - ------------------------------------------------------------------- Thu Feb 25 21:32:53 UTC 2010 - dominique.leuenberger@tmf-group.com diff --git a/mutter.spec b/mutter.spec index e09fef1..3b46a07 100644 --- a/mutter.spec +++ b/mutter.spec @@ -1,5 +1,5 @@ # -# spec file for package mutter (Version 2.29.1) +# spec file for package mutter (Version 2.29.0) # # Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany. # @@ -33,10 +33,12 @@ BuildRequires: update-desktop-files BuildRequires: zenity License: GPLv2+ Group: System/GUI/GNOME -Version: 2.29.1 +Version: 2.29.0 Release: 1 Summary: Window and compositing manager based on Clutter Source: %{name}-%{version}.tar.bz2 +# PATCH-FIX-UPSTREAM mutter-cogl_texture-deprecated.patch bgo#610454 dimstar@opensuse.org -- cogl_texture_[un]ref has been deprecated in favor of cogl_handle_[un]ref. +Patch0: mutter-cogl_texture-deprecated.patch # PATCH-FIX-UPSTREAM mutter-gcc45.patch bgo#606719 dimstar@opensuse.org -- Fix build with GCC 4.5 Patch1: mutter-gcc45.patch Url: http://www.gnome.org @@ -66,6 +68,7 @@ to develop applications that require these. %lang_package %prep %setup -q +%patch0 -p1 %patch1 -p1 %build From 1e9b74708ac29b40a67419cac08bb2145a03ed84f20f08ac8e5f3ee86b15d153 Mon Sep 17 00:00:00 2001 From: Vincent Untz Date: Fri, 6 Aug 2010 22:14:46 +0000 Subject: [PATCH 2/8] Accepting request 43799 from home:dimstar:branches:GNOME:Factory Copy from home:dimstar:branches:GNOME:Factory/mutter via accept of submit request 43799 revision 9. Request was accepted with message: thanks OBS-URL: https://build.opensuse.org/request/show/43799 OBS-URL: https://build.opensuse.org/package/show/GNOME:Factory/mutter?expand=0&rev=27 --- mutter-2.29.0.tar.bz2 | 3 - mutter-2.31.5.tar.bz2 | 3 + mutter-cogl_texture-deprecated.patch | 88 ---------------------------- mutter-gcc45.patch | 39 ------------ mutter.changes | 83 ++++++++++++++++++++++++++ mutter.spec | 13 ++-- 6 files changed, 90 insertions(+), 139 deletions(-) delete mode 100644 mutter-2.29.0.tar.bz2 create mode 100644 mutter-2.31.5.tar.bz2 delete mode 100644 mutter-cogl_texture-deprecated.patch delete mode 100644 mutter-gcc45.patch diff --git a/mutter-2.29.0.tar.bz2 b/mutter-2.29.0.tar.bz2 deleted file mode 100644 index 91c0bef..0000000 --- a/mutter-2.29.0.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:7e4c1c46542f1251e9ec495729a3b753e5753ecd18fe35df586e474f6bf5ab90 -size 2001498 diff --git a/mutter-2.31.5.tar.bz2 b/mutter-2.31.5.tar.bz2 new file mode 100644 index 0000000..df972f1 --- /dev/null +++ b/mutter-2.31.5.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:518df8d359acd7ec91e8ffcce1c3420fce5bcf85fefba6f4571ad3f6c419d398 +size 1992924 diff --git a/mutter-cogl_texture-deprecated.patch b/mutter-cogl_texture-deprecated.patch deleted file mode 100644 index 3dbd4a5..0000000 --- a/mutter-cogl_texture-deprecated.patch +++ /dev/null @@ -1,88 +0,0 @@ -Index: mutter-2.29.0/src/compositor/mutter-shaped-texture.c -=================================================================== ---- mutter-2.29.0.orig/src/compositor/mutter-shaped-texture.c -+++ mutter-2.29.0/src/compositor/mutter-shaped-texture.c -@@ -124,18 +124,18 @@ mutter_shaped_texture_dispose (GObject * - - if (priv->material != COGL_INVALID_HANDLE) - { -- cogl_material_unref (priv->material); -+ cogl_handle_unref (priv->material); - priv->material = COGL_INVALID_HANDLE; - } - if (priv->material_unshaped != COGL_INVALID_HANDLE) - { -- cogl_material_unref (priv->material_unshaped); -+ cogl_handle_unref (priv->material_unshaped); - priv->material_unshaped = COGL_INVALID_HANDLE; - } - #if 1 /* see comment in mutter_shaped_texture_paint */ - if (priv->material_workaround != COGL_INVALID_HANDLE) - { -- cogl_material_unref (priv->material_workaround); -+ cogl_handle_unref (priv->material_workaround); - priv->material_workaround = COGL_INVALID_HANDLE; - } - #endif -@@ -194,7 +194,7 @@ mutter_shaped_texture_dirty_mask (Mutter - if (mask_gl_target == GL_TEXTURE_RECTANGLE_ARB) - glDeleteTextures (1, &mask_gl_tex); - -- cogl_texture_unref (priv->mask_texture); -+ cogl_handle_unref (priv->mask_texture); - priv->mask_texture = COGL_INVALID_HANDLE; - } - } -Index: mutter-2.29.0/src/compositor/mutter-texture-tower.c -=================================================================== ---- mutter-2.29.0.orig/src/compositor/mutter-texture-tower.c -+++ mutter-2.29.0/src/compositor/mutter-texture-tower.c -@@ -131,7 +131,7 @@ free_texture (CoglHandle texture) - if (gl_target == GL_TEXTURE_RECTANGLE_ARB) - glDeleteTextures (1, &gl_tex); - -- cogl_texture_unref (texture); -+ cogl_handle_unref (texture); - } - - /** -@@ -180,7 +180,7 @@ mutter_texture_tower_set_base_texture (M - #endif - } - -- cogl_texture_unref (tower->textures[0]); -+ cogl_handle_unref (tower->textures[0]); - } - - tower->textures[0] = texture; -@@ -189,7 +189,7 @@ mutter_texture_tower_set_base_texture (M - { - int width, height; - -- cogl_texture_ref (tower->textures[0]); -+ cogl_handle_ref (tower->textures[0]); - - width = cogl_texture_get_width (tower->textures[0]); - height = cogl_texture_get_height (tower->textures[0]); -Index: mutter-2.29.0/src/compositor/tidy/tidy-texture-frame.c -=================================================================== ---- mutter-2.29.0.orig/src/compositor/tidy/tidy-texture-frame.c -+++ mutter-2.29.0/src/compositor/tidy/tidy-texture-frame.c -@@ -155,7 +155,7 @@ tidy_texture_frame_unrealize (ClutterAct - if (priv->material == COGL_INVALID_HANDLE) - return; - -- cogl_material_unref (priv->material); -+ cogl_handle_unref (priv->material); - priv->material = COGL_INVALID_HANDLE; - - CLUTTER_ACTOR_UNSET_FLAGS (self, CLUTTER_ACTOR_REALIZED); -@@ -415,7 +415,7 @@ tidy_texture_frame_dispose (GObject *gob - - if (priv->material) - { -- cogl_material_unref (priv->material); -+ cogl_handle_unref (priv->material); - priv->material = COGL_INVALID_HANDLE; - } - diff --git a/mutter-gcc45.patch b/mutter-gcc45.patch deleted file mode 100644 index 6a9f67c..0000000 --- a/mutter-gcc45.patch +++ /dev/null @@ -1,39 +0,0 @@ -Index: mutter-2.29.0/src/core/core.c -=================================================================== ---- mutter-2.29.0.orig/src/core/core.c -+++ mutter-2.29.0/src/core/core.c -@@ -526,6 +526,9 @@ meta_core_get_menu_accelerator (MetaMenu - - switch (menu_op) - { -+ case META_MENU_OP_NONE: -+ /* No keybindings needed here */ -+ break; - case META_MENU_OP_DELETE: - name = "close"; - break; -Index: mutter-2.29.0/src/include/common.h -=================================================================== ---- mutter-2.29.0.orig/src/include/common.h -+++ mutter-2.29.0/src/include/common.h -@@ -52,6 +52,7 @@ typedef enum - - typedef enum - { -+ META_MENU_OP_NONE = 0, - META_MENU_OP_DELETE = 1 << 0, - META_MENU_OP_MINIMIZE = 1 << 1, - META_MENU_OP_UNMAXIMIZE = 1 << 2, -Index: mutter-2.29.0/src/core/window.c -=================================================================== ---- mutter-2.29.0.orig/src/core/window.c -+++ mutter-2.29.0/src/core/window.c -@@ -7157,7 +7157,7 @@ menu_callback (MetaWindowMenu *menu, - meta_window_shove_titlebar_onscreen (window); - break; - -- case 0: -+ case META_MENU_OP_NONE: - /* nothing */ - break; - diff --git a/mutter.changes b/mutter.changes index f22561f..d686f0e 100644 --- a/mutter.changes +++ b/mutter.changes @@ -1,3 +1,86 @@ +------------------------------------------------------------------- +Fri Jul 16 13:49:04 UTC 2010 - dimstar@opensuse.org + +- Update to 2.31.5: + + Support building with GTK+ 3.0 + + Remove deprecated usages for compatibility with GTK+ 3.0 + + Export a boxed type for MetaRectangle + + Allow disabling -Werror with --enable-compile-warnings=yes + + Build fixes [Andreas, Florian, Owen] +- BuildRequire gtk3-devel instead of gtk2-devel. + +------------------------------------------------------------------- +Mon Jul 5 20:40:09 CEST 2010 - dimstar@opensuse.org + +- Update to version 2.31.4: + + Clean up MutterPlugin effect interface + + Track damage as the bounding box, a significant optimizations + for rapidly drawing clients + + Add meta_window_is_remote() + + Add meta_add_debug_topic() for turning on logging of specific + topics + + Fix bug with window unmaximization + + Bugs fixed: + - bgo#611838: expose sub-stage redraws by streaming raw updates + to ClutterX11TexturePixmap + - bgo#620585: Add meta_window_is_remote + - bgo#620860: function ‘meta_display_open’ + - bgo#621082: MutterPluginManager should call + plugin->switch_workspace, when screen doesn't have any + window. Or function should be renamed. + - bgo#621413: Maximize/Unmaximize not behaving properly for + some non-gnome based programs + + Updated translations. + +------------------------------------------------------------------- +Fri May 28 21:53:59 CEST 2010 - dimstar@opensuse.org + +- Update to version 2.31.2: + + Theme enhancements + - Add a flexible version mechanism for themes - + metacity-theme-3.xml is now supported, and can include + version="> 3.2" type attributes on the root element or + any subelement. + - Add frame_x_center/frame_y_center variables + - Allow a theme to turn on title ellipsization + + Performance enhancements: + - Stream raw damage updates to ClutterX11TexturePixmap + to enable partial stage updates when windos change + - Don't trap XErrors in meta_compositor_process_event + + Add meta_prefs_override_preference_location(); this allows + a plugin like GNOME Shell to redirect preferences to a + plugin-specific location. + + Support a _MUTTER_HINTS window property; this is a string + property holding key-value pairs with plugin-specific + interpretation + + Build with GSEAL_ENABLE + + Add meta_display_get_leader_window() + + Add meta_display_sort_windows_by_stacking + + Export + meta_display_get_last_user_time() + meta_display_xserver_time_is_before() + meta_window_foreach_ancestor(), + meta_window_foreach_transient() + meta_window_lower() + meta_window_raise() + meta_window_set_demands_attention() + meta_window_unset_demands_attention() + + Bug fixes + + Build fixes +- Drop mutter-gcc45.patch, fixed by upstream. + +------------------------------------------------------------------- +Fri Mar 19 09:01:56 CET 2010 - dimstar@opensuse.org + +- Update to version 2.29.1: + + Support and require Clutter 1.2 + + Add meta_display_get_keybinding_action() + + Add meta_window_get_wm_class_instance() + + Remove workaround for bug fixed in intel driver Q2/2009 release + + Build fixes + + Updated translations. +- Drop upstreamed patch mutter-cogl_texture-deprecated.patch. + ------------------------------------------------------------------- Thu Feb 25 21:32:53 UTC 2010 - dominique.leuenberger@tmf-group.com diff --git a/mutter.spec b/mutter.spec index 3b46a07..269296b 100644 --- a/mutter.spec +++ b/mutter.spec @@ -1,5 +1,5 @@ # -# spec file for package mutter (Version 2.29.0) +# spec file for package mutter (Version 2.31.5) # # Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany. # @@ -25,7 +25,7 @@ BuildRequires: gconf2-devel BuildRequires: gir-repository BuildRequires: gnome-doc-utils-devel BuildRequires: gobject-introspection-devel -BuildRequires: gtk2-devel +BuildRequires: gtk3-devel BuildRequires: intltool BuildRequires: libcanberra-devel BuildRequires: startup-notification-devel @@ -33,14 +33,10 @@ BuildRequires: update-desktop-files BuildRequires: zenity License: GPLv2+ Group: System/GUI/GNOME -Version: 2.29.0 +Version: 2.31.5 Release: 1 Summary: Window and compositing manager based on Clutter Source: %{name}-%{version}.tar.bz2 -# PATCH-FIX-UPSTREAM mutter-cogl_texture-deprecated.patch bgo#610454 dimstar@opensuse.org -- cogl_texture_[un]ref has been deprecated in favor of cogl_handle_[un]ref. -Patch0: mutter-cogl_texture-deprecated.patch -# PATCH-FIX-UPSTREAM mutter-gcc45.patch bgo#606719 dimstar@opensuse.org -- Fix build with GCC 4.5 -Patch1: mutter-gcc45.patch Url: http://www.gnome.org BuildRoot: %{_tmppath}/%{name}-%{version}-build Requires: zenity @@ -68,13 +64,12 @@ to develop applications that require these. %lang_package %prep %setup -q -%patch0 -p1 -%patch1 -p1 %build %configure \ --libexecdir=%{_libexecdir}/%{name} \ --disable-static \ + --with-gtk=3.0 \ --disable-schemas-install %__make %{?jobs:-j%jobs} From 94ec0f240f151bc9d45dce2b9fa6d2d0e67c5d7cf5a02d421be10692340fa1a5 Mon Sep 17 00:00:00 2001 From: Vincent Untz Date: Fri, 6 Aug 2010 22:33:04 +0000 Subject: [PATCH 3/8] Accepting request 44777 from home:vuntz:branches:GNOME:Factory Copy from home:vuntz:branches:GNOME:Factory/mutter via accept of submit request 44777 revision 2. Request was accepted with message: ok OBS-URL: https://build.opensuse.org/request/show/44777 OBS-URL: https://build.opensuse.org/package/show/GNOME:Factory/mutter?expand=0&rev=28 --- mutter.changes | 7 ++++--- mutter.spec | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/mutter.changes b/mutter.changes index d686f0e..013df68 100644 --- a/mutter.changes +++ b/mutter.changes @@ -6,8 +6,9 @@ Fri Jul 16 13:49:04 UTC 2010 - dimstar@opensuse.org + Remove deprecated usages for compatibility with GTK+ 3.0 + Export a boxed type for MetaRectangle + Allow disabling -Werror with --enable-compile-warnings=yes - + Build fixes [Andreas, Florian, Owen] -- BuildRequire gtk3-devel instead of gtk2-devel. + + Build fixes +- Build against GTK+ 3: use gtk3-devel BuildRequires instead of + gtk2-devel and pass --with-gtk=3.0 to configure. ------------------------------------------------------------------- Mon Jul 5 20:40:09 CEST 2010 - dimstar@opensuse.org @@ -67,7 +68,7 @@ Fri May 28 21:53:59 CEST 2010 - dimstar@opensuse.org meta_window_unset_demands_attention() + Bug fixes + Build fixes -- Drop mutter-gcc45.patch, fixed by upstream. +- Drop mutter-gcc45.patch, fixed upstream. ------------------------------------------------------------------- Fri Mar 19 09:01:56 CET 2010 - dimstar@opensuse.org diff --git a/mutter.spec b/mutter.spec index 269296b..5a5f6fc 100644 --- a/mutter.spec +++ b/mutter.spec @@ -69,8 +69,8 @@ to develop applications that require these. %configure \ --libexecdir=%{_libexecdir}/%{name} \ --disable-static \ - --with-gtk=3.0 \ - --disable-schemas-install + --disable-schemas-install \ + --with-gtk=3.0 %__make %{?jobs:-j%jobs} %install From 9b16c76fa0c75899d15676e04802f4aa7cac0084adffe6ea429f6c7ed11b49cc Mon Sep 17 00:00:00 2001 From: Dominique Leuenberger Date: Wed, 1 Sep 2010 18:40:42 +0000 Subject: [PATCH 4/8] Accepting request 46906 from home:vuntz:branches:GNOME:Factory Copy from home:vuntz:branches:GNOME:Factory/mutter via accept of submit request 46906 revision 2. Request was accepted with message: Looks fine, thanks. OBS-URL: https://build.opensuse.org/request/show/46906 OBS-URL: https://build.opensuse.org/package/show/GNOME:Factory/mutter?expand=0&rev=29 --- mutter.changes | 7 +++++++ mutter.spec | 1 - 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/mutter.changes b/mutter.changes index 013df68..b0d21e8 100644 --- a/mutter.changes +++ b/mutter.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Wed Sep 1 15:32:49 CEST 2010 - vuntz@opensuse.org + +- Drop gir-repository BuildRequires: the introspection files that + were needed from there are now directly with the appropriate + libraries. + ------------------------------------------------------------------- Fri Jul 16 13:49:04 UTC 2010 - dimstar@opensuse.org diff --git a/mutter.spec b/mutter.spec index 5a5f6fc..c146c28 100644 --- a/mutter.spec +++ b/mutter.spec @@ -22,7 +22,6 @@ Name: mutter BuildRequires: clutter-devel BuildRequires: fdupes BuildRequires: gconf2-devel -BuildRequires: gir-repository BuildRequires: gnome-doc-utils-devel BuildRequires: gobject-introspection-devel BuildRequires: gtk3-devel From 49fc7750b8c586c342aca77e23d8cfea67111dc3f257d773f61e2c8aada0a37f Mon Sep 17 00:00:00 2001 From: Vincent Untz Date: Thu, 9 Sep 2010 21:07:02 +0000 Subject: [PATCH 5/8] Accepting request 47026 from home:dimstar:branches:GNOME:Factory thanks OBS-URL: https://build.opensuse.org/request/show/47026 OBS-URL: https://build.opensuse.org/package/show/GNOME:Factory/mutter?expand=0&rev=30 --- mutter-gdk-cairo.patch | 1114 ++++++++++++++++++++++++++++++++++++++++ mutter.changes | 6 + mutter.spec | 3 + 3 files changed, 1123 insertions(+) create mode 100644 mutter-gdk-cairo.patch diff --git a/mutter-gdk-cairo.patch b/mutter-gdk-cairo.patch new file mode 100644 index 0000000..503f95d --- /dev/null +++ b/mutter-gdk-cairo.patch @@ -0,0 +1,1114 @@ +From 08cfdcd802c762b04351798e8a03524e11db637e Mon Sep 17 00:00:00 2001 +From: Florian Müllner +Date: Mon, 19 Jul 2010 15:55:00 +0000 +Subject: Replace GDK drawing API with cairo + +The GDK drawing API was deprecated/removed. + +https://bugzilla.gnome.org/show_bug.cgi?id=626583 +--- +Index: mutter-2.31.5/src/ui/draw-workspace.c +=================================================================== +--- mutter-2.31.5.orig/src/ui/draw-workspace.c ++++ mutter-2.31.5/src/ui/draw-workspace.c +@@ -180,6 +180,7 @@ wnck_draw_workspace (GtkWidget + GdkRectangle workspace_rect; + GtkStateType state; + GtkStyle *style; ++ cairo_t *cr; + + workspace_rect.x = x; + workspace_rect.y = y; +@@ -194,28 +195,21 @@ wnck_draw_workspace (GtkWidget + state = GTK_STATE_NORMAL; + + style = gtk_widget_get_style (widget); ++ cr = gdk_cairo_create (drawable); + + if (workspace_background) + { +- gdk_draw_pixbuf (drawable, +- style->dark_gc[state], +- workspace_background, +- 0, 0, +- x, y, +- -1, -1, +- GDK_RGB_DITHER_MAX, +- 0, 0); ++ gdk_cairo_set_source_pixbuf (cr, workspace_background, x, y); ++ cairo_paint (cr); + } + else + { +- cairo_t *cr; +- +- cr = gdk_cairo_create (gtk_widget_get_window (widget)); + gdk_cairo_set_source_color (cr, &style->dark[state]); + cairo_rectangle (cr, x, y, width, height); + cairo_fill (cr); +- cairo_destroy (cr); + } ++ ++ cairo_destroy (cr); + + i = 0; + while (i < n_windows) +Index: mutter-2.31.5/src/ui/frames.c +=================================================================== +--- mutter-2.31.5.orig/src/ui/frames.c ++++ mutter-2.31.5/src/ui/frames.c +@@ -2004,46 +2004,64 @@ meta_frames_destroy_event (Gtk + return TRUE; + } + +-/* Cut and paste from GDK */ +-static GdkGC * +-get_bg_gc (GdkWindow *window, int x_offset, int y_offset) ++#if !GTK_CHECK_VERSION(2,21,6) ++/* Copied from GDK */ ++static cairo_pattern_t * ++gdk_window_get_background_pattern (GdkWindow *window) ++{ ++ GdkWindowObject *private = (GdkWindowObject *) window; ++ cairo_pattern_t *pattern; ++ ++ g_return_val_if_fail (GDK_IS_WINDOW (window), NULL); ++ ++ if (private->bg_pixmap == GDK_PARENT_RELATIVE_BG) ++ pattern = NULL; ++ else if (private->bg_pixmap != GDK_NO_BG && ++ private->bg_pixmap != NULL) ++ { ++ static cairo_user_data_key_t key; ++ cairo_surface_t *surface; ++ ++ surface = _gdk_drawable_ref_cairo_surface (private->bg_pixmap); ++ pattern = cairo_pattern_create_for_surface (surface); ++ cairo_surface_destroy (surface); ++ ++ cairo_pattern_set_extend (pattern, CAIRO_EXTEND_REPEAT); ++ cairo_pattern_set_user_data (pattern, ++ &key, ++ g_object_ref (private->bg_pixmap), ++ g_object_unref); ++ } ++ else ++ pattern = ++ cairo_pattern_create_rgb (private->bg_color.red / 65535., ++ private->bg_color.green / 65535., ++ private->bg_color.blue / 65535.); ++ } ++ ++ return pattern; ++} ++#endif ++ ++static void ++setup_bg_cr (cairo_t *cr, GdkWindow *window, int x_offset, int y_offset) + { + GdkWindow *parent = gdk_window_get_parent (window); +- GdkPixmap *back_pixmap; +- gboolean parent_relative; +- guint gc_mask = 0; +- GdkGCValues gc_values; ++ cairo_pattern_t *bg_pattern; + +- gdk_window_get_back_pixmap (window, &back_pixmap, &parent_relative); +- if (parent_relative && parent) ++ bg_pattern = gdk_window_get_background_pattern (window); ++ if (bg_pattern == NULL && parent) + { + gint window_x, window_y; + + gdk_window_get_position (window, &window_x, &window_y); +- return get_bg_gc (parent, +- x_offset + window_x, +- y_offset + window_y); +- } +- else if (back_pixmap) +- { +- gc_values.fill = GDK_TILED; +- gc_values.tile = back_pixmap; +- gc_values.ts_x_origin = x_offset; +- gc_values.ts_y_origin = y_offset; +- +- gc_mask = GDK_GC_FILL | GDK_GC_TILE | GDK_GC_TS_X_ORIGIN | GDK_GC_TS_Y_ORIGIN; +- +- return gdk_gc_new_with_values (window, &gc_values, gc_mask); ++ setup_bg_cr (cr, parent, x_offset + window_x, y_offset + window_y); + } +- else ++ else if (bg_pattern) + { +- GdkColor bg_color; +- GdkGC *gc = gdk_gc_new (window); +- +- gdk_window_get_background (window, &bg_color); +- gdk_gc_set_foreground (gc, &bg_color); +- +- return gc; ++ cairo_translate (cr, - x_offset, - y_offset); ++ cairo_set_source (cr, bg_pattern); ++ cairo_translate (cr, x_offset, y_offset); + } + } + +@@ -2052,12 +2070,16 @@ clear_backing (GdkPixmap *pixmap, + GdkWindow *window, + int xoffset, int yoffset) + { +- GdkGC *tmp_gc = get_bg_gc (window, xoffset, yoffset); ++ int width, height; ++ cairo_t *cr = gdk_cairo_create (pixmap); ++ ++ setup_bg_cr (cr, window, xoffset, yoffset); + +- gdk_draw_rectangle (pixmap, tmp_gc, TRUE, +- 0, 0, -1, -1); ++ gdk_drawable_get_size (GDK_DRAWABLE (pixmap), &width, &height); ++ cairo_rectangle (cr, 0, 0, width, height); ++ cairo_fill (cr); + +- g_object_unref (tmp_gc); ++ cairo_destroy (cr); + } + + /* Returns a pixmap with a piece of the windows frame painted on it. +@@ -2220,10 +2242,10 @@ cached_pixels_draw (CachedPixels *pixels + GdkWindow *window, + MetaRegion *region) + { +- GdkGC *gc; ++ cairo_t *cr; + int i; + +- gc = gdk_gc_new (window); ++ cr = gdk_cairo_create (window); + + for (i = 0; i < 4; i++) + { +@@ -2232,16 +2254,15 @@ cached_pixels_draw (CachedPixels *pixels + + if (piece->pixmap) + { +- gdk_draw_drawable (window, gc, piece->pixmap, +- 0, 0, +- piece->rect.x, piece->rect.y, +- -1, -1); ++ gdk_cairo_set_source_pixmap (cr, piece->pixmap, ++ piece->rect.x, piece->rect.y); ++ cairo_paint (cr); + subtract_from_region (region, piece->pixmap, + piece->rect.x, piece->rect.y); + } + } + +- g_object_unref (gc); ++ cairo_destroy (cr); + } + + static gboolean +@@ -2550,11 +2571,6 @@ meta_frames_set_window_background (MetaF + GTK_WIDGET (frames), + &color); + +- /* Fill in color.pixel */ +- +- gdk_rgb_find_color (gtk_widget_get_colormap (GTK_WIDGET (frames)), +- &color); +- + /* Set A in ARGB to window_background_alpha, if we have ARGB */ + + visual = gtk_widget_get_visual (GTK_WIDGET (frames)); +Index: mutter-2.31.5/src/ui/tabpopup.c +=================================================================== +--- mutter-2.31.5.orig/src/ui/tabpopup.c ++++ mutter-2.31.5/src/ui/tabpopup.c +@@ -83,6 +83,7 @@ outline_window_expose (GtkWidget *w + TabEntry *te; + GtkStyle *style; + GdkWindow *window; ++ cairo_t *cr; + + popup = data; + +@@ -92,20 +93,24 @@ outline_window_expose (GtkWidget *w + te = popup->current_selected_entry; + window = gtk_widget_get_window (widget); + style = gtk_widget_get_style (widget); +- +- gdk_draw_rectangle (window, +- style->white_gc, +- FALSE, +- 0, 0, +- te->rect.width - 1, +- te->rect.height - 1); +- +- gdk_draw_rectangle (window, +- style->white_gc, +- FALSE, +- te->inner_rect.x - 1, te->inner_rect.y - 1, +- te->inner_rect.width + 1, +- te->inner_rect.height + 1); ++ cr = gdk_cairo_create (window); ++ ++ cairo_set_line_width (cr, 1.0); ++ gdk_cairo_set_source_color (cr, &style->white); ++ ++ cairo_rectangle (cr, ++ 0.5, 0.5, ++ te->rect.width - 1, ++ te->rect.height - 1); ++ cairo_stroke (cr); ++ ++ cairo_rectangle (cr, ++ te->inner_rect.x - 0.5, te->inner_rect.y - 0.5, ++ te->inner_rect.width + 1, ++ te->inner_rect.height + 1); ++ cairo_stroke (cr); ++ ++ cairo_destroy (cr); + + return FALSE; + } +@@ -710,6 +715,7 @@ meta_select_image_expose_event (GtkWidge + int x, y, w, h; + gint xpad, ypad; + gfloat xalign, yalign; ++ cairo_t *cr; + + misc = GTK_MISC (widget); + +@@ -734,27 +740,28 @@ meta_select_image_expose_event (GtkWidge + window = gtk_widget_get_window (widget); + style = gtk_widget_get_style (widget); + state = gtk_widget_get_state (widget); ++ cr = gdk_cairo_create (window); + +- gdk_draw_rectangle (window, +- style->fg_gc[state], +- FALSE, +- x, y, w, h); +- gdk_draw_rectangle (window, +- style->fg_gc[state], +- FALSE, +- x - 1, y - 1, w + 2, h + 2); +- ++ cairo_set_line_width (cr, 2.0); ++ gdk_cairo_set_source_color (cr, &style->fg[state]); ++ ++ cairo_rectangle (cr, x, y, w + 1, h + 1); ++ cairo_stroke (cr); ++ ++ cairo_set_line_width (cr, 1.0); + #if 0 +- gdk_draw_rectangle (widget->window, +- widget->style->bg_gc[GTK_STATE_SELECTED], +- TRUE, +- x, y, w, h); ++ gdk_cairo_set_source_color (cr, &style->bg[GTK_STATE_SELECTED]); ++ cairo_rectangle (cr, x, y, w, h); ++ cairo_fill (cr); + #endif ++ + #if 0 + gtk_paint_focus (widget->style, widget->window, + &event->area, widget, "meta-tab-image", + x, y, w, h); + #endif ++ ++ cairo_destroy (cr); + } + + return GTK_WIDGET_CLASS (parent_class)->expose_event (widget, event); +@@ -906,6 +913,7 @@ meta_select_workspace_expose_event (GtkW + GtkAllocation allocation; + GtkStyle *style; + GdkWindow *window; ++ cairo_t *cr; + int i, n_windows; + GList *tmp, *list; + +@@ -965,20 +973,19 @@ meta_select_workspace_expose_event (GtkW + if (META_SELECT_WORKSPACE (widget)->selected) + { + style = gtk_widget_get_style (widget); +- i = SELECT_OUTLINE_WIDTH - 1; ++ cr = gdk_cairo_create (window); + +- while (i >= 0) +- { +- gdk_draw_rectangle (window, +- style->fg_gc[gtk_widget_get_state (widget)], +- FALSE, +- i, +- i, +- allocation.width - i * 2 - 1, +- allocation.height - i * 2 - 1); ++ gdk_cairo_set_source_color (cr, ++ &style->fg[gtk_widget_get_state (widget)]); ++ cairo_set_line_width (cr, SELECT_OUTLINE_WIDTH); ++ ++ cairo_rectangle (cr, ++ SELECT_OUTLINE_WIDTH / 2.0, SELECT_OUTLINE_WIDTH / 2.0, ++ allocation.width - SELECT_OUTLINE_WIDTH, ++ allocation.height - SELECT_OUTLINE_WIDTH); ++ cairo_stroke (cr); + +- --i; +- } ++ cairo_destroy (cr); + } + + return TRUE; +Index: mutter-2.31.5/src/ui/testgradient.c +=================================================================== +--- mutter-2.31.5.orig/src/ui/testgradient.c ++++ mutter-2.31.5/src/ui/testgradient.c +@@ -24,7 +24,7 @@ + #include + + typedef void (* RenderGradientFunc) (GdkDrawable *drawable, +- GdkGC *gc, ++ cairo_t *cr, + int width, + int height); + +@@ -34,28 +34,22 @@ draw_checkerboard (GdkDrawable *drawable + int height) + { + gint i, j, xcount, ycount; +- GdkGC *gc1, *gc2; +- GdkColor color; ++ GdkColor color1, color2; ++ cairo_t *cr; + + #define CHECK_SIZE 10 + #define SPACING 2 + +- /* It would be a bit more efficient to keep these +- * GC's around instead of recreating on each expose, but +- * this is the lazy/slow way. +- */ +- gc1 = gdk_gc_new (drawable); +- color.red = 30000; +- color.green = 30000; +- color.blue = 30000; +- gdk_gc_set_rgb_fg_color (gc1, &color); +- +- gc2 = gdk_gc_new (drawable); +- color.red = 50000; +- color.green = 50000; +- color.blue = 50000; +- gdk_gc_set_rgb_fg_color (gc2, &color); +- ++ color1.red = 30000; ++ color1.green = 30000; ++ color1.blue = 30000; ++ ++ color2.red = 50000; ++ color2.green = 50000; ++ color2.blue = 50000; ++ ++ cr = gdk_cairo_create (drawable); ++ + xcount = 0; + i = SPACING; + while (i < width) +@@ -64,23 +58,17 @@ draw_checkerboard (GdkDrawable *drawable + ycount = xcount % 2; /* start with even/odd depending on row */ + while (j < height) + { +- GdkGC *gc; +- + if (ycount % 2) +- gc = gc1; ++ gdk_cairo_set_source_color (cr, &color1); + else +- gc = gc2; ++ gdk_cairo_set_source_color (cr, &color2); + + /* If we're outside event->area, this will do nothing. + * It might be mildly more efficient if we handled + * the clipping ourselves, but again we're feeling lazy. + */ +- gdk_draw_rectangle (drawable, +- gc, +- TRUE, +- i, j, +- CHECK_SIZE, +- CHECK_SIZE); ++ cairo_rectangle (cr, i, j, CHECK_SIZE, CHECK_SIZE); ++ cairo_fill (cr); + + j += CHECK_SIZE + SPACING; + ++ycount; +@@ -90,13 +78,12 @@ draw_checkerboard (GdkDrawable *drawable + ++xcount; + } + +- g_object_unref (G_OBJECT (gc1)); +- g_object_unref (G_OBJECT (gc2)); ++ cairo_destroy (cr); + } + + static void + render_simple (GdkDrawable *drawable, +- GdkGC *gc, ++ cairo_t *cr, + int width, int height, + MetaGradientType type, + gboolean with_alpha) +@@ -131,52 +118,48 @@ render_simple (GdkDrawable *drawable, + draw_checkerboard (drawable, width, height); + } + +- gdk_draw_pixbuf (drawable, +- gc, +- pixbuf, +- 0, 0, +- 0, 0, width, height, +- GDK_RGB_DITHER_MAX, +- 0, 0); ++ gdk_cairo_set_source_pixbuf (cr, pixbuf, 0, 0); ++ cairo_rectangle (cr, 0, 0, width, height); ++ cairo_fill (cr); + + g_object_unref (G_OBJECT (pixbuf)); + } + + static void + render_vertical_func (GdkDrawable *drawable, +- GdkGC *gc, ++ cairo_t *cr, + int width, int height) + { +- render_simple (drawable, gc, width, height, META_GRADIENT_VERTICAL, FALSE); ++ render_simple (drawable, cr, width, height, META_GRADIENT_VERTICAL, FALSE); + } + + static void + render_horizontal_func (GdkDrawable *drawable, +- GdkGC *gc, ++ cairo_t *cr, + int width, int height) + { +- render_simple (drawable, gc, width, height, META_GRADIENT_HORIZONTAL, FALSE); ++ render_simple (drawable, cr, width, height, META_GRADIENT_HORIZONTAL, FALSE); + } + + static void + render_diagonal_func (GdkDrawable *drawable, +- GdkGC *gc, ++ cairo_t *cr, + int width, int height) + { +- render_simple (drawable, gc, width, height, META_GRADIENT_DIAGONAL, FALSE); ++ render_simple (drawable, cr, width, height, META_GRADIENT_DIAGONAL, FALSE); + } + + static void + render_diagonal_alpha_func (GdkDrawable *drawable, +- GdkGC *gc, ++ cairo_t *cr, + int width, int height) + { +- render_simple (drawable, gc, width, height, META_GRADIENT_DIAGONAL, TRUE); ++ render_simple (drawable, cr, width, height, META_GRADIENT_DIAGONAL, TRUE); + } + + static void + render_multi (GdkDrawable *drawable, +- GdkGC *gc, ++ cairo_t *cr, + int width, int height, + MetaGradientType type) + { +@@ -194,14 +177,9 @@ render_multi (GdkDrawable *drawable, + colors, N_COLORS, + type); + +- gdk_draw_pixbuf (drawable, +- gc, +- pixbuf, +- 0, 0, +- 0, 0, +- width, height, +- GDK_RGB_DITHER_NORMAL, +- 0, 0); ++ gdk_cairo_set_source_pixbuf (cr, pixbuf, 0, 0); ++ cairo_rectangle (cr, 0, 0, width, height); ++ cairo_fill (cr); + + g_object_unref (G_OBJECT (pixbuf)); + #undef N_COLORS +@@ -209,31 +187,31 @@ render_multi (GdkDrawable *drawable, + + static void + render_vertical_multi_func (GdkDrawable *drawable, +- GdkGC *gc, ++ cairo_t *cr, + int width, int height) + { +- render_multi (drawable, gc, width, height, META_GRADIENT_VERTICAL); ++ render_multi (drawable, cr, width, height, META_GRADIENT_VERTICAL); + } + + static void + render_horizontal_multi_func (GdkDrawable *drawable, +- GdkGC *gc, ++ cairo_t *cr, + int width, int height) + { +- render_multi (drawable, gc, width, height, META_GRADIENT_HORIZONTAL); ++ render_multi (drawable, cr, width, height, META_GRADIENT_HORIZONTAL); + } + + static void + render_diagonal_multi_func (GdkDrawable *drawable, +- GdkGC *gc, ++ cairo_t *cr, + int width, int height) + { +- render_multi (drawable, gc, width, height, META_GRADIENT_DIAGONAL); ++ render_multi (drawable, cr, width, height, META_GRADIENT_DIAGONAL); + } + + static void + render_interwoven_func (GdkDrawable *drawable, +- GdkGC *gc, ++ cairo_t *cr, + int width, int height) + { + GdkPixbuf *pixbuf; +@@ -249,14 +227,9 @@ render_interwoven_func (GdkDrawable *dra + colors, height / 10, + colors + 2, height / 14); + +- gdk_draw_pixbuf (drawable, +- gc, +- pixbuf, +- 0, 0, +- 0, 0, +- width, height, +- GDK_RGB_DITHER_NORMAL, +- 0, 0); ++ gdk_cairo_set_source_pixbuf (cr, pixbuf, 0, 0); ++ cairo_rectangle (cr, 0, 0, width, height); ++ cairo_fill (cr); + + g_object_unref (G_OBJECT (pixbuf)); + } +@@ -267,17 +240,25 @@ expose_callback (GtkWidget *widget, + gpointer data) + { + RenderGradientFunc func = data; ++ GdkWindow *window; + GtkAllocation allocation; + GtkStyle *style; ++ cairo_t *cr; + + style = gtk_widget_get_style (widget); + gtk_widget_get_allocation (widget, &allocation); + ++ window = gtk_widget_get_window (widget); ++ cr = gdk_cairo_create (window); ++ gdk_cairo_set_source_color (cr, &style->fg[gtk_widget_get_state (widget)]); ++ + (* func) (gtk_widget_get_window (widget), +- style->fg_gc[gtk_widget_get_state (widget)], ++ cr, + allocation.width, + allocation.height); + ++ cairo_destroy (cr); ++ + return TRUE; + } + +Index: mutter-2.31.5/src/ui/theme.c +=================================================================== +--- mutter-2.31.5.orig/src/ui/theme.c ++++ mutter-2.31.5/src/ui/theme.c +@@ -2922,36 +2922,6 @@ meta_draw_op_free (MetaDrawOp *op) + g_free (op); + } + +-static GdkGC* +-get_gc_for_primitive (GtkWidget *widget, +- GdkDrawable *drawable, +- MetaColorSpec *color_spec, +- const GdkRectangle *clip, +- int line_width) +-{ +- GdkGC *gc; +- GdkGCValues values; +- GdkColor color; +- +- meta_color_spec_render (color_spec, widget, &color); +- +- values.foreground = color; +- +- gdk_rgb_find_color (gdk_drawable_get_colormap (drawable), +- &values.foreground); +- +- values.line_width = line_width; +- +- gc = gdk_gc_new_with_values (drawable, &values, +- GDK_GC_FOREGROUND | GDK_GC_LINE_WIDTH); +- +- if (clip) +- gdk_gc_set_clip_rectangle (gc, +- (GdkRectangle*) clip); /* const cast */ +- +- return gc; +-} +- + static GdkPixbuf* + apply_alpha (GdkPixbuf *pixbuf, + MetaAlphaGradientSpec *spec, +@@ -2988,54 +2958,6 @@ apply_alpha (GdkPixbuf *pixb + return pixbuf; + } + +-static void +-render_pixbuf (GdkDrawable *drawable, +- const GdkRectangle *clip, +- GdkPixbuf *pixbuf, +- int x, +- int y) +-{ +- /* grumble, render_to_drawable_alpha does not accept a clip +- * mask, so we have to go through some BS +- */ +- /* FIXME once GTK 1.3.13 has been out a while we can use +- * render_to_drawable() which now does alpha with clip. +- * +- * Though the gdk_rectangle_intersect() check may be a useful +- * optimization anyway. +- */ +- GdkRectangle pixbuf_rect; +- GdkRectangle draw_rect; +- +- pixbuf_rect.x = x; +- pixbuf_rect.y = y; +- pixbuf_rect.width = gdk_pixbuf_get_width (pixbuf); +- pixbuf_rect.height = gdk_pixbuf_get_height (pixbuf); +- +- if (clip) +- { +- if (!gdk_rectangle_intersect ((GdkRectangle*)clip, +- &pixbuf_rect, &draw_rect)) +- return; +- } +- else +- { +- draw_rect = pixbuf_rect; +- } +- +- gdk_draw_pixbuf (drawable, +- NULL, +- pixbuf, +- draw_rect.x - pixbuf_rect.x, +- draw_rect.y - pixbuf_rect.y, +- draw_rect.x, draw_rect.y, +- draw_rect.width, +- draw_rect.height, +- GDK_RGB_DITHER_NORMAL, +- draw_rect.x - pixbuf_rect.x, +- draw_rect.y - pixbuf_rect.y); +-} +- + static GdkPixbuf* + pixbuf_tile (GdkPixbuf *tile, + int width, +@@ -3476,6 +3398,17 @@ fill_env (MetaPositionExprEnv *env, + env->theme = meta_current_theme; + } + ++/* This code was originally rendering anti-aliased using X primitives, and ++ * now has been switched to draw anti-aliased using cairo. In general, the ++ * closest correspondence between X rendering and cairo rendering is given ++ * by offsetting the geometry by 0.5 pixels in both directions before rendering ++ * with cairo. This is because X samples at the upper left corner of the ++ * pixel while cairo averages over the entire pixel. However, in the cases ++ * where the X rendering was an exact rectangle with no "jaggies" ++ * we need to be a bit careful about applying the offset. We want to produce ++ * the exact same pixel-aligned rectangle, rather than a rectangle with ++ * fuzz around the edges. ++ */ + static void + meta_draw_op_draw_with_env (const MetaDrawOp *op, + GtkStyle *style_gtk, +@@ -3486,7 +3419,18 @@ meta_draw_op_draw_with_env (const MetaDr + MetaRectangle rect, + MetaPositionExprEnv *env) + { +- GdkGC *gc; ++ GdkColor color; ++ cairo_t *cr; ++ ++ cr = gdk_cairo_create (drawable); ++ ++ cairo_set_line_width (cr, 1.0); ++ ++ if (clip) ++ { ++ gdk_cairo_rectangle (cr, clip); ++ cairo_clip (cr); ++ } + + switch (op->type) + { +@@ -3494,18 +3438,19 @@ meta_draw_op_draw_with_env (const MetaDr + { + int x1, x2, y1, y2; + +- gc = get_gc_for_primitive (widget, drawable, +- op->data.line.color_spec, +- clip, +- op->data.line.width); ++ meta_color_spec_render (op->data.line.color_spec, widget, &color); ++ gdk_cairo_set_source_color (cr, &color); ++ ++ if (op->data.line.width > 0) ++ cairo_set_line_width (cr, op->data.line.width); + + if (op->data.line.dash_on_length > 0 && + op->data.line.dash_off_length > 0) + { +- gint8 dash_list[2]; ++ double dash_list[2]; + dash_list[0] = op->data.line.dash_on_length; + dash_list[1] = op->data.line.dash_off_length; +- gdk_gc_set_dashes (gc, 0, dash_list, 2); ++ cairo_set_dash (cr, dash_list, 2, 0); + } + + x1 = parse_x_position_unchecked (op->data.line.x1, env); +@@ -3514,7 +3459,10 @@ meta_draw_op_draw_with_env (const MetaDr + if (!op->data.line.x2 && + !op->data.line.y2 && + op->data.line.width==0) +- gdk_draw_point (drawable, gc, x1, y1); ++ { ++ cairo_rectangle (cr, x1, y1, 1, 1); ++ cairo_fill (cr); ++ } + else + { + if (op->data.line.x2) +@@ -3527,10 +3475,34 @@ meta_draw_op_draw_with_env (const MetaDr + else + y2 = y1; + +- gdk_draw_line (drawable, gc, x1, y1, x2, y2); +- } ++ /* This is one of the cases where we are matching the exact ++ * pixel aligned rectangle produced by X. ++ */ ++ if (y1 == y2 || x1 == x2) ++ { ++ double offset = (op->data.line.width == 0 || ++ op->data.line.width % 2) ? .5 : 0; ++ /* X includes end points for lines of width 0 */ ++ double line_extend = op->data.line.width == 0 ? 1. : 0.; + +- g_object_unref (G_OBJECT (gc)); ++ if (y1 == y2) ++ { ++ cairo_move_to (cr, x1, y1 + offset); ++ cairo_line_to (cr, x2 + line_extend, y2 + offset); ++ } ++ else ++ { ++ cairo_move_to (cr, x1 + offset, y1); ++ cairo_line_to (cr, x2 + offset, y2 + line_extend); ++ } ++ } ++ else ++ { ++ cairo_move_to (cr, x1 + .5, y1 + .5); ++ cairo_line_to (cr, x2 + .5, y2 + .5); ++ } ++ cairo_stroke (cr); ++ } + } + break; + +@@ -3538,45 +3510,69 @@ meta_draw_op_draw_with_env (const MetaDr + { + int rx, ry, rwidth, rheight; + +- gc = get_gc_for_primitive (widget, drawable, +- op->data.rectangle.color_spec, +- clip, 0); ++ meta_color_spec_render (op->data.rectangle.color_spec, widget, &color); ++ gdk_cairo_set_source_color (cr, &color); + + rx = parse_x_position_unchecked (op->data.rectangle.x, env); + ry = parse_y_position_unchecked (op->data.rectangle.y, env); + rwidth = parse_size_unchecked (op->data.rectangle.width, env); + rheight = parse_size_unchecked (op->data.rectangle.height, env); + +- gdk_draw_rectangle (drawable, gc, +- op->data.rectangle.filled, +- rx, ry, rwidth, rheight); +- +- g_object_unref (G_OBJECT (gc)); ++ /* Filled and stroked rectangles are the other cases ++ * we pixel-align to X rasterization ++ */ ++ if (op->data.rectangle.filled) ++ { ++ cairo_rectangle (cr, rx, ry, rwidth, rheight); ++ cairo_fill (cr); ++ } ++ else ++ { ++ cairo_rectangle (cr, rx + .5, ry + .5, rwidth, rheight); ++ cairo_stroke (cr); ++ } + } + break; + + case META_DRAW_ARC: + { + int rx, ry, rwidth, rheight; ++ double start_angle, end_angle; ++ double center_x, center_y; + +- gc = get_gc_for_primitive (widget, drawable, +- op->data.arc.color_spec, +- clip, 0); ++ meta_color_spec_render (op->data.arc.color_spec, widget, &color); ++ gdk_cairo_set_source_color (cr, &color); + + rx = parse_x_position_unchecked (op->data.arc.x, env); + ry = parse_y_position_unchecked (op->data.arc.y, env); + rwidth = parse_size_unchecked (op->data.arc.width, env); + rheight = parse_size_unchecked (op->data.arc.height, env); + +- gdk_draw_arc (drawable, +- gc, +- op->data.arc.filled, +- rx, ry, rwidth, rheight, +- op->data.arc.start_angle * (360.0 * 64.0) - +- (90.0 * 64.0), /* start at 12 instead of 3 oclock */ +- op->data.arc.extent_angle * (360.0 * 64.0)); ++ start_angle = op->data.arc.start_angle * (M_PI / 180.) ++ - (.25 * M_PI); /* start at 12 instead of 3 oclock */ ++ end_angle = start_angle + op->data.arc.extent_angle * (M_PI / 180.); ++ center_x = rx + (double)rwidth / 2. + .5; ++ center_y = ry + (double)rheight / 2. + .5; ++ ++ cairo_save (cr); ++ ++ cairo_translate (cr, center_x, center_y); ++ cairo_scale (cr, (double)rwidth / 2., (double)rheight / 2.); + +- g_object_unref (G_OBJECT (gc)); ++ if (op->data.arc.extent_angle >= 0) ++ cairo_arc (cr, 0, 0, 1, start_angle, end_angle); ++ else ++ cairo_arc_negative (cr, 0, 0, 1, start_angle, end_angle); ++ ++ cairo_restore (cr); ++ ++ if (op->data.arc.filled) ++ { ++ cairo_line_to (cr, center_x, center_y); ++ cairo_fill (cr); ++ } ++ else ++ cairo_stroke (cr); + } + break; + +@@ -3599,15 +3595,11 @@ meta_draw_op_draw_with_env (const MetaDr + + if (!needs_alpha) + { +- gc = get_gc_for_primitive (widget, drawable, +- op->data.tint.color_spec, +- clip, 0); +- +- gdk_draw_rectangle (drawable, gc, +- TRUE, +- rx, ry, rwidth, rheight); ++ meta_color_spec_render (op->data.tint.color_spec, widget, &color); ++ gdk_cairo_set_source_color (cr, &color); + +- g_object_unref (G_OBJECT (gc)); ++ cairo_rectangle (cr, rx + .5, ry + .5, rwidth, rheight); ++ cairo_fill (cr); + } + else + { +@@ -3618,7 +3610,8 @@ meta_draw_op_draw_with_env (const MetaDr + + if (pixbuf) + { +- render_pixbuf (drawable, clip, pixbuf, rx, ry); ++ gdk_cairo_set_source_pixbuf (cr, pixbuf, rx, ry); ++ cairo_paint (cr); + + g_object_unref (G_OBJECT (pixbuf)); + } +@@ -3641,7 +3634,8 @@ meta_draw_op_draw_with_env (const MetaDr + + if (pixbuf) + { +- render_pixbuf (drawable, clip, pixbuf, rx, ry); ++ gdk_cairo_set_source_pixbuf (cr, pixbuf, rx, ry); ++ cairo_paint (cr); + + g_object_unref (G_OBJECT (pixbuf)); + } +@@ -3670,7 +3664,8 @@ meta_draw_op_draw_with_env (const MetaDr + rx = parse_x_position_unchecked (op->data.image.x, env); + ry = parse_y_position_unchecked (op->data.image.y, env); + +- render_pixbuf (drawable, clip, pixbuf, rx, ry); ++ gdk_cairo_set_source_pixbuf (cr, pixbuf, rx, ry); ++ cairo_paint (cr); + + g_object_unref (G_OBJECT (pixbuf)); + } +@@ -3753,7 +3748,8 @@ meta_draw_op_draw_with_env (const MetaDr + rx = parse_x_position_unchecked (op->data.icon.x, env); + ry = parse_y_position_unchecked (op->data.icon.y, env); + +- render_pixbuf (drawable, clip, pixbuf, rx, ry); ++ gdk_cairo_set_source_pixbuf (cr, pixbuf, rx, ry); ++ cairo_paint (cr); + + g_object_unref (G_OBJECT (pixbuf)); + } +@@ -3766,9 +3762,8 @@ meta_draw_op_draw_with_env (const MetaDr + int rx, ry; + PangoRectangle ink_rect, logical_rect; + +- gc = get_gc_for_primitive (widget, drawable, +- op->data.title.color_spec, +- clip, 0); ++ meta_color_spec_render (op->data.title.color_spec, widget, &color); ++ gdk_cairo_set_source_color (cr, &color); + + rx = parse_x_position_unchecked (op->data.title.x, env); + ry = parse_y_position_unchecked (op->data.title.y, env); +@@ -3790,7 +3785,7 @@ meta_draw_op_draw_with_env (const MetaDr + * correct for this, by reducing the ellipsization width by the overflow + * of the un-ellipsized text on the right... it's always the visual + * right we want regardless of bidi, since since the X we pass in to +- * gdk_draw_layout() is always the left edge of the line. ++ * cairo_move_to() is always the left edge of the line. + */ + right_bearing = (ink_rect.x + ink_rect.width) - (logical_rect.x + logical_rect.width); + right_bearing = MAX (right_bearing, 0); +@@ -3806,15 +3801,12 @@ meta_draw_op_draw_with_env (const MetaDr + pango_layout_set_width (info->title_layout, PANGO_SCALE * ellipsize_width); + } + +- gdk_draw_layout (drawable, gc, +- rx, ry, +- info->title_layout); ++ cairo_move_to (cr, rx, ry); ++ pango_cairo_show_layout (cr, info->title_layout); + + /* Remove any ellipsization we might have set; will short-circuit + * if the width is already -1 */ + pango_layout_set_width (info->title_layout, -1); +- +- g_object_unref (G_OBJECT (gc)); + } + break; + +@@ -3882,6 +3874,8 @@ meta_draw_op_draw_with_env (const MetaDr + } + break; + } ++ ++ cairo_destroy (cr); + } + + void +@@ -6637,7 +6631,8 @@ draw_bg_gradient_composite (const MetaTe + GDK_INTERP_BILINEAR, + 255 * alpha); + +- render_pixbuf (drawable, clip, composited, x, y); ++ gdk_cairo_set_source_pixbuf (cr, composited, x, y); ++ cairo_paint (cr); + + g_object_unref (G_OBJECT (bg_pixbuf)); + g_object_unref (G_OBJECT (fg_pixbuf)); +Index: mutter-2.31.5/src/ui/ui.c +=================================================================== +--- mutter-2.31.5.orig/src/ui/ui.c ++++ mutter-2.31.5/src/ui/ui.c +@@ -419,21 +419,17 @@ meta_image_window_set (MetaImageWindow * + int y) + { + GdkWindow *window; ++ cairo_t *cr; + + /* We use a back pixmap to avoid having to handle exposes, because + * it's really too slow for large clients being minimized, etc. + * and this way flicker is genuinely zero. + */ + +- gdk_draw_pixbuf (iw->pixmap, +- gtk_widget_get_style (iw->window)->black_gc, +- pixbuf, +- 0, 0, +- 0, 0, +- gdk_pixbuf_get_width (pixbuf), +- gdk_pixbuf_get_height (pixbuf), +- GDK_RGB_DITHER_NORMAL, +- 0, 0); ++ cr = gdk_cairo_create (iw->pixmap); ++ gdk_cairo_set_source_pixbuf (cr, pixbuf, 0, 0); ++ cairo_paint (cr); ++ cairo_destroy (cr); + + window = gtk_widget_get_window (iw->window); + +@@ -1001,7 +997,7 @@ meta_ui_get_pixbuf_from_pixmap (Pixmap + + depth = gdk_drawable_get_depth (GDK_DRAWABLE (gpmap)); + if (depth <= 24) +- cmap = gdk_screen_get_rgb_colormap (screen); ++ cmap = gdk_screen_get_system_colormap (screen); + else + cmap = gdk_screen_get_rgba_colormap (screen); + +Index: mutter-2.31.5/src/gdk-compat.h +=================================================================== +--- mutter-2.31.5.orig/src/gdk-compat.h ++++ mutter-2.31.5/src/gdk-compat.h +@@ -11,24 +11,7 @@ + + #if !GTK_CHECK_VERSION (2, 21, 1) + +-#define gdk_window_get_background(w,c) *c = GDK_WINDOW_OBJECT (w)->bg_color + #define gdk_visual_get_depth(v) GDK_VISUAL(v)->depth +-#define gdk_window_get_back_pixmap(w,p,r) \ +- G_STMT_START { \ +- GdkWindowObject *priv = GDK_WINDOW_OBJECT (w); \ +- \ +- if (p != NULL) \ +- { \ +- if (priv->bg_pixmap == GDK_PARENT_RELATIVE_BG || \ +- priv->bg_pixmap == GDK_NO_BG) \ +- *p = NULL; \ +- else \ +- *p = priv->bg_pixmap; \ +- } \ +- \ +- if (r != NULL) \ +- *r = (priv->bg_pixmap == GDK_PARENT_RELATIVE_BG); \ +- } G_STMT_END + + #endif /*GTK_CHECK_VERSION */ + diff --git a/mutter.changes b/mutter.changes index b0d21e8..a53389d 100644 --- a/mutter.changes +++ b/mutter.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Sep 2 20:48:40 UTC 2010 - dimstar@opensuse.org + +- Add mutter-gdk-cairo.patch, replace GDK Drawing API with cairo. + This fixes building with GTK3 2.90.6. + ------------------------------------------------------------------- Wed Sep 1 15:32:49 CEST 2010 - vuntz@opensuse.org diff --git a/mutter.spec b/mutter.spec index c146c28..3299633 100644 --- a/mutter.spec +++ b/mutter.spec @@ -36,6 +36,8 @@ Version: 2.31.5 Release: 1 Summary: Window and compositing manager based on Clutter Source: %{name}-%{version}.tar.bz2 +# PATCH-FIX-UPSTREAM mutter-gdk-cairo.patch dimstar@opensuse.org -- Replace GDK drawing API with cairo, upstream git commit 08cfdcd & 0839c1 +Patch0: mutter-gdk-cairo.patch Url: http://www.gnome.org BuildRoot: %{_tmppath}/%{name}-%{version}-build Requires: zenity @@ -63,6 +65,7 @@ to develop applications that require these. %lang_package %prep %setup -q +%patch0 -p1 %build %configure \ From 7e9e83b4fd5ffcba9cdb0f8ad3319c163e39a8b8244efc64cb0bf0c1dfce179b Mon Sep 17 00:00:00 2001 From: Vincent Untz Date: Thu, 9 Sep 2010 21:10:29 +0000 Subject: [PATCH 6/8] Accepting request 47648 from home:vuntz:branches:GNOME:Factory ok OBS-URL: https://build.opensuse.org/request/show/47648 OBS-URL: https://build.opensuse.org/package/show/GNOME:Factory/mutter?expand=0&rev=31 --- mutter.changes | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mutter.changes b/mutter.changes index a53389d..d7d14fe 100644 --- a/mutter.changes +++ b/mutter.changes @@ -1,7 +1,7 @@ ------------------------------------------------------------------- Thu Sep 2 20:48:40 UTC 2010 - dimstar@opensuse.org -- Add mutter-gdk-cairo.patch, replace GDK Drawing API with cairo. +- Add mutter-gdk-cairo.patch: replace GDK Drawing API with cairo. This fixes building with GTK3 2.90.6. ------------------------------------------------------------------- From 432b22787486fa265aedc9a44c0e0adde0a5e969ccd28c61bc4e61100b40620f Mon Sep 17 00:00:00 2001 From: OBS User autobuild Date: Mon, 13 Sep 2010 11:19:49 +0000 Subject: [PATCH 7/8] Accepting request 47794 from GNOME:Factory checked in (request 47794) OBS-URL: https://build.opensuse.org/request/show/47794 OBS-URL: https://build.opensuse.org/package/show/GNOME:Factory/mutter?expand=0&rev=32 --- mutter-2.29.1.tar.bz2 | 3 + mutter-2.31.5.tar.bz2 | 3 - mutter-gcc45.patch | 39 ++ mutter-gdk-cairo.patch | 1114 ---------------------------------------- mutter.changes | 85 --- mutter.spec | 16 +- 6 files changed, 50 insertions(+), 1210 deletions(-) create mode 100644 mutter-2.29.1.tar.bz2 delete mode 100644 mutter-2.31.5.tar.bz2 create mode 100644 mutter-gcc45.patch delete mode 100644 mutter-gdk-cairo.patch diff --git a/mutter-2.29.1.tar.bz2 b/mutter-2.29.1.tar.bz2 new file mode 100644 index 0000000..ea9ee8f --- /dev/null +++ b/mutter-2.29.1.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:175f3adcc5ad5c6f23772ca15c862f275fc3d9a9c3104e9146cf265847a4a10a +size 1981019 diff --git a/mutter-2.31.5.tar.bz2 b/mutter-2.31.5.tar.bz2 deleted file mode 100644 index df972f1..0000000 --- a/mutter-2.31.5.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:518df8d359acd7ec91e8ffcce1c3420fce5bcf85fefba6f4571ad3f6c419d398 -size 1992924 diff --git a/mutter-gcc45.patch b/mutter-gcc45.patch new file mode 100644 index 0000000..6a9f67c --- /dev/null +++ b/mutter-gcc45.patch @@ -0,0 +1,39 @@ +Index: mutter-2.29.0/src/core/core.c +=================================================================== +--- mutter-2.29.0.orig/src/core/core.c ++++ mutter-2.29.0/src/core/core.c +@@ -526,6 +526,9 @@ meta_core_get_menu_accelerator (MetaMenu + + switch (menu_op) + { ++ case META_MENU_OP_NONE: ++ /* No keybindings needed here */ ++ break; + case META_MENU_OP_DELETE: + name = "close"; + break; +Index: mutter-2.29.0/src/include/common.h +=================================================================== +--- mutter-2.29.0.orig/src/include/common.h ++++ mutter-2.29.0/src/include/common.h +@@ -52,6 +52,7 @@ typedef enum + + typedef enum + { ++ META_MENU_OP_NONE = 0, + META_MENU_OP_DELETE = 1 << 0, + META_MENU_OP_MINIMIZE = 1 << 1, + META_MENU_OP_UNMAXIMIZE = 1 << 2, +Index: mutter-2.29.0/src/core/window.c +=================================================================== +--- mutter-2.29.0.orig/src/core/window.c ++++ mutter-2.29.0/src/core/window.c +@@ -7157,7 +7157,7 @@ menu_callback (MetaWindowMenu *menu, + meta_window_shove_titlebar_onscreen (window); + break; + +- case 0: ++ case META_MENU_OP_NONE: + /* nothing */ + break; + diff --git a/mutter-gdk-cairo.patch b/mutter-gdk-cairo.patch deleted file mode 100644 index 503f95d..0000000 --- a/mutter-gdk-cairo.patch +++ /dev/null @@ -1,1114 +0,0 @@ -From 08cfdcd802c762b04351798e8a03524e11db637e Mon Sep 17 00:00:00 2001 -From: Florian Müllner -Date: Mon, 19 Jul 2010 15:55:00 +0000 -Subject: Replace GDK drawing API with cairo - -The GDK drawing API was deprecated/removed. - -https://bugzilla.gnome.org/show_bug.cgi?id=626583 ---- -Index: mutter-2.31.5/src/ui/draw-workspace.c -=================================================================== ---- mutter-2.31.5.orig/src/ui/draw-workspace.c -+++ mutter-2.31.5/src/ui/draw-workspace.c -@@ -180,6 +180,7 @@ wnck_draw_workspace (GtkWidget - GdkRectangle workspace_rect; - GtkStateType state; - GtkStyle *style; -+ cairo_t *cr; - - workspace_rect.x = x; - workspace_rect.y = y; -@@ -194,28 +195,21 @@ wnck_draw_workspace (GtkWidget - state = GTK_STATE_NORMAL; - - style = gtk_widget_get_style (widget); -+ cr = gdk_cairo_create (drawable); - - if (workspace_background) - { -- gdk_draw_pixbuf (drawable, -- style->dark_gc[state], -- workspace_background, -- 0, 0, -- x, y, -- -1, -1, -- GDK_RGB_DITHER_MAX, -- 0, 0); -+ gdk_cairo_set_source_pixbuf (cr, workspace_background, x, y); -+ cairo_paint (cr); - } - else - { -- cairo_t *cr; -- -- cr = gdk_cairo_create (gtk_widget_get_window (widget)); - gdk_cairo_set_source_color (cr, &style->dark[state]); - cairo_rectangle (cr, x, y, width, height); - cairo_fill (cr); -- cairo_destroy (cr); - } -+ -+ cairo_destroy (cr); - - i = 0; - while (i < n_windows) -Index: mutter-2.31.5/src/ui/frames.c -=================================================================== ---- mutter-2.31.5.orig/src/ui/frames.c -+++ mutter-2.31.5/src/ui/frames.c -@@ -2004,46 +2004,64 @@ meta_frames_destroy_event (Gtk - return TRUE; - } - --/* Cut and paste from GDK */ --static GdkGC * --get_bg_gc (GdkWindow *window, int x_offset, int y_offset) -+#if !GTK_CHECK_VERSION(2,21,6) -+/* Copied from GDK */ -+static cairo_pattern_t * -+gdk_window_get_background_pattern (GdkWindow *window) -+{ -+ GdkWindowObject *private = (GdkWindowObject *) window; -+ cairo_pattern_t *pattern; -+ -+ g_return_val_if_fail (GDK_IS_WINDOW (window), NULL); -+ -+ if (private->bg_pixmap == GDK_PARENT_RELATIVE_BG) -+ pattern = NULL; -+ else if (private->bg_pixmap != GDK_NO_BG && -+ private->bg_pixmap != NULL) -+ { -+ static cairo_user_data_key_t key; -+ cairo_surface_t *surface; -+ -+ surface = _gdk_drawable_ref_cairo_surface (private->bg_pixmap); -+ pattern = cairo_pattern_create_for_surface (surface); -+ cairo_surface_destroy (surface); -+ -+ cairo_pattern_set_extend (pattern, CAIRO_EXTEND_REPEAT); -+ cairo_pattern_set_user_data (pattern, -+ &key, -+ g_object_ref (private->bg_pixmap), -+ g_object_unref); -+ } -+ else -+ pattern = -+ cairo_pattern_create_rgb (private->bg_color.red / 65535., -+ private->bg_color.green / 65535., -+ private->bg_color.blue / 65535.); -+ } -+ -+ return pattern; -+} -+#endif -+ -+static void -+setup_bg_cr (cairo_t *cr, GdkWindow *window, int x_offset, int y_offset) - { - GdkWindow *parent = gdk_window_get_parent (window); -- GdkPixmap *back_pixmap; -- gboolean parent_relative; -- guint gc_mask = 0; -- GdkGCValues gc_values; -+ cairo_pattern_t *bg_pattern; - -- gdk_window_get_back_pixmap (window, &back_pixmap, &parent_relative); -- if (parent_relative && parent) -+ bg_pattern = gdk_window_get_background_pattern (window); -+ if (bg_pattern == NULL && parent) - { - gint window_x, window_y; - - gdk_window_get_position (window, &window_x, &window_y); -- return get_bg_gc (parent, -- x_offset + window_x, -- y_offset + window_y); -- } -- else if (back_pixmap) -- { -- gc_values.fill = GDK_TILED; -- gc_values.tile = back_pixmap; -- gc_values.ts_x_origin = x_offset; -- gc_values.ts_y_origin = y_offset; -- -- gc_mask = GDK_GC_FILL | GDK_GC_TILE | GDK_GC_TS_X_ORIGIN | GDK_GC_TS_Y_ORIGIN; -- -- return gdk_gc_new_with_values (window, &gc_values, gc_mask); -+ setup_bg_cr (cr, parent, x_offset + window_x, y_offset + window_y); - } -- else -+ else if (bg_pattern) - { -- GdkColor bg_color; -- GdkGC *gc = gdk_gc_new (window); -- -- gdk_window_get_background (window, &bg_color); -- gdk_gc_set_foreground (gc, &bg_color); -- -- return gc; -+ cairo_translate (cr, - x_offset, - y_offset); -+ cairo_set_source (cr, bg_pattern); -+ cairo_translate (cr, x_offset, y_offset); - } - } - -@@ -2052,12 +2070,16 @@ clear_backing (GdkPixmap *pixmap, - GdkWindow *window, - int xoffset, int yoffset) - { -- GdkGC *tmp_gc = get_bg_gc (window, xoffset, yoffset); -+ int width, height; -+ cairo_t *cr = gdk_cairo_create (pixmap); -+ -+ setup_bg_cr (cr, window, xoffset, yoffset); - -- gdk_draw_rectangle (pixmap, tmp_gc, TRUE, -- 0, 0, -1, -1); -+ gdk_drawable_get_size (GDK_DRAWABLE (pixmap), &width, &height); -+ cairo_rectangle (cr, 0, 0, width, height); -+ cairo_fill (cr); - -- g_object_unref (tmp_gc); -+ cairo_destroy (cr); - } - - /* Returns a pixmap with a piece of the windows frame painted on it. -@@ -2220,10 +2242,10 @@ cached_pixels_draw (CachedPixels *pixels - GdkWindow *window, - MetaRegion *region) - { -- GdkGC *gc; -+ cairo_t *cr; - int i; - -- gc = gdk_gc_new (window); -+ cr = gdk_cairo_create (window); - - for (i = 0; i < 4; i++) - { -@@ -2232,16 +2254,15 @@ cached_pixels_draw (CachedPixels *pixels - - if (piece->pixmap) - { -- gdk_draw_drawable (window, gc, piece->pixmap, -- 0, 0, -- piece->rect.x, piece->rect.y, -- -1, -1); -+ gdk_cairo_set_source_pixmap (cr, piece->pixmap, -+ piece->rect.x, piece->rect.y); -+ cairo_paint (cr); - subtract_from_region (region, piece->pixmap, - piece->rect.x, piece->rect.y); - } - } - -- g_object_unref (gc); -+ cairo_destroy (cr); - } - - static gboolean -@@ -2550,11 +2571,6 @@ meta_frames_set_window_background (MetaF - GTK_WIDGET (frames), - &color); - -- /* Fill in color.pixel */ -- -- gdk_rgb_find_color (gtk_widget_get_colormap (GTK_WIDGET (frames)), -- &color); -- - /* Set A in ARGB to window_background_alpha, if we have ARGB */ - - visual = gtk_widget_get_visual (GTK_WIDGET (frames)); -Index: mutter-2.31.5/src/ui/tabpopup.c -=================================================================== ---- mutter-2.31.5.orig/src/ui/tabpopup.c -+++ mutter-2.31.5/src/ui/tabpopup.c -@@ -83,6 +83,7 @@ outline_window_expose (GtkWidget *w - TabEntry *te; - GtkStyle *style; - GdkWindow *window; -+ cairo_t *cr; - - popup = data; - -@@ -92,20 +93,24 @@ outline_window_expose (GtkWidget *w - te = popup->current_selected_entry; - window = gtk_widget_get_window (widget); - style = gtk_widget_get_style (widget); -- -- gdk_draw_rectangle (window, -- style->white_gc, -- FALSE, -- 0, 0, -- te->rect.width - 1, -- te->rect.height - 1); -- -- gdk_draw_rectangle (window, -- style->white_gc, -- FALSE, -- te->inner_rect.x - 1, te->inner_rect.y - 1, -- te->inner_rect.width + 1, -- te->inner_rect.height + 1); -+ cr = gdk_cairo_create (window); -+ -+ cairo_set_line_width (cr, 1.0); -+ gdk_cairo_set_source_color (cr, &style->white); -+ -+ cairo_rectangle (cr, -+ 0.5, 0.5, -+ te->rect.width - 1, -+ te->rect.height - 1); -+ cairo_stroke (cr); -+ -+ cairo_rectangle (cr, -+ te->inner_rect.x - 0.5, te->inner_rect.y - 0.5, -+ te->inner_rect.width + 1, -+ te->inner_rect.height + 1); -+ cairo_stroke (cr); -+ -+ cairo_destroy (cr); - - return FALSE; - } -@@ -710,6 +715,7 @@ meta_select_image_expose_event (GtkWidge - int x, y, w, h; - gint xpad, ypad; - gfloat xalign, yalign; -+ cairo_t *cr; - - misc = GTK_MISC (widget); - -@@ -734,27 +740,28 @@ meta_select_image_expose_event (GtkWidge - window = gtk_widget_get_window (widget); - style = gtk_widget_get_style (widget); - state = gtk_widget_get_state (widget); -+ cr = gdk_cairo_create (window); - -- gdk_draw_rectangle (window, -- style->fg_gc[state], -- FALSE, -- x, y, w, h); -- gdk_draw_rectangle (window, -- style->fg_gc[state], -- FALSE, -- x - 1, y - 1, w + 2, h + 2); -- -+ cairo_set_line_width (cr, 2.0); -+ gdk_cairo_set_source_color (cr, &style->fg[state]); -+ -+ cairo_rectangle (cr, x, y, w + 1, h + 1); -+ cairo_stroke (cr); -+ -+ cairo_set_line_width (cr, 1.0); - #if 0 -- gdk_draw_rectangle (widget->window, -- widget->style->bg_gc[GTK_STATE_SELECTED], -- TRUE, -- x, y, w, h); -+ gdk_cairo_set_source_color (cr, &style->bg[GTK_STATE_SELECTED]); -+ cairo_rectangle (cr, x, y, w, h); -+ cairo_fill (cr); - #endif -+ - #if 0 - gtk_paint_focus (widget->style, widget->window, - &event->area, widget, "meta-tab-image", - x, y, w, h); - #endif -+ -+ cairo_destroy (cr); - } - - return GTK_WIDGET_CLASS (parent_class)->expose_event (widget, event); -@@ -906,6 +913,7 @@ meta_select_workspace_expose_event (GtkW - GtkAllocation allocation; - GtkStyle *style; - GdkWindow *window; -+ cairo_t *cr; - int i, n_windows; - GList *tmp, *list; - -@@ -965,20 +973,19 @@ meta_select_workspace_expose_event (GtkW - if (META_SELECT_WORKSPACE (widget)->selected) - { - style = gtk_widget_get_style (widget); -- i = SELECT_OUTLINE_WIDTH - 1; -+ cr = gdk_cairo_create (window); - -- while (i >= 0) -- { -- gdk_draw_rectangle (window, -- style->fg_gc[gtk_widget_get_state (widget)], -- FALSE, -- i, -- i, -- allocation.width - i * 2 - 1, -- allocation.height - i * 2 - 1); -+ gdk_cairo_set_source_color (cr, -+ &style->fg[gtk_widget_get_state (widget)]); -+ cairo_set_line_width (cr, SELECT_OUTLINE_WIDTH); -+ -+ cairo_rectangle (cr, -+ SELECT_OUTLINE_WIDTH / 2.0, SELECT_OUTLINE_WIDTH / 2.0, -+ allocation.width - SELECT_OUTLINE_WIDTH, -+ allocation.height - SELECT_OUTLINE_WIDTH); -+ cairo_stroke (cr); - -- --i; -- } -+ cairo_destroy (cr); - } - - return TRUE; -Index: mutter-2.31.5/src/ui/testgradient.c -=================================================================== ---- mutter-2.31.5.orig/src/ui/testgradient.c -+++ mutter-2.31.5/src/ui/testgradient.c -@@ -24,7 +24,7 @@ - #include - - typedef void (* RenderGradientFunc) (GdkDrawable *drawable, -- GdkGC *gc, -+ cairo_t *cr, - int width, - int height); - -@@ -34,28 +34,22 @@ draw_checkerboard (GdkDrawable *drawable - int height) - { - gint i, j, xcount, ycount; -- GdkGC *gc1, *gc2; -- GdkColor color; -+ GdkColor color1, color2; -+ cairo_t *cr; - - #define CHECK_SIZE 10 - #define SPACING 2 - -- /* It would be a bit more efficient to keep these -- * GC's around instead of recreating on each expose, but -- * this is the lazy/slow way. -- */ -- gc1 = gdk_gc_new (drawable); -- color.red = 30000; -- color.green = 30000; -- color.blue = 30000; -- gdk_gc_set_rgb_fg_color (gc1, &color); -- -- gc2 = gdk_gc_new (drawable); -- color.red = 50000; -- color.green = 50000; -- color.blue = 50000; -- gdk_gc_set_rgb_fg_color (gc2, &color); -- -+ color1.red = 30000; -+ color1.green = 30000; -+ color1.blue = 30000; -+ -+ color2.red = 50000; -+ color2.green = 50000; -+ color2.blue = 50000; -+ -+ cr = gdk_cairo_create (drawable); -+ - xcount = 0; - i = SPACING; - while (i < width) -@@ -64,23 +58,17 @@ draw_checkerboard (GdkDrawable *drawable - ycount = xcount % 2; /* start with even/odd depending on row */ - while (j < height) - { -- GdkGC *gc; -- - if (ycount % 2) -- gc = gc1; -+ gdk_cairo_set_source_color (cr, &color1); - else -- gc = gc2; -+ gdk_cairo_set_source_color (cr, &color2); - - /* If we're outside event->area, this will do nothing. - * It might be mildly more efficient if we handled - * the clipping ourselves, but again we're feeling lazy. - */ -- gdk_draw_rectangle (drawable, -- gc, -- TRUE, -- i, j, -- CHECK_SIZE, -- CHECK_SIZE); -+ cairo_rectangle (cr, i, j, CHECK_SIZE, CHECK_SIZE); -+ cairo_fill (cr); - - j += CHECK_SIZE + SPACING; - ++ycount; -@@ -90,13 +78,12 @@ draw_checkerboard (GdkDrawable *drawable - ++xcount; - } - -- g_object_unref (G_OBJECT (gc1)); -- g_object_unref (G_OBJECT (gc2)); -+ cairo_destroy (cr); - } - - static void - render_simple (GdkDrawable *drawable, -- GdkGC *gc, -+ cairo_t *cr, - int width, int height, - MetaGradientType type, - gboolean with_alpha) -@@ -131,52 +118,48 @@ render_simple (GdkDrawable *drawable, - draw_checkerboard (drawable, width, height); - } - -- gdk_draw_pixbuf (drawable, -- gc, -- pixbuf, -- 0, 0, -- 0, 0, width, height, -- GDK_RGB_DITHER_MAX, -- 0, 0); -+ gdk_cairo_set_source_pixbuf (cr, pixbuf, 0, 0); -+ cairo_rectangle (cr, 0, 0, width, height); -+ cairo_fill (cr); - - g_object_unref (G_OBJECT (pixbuf)); - } - - static void - render_vertical_func (GdkDrawable *drawable, -- GdkGC *gc, -+ cairo_t *cr, - int width, int height) - { -- render_simple (drawable, gc, width, height, META_GRADIENT_VERTICAL, FALSE); -+ render_simple (drawable, cr, width, height, META_GRADIENT_VERTICAL, FALSE); - } - - static void - render_horizontal_func (GdkDrawable *drawable, -- GdkGC *gc, -+ cairo_t *cr, - int width, int height) - { -- render_simple (drawable, gc, width, height, META_GRADIENT_HORIZONTAL, FALSE); -+ render_simple (drawable, cr, width, height, META_GRADIENT_HORIZONTAL, FALSE); - } - - static void - render_diagonal_func (GdkDrawable *drawable, -- GdkGC *gc, -+ cairo_t *cr, - int width, int height) - { -- render_simple (drawable, gc, width, height, META_GRADIENT_DIAGONAL, FALSE); -+ render_simple (drawable, cr, width, height, META_GRADIENT_DIAGONAL, FALSE); - } - - static void - render_diagonal_alpha_func (GdkDrawable *drawable, -- GdkGC *gc, -+ cairo_t *cr, - int width, int height) - { -- render_simple (drawable, gc, width, height, META_GRADIENT_DIAGONAL, TRUE); -+ render_simple (drawable, cr, width, height, META_GRADIENT_DIAGONAL, TRUE); - } - - static void - render_multi (GdkDrawable *drawable, -- GdkGC *gc, -+ cairo_t *cr, - int width, int height, - MetaGradientType type) - { -@@ -194,14 +177,9 @@ render_multi (GdkDrawable *drawable, - colors, N_COLORS, - type); - -- gdk_draw_pixbuf (drawable, -- gc, -- pixbuf, -- 0, 0, -- 0, 0, -- width, height, -- GDK_RGB_DITHER_NORMAL, -- 0, 0); -+ gdk_cairo_set_source_pixbuf (cr, pixbuf, 0, 0); -+ cairo_rectangle (cr, 0, 0, width, height); -+ cairo_fill (cr); - - g_object_unref (G_OBJECT (pixbuf)); - #undef N_COLORS -@@ -209,31 +187,31 @@ render_multi (GdkDrawable *drawable, - - static void - render_vertical_multi_func (GdkDrawable *drawable, -- GdkGC *gc, -+ cairo_t *cr, - int width, int height) - { -- render_multi (drawable, gc, width, height, META_GRADIENT_VERTICAL); -+ render_multi (drawable, cr, width, height, META_GRADIENT_VERTICAL); - } - - static void - render_horizontal_multi_func (GdkDrawable *drawable, -- GdkGC *gc, -+ cairo_t *cr, - int width, int height) - { -- render_multi (drawable, gc, width, height, META_GRADIENT_HORIZONTAL); -+ render_multi (drawable, cr, width, height, META_GRADIENT_HORIZONTAL); - } - - static void - render_diagonal_multi_func (GdkDrawable *drawable, -- GdkGC *gc, -+ cairo_t *cr, - int width, int height) - { -- render_multi (drawable, gc, width, height, META_GRADIENT_DIAGONAL); -+ render_multi (drawable, cr, width, height, META_GRADIENT_DIAGONAL); - } - - static void - render_interwoven_func (GdkDrawable *drawable, -- GdkGC *gc, -+ cairo_t *cr, - int width, int height) - { - GdkPixbuf *pixbuf; -@@ -249,14 +227,9 @@ render_interwoven_func (GdkDrawable *dra - colors, height / 10, - colors + 2, height / 14); - -- gdk_draw_pixbuf (drawable, -- gc, -- pixbuf, -- 0, 0, -- 0, 0, -- width, height, -- GDK_RGB_DITHER_NORMAL, -- 0, 0); -+ gdk_cairo_set_source_pixbuf (cr, pixbuf, 0, 0); -+ cairo_rectangle (cr, 0, 0, width, height); -+ cairo_fill (cr); - - g_object_unref (G_OBJECT (pixbuf)); - } -@@ -267,17 +240,25 @@ expose_callback (GtkWidget *widget, - gpointer data) - { - RenderGradientFunc func = data; -+ GdkWindow *window; - GtkAllocation allocation; - GtkStyle *style; -+ cairo_t *cr; - - style = gtk_widget_get_style (widget); - gtk_widget_get_allocation (widget, &allocation); - -+ window = gtk_widget_get_window (widget); -+ cr = gdk_cairo_create (window); -+ gdk_cairo_set_source_color (cr, &style->fg[gtk_widget_get_state (widget)]); -+ - (* func) (gtk_widget_get_window (widget), -- style->fg_gc[gtk_widget_get_state (widget)], -+ cr, - allocation.width, - allocation.height); - -+ cairo_destroy (cr); -+ - return TRUE; - } - -Index: mutter-2.31.5/src/ui/theme.c -=================================================================== ---- mutter-2.31.5.orig/src/ui/theme.c -+++ mutter-2.31.5/src/ui/theme.c -@@ -2922,36 +2922,6 @@ meta_draw_op_free (MetaDrawOp *op) - g_free (op); - } - --static GdkGC* --get_gc_for_primitive (GtkWidget *widget, -- GdkDrawable *drawable, -- MetaColorSpec *color_spec, -- const GdkRectangle *clip, -- int line_width) --{ -- GdkGC *gc; -- GdkGCValues values; -- GdkColor color; -- -- meta_color_spec_render (color_spec, widget, &color); -- -- values.foreground = color; -- -- gdk_rgb_find_color (gdk_drawable_get_colormap (drawable), -- &values.foreground); -- -- values.line_width = line_width; -- -- gc = gdk_gc_new_with_values (drawable, &values, -- GDK_GC_FOREGROUND | GDK_GC_LINE_WIDTH); -- -- if (clip) -- gdk_gc_set_clip_rectangle (gc, -- (GdkRectangle*) clip); /* const cast */ -- -- return gc; --} -- - static GdkPixbuf* - apply_alpha (GdkPixbuf *pixbuf, - MetaAlphaGradientSpec *spec, -@@ -2988,54 +2958,6 @@ apply_alpha (GdkPixbuf *pixb - return pixbuf; - } - --static void --render_pixbuf (GdkDrawable *drawable, -- const GdkRectangle *clip, -- GdkPixbuf *pixbuf, -- int x, -- int y) --{ -- /* grumble, render_to_drawable_alpha does not accept a clip -- * mask, so we have to go through some BS -- */ -- /* FIXME once GTK 1.3.13 has been out a while we can use -- * render_to_drawable() which now does alpha with clip. -- * -- * Though the gdk_rectangle_intersect() check may be a useful -- * optimization anyway. -- */ -- GdkRectangle pixbuf_rect; -- GdkRectangle draw_rect; -- -- pixbuf_rect.x = x; -- pixbuf_rect.y = y; -- pixbuf_rect.width = gdk_pixbuf_get_width (pixbuf); -- pixbuf_rect.height = gdk_pixbuf_get_height (pixbuf); -- -- if (clip) -- { -- if (!gdk_rectangle_intersect ((GdkRectangle*)clip, -- &pixbuf_rect, &draw_rect)) -- return; -- } -- else -- { -- draw_rect = pixbuf_rect; -- } -- -- gdk_draw_pixbuf (drawable, -- NULL, -- pixbuf, -- draw_rect.x - pixbuf_rect.x, -- draw_rect.y - pixbuf_rect.y, -- draw_rect.x, draw_rect.y, -- draw_rect.width, -- draw_rect.height, -- GDK_RGB_DITHER_NORMAL, -- draw_rect.x - pixbuf_rect.x, -- draw_rect.y - pixbuf_rect.y); --} -- - static GdkPixbuf* - pixbuf_tile (GdkPixbuf *tile, - int width, -@@ -3476,6 +3398,17 @@ fill_env (MetaPositionExprEnv *env, - env->theme = meta_current_theme; - } - -+/* This code was originally rendering anti-aliased using X primitives, and -+ * now has been switched to draw anti-aliased using cairo. In general, the -+ * closest correspondence between X rendering and cairo rendering is given -+ * by offsetting the geometry by 0.5 pixels in both directions before rendering -+ * with cairo. This is because X samples at the upper left corner of the -+ * pixel while cairo averages over the entire pixel. However, in the cases -+ * where the X rendering was an exact rectangle with no "jaggies" -+ * we need to be a bit careful about applying the offset. We want to produce -+ * the exact same pixel-aligned rectangle, rather than a rectangle with -+ * fuzz around the edges. -+ */ - static void - meta_draw_op_draw_with_env (const MetaDrawOp *op, - GtkStyle *style_gtk, -@@ -3486,7 +3419,18 @@ meta_draw_op_draw_with_env (const MetaDr - MetaRectangle rect, - MetaPositionExprEnv *env) - { -- GdkGC *gc; -+ GdkColor color; -+ cairo_t *cr; -+ -+ cr = gdk_cairo_create (drawable); -+ -+ cairo_set_line_width (cr, 1.0); -+ -+ if (clip) -+ { -+ gdk_cairo_rectangle (cr, clip); -+ cairo_clip (cr); -+ } - - switch (op->type) - { -@@ -3494,18 +3438,19 @@ meta_draw_op_draw_with_env (const MetaDr - { - int x1, x2, y1, y2; - -- gc = get_gc_for_primitive (widget, drawable, -- op->data.line.color_spec, -- clip, -- op->data.line.width); -+ meta_color_spec_render (op->data.line.color_spec, widget, &color); -+ gdk_cairo_set_source_color (cr, &color); -+ -+ if (op->data.line.width > 0) -+ cairo_set_line_width (cr, op->data.line.width); - - if (op->data.line.dash_on_length > 0 && - op->data.line.dash_off_length > 0) - { -- gint8 dash_list[2]; -+ double dash_list[2]; - dash_list[0] = op->data.line.dash_on_length; - dash_list[1] = op->data.line.dash_off_length; -- gdk_gc_set_dashes (gc, 0, dash_list, 2); -+ cairo_set_dash (cr, dash_list, 2, 0); - } - - x1 = parse_x_position_unchecked (op->data.line.x1, env); -@@ -3514,7 +3459,10 @@ meta_draw_op_draw_with_env (const MetaDr - if (!op->data.line.x2 && - !op->data.line.y2 && - op->data.line.width==0) -- gdk_draw_point (drawable, gc, x1, y1); -+ { -+ cairo_rectangle (cr, x1, y1, 1, 1); -+ cairo_fill (cr); -+ } - else - { - if (op->data.line.x2) -@@ -3527,10 +3475,34 @@ meta_draw_op_draw_with_env (const MetaDr - else - y2 = y1; - -- gdk_draw_line (drawable, gc, x1, y1, x2, y2); -- } -+ /* This is one of the cases where we are matching the exact -+ * pixel aligned rectangle produced by X. -+ */ -+ if (y1 == y2 || x1 == x2) -+ { -+ double offset = (op->data.line.width == 0 || -+ op->data.line.width % 2) ? .5 : 0; -+ /* X includes end points for lines of width 0 */ -+ double line_extend = op->data.line.width == 0 ? 1. : 0.; - -- g_object_unref (G_OBJECT (gc)); -+ if (y1 == y2) -+ { -+ cairo_move_to (cr, x1, y1 + offset); -+ cairo_line_to (cr, x2 + line_extend, y2 + offset); -+ } -+ else -+ { -+ cairo_move_to (cr, x1 + offset, y1); -+ cairo_line_to (cr, x2 + offset, y2 + line_extend); -+ } -+ } -+ else -+ { -+ cairo_move_to (cr, x1 + .5, y1 + .5); -+ cairo_line_to (cr, x2 + .5, y2 + .5); -+ } -+ cairo_stroke (cr); -+ } - } - break; - -@@ -3538,45 +3510,69 @@ meta_draw_op_draw_with_env (const MetaDr - { - int rx, ry, rwidth, rheight; - -- gc = get_gc_for_primitive (widget, drawable, -- op->data.rectangle.color_spec, -- clip, 0); -+ meta_color_spec_render (op->data.rectangle.color_spec, widget, &color); -+ gdk_cairo_set_source_color (cr, &color); - - rx = parse_x_position_unchecked (op->data.rectangle.x, env); - ry = parse_y_position_unchecked (op->data.rectangle.y, env); - rwidth = parse_size_unchecked (op->data.rectangle.width, env); - rheight = parse_size_unchecked (op->data.rectangle.height, env); - -- gdk_draw_rectangle (drawable, gc, -- op->data.rectangle.filled, -- rx, ry, rwidth, rheight); -- -- g_object_unref (G_OBJECT (gc)); -+ /* Filled and stroked rectangles are the other cases -+ * we pixel-align to X rasterization -+ */ -+ if (op->data.rectangle.filled) -+ { -+ cairo_rectangle (cr, rx, ry, rwidth, rheight); -+ cairo_fill (cr); -+ } -+ else -+ { -+ cairo_rectangle (cr, rx + .5, ry + .5, rwidth, rheight); -+ cairo_stroke (cr); -+ } - } - break; - - case META_DRAW_ARC: - { - int rx, ry, rwidth, rheight; -+ double start_angle, end_angle; -+ double center_x, center_y; - -- gc = get_gc_for_primitive (widget, drawable, -- op->data.arc.color_spec, -- clip, 0); -+ meta_color_spec_render (op->data.arc.color_spec, widget, &color); -+ gdk_cairo_set_source_color (cr, &color); - - rx = parse_x_position_unchecked (op->data.arc.x, env); - ry = parse_y_position_unchecked (op->data.arc.y, env); - rwidth = parse_size_unchecked (op->data.arc.width, env); - rheight = parse_size_unchecked (op->data.arc.height, env); - -- gdk_draw_arc (drawable, -- gc, -- op->data.arc.filled, -- rx, ry, rwidth, rheight, -- op->data.arc.start_angle * (360.0 * 64.0) - -- (90.0 * 64.0), /* start at 12 instead of 3 oclock */ -- op->data.arc.extent_angle * (360.0 * 64.0)); -+ start_angle = op->data.arc.start_angle * (M_PI / 180.) -+ - (.25 * M_PI); /* start at 12 instead of 3 oclock */ -+ end_angle = start_angle + op->data.arc.extent_angle * (M_PI / 180.); -+ center_x = rx + (double)rwidth / 2. + .5; -+ center_y = ry + (double)rheight / 2. + .5; -+ -+ cairo_save (cr); -+ -+ cairo_translate (cr, center_x, center_y); -+ cairo_scale (cr, (double)rwidth / 2., (double)rheight / 2.); - -- g_object_unref (G_OBJECT (gc)); -+ if (op->data.arc.extent_angle >= 0) -+ cairo_arc (cr, 0, 0, 1, start_angle, end_angle); -+ else -+ cairo_arc_negative (cr, 0, 0, 1, start_angle, end_angle); -+ -+ cairo_restore (cr); -+ -+ if (op->data.arc.filled) -+ { -+ cairo_line_to (cr, center_x, center_y); -+ cairo_fill (cr); -+ } -+ else -+ cairo_stroke (cr); - } - break; - -@@ -3599,15 +3595,11 @@ meta_draw_op_draw_with_env (const MetaDr - - if (!needs_alpha) - { -- gc = get_gc_for_primitive (widget, drawable, -- op->data.tint.color_spec, -- clip, 0); -- -- gdk_draw_rectangle (drawable, gc, -- TRUE, -- rx, ry, rwidth, rheight); -+ meta_color_spec_render (op->data.tint.color_spec, widget, &color); -+ gdk_cairo_set_source_color (cr, &color); - -- g_object_unref (G_OBJECT (gc)); -+ cairo_rectangle (cr, rx + .5, ry + .5, rwidth, rheight); -+ cairo_fill (cr); - } - else - { -@@ -3618,7 +3610,8 @@ meta_draw_op_draw_with_env (const MetaDr - - if (pixbuf) - { -- render_pixbuf (drawable, clip, pixbuf, rx, ry); -+ gdk_cairo_set_source_pixbuf (cr, pixbuf, rx, ry); -+ cairo_paint (cr); - - g_object_unref (G_OBJECT (pixbuf)); - } -@@ -3641,7 +3634,8 @@ meta_draw_op_draw_with_env (const MetaDr - - if (pixbuf) - { -- render_pixbuf (drawable, clip, pixbuf, rx, ry); -+ gdk_cairo_set_source_pixbuf (cr, pixbuf, rx, ry); -+ cairo_paint (cr); - - g_object_unref (G_OBJECT (pixbuf)); - } -@@ -3670,7 +3664,8 @@ meta_draw_op_draw_with_env (const MetaDr - rx = parse_x_position_unchecked (op->data.image.x, env); - ry = parse_y_position_unchecked (op->data.image.y, env); - -- render_pixbuf (drawable, clip, pixbuf, rx, ry); -+ gdk_cairo_set_source_pixbuf (cr, pixbuf, rx, ry); -+ cairo_paint (cr); - - g_object_unref (G_OBJECT (pixbuf)); - } -@@ -3753,7 +3748,8 @@ meta_draw_op_draw_with_env (const MetaDr - rx = parse_x_position_unchecked (op->data.icon.x, env); - ry = parse_y_position_unchecked (op->data.icon.y, env); - -- render_pixbuf (drawable, clip, pixbuf, rx, ry); -+ gdk_cairo_set_source_pixbuf (cr, pixbuf, rx, ry); -+ cairo_paint (cr); - - g_object_unref (G_OBJECT (pixbuf)); - } -@@ -3766,9 +3762,8 @@ meta_draw_op_draw_with_env (const MetaDr - int rx, ry; - PangoRectangle ink_rect, logical_rect; - -- gc = get_gc_for_primitive (widget, drawable, -- op->data.title.color_spec, -- clip, 0); -+ meta_color_spec_render (op->data.title.color_spec, widget, &color); -+ gdk_cairo_set_source_color (cr, &color); - - rx = parse_x_position_unchecked (op->data.title.x, env); - ry = parse_y_position_unchecked (op->data.title.y, env); -@@ -3790,7 +3785,7 @@ meta_draw_op_draw_with_env (const MetaDr - * correct for this, by reducing the ellipsization width by the overflow - * of the un-ellipsized text on the right... it's always the visual - * right we want regardless of bidi, since since the X we pass in to -- * gdk_draw_layout() is always the left edge of the line. -+ * cairo_move_to() is always the left edge of the line. - */ - right_bearing = (ink_rect.x + ink_rect.width) - (logical_rect.x + logical_rect.width); - right_bearing = MAX (right_bearing, 0); -@@ -3806,15 +3801,12 @@ meta_draw_op_draw_with_env (const MetaDr - pango_layout_set_width (info->title_layout, PANGO_SCALE * ellipsize_width); - } - -- gdk_draw_layout (drawable, gc, -- rx, ry, -- info->title_layout); -+ cairo_move_to (cr, rx, ry); -+ pango_cairo_show_layout (cr, info->title_layout); - - /* Remove any ellipsization we might have set; will short-circuit - * if the width is already -1 */ - pango_layout_set_width (info->title_layout, -1); -- -- g_object_unref (G_OBJECT (gc)); - } - break; - -@@ -3882,6 +3874,8 @@ meta_draw_op_draw_with_env (const MetaDr - } - break; - } -+ -+ cairo_destroy (cr); - } - - void -@@ -6637,7 +6631,8 @@ draw_bg_gradient_composite (const MetaTe - GDK_INTERP_BILINEAR, - 255 * alpha); - -- render_pixbuf (drawable, clip, composited, x, y); -+ gdk_cairo_set_source_pixbuf (cr, composited, x, y); -+ cairo_paint (cr); - - g_object_unref (G_OBJECT (bg_pixbuf)); - g_object_unref (G_OBJECT (fg_pixbuf)); -Index: mutter-2.31.5/src/ui/ui.c -=================================================================== ---- mutter-2.31.5.orig/src/ui/ui.c -+++ mutter-2.31.5/src/ui/ui.c -@@ -419,21 +419,17 @@ meta_image_window_set (MetaImageWindow * - int y) - { - GdkWindow *window; -+ cairo_t *cr; - - /* We use a back pixmap to avoid having to handle exposes, because - * it's really too slow for large clients being minimized, etc. - * and this way flicker is genuinely zero. - */ - -- gdk_draw_pixbuf (iw->pixmap, -- gtk_widget_get_style (iw->window)->black_gc, -- pixbuf, -- 0, 0, -- 0, 0, -- gdk_pixbuf_get_width (pixbuf), -- gdk_pixbuf_get_height (pixbuf), -- GDK_RGB_DITHER_NORMAL, -- 0, 0); -+ cr = gdk_cairo_create (iw->pixmap); -+ gdk_cairo_set_source_pixbuf (cr, pixbuf, 0, 0); -+ cairo_paint (cr); -+ cairo_destroy (cr); - - window = gtk_widget_get_window (iw->window); - -@@ -1001,7 +997,7 @@ meta_ui_get_pixbuf_from_pixmap (Pixmap - - depth = gdk_drawable_get_depth (GDK_DRAWABLE (gpmap)); - if (depth <= 24) -- cmap = gdk_screen_get_rgb_colormap (screen); -+ cmap = gdk_screen_get_system_colormap (screen); - else - cmap = gdk_screen_get_rgba_colormap (screen); - -Index: mutter-2.31.5/src/gdk-compat.h -=================================================================== ---- mutter-2.31.5.orig/src/gdk-compat.h -+++ mutter-2.31.5/src/gdk-compat.h -@@ -11,24 +11,7 @@ - - #if !GTK_CHECK_VERSION (2, 21, 1) - --#define gdk_window_get_background(w,c) *c = GDK_WINDOW_OBJECT (w)->bg_color - #define gdk_visual_get_depth(v) GDK_VISUAL(v)->depth --#define gdk_window_get_back_pixmap(w,p,r) \ -- G_STMT_START { \ -- GdkWindowObject *priv = GDK_WINDOW_OBJECT (w); \ -- \ -- if (p != NULL) \ -- { \ -- if (priv->bg_pixmap == GDK_PARENT_RELATIVE_BG || \ -- priv->bg_pixmap == GDK_NO_BG) \ -- *p = NULL; \ -- else \ -- *p = priv->bg_pixmap; \ -- } \ -- \ -- if (r != NULL) \ -- *r = (priv->bg_pixmap == GDK_PARENT_RELATIVE_BG); \ -- } G_STMT_END - - #endif /*GTK_CHECK_VERSION */ - diff --git a/mutter.changes b/mutter.changes index d7d14fe..7507061 100644 --- a/mutter.changes +++ b/mutter.changes @@ -1,88 +1,3 @@ -------------------------------------------------------------------- -Thu Sep 2 20:48:40 UTC 2010 - dimstar@opensuse.org - -- Add mutter-gdk-cairo.patch: replace GDK Drawing API with cairo. - This fixes building with GTK3 2.90.6. - -------------------------------------------------------------------- -Wed Sep 1 15:32:49 CEST 2010 - vuntz@opensuse.org - -- Drop gir-repository BuildRequires: the introspection files that - were needed from there are now directly with the appropriate - libraries. - -------------------------------------------------------------------- -Fri Jul 16 13:49:04 UTC 2010 - dimstar@opensuse.org - -- Update to 2.31.5: - + Support building with GTK+ 3.0 - + Remove deprecated usages for compatibility with GTK+ 3.0 - + Export a boxed type for MetaRectangle - + Allow disabling -Werror with --enable-compile-warnings=yes - + Build fixes -- Build against GTK+ 3: use gtk3-devel BuildRequires instead of - gtk2-devel and pass --with-gtk=3.0 to configure. - -------------------------------------------------------------------- -Mon Jul 5 20:40:09 CEST 2010 - dimstar@opensuse.org - -- Update to version 2.31.4: - + Clean up MutterPlugin effect interface - + Track damage as the bounding box, a significant optimizations - for rapidly drawing clients - + Add meta_window_is_remote() - + Add meta_add_debug_topic() for turning on logging of specific - topics - + Fix bug with window unmaximization - + Bugs fixed: - - bgo#611838: expose sub-stage redraws by streaming raw updates - to ClutterX11TexturePixmap - - bgo#620585: Add meta_window_is_remote - - bgo#620860: function ‘meta_display_open’ - - bgo#621082: MutterPluginManager should call - plugin->switch_workspace, when screen doesn't have any - window. Or function should be renamed. - - bgo#621413: Maximize/Unmaximize not behaving properly for - some non-gnome based programs - + Updated translations. - -------------------------------------------------------------------- -Fri May 28 21:53:59 CEST 2010 - dimstar@opensuse.org - -- Update to version 2.31.2: - + Theme enhancements - - Add a flexible version mechanism for themes - - metacity-theme-3.xml is now supported, and can include - version="> 3.2" type attributes on the root element or - any subelement. - - Add frame_x_center/frame_y_center variables - - Allow a theme to turn on title ellipsization - + Performance enhancements: - - Stream raw damage updates to ClutterX11TexturePixmap - to enable partial stage updates when windos change - - Don't trap XErrors in meta_compositor_process_event - + Add meta_prefs_override_preference_location(); this allows - a plugin like GNOME Shell to redirect preferences to a - plugin-specific location. - + Support a _MUTTER_HINTS window property; this is a string - property holding key-value pairs with plugin-specific - interpretation - + Build with GSEAL_ENABLE - + Add meta_display_get_leader_window() - + Add meta_display_sort_windows_by_stacking - + Export - meta_display_get_last_user_time() - meta_display_xserver_time_is_before() - meta_window_foreach_ancestor(), - meta_window_foreach_transient() - meta_window_lower() - meta_window_raise() - meta_window_set_demands_attention() - meta_window_unset_demands_attention() - + Bug fixes - + Build fixes -- Drop mutter-gcc45.patch, fixed upstream. - ------------------------------------------------------------------- Fri Mar 19 09:01:56 CET 2010 - dimstar@opensuse.org diff --git a/mutter.spec b/mutter.spec index 3299633..e09fef1 100644 --- a/mutter.spec +++ b/mutter.spec @@ -1,5 +1,5 @@ # -# spec file for package mutter (Version 2.31.5) +# spec file for package mutter (Version 2.29.1) # # Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany. # @@ -22,9 +22,10 @@ Name: mutter BuildRequires: clutter-devel BuildRequires: fdupes BuildRequires: gconf2-devel +BuildRequires: gir-repository BuildRequires: gnome-doc-utils-devel BuildRequires: gobject-introspection-devel -BuildRequires: gtk3-devel +BuildRequires: gtk2-devel BuildRequires: intltool BuildRequires: libcanberra-devel BuildRequires: startup-notification-devel @@ -32,12 +33,12 @@ BuildRequires: update-desktop-files BuildRequires: zenity License: GPLv2+ Group: System/GUI/GNOME -Version: 2.31.5 +Version: 2.29.1 Release: 1 Summary: Window and compositing manager based on Clutter Source: %{name}-%{version}.tar.bz2 -# PATCH-FIX-UPSTREAM mutter-gdk-cairo.patch dimstar@opensuse.org -- Replace GDK drawing API with cairo, upstream git commit 08cfdcd & 0839c1 -Patch0: mutter-gdk-cairo.patch +# PATCH-FIX-UPSTREAM mutter-gcc45.patch bgo#606719 dimstar@opensuse.org -- Fix build with GCC 4.5 +Patch1: mutter-gcc45.patch Url: http://www.gnome.org BuildRoot: %{_tmppath}/%{name}-%{version}-build Requires: zenity @@ -65,14 +66,13 @@ to develop applications that require these. %lang_package %prep %setup -q -%patch0 -p1 +%patch1 -p1 %build %configure \ --libexecdir=%{_libexecdir}/%{name} \ --disable-static \ - --disable-schemas-install \ - --with-gtk=3.0 + --disable-schemas-install %__make %{?jobs:-j%jobs} %install From f76be8bac87628eada1880690258ecb4ab8bc49e8aedb5f965871cc355de0ffb Mon Sep 17 00:00:00 2001 From: OBS User buildservice-autocommit Date: Mon, 13 Sep 2010 11:19:51 +0000 Subject: [PATCH 8/8] Updating link to change in openSUSE:Factory/mutter revision 16.0 OBS-URL: https://build.opensuse.org/package/show/GNOME:Factory/mutter?expand=0&rev=d204f8de5b403796c2605ff023386286 --- mutter-2.29.1.tar.bz2 | 3 - mutter-2.31.5.tar.bz2 | 3 + mutter-gcc45.patch | 39 -- mutter-gdk-cairo.patch | 1114 ++++++++++++++++++++++++++++++++++++++++ mutter.changes | 85 +++ mutter.spec | 16 +- 6 files changed, 1210 insertions(+), 50 deletions(-) delete mode 100644 mutter-2.29.1.tar.bz2 create mode 100644 mutter-2.31.5.tar.bz2 delete mode 100644 mutter-gcc45.patch create mode 100644 mutter-gdk-cairo.patch diff --git a/mutter-2.29.1.tar.bz2 b/mutter-2.29.1.tar.bz2 deleted file mode 100644 index ea9ee8f..0000000 --- a/mutter-2.29.1.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:175f3adcc5ad5c6f23772ca15c862f275fc3d9a9c3104e9146cf265847a4a10a -size 1981019 diff --git a/mutter-2.31.5.tar.bz2 b/mutter-2.31.5.tar.bz2 new file mode 100644 index 0000000..df972f1 --- /dev/null +++ b/mutter-2.31.5.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:518df8d359acd7ec91e8ffcce1c3420fce5bcf85fefba6f4571ad3f6c419d398 +size 1992924 diff --git a/mutter-gcc45.patch b/mutter-gcc45.patch deleted file mode 100644 index 6a9f67c..0000000 --- a/mutter-gcc45.patch +++ /dev/null @@ -1,39 +0,0 @@ -Index: mutter-2.29.0/src/core/core.c -=================================================================== ---- mutter-2.29.0.orig/src/core/core.c -+++ mutter-2.29.0/src/core/core.c -@@ -526,6 +526,9 @@ meta_core_get_menu_accelerator (MetaMenu - - switch (menu_op) - { -+ case META_MENU_OP_NONE: -+ /* No keybindings needed here */ -+ break; - case META_MENU_OP_DELETE: - name = "close"; - break; -Index: mutter-2.29.0/src/include/common.h -=================================================================== ---- mutter-2.29.0.orig/src/include/common.h -+++ mutter-2.29.0/src/include/common.h -@@ -52,6 +52,7 @@ typedef enum - - typedef enum - { -+ META_MENU_OP_NONE = 0, - META_MENU_OP_DELETE = 1 << 0, - META_MENU_OP_MINIMIZE = 1 << 1, - META_MENU_OP_UNMAXIMIZE = 1 << 2, -Index: mutter-2.29.0/src/core/window.c -=================================================================== ---- mutter-2.29.0.orig/src/core/window.c -+++ mutter-2.29.0/src/core/window.c -@@ -7157,7 +7157,7 @@ menu_callback (MetaWindowMenu *menu, - meta_window_shove_titlebar_onscreen (window); - break; - -- case 0: -+ case META_MENU_OP_NONE: - /* nothing */ - break; - diff --git a/mutter-gdk-cairo.patch b/mutter-gdk-cairo.patch new file mode 100644 index 0000000..503f95d --- /dev/null +++ b/mutter-gdk-cairo.patch @@ -0,0 +1,1114 @@ +From 08cfdcd802c762b04351798e8a03524e11db637e Mon Sep 17 00:00:00 2001 +From: Florian Müllner +Date: Mon, 19 Jul 2010 15:55:00 +0000 +Subject: Replace GDK drawing API with cairo + +The GDK drawing API was deprecated/removed. + +https://bugzilla.gnome.org/show_bug.cgi?id=626583 +--- +Index: mutter-2.31.5/src/ui/draw-workspace.c +=================================================================== +--- mutter-2.31.5.orig/src/ui/draw-workspace.c ++++ mutter-2.31.5/src/ui/draw-workspace.c +@@ -180,6 +180,7 @@ wnck_draw_workspace (GtkWidget + GdkRectangle workspace_rect; + GtkStateType state; + GtkStyle *style; ++ cairo_t *cr; + + workspace_rect.x = x; + workspace_rect.y = y; +@@ -194,28 +195,21 @@ wnck_draw_workspace (GtkWidget + state = GTK_STATE_NORMAL; + + style = gtk_widget_get_style (widget); ++ cr = gdk_cairo_create (drawable); + + if (workspace_background) + { +- gdk_draw_pixbuf (drawable, +- style->dark_gc[state], +- workspace_background, +- 0, 0, +- x, y, +- -1, -1, +- GDK_RGB_DITHER_MAX, +- 0, 0); ++ gdk_cairo_set_source_pixbuf (cr, workspace_background, x, y); ++ cairo_paint (cr); + } + else + { +- cairo_t *cr; +- +- cr = gdk_cairo_create (gtk_widget_get_window (widget)); + gdk_cairo_set_source_color (cr, &style->dark[state]); + cairo_rectangle (cr, x, y, width, height); + cairo_fill (cr); +- cairo_destroy (cr); + } ++ ++ cairo_destroy (cr); + + i = 0; + while (i < n_windows) +Index: mutter-2.31.5/src/ui/frames.c +=================================================================== +--- mutter-2.31.5.orig/src/ui/frames.c ++++ mutter-2.31.5/src/ui/frames.c +@@ -2004,46 +2004,64 @@ meta_frames_destroy_event (Gtk + return TRUE; + } + +-/* Cut and paste from GDK */ +-static GdkGC * +-get_bg_gc (GdkWindow *window, int x_offset, int y_offset) ++#if !GTK_CHECK_VERSION(2,21,6) ++/* Copied from GDK */ ++static cairo_pattern_t * ++gdk_window_get_background_pattern (GdkWindow *window) ++{ ++ GdkWindowObject *private = (GdkWindowObject *) window; ++ cairo_pattern_t *pattern; ++ ++ g_return_val_if_fail (GDK_IS_WINDOW (window), NULL); ++ ++ if (private->bg_pixmap == GDK_PARENT_RELATIVE_BG) ++ pattern = NULL; ++ else if (private->bg_pixmap != GDK_NO_BG && ++ private->bg_pixmap != NULL) ++ { ++ static cairo_user_data_key_t key; ++ cairo_surface_t *surface; ++ ++ surface = _gdk_drawable_ref_cairo_surface (private->bg_pixmap); ++ pattern = cairo_pattern_create_for_surface (surface); ++ cairo_surface_destroy (surface); ++ ++ cairo_pattern_set_extend (pattern, CAIRO_EXTEND_REPEAT); ++ cairo_pattern_set_user_data (pattern, ++ &key, ++ g_object_ref (private->bg_pixmap), ++ g_object_unref); ++ } ++ else ++ pattern = ++ cairo_pattern_create_rgb (private->bg_color.red / 65535., ++ private->bg_color.green / 65535., ++ private->bg_color.blue / 65535.); ++ } ++ ++ return pattern; ++} ++#endif ++ ++static void ++setup_bg_cr (cairo_t *cr, GdkWindow *window, int x_offset, int y_offset) + { + GdkWindow *parent = gdk_window_get_parent (window); +- GdkPixmap *back_pixmap; +- gboolean parent_relative; +- guint gc_mask = 0; +- GdkGCValues gc_values; ++ cairo_pattern_t *bg_pattern; + +- gdk_window_get_back_pixmap (window, &back_pixmap, &parent_relative); +- if (parent_relative && parent) ++ bg_pattern = gdk_window_get_background_pattern (window); ++ if (bg_pattern == NULL && parent) + { + gint window_x, window_y; + + gdk_window_get_position (window, &window_x, &window_y); +- return get_bg_gc (parent, +- x_offset + window_x, +- y_offset + window_y); +- } +- else if (back_pixmap) +- { +- gc_values.fill = GDK_TILED; +- gc_values.tile = back_pixmap; +- gc_values.ts_x_origin = x_offset; +- gc_values.ts_y_origin = y_offset; +- +- gc_mask = GDK_GC_FILL | GDK_GC_TILE | GDK_GC_TS_X_ORIGIN | GDK_GC_TS_Y_ORIGIN; +- +- return gdk_gc_new_with_values (window, &gc_values, gc_mask); ++ setup_bg_cr (cr, parent, x_offset + window_x, y_offset + window_y); + } +- else ++ else if (bg_pattern) + { +- GdkColor bg_color; +- GdkGC *gc = gdk_gc_new (window); +- +- gdk_window_get_background (window, &bg_color); +- gdk_gc_set_foreground (gc, &bg_color); +- +- return gc; ++ cairo_translate (cr, - x_offset, - y_offset); ++ cairo_set_source (cr, bg_pattern); ++ cairo_translate (cr, x_offset, y_offset); + } + } + +@@ -2052,12 +2070,16 @@ clear_backing (GdkPixmap *pixmap, + GdkWindow *window, + int xoffset, int yoffset) + { +- GdkGC *tmp_gc = get_bg_gc (window, xoffset, yoffset); ++ int width, height; ++ cairo_t *cr = gdk_cairo_create (pixmap); ++ ++ setup_bg_cr (cr, window, xoffset, yoffset); + +- gdk_draw_rectangle (pixmap, tmp_gc, TRUE, +- 0, 0, -1, -1); ++ gdk_drawable_get_size (GDK_DRAWABLE (pixmap), &width, &height); ++ cairo_rectangle (cr, 0, 0, width, height); ++ cairo_fill (cr); + +- g_object_unref (tmp_gc); ++ cairo_destroy (cr); + } + + /* Returns a pixmap with a piece of the windows frame painted on it. +@@ -2220,10 +2242,10 @@ cached_pixels_draw (CachedPixels *pixels + GdkWindow *window, + MetaRegion *region) + { +- GdkGC *gc; ++ cairo_t *cr; + int i; + +- gc = gdk_gc_new (window); ++ cr = gdk_cairo_create (window); + + for (i = 0; i < 4; i++) + { +@@ -2232,16 +2254,15 @@ cached_pixels_draw (CachedPixels *pixels + + if (piece->pixmap) + { +- gdk_draw_drawable (window, gc, piece->pixmap, +- 0, 0, +- piece->rect.x, piece->rect.y, +- -1, -1); ++ gdk_cairo_set_source_pixmap (cr, piece->pixmap, ++ piece->rect.x, piece->rect.y); ++ cairo_paint (cr); + subtract_from_region (region, piece->pixmap, + piece->rect.x, piece->rect.y); + } + } + +- g_object_unref (gc); ++ cairo_destroy (cr); + } + + static gboolean +@@ -2550,11 +2571,6 @@ meta_frames_set_window_background (MetaF + GTK_WIDGET (frames), + &color); + +- /* Fill in color.pixel */ +- +- gdk_rgb_find_color (gtk_widget_get_colormap (GTK_WIDGET (frames)), +- &color); +- + /* Set A in ARGB to window_background_alpha, if we have ARGB */ + + visual = gtk_widget_get_visual (GTK_WIDGET (frames)); +Index: mutter-2.31.5/src/ui/tabpopup.c +=================================================================== +--- mutter-2.31.5.orig/src/ui/tabpopup.c ++++ mutter-2.31.5/src/ui/tabpopup.c +@@ -83,6 +83,7 @@ outline_window_expose (GtkWidget *w + TabEntry *te; + GtkStyle *style; + GdkWindow *window; ++ cairo_t *cr; + + popup = data; + +@@ -92,20 +93,24 @@ outline_window_expose (GtkWidget *w + te = popup->current_selected_entry; + window = gtk_widget_get_window (widget); + style = gtk_widget_get_style (widget); +- +- gdk_draw_rectangle (window, +- style->white_gc, +- FALSE, +- 0, 0, +- te->rect.width - 1, +- te->rect.height - 1); +- +- gdk_draw_rectangle (window, +- style->white_gc, +- FALSE, +- te->inner_rect.x - 1, te->inner_rect.y - 1, +- te->inner_rect.width + 1, +- te->inner_rect.height + 1); ++ cr = gdk_cairo_create (window); ++ ++ cairo_set_line_width (cr, 1.0); ++ gdk_cairo_set_source_color (cr, &style->white); ++ ++ cairo_rectangle (cr, ++ 0.5, 0.5, ++ te->rect.width - 1, ++ te->rect.height - 1); ++ cairo_stroke (cr); ++ ++ cairo_rectangle (cr, ++ te->inner_rect.x - 0.5, te->inner_rect.y - 0.5, ++ te->inner_rect.width + 1, ++ te->inner_rect.height + 1); ++ cairo_stroke (cr); ++ ++ cairo_destroy (cr); + + return FALSE; + } +@@ -710,6 +715,7 @@ meta_select_image_expose_event (GtkWidge + int x, y, w, h; + gint xpad, ypad; + gfloat xalign, yalign; ++ cairo_t *cr; + + misc = GTK_MISC (widget); + +@@ -734,27 +740,28 @@ meta_select_image_expose_event (GtkWidge + window = gtk_widget_get_window (widget); + style = gtk_widget_get_style (widget); + state = gtk_widget_get_state (widget); ++ cr = gdk_cairo_create (window); + +- gdk_draw_rectangle (window, +- style->fg_gc[state], +- FALSE, +- x, y, w, h); +- gdk_draw_rectangle (window, +- style->fg_gc[state], +- FALSE, +- x - 1, y - 1, w + 2, h + 2); +- ++ cairo_set_line_width (cr, 2.0); ++ gdk_cairo_set_source_color (cr, &style->fg[state]); ++ ++ cairo_rectangle (cr, x, y, w + 1, h + 1); ++ cairo_stroke (cr); ++ ++ cairo_set_line_width (cr, 1.0); + #if 0 +- gdk_draw_rectangle (widget->window, +- widget->style->bg_gc[GTK_STATE_SELECTED], +- TRUE, +- x, y, w, h); ++ gdk_cairo_set_source_color (cr, &style->bg[GTK_STATE_SELECTED]); ++ cairo_rectangle (cr, x, y, w, h); ++ cairo_fill (cr); + #endif ++ + #if 0 + gtk_paint_focus (widget->style, widget->window, + &event->area, widget, "meta-tab-image", + x, y, w, h); + #endif ++ ++ cairo_destroy (cr); + } + + return GTK_WIDGET_CLASS (parent_class)->expose_event (widget, event); +@@ -906,6 +913,7 @@ meta_select_workspace_expose_event (GtkW + GtkAllocation allocation; + GtkStyle *style; + GdkWindow *window; ++ cairo_t *cr; + int i, n_windows; + GList *tmp, *list; + +@@ -965,20 +973,19 @@ meta_select_workspace_expose_event (GtkW + if (META_SELECT_WORKSPACE (widget)->selected) + { + style = gtk_widget_get_style (widget); +- i = SELECT_OUTLINE_WIDTH - 1; ++ cr = gdk_cairo_create (window); + +- while (i >= 0) +- { +- gdk_draw_rectangle (window, +- style->fg_gc[gtk_widget_get_state (widget)], +- FALSE, +- i, +- i, +- allocation.width - i * 2 - 1, +- allocation.height - i * 2 - 1); ++ gdk_cairo_set_source_color (cr, ++ &style->fg[gtk_widget_get_state (widget)]); ++ cairo_set_line_width (cr, SELECT_OUTLINE_WIDTH); ++ ++ cairo_rectangle (cr, ++ SELECT_OUTLINE_WIDTH / 2.0, SELECT_OUTLINE_WIDTH / 2.0, ++ allocation.width - SELECT_OUTLINE_WIDTH, ++ allocation.height - SELECT_OUTLINE_WIDTH); ++ cairo_stroke (cr); + +- --i; +- } ++ cairo_destroy (cr); + } + + return TRUE; +Index: mutter-2.31.5/src/ui/testgradient.c +=================================================================== +--- mutter-2.31.5.orig/src/ui/testgradient.c ++++ mutter-2.31.5/src/ui/testgradient.c +@@ -24,7 +24,7 @@ + #include + + typedef void (* RenderGradientFunc) (GdkDrawable *drawable, +- GdkGC *gc, ++ cairo_t *cr, + int width, + int height); + +@@ -34,28 +34,22 @@ draw_checkerboard (GdkDrawable *drawable + int height) + { + gint i, j, xcount, ycount; +- GdkGC *gc1, *gc2; +- GdkColor color; ++ GdkColor color1, color2; ++ cairo_t *cr; + + #define CHECK_SIZE 10 + #define SPACING 2 + +- /* It would be a bit more efficient to keep these +- * GC's around instead of recreating on each expose, but +- * this is the lazy/slow way. +- */ +- gc1 = gdk_gc_new (drawable); +- color.red = 30000; +- color.green = 30000; +- color.blue = 30000; +- gdk_gc_set_rgb_fg_color (gc1, &color); +- +- gc2 = gdk_gc_new (drawable); +- color.red = 50000; +- color.green = 50000; +- color.blue = 50000; +- gdk_gc_set_rgb_fg_color (gc2, &color); +- ++ color1.red = 30000; ++ color1.green = 30000; ++ color1.blue = 30000; ++ ++ color2.red = 50000; ++ color2.green = 50000; ++ color2.blue = 50000; ++ ++ cr = gdk_cairo_create (drawable); ++ + xcount = 0; + i = SPACING; + while (i < width) +@@ -64,23 +58,17 @@ draw_checkerboard (GdkDrawable *drawable + ycount = xcount % 2; /* start with even/odd depending on row */ + while (j < height) + { +- GdkGC *gc; +- + if (ycount % 2) +- gc = gc1; ++ gdk_cairo_set_source_color (cr, &color1); + else +- gc = gc2; ++ gdk_cairo_set_source_color (cr, &color2); + + /* If we're outside event->area, this will do nothing. + * It might be mildly more efficient if we handled + * the clipping ourselves, but again we're feeling lazy. + */ +- gdk_draw_rectangle (drawable, +- gc, +- TRUE, +- i, j, +- CHECK_SIZE, +- CHECK_SIZE); ++ cairo_rectangle (cr, i, j, CHECK_SIZE, CHECK_SIZE); ++ cairo_fill (cr); + + j += CHECK_SIZE + SPACING; + ++ycount; +@@ -90,13 +78,12 @@ draw_checkerboard (GdkDrawable *drawable + ++xcount; + } + +- g_object_unref (G_OBJECT (gc1)); +- g_object_unref (G_OBJECT (gc2)); ++ cairo_destroy (cr); + } + + static void + render_simple (GdkDrawable *drawable, +- GdkGC *gc, ++ cairo_t *cr, + int width, int height, + MetaGradientType type, + gboolean with_alpha) +@@ -131,52 +118,48 @@ render_simple (GdkDrawable *drawable, + draw_checkerboard (drawable, width, height); + } + +- gdk_draw_pixbuf (drawable, +- gc, +- pixbuf, +- 0, 0, +- 0, 0, width, height, +- GDK_RGB_DITHER_MAX, +- 0, 0); ++ gdk_cairo_set_source_pixbuf (cr, pixbuf, 0, 0); ++ cairo_rectangle (cr, 0, 0, width, height); ++ cairo_fill (cr); + + g_object_unref (G_OBJECT (pixbuf)); + } + + static void + render_vertical_func (GdkDrawable *drawable, +- GdkGC *gc, ++ cairo_t *cr, + int width, int height) + { +- render_simple (drawable, gc, width, height, META_GRADIENT_VERTICAL, FALSE); ++ render_simple (drawable, cr, width, height, META_GRADIENT_VERTICAL, FALSE); + } + + static void + render_horizontal_func (GdkDrawable *drawable, +- GdkGC *gc, ++ cairo_t *cr, + int width, int height) + { +- render_simple (drawable, gc, width, height, META_GRADIENT_HORIZONTAL, FALSE); ++ render_simple (drawable, cr, width, height, META_GRADIENT_HORIZONTAL, FALSE); + } + + static void + render_diagonal_func (GdkDrawable *drawable, +- GdkGC *gc, ++ cairo_t *cr, + int width, int height) + { +- render_simple (drawable, gc, width, height, META_GRADIENT_DIAGONAL, FALSE); ++ render_simple (drawable, cr, width, height, META_GRADIENT_DIAGONAL, FALSE); + } + + static void + render_diagonal_alpha_func (GdkDrawable *drawable, +- GdkGC *gc, ++ cairo_t *cr, + int width, int height) + { +- render_simple (drawable, gc, width, height, META_GRADIENT_DIAGONAL, TRUE); ++ render_simple (drawable, cr, width, height, META_GRADIENT_DIAGONAL, TRUE); + } + + static void + render_multi (GdkDrawable *drawable, +- GdkGC *gc, ++ cairo_t *cr, + int width, int height, + MetaGradientType type) + { +@@ -194,14 +177,9 @@ render_multi (GdkDrawable *drawable, + colors, N_COLORS, + type); + +- gdk_draw_pixbuf (drawable, +- gc, +- pixbuf, +- 0, 0, +- 0, 0, +- width, height, +- GDK_RGB_DITHER_NORMAL, +- 0, 0); ++ gdk_cairo_set_source_pixbuf (cr, pixbuf, 0, 0); ++ cairo_rectangle (cr, 0, 0, width, height); ++ cairo_fill (cr); + + g_object_unref (G_OBJECT (pixbuf)); + #undef N_COLORS +@@ -209,31 +187,31 @@ render_multi (GdkDrawable *drawable, + + static void + render_vertical_multi_func (GdkDrawable *drawable, +- GdkGC *gc, ++ cairo_t *cr, + int width, int height) + { +- render_multi (drawable, gc, width, height, META_GRADIENT_VERTICAL); ++ render_multi (drawable, cr, width, height, META_GRADIENT_VERTICAL); + } + + static void + render_horizontal_multi_func (GdkDrawable *drawable, +- GdkGC *gc, ++ cairo_t *cr, + int width, int height) + { +- render_multi (drawable, gc, width, height, META_GRADIENT_HORIZONTAL); ++ render_multi (drawable, cr, width, height, META_GRADIENT_HORIZONTAL); + } + + static void + render_diagonal_multi_func (GdkDrawable *drawable, +- GdkGC *gc, ++ cairo_t *cr, + int width, int height) + { +- render_multi (drawable, gc, width, height, META_GRADIENT_DIAGONAL); ++ render_multi (drawable, cr, width, height, META_GRADIENT_DIAGONAL); + } + + static void + render_interwoven_func (GdkDrawable *drawable, +- GdkGC *gc, ++ cairo_t *cr, + int width, int height) + { + GdkPixbuf *pixbuf; +@@ -249,14 +227,9 @@ render_interwoven_func (GdkDrawable *dra + colors, height / 10, + colors + 2, height / 14); + +- gdk_draw_pixbuf (drawable, +- gc, +- pixbuf, +- 0, 0, +- 0, 0, +- width, height, +- GDK_RGB_DITHER_NORMAL, +- 0, 0); ++ gdk_cairo_set_source_pixbuf (cr, pixbuf, 0, 0); ++ cairo_rectangle (cr, 0, 0, width, height); ++ cairo_fill (cr); + + g_object_unref (G_OBJECT (pixbuf)); + } +@@ -267,17 +240,25 @@ expose_callback (GtkWidget *widget, + gpointer data) + { + RenderGradientFunc func = data; ++ GdkWindow *window; + GtkAllocation allocation; + GtkStyle *style; ++ cairo_t *cr; + + style = gtk_widget_get_style (widget); + gtk_widget_get_allocation (widget, &allocation); + ++ window = gtk_widget_get_window (widget); ++ cr = gdk_cairo_create (window); ++ gdk_cairo_set_source_color (cr, &style->fg[gtk_widget_get_state (widget)]); ++ + (* func) (gtk_widget_get_window (widget), +- style->fg_gc[gtk_widget_get_state (widget)], ++ cr, + allocation.width, + allocation.height); + ++ cairo_destroy (cr); ++ + return TRUE; + } + +Index: mutter-2.31.5/src/ui/theme.c +=================================================================== +--- mutter-2.31.5.orig/src/ui/theme.c ++++ mutter-2.31.5/src/ui/theme.c +@@ -2922,36 +2922,6 @@ meta_draw_op_free (MetaDrawOp *op) + g_free (op); + } + +-static GdkGC* +-get_gc_for_primitive (GtkWidget *widget, +- GdkDrawable *drawable, +- MetaColorSpec *color_spec, +- const GdkRectangle *clip, +- int line_width) +-{ +- GdkGC *gc; +- GdkGCValues values; +- GdkColor color; +- +- meta_color_spec_render (color_spec, widget, &color); +- +- values.foreground = color; +- +- gdk_rgb_find_color (gdk_drawable_get_colormap (drawable), +- &values.foreground); +- +- values.line_width = line_width; +- +- gc = gdk_gc_new_with_values (drawable, &values, +- GDK_GC_FOREGROUND | GDK_GC_LINE_WIDTH); +- +- if (clip) +- gdk_gc_set_clip_rectangle (gc, +- (GdkRectangle*) clip); /* const cast */ +- +- return gc; +-} +- + static GdkPixbuf* + apply_alpha (GdkPixbuf *pixbuf, + MetaAlphaGradientSpec *spec, +@@ -2988,54 +2958,6 @@ apply_alpha (GdkPixbuf *pixb + return pixbuf; + } + +-static void +-render_pixbuf (GdkDrawable *drawable, +- const GdkRectangle *clip, +- GdkPixbuf *pixbuf, +- int x, +- int y) +-{ +- /* grumble, render_to_drawable_alpha does not accept a clip +- * mask, so we have to go through some BS +- */ +- /* FIXME once GTK 1.3.13 has been out a while we can use +- * render_to_drawable() which now does alpha with clip. +- * +- * Though the gdk_rectangle_intersect() check may be a useful +- * optimization anyway. +- */ +- GdkRectangle pixbuf_rect; +- GdkRectangle draw_rect; +- +- pixbuf_rect.x = x; +- pixbuf_rect.y = y; +- pixbuf_rect.width = gdk_pixbuf_get_width (pixbuf); +- pixbuf_rect.height = gdk_pixbuf_get_height (pixbuf); +- +- if (clip) +- { +- if (!gdk_rectangle_intersect ((GdkRectangle*)clip, +- &pixbuf_rect, &draw_rect)) +- return; +- } +- else +- { +- draw_rect = pixbuf_rect; +- } +- +- gdk_draw_pixbuf (drawable, +- NULL, +- pixbuf, +- draw_rect.x - pixbuf_rect.x, +- draw_rect.y - pixbuf_rect.y, +- draw_rect.x, draw_rect.y, +- draw_rect.width, +- draw_rect.height, +- GDK_RGB_DITHER_NORMAL, +- draw_rect.x - pixbuf_rect.x, +- draw_rect.y - pixbuf_rect.y); +-} +- + static GdkPixbuf* + pixbuf_tile (GdkPixbuf *tile, + int width, +@@ -3476,6 +3398,17 @@ fill_env (MetaPositionExprEnv *env, + env->theme = meta_current_theme; + } + ++/* This code was originally rendering anti-aliased using X primitives, and ++ * now has been switched to draw anti-aliased using cairo. In general, the ++ * closest correspondence between X rendering and cairo rendering is given ++ * by offsetting the geometry by 0.5 pixels in both directions before rendering ++ * with cairo. This is because X samples at the upper left corner of the ++ * pixel while cairo averages over the entire pixel. However, in the cases ++ * where the X rendering was an exact rectangle with no "jaggies" ++ * we need to be a bit careful about applying the offset. We want to produce ++ * the exact same pixel-aligned rectangle, rather than a rectangle with ++ * fuzz around the edges. ++ */ + static void + meta_draw_op_draw_with_env (const MetaDrawOp *op, + GtkStyle *style_gtk, +@@ -3486,7 +3419,18 @@ meta_draw_op_draw_with_env (const MetaDr + MetaRectangle rect, + MetaPositionExprEnv *env) + { +- GdkGC *gc; ++ GdkColor color; ++ cairo_t *cr; ++ ++ cr = gdk_cairo_create (drawable); ++ ++ cairo_set_line_width (cr, 1.0); ++ ++ if (clip) ++ { ++ gdk_cairo_rectangle (cr, clip); ++ cairo_clip (cr); ++ } + + switch (op->type) + { +@@ -3494,18 +3438,19 @@ meta_draw_op_draw_with_env (const MetaDr + { + int x1, x2, y1, y2; + +- gc = get_gc_for_primitive (widget, drawable, +- op->data.line.color_spec, +- clip, +- op->data.line.width); ++ meta_color_spec_render (op->data.line.color_spec, widget, &color); ++ gdk_cairo_set_source_color (cr, &color); ++ ++ if (op->data.line.width > 0) ++ cairo_set_line_width (cr, op->data.line.width); + + if (op->data.line.dash_on_length > 0 && + op->data.line.dash_off_length > 0) + { +- gint8 dash_list[2]; ++ double dash_list[2]; + dash_list[0] = op->data.line.dash_on_length; + dash_list[1] = op->data.line.dash_off_length; +- gdk_gc_set_dashes (gc, 0, dash_list, 2); ++ cairo_set_dash (cr, dash_list, 2, 0); + } + + x1 = parse_x_position_unchecked (op->data.line.x1, env); +@@ -3514,7 +3459,10 @@ meta_draw_op_draw_with_env (const MetaDr + if (!op->data.line.x2 && + !op->data.line.y2 && + op->data.line.width==0) +- gdk_draw_point (drawable, gc, x1, y1); ++ { ++ cairo_rectangle (cr, x1, y1, 1, 1); ++ cairo_fill (cr); ++ } + else + { + if (op->data.line.x2) +@@ -3527,10 +3475,34 @@ meta_draw_op_draw_with_env (const MetaDr + else + y2 = y1; + +- gdk_draw_line (drawable, gc, x1, y1, x2, y2); +- } ++ /* This is one of the cases where we are matching the exact ++ * pixel aligned rectangle produced by X. ++ */ ++ if (y1 == y2 || x1 == x2) ++ { ++ double offset = (op->data.line.width == 0 || ++ op->data.line.width % 2) ? .5 : 0; ++ /* X includes end points for lines of width 0 */ ++ double line_extend = op->data.line.width == 0 ? 1. : 0.; + +- g_object_unref (G_OBJECT (gc)); ++ if (y1 == y2) ++ { ++ cairo_move_to (cr, x1, y1 + offset); ++ cairo_line_to (cr, x2 + line_extend, y2 + offset); ++ } ++ else ++ { ++ cairo_move_to (cr, x1 + offset, y1); ++ cairo_line_to (cr, x2 + offset, y2 + line_extend); ++ } ++ } ++ else ++ { ++ cairo_move_to (cr, x1 + .5, y1 + .5); ++ cairo_line_to (cr, x2 + .5, y2 + .5); ++ } ++ cairo_stroke (cr); ++ } + } + break; + +@@ -3538,45 +3510,69 @@ meta_draw_op_draw_with_env (const MetaDr + { + int rx, ry, rwidth, rheight; + +- gc = get_gc_for_primitive (widget, drawable, +- op->data.rectangle.color_spec, +- clip, 0); ++ meta_color_spec_render (op->data.rectangle.color_spec, widget, &color); ++ gdk_cairo_set_source_color (cr, &color); + + rx = parse_x_position_unchecked (op->data.rectangle.x, env); + ry = parse_y_position_unchecked (op->data.rectangle.y, env); + rwidth = parse_size_unchecked (op->data.rectangle.width, env); + rheight = parse_size_unchecked (op->data.rectangle.height, env); + +- gdk_draw_rectangle (drawable, gc, +- op->data.rectangle.filled, +- rx, ry, rwidth, rheight); +- +- g_object_unref (G_OBJECT (gc)); ++ /* Filled and stroked rectangles are the other cases ++ * we pixel-align to X rasterization ++ */ ++ if (op->data.rectangle.filled) ++ { ++ cairo_rectangle (cr, rx, ry, rwidth, rheight); ++ cairo_fill (cr); ++ } ++ else ++ { ++ cairo_rectangle (cr, rx + .5, ry + .5, rwidth, rheight); ++ cairo_stroke (cr); ++ } + } + break; + + case META_DRAW_ARC: + { + int rx, ry, rwidth, rheight; ++ double start_angle, end_angle; ++ double center_x, center_y; + +- gc = get_gc_for_primitive (widget, drawable, +- op->data.arc.color_spec, +- clip, 0); ++ meta_color_spec_render (op->data.arc.color_spec, widget, &color); ++ gdk_cairo_set_source_color (cr, &color); + + rx = parse_x_position_unchecked (op->data.arc.x, env); + ry = parse_y_position_unchecked (op->data.arc.y, env); + rwidth = parse_size_unchecked (op->data.arc.width, env); + rheight = parse_size_unchecked (op->data.arc.height, env); + +- gdk_draw_arc (drawable, +- gc, +- op->data.arc.filled, +- rx, ry, rwidth, rheight, +- op->data.arc.start_angle * (360.0 * 64.0) - +- (90.0 * 64.0), /* start at 12 instead of 3 oclock */ +- op->data.arc.extent_angle * (360.0 * 64.0)); ++ start_angle = op->data.arc.start_angle * (M_PI / 180.) ++ - (.25 * M_PI); /* start at 12 instead of 3 oclock */ ++ end_angle = start_angle + op->data.arc.extent_angle * (M_PI / 180.); ++ center_x = rx + (double)rwidth / 2. + .5; ++ center_y = ry + (double)rheight / 2. + .5; ++ ++ cairo_save (cr); ++ ++ cairo_translate (cr, center_x, center_y); ++ cairo_scale (cr, (double)rwidth / 2., (double)rheight / 2.); + +- g_object_unref (G_OBJECT (gc)); ++ if (op->data.arc.extent_angle >= 0) ++ cairo_arc (cr, 0, 0, 1, start_angle, end_angle); ++ else ++ cairo_arc_negative (cr, 0, 0, 1, start_angle, end_angle); ++ ++ cairo_restore (cr); ++ ++ if (op->data.arc.filled) ++ { ++ cairo_line_to (cr, center_x, center_y); ++ cairo_fill (cr); ++ } ++ else ++ cairo_stroke (cr); + } + break; + +@@ -3599,15 +3595,11 @@ meta_draw_op_draw_with_env (const MetaDr + + if (!needs_alpha) + { +- gc = get_gc_for_primitive (widget, drawable, +- op->data.tint.color_spec, +- clip, 0); +- +- gdk_draw_rectangle (drawable, gc, +- TRUE, +- rx, ry, rwidth, rheight); ++ meta_color_spec_render (op->data.tint.color_spec, widget, &color); ++ gdk_cairo_set_source_color (cr, &color); + +- g_object_unref (G_OBJECT (gc)); ++ cairo_rectangle (cr, rx + .5, ry + .5, rwidth, rheight); ++ cairo_fill (cr); + } + else + { +@@ -3618,7 +3610,8 @@ meta_draw_op_draw_with_env (const MetaDr + + if (pixbuf) + { +- render_pixbuf (drawable, clip, pixbuf, rx, ry); ++ gdk_cairo_set_source_pixbuf (cr, pixbuf, rx, ry); ++ cairo_paint (cr); + + g_object_unref (G_OBJECT (pixbuf)); + } +@@ -3641,7 +3634,8 @@ meta_draw_op_draw_with_env (const MetaDr + + if (pixbuf) + { +- render_pixbuf (drawable, clip, pixbuf, rx, ry); ++ gdk_cairo_set_source_pixbuf (cr, pixbuf, rx, ry); ++ cairo_paint (cr); + + g_object_unref (G_OBJECT (pixbuf)); + } +@@ -3670,7 +3664,8 @@ meta_draw_op_draw_with_env (const MetaDr + rx = parse_x_position_unchecked (op->data.image.x, env); + ry = parse_y_position_unchecked (op->data.image.y, env); + +- render_pixbuf (drawable, clip, pixbuf, rx, ry); ++ gdk_cairo_set_source_pixbuf (cr, pixbuf, rx, ry); ++ cairo_paint (cr); + + g_object_unref (G_OBJECT (pixbuf)); + } +@@ -3753,7 +3748,8 @@ meta_draw_op_draw_with_env (const MetaDr + rx = parse_x_position_unchecked (op->data.icon.x, env); + ry = parse_y_position_unchecked (op->data.icon.y, env); + +- render_pixbuf (drawable, clip, pixbuf, rx, ry); ++ gdk_cairo_set_source_pixbuf (cr, pixbuf, rx, ry); ++ cairo_paint (cr); + + g_object_unref (G_OBJECT (pixbuf)); + } +@@ -3766,9 +3762,8 @@ meta_draw_op_draw_with_env (const MetaDr + int rx, ry; + PangoRectangle ink_rect, logical_rect; + +- gc = get_gc_for_primitive (widget, drawable, +- op->data.title.color_spec, +- clip, 0); ++ meta_color_spec_render (op->data.title.color_spec, widget, &color); ++ gdk_cairo_set_source_color (cr, &color); + + rx = parse_x_position_unchecked (op->data.title.x, env); + ry = parse_y_position_unchecked (op->data.title.y, env); +@@ -3790,7 +3785,7 @@ meta_draw_op_draw_with_env (const MetaDr + * correct for this, by reducing the ellipsization width by the overflow + * of the un-ellipsized text on the right... it's always the visual + * right we want regardless of bidi, since since the X we pass in to +- * gdk_draw_layout() is always the left edge of the line. ++ * cairo_move_to() is always the left edge of the line. + */ + right_bearing = (ink_rect.x + ink_rect.width) - (logical_rect.x + logical_rect.width); + right_bearing = MAX (right_bearing, 0); +@@ -3806,15 +3801,12 @@ meta_draw_op_draw_with_env (const MetaDr + pango_layout_set_width (info->title_layout, PANGO_SCALE * ellipsize_width); + } + +- gdk_draw_layout (drawable, gc, +- rx, ry, +- info->title_layout); ++ cairo_move_to (cr, rx, ry); ++ pango_cairo_show_layout (cr, info->title_layout); + + /* Remove any ellipsization we might have set; will short-circuit + * if the width is already -1 */ + pango_layout_set_width (info->title_layout, -1); +- +- g_object_unref (G_OBJECT (gc)); + } + break; + +@@ -3882,6 +3874,8 @@ meta_draw_op_draw_with_env (const MetaDr + } + break; + } ++ ++ cairo_destroy (cr); + } + + void +@@ -6637,7 +6631,8 @@ draw_bg_gradient_composite (const MetaTe + GDK_INTERP_BILINEAR, + 255 * alpha); + +- render_pixbuf (drawable, clip, composited, x, y); ++ gdk_cairo_set_source_pixbuf (cr, composited, x, y); ++ cairo_paint (cr); + + g_object_unref (G_OBJECT (bg_pixbuf)); + g_object_unref (G_OBJECT (fg_pixbuf)); +Index: mutter-2.31.5/src/ui/ui.c +=================================================================== +--- mutter-2.31.5.orig/src/ui/ui.c ++++ mutter-2.31.5/src/ui/ui.c +@@ -419,21 +419,17 @@ meta_image_window_set (MetaImageWindow * + int y) + { + GdkWindow *window; ++ cairo_t *cr; + + /* We use a back pixmap to avoid having to handle exposes, because + * it's really too slow for large clients being minimized, etc. + * and this way flicker is genuinely zero. + */ + +- gdk_draw_pixbuf (iw->pixmap, +- gtk_widget_get_style (iw->window)->black_gc, +- pixbuf, +- 0, 0, +- 0, 0, +- gdk_pixbuf_get_width (pixbuf), +- gdk_pixbuf_get_height (pixbuf), +- GDK_RGB_DITHER_NORMAL, +- 0, 0); ++ cr = gdk_cairo_create (iw->pixmap); ++ gdk_cairo_set_source_pixbuf (cr, pixbuf, 0, 0); ++ cairo_paint (cr); ++ cairo_destroy (cr); + + window = gtk_widget_get_window (iw->window); + +@@ -1001,7 +997,7 @@ meta_ui_get_pixbuf_from_pixmap (Pixmap + + depth = gdk_drawable_get_depth (GDK_DRAWABLE (gpmap)); + if (depth <= 24) +- cmap = gdk_screen_get_rgb_colormap (screen); ++ cmap = gdk_screen_get_system_colormap (screen); + else + cmap = gdk_screen_get_rgba_colormap (screen); + +Index: mutter-2.31.5/src/gdk-compat.h +=================================================================== +--- mutter-2.31.5.orig/src/gdk-compat.h ++++ mutter-2.31.5/src/gdk-compat.h +@@ -11,24 +11,7 @@ + + #if !GTK_CHECK_VERSION (2, 21, 1) + +-#define gdk_window_get_background(w,c) *c = GDK_WINDOW_OBJECT (w)->bg_color + #define gdk_visual_get_depth(v) GDK_VISUAL(v)->depth +-#define gdk_window_get_back_pixmap(w,p,r) \ +- G_STMT_START { \ +- GdkWindowObject *priv = GDK_WINDOW_OBJECT (w); \ +- \ +- if (p != NULL) \ +- { \ +- if (priv->bg_pixmap == GDK_PARENT_RELATIVE_BG || \ +- priv->bg_pixmap == GDK_NO_BG) \ +- *p = NULL; \ +- else \ +- *p = priv->bg_pixmap; \ +- } \ +- \ +- if (r != NULL) \ +- *r = (priv->bg_pixmap == GDK_PARENT_RELATIVE_BG); \ +- } G_STMT_END + + #endif /*GTK_CHECK_VERSION */ + diff --git a/mutter.changes b/mutter.changes index 7507061..d7d14fe 100644 --- a/mutter.changes +++ b/mutter.changes @@ -1,3 +1,88 @@ +------------------------------------------------------------------- +Thu Sep 2 20:48:40 UTC 2010 - dimstar@opensuse.org + +- Add mutter-gdk-cairo.patch: replace GDK Drawing API with cairo. + This fixes building with GTK3 2.90.6. + +------------------------------------------------------------------- +Wed Sep 1 15:32:49 CEST 2010 - vuntz@opensuse.org + +- Drop gir-repository BuildRequires: the introspection files that + were needed from there are now directly with the appropriate + libraries. + +------------------------------------------------------------------- +Fri Jul 16 13:49:04 UTC 2010 - dimstar@opensuse.org + +- Update to 2.31.5: + + Support building with GTK+ 3.0 + + Remove deprecated usages for compatibility with GTK+ 3.0 + + Export a boxed type for MetaRectangle + + Allow disabling -Werror with --enable-compile-warnings=yes + + Build fixes +- Build against GTK+ 3: use gtk3-devel BuildRequires instead of + gtk2-devel and pass --with-gtk=3.0 to configure. + +------------------------------------------------------------------- +Mon Jul 5 20:40:09 CEST 2010 - dimstar@opensuse.org + +- Update to version 2.31.4: + + Clean up MutterPlugin effect interface + + Track damage as the bounding box, a significant optimizations + for rapidly drawing clients + + Add meta_window_is_remote() + + Add meta_add_debug_topic() for turning on logging of specific + topics + + Fix bug with window unmaximization + + Bugs fixed: + - bgo#611838: expose sub-stage redraws by streaming raw updates + to ClutterX11TexturePixmap + - bgo#620585: Add meta_window_is_remote + - bgo#620860: function ‘meta_display_open’ + - bgo#621082: MutterPluginManager should call + plugin->switch_workspace, when screen doesn't have any + window. Or function should be renamed. + - bgo#621413: Maximize/Unmaximize not behaving properly for + some non-gnome based programs + + Updated translations. + +------------------------------------------------------------------- +Fri May 28 21:53:59 CEST 2010 - dimstar@opensuse.org + +- Update to version 2.31.2: + + Theme enhancements + - Add a flexible version mechanism for themes - + metacity-theme-3.xml is now supported, and can include + version="> 3.2" type attributes on the root element or + any subelement. + - Add frame_x_center/frame_y_center variables + - Allow a theme to turn on title ellipsization + + Performance enhancements: + - Stream raw damage updates to ClutterX11TexturePixmap + to enable partial stage updates when windos change + - Don't trap XErrors in meta_compositor_process_event + + Add meta_prefs_override_preference_location(); this allows + a plugin like GNOME Shell to redirect preferences to a + plugin-specific location. + + Support a _MUTTER_HINTS window property; this is a string + property holding key-value pairs with plugin-specific + interpretation + + Build with GSEAL_ENABLE + + Add meta_display_get_leader_window() + + Add meta_display_sort_windows_by_stacking + + Export + meta_display_get_last_user_time() + meta_display_xserver_time_is_before() + meta_window_foreach_ancestor(), + meta_window_foreach_transient() + meta_window_lower() + meta_window_raise() + meta_window_set_demands_attention() + meta_window_unset_demands_attention() + + Bug fixes + + Build fixes +- Drop mutter-gcc45.patch, fixed upstream. + ------------------------------------------------------------------- Fri Mar 19 09:01:56 CET 2010 - dimstar@opensuse.org diff --git a/mutter.spec b/mutter.spec index e09fef1..3299633 100644 --- a/mutter.spec +++ b/mutter.spec @@ -1,5 +1,5 @@ # -# spec file for package mutter (Version 2.29.1) +# spec file for package mutter (Version 2.31.5) # # Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany. # @@ -22,10 +22,9 @@ Name: mutter BuildRequires: clutter-devel BuildRequires: fdupes BuildRequires: gconf2-devel -BuildRequires: gir-repository BuildRequires: gnome-doc-utils-devel BuildRequires: gobject-introspection-devel -BuildRequires: gtk2-devel +BuildRequires: gtk3-devel BuildRequires: intltool BuildRequires: libcanberra-devel BuildRequires: startup-notification-devel @@ -33,12 +32,12 @@ BuildRequires: update-desktop-files BuildRequires: zenity License: GPLv2+ Group: System/GUI/GNOME -Version: 2.29.1 +Version: 2.31.5 Release: 1 Summary: Window and compositing manager based on Clutter Source: %{name}-%{version}.tar.bz2 -# PATCH-FIX-UPSTREAM mutter-gcc45.patch bgo#606719 dimstar@opensuse.org -- Fix build with GCC 4.5 -Patch1: mutter-gcc45.patch +# PATCH-FIX-UPSTREAM mutter-gdk-cairo.patch dimstar@opensuse.org -- Replace GDK drawing API with cairo, upstream git commit 08cfdcd & 0839c1 +Patch0: mutter-gdk-cairo.patch Url: http://www.gnome.org BuildRoot: %{_tmppath}/%{name}-%{version}-build Requires: zenity @@ -66,13 +65,14 @@ to develop applications that require these. %lang_package %prep %setup -q -%patch1 -p1 +%patch0 -p1 %build %configure \ --libexecdir=%{_libexecdir}/%{name} \ --disable-static \ - --disable-schemas-install + --disable-schemas-install \ + --with-gtk=3.0 %__make %{?jobs:-j%jobs} %install