From 7b2037542cb5f86f029678f0f55dd3fe444a852c660bc5127add3fe3948059c0 Mon Sep 17 00:00:00 2001 From: Vincent Untz Date: Wed, 15 Dec 2010 14:45:05 +0000 Subject: [PATCH] Accepting request 55899 from home:dimstar:branches:GNOME:Factory thanks OBS-URL: https://build.opensuse.org/request/show/55899 OBS-URL: https://build.opensuse.org/package/show/GNOME:Factory/mutter?expand=0&rev=43 --- mutter-gdk_functions.patch | 73 ++++++++ mutter-gtk_states.patch | 50 ++++++ mutter-port-testgradients-to-gtk3.patch | 211 ++++++++++++++++++++++++ mutter.changes | 8 + mutter.spec | 9 + 5 files changed, 351 insertions(+) create mode 100644 mutter-gdk_functions.patch create mode 100644 mutter-gtk_states.patch create mode 100644 mutter-port-testgradients-to-gtk3.patch diff --git a/mutter-gdk_functions.patch b/mutter-gdk_functions.patch new file mode 100644 index 0000000..432a976 --- /dev/null +++ b/mutter-gdk_functions.patch @@ -0,0 +1,73 @@ +From 8994e621f720ca1897d86596564dc8e9316b052d Mon Sep 17 00:00:00 2001 +From: Benjamin Otte +Date: Thu, 02 Dec 2010 14:51:36 +0000 +Subject: Replace some GDK X11 calls with future-proof ones + +GTK is about to clean up its code and remove duplicate macros and +GdkDrawable usage. To prepare for that landing, we use the future-safe +versions of the same calls. + +https://bugzilla.gnome.org/show_bug.cgi?id=636302 +--- +diff --git a/src/tools/mutter-window-demo.c b/src/tools/mutter-window-demo.c +index 5e8c5ca..2b8991e 100644 +--- a/src/tools/mutter-window-demo.c ++++ b/src/tools/mutter-window-demo.c +@@ -51,7 +51,7 @@ set_gdk_window_struts (GdkWindow *window, + vals[11] = 800; + + XChangeProperty (GDK_WINDOW_XDISPLAY (window), +- GDK_WINDOW_XWINDOW (window), ++ GDK_WINDOW_XID (window), + XInternAtom (GDK_WINDOW_XDISPLAY (window), + "_NET_WM_STRUT_PARTIAL", False), + XA_CARDINAL, 32, PropModeReplace, +@@ -125,7 +125,7 @@ set_gdk_window_type (GdkWindow *window, + type, False); + + XChangeProperty (GDK_WINDOW_XDISPLAY (window), +- GDK_WINDOW_XWINDOW (window), ++ GDK_WINDOW_XID (window), + XInternAtom (GDK_WINDOW_XDISPLAY (window), "_NET_WM_WINDOW_TYPE", False), + XA_ATOM, 32, PropModeReplace, + (guchar *)atoms, +diff --git a/src/ui/menu.c b/src/ui/menu.c +index 02f14d8..18324cb 100644 +--- a/src/ui/menu.c ++++ b/src/ui/menu.c +@@ -401,10 +401,10 @@ meta_window_menu_new (MetaFrames *frames, + n_workspaces, active_workspace); + + window = gtk_widget_get_window (GTK_WIDGET (frames)); +- display = gdk_x11_drawable_get_xdisplay (window); ++ display = GDK_WINDOW_XDISPLAY (window); + + screen = gdk_window_get_screen (window); +- xroot = GDK_DRAWABLE_XID (gdk_screen_get_root_window (screen)); ++ xroot = GDK_WINDOW_XID (gdk_screen_get_root_window (screen)); + + submenu = gtk_menu_new (); + +diff --git a/src/ui/tile-preview.c b/src/ui/tile-preview.c +index 214e1fa..3a0bbbd 100644 +--- a/src/ui/tile-preview.c ++++ b/src/ui/tile-preview.c +@@ -195,7 +195,7 @@ meta_tile_preview_show (MetaTilePreview *preview, + gtk_widget_show (preview->preview_window); + window = gtk_widget_get_window (preview->preview_window); + meta_core_lower_beneath_focus_window (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), +- GDK_WINDOW_XWINDOW (window), ++ GDK_WINDOW_XID (window), + gtk_get_current_event_time ()); + + old_rect.x = old_rect.y = 0; +@@ -254,5 +254,5 @@ meta_tile_preview_get_xwindow (MetaTilePreview *preview, + if (create_serial) + *create_serial = preview->create_serial; + +- return GDK_WINDOW_XWINDOW (window); ++ return GDK_WINDOW_XID (window); + } +-- +cgit v0.8.3.1 + diff --git a/mutter-gtk_states.patch b/mutter-gtk_states.patch new file mode 100644 index 0000000..dbc9416 --- /dev/null +++ b/mutter-gtk_states.patch @@ -0,0 +1,50 @@ +From 544c8edd9e06e3144e36f89e847585cfe2f779f4 Mon Sep 17 00:00:00 2001 +From: Colin Walters +Date: Sat, 04 Dec 2010 22:19:44 +0000 +Subject: theme: Handle new GTK+ states + +--- +diff --git a/src/ui/theme.c b/src/ui/theme.c +index f7ac4aa..1de6b62 100644 +--- a/src/ui/theme.c ++++ b/src/ui/theme.c +@@ -6089,16 +6089,20 @@ meta_gradient_type_to_string (MetaGradientType type) + GtkStateType + meta_gtk_state_from_string (const char *str) + { +- if (strcmp ("normal", str) == 0 || strcmp ("NORMAL", str) == 0) ++ if (g_ascii_strcasecmp ("normal", str) == 0) + return GTK_STATE_NORMAL; +- else if (strcmp ("prelight", str) == 0 || strcmp ("PRELIGHT", str) == 0) ++ else if (g_ascii_strcasecmp ("prelight", str) == 0) + return GTK_STATE_PRELIGHT; +- else if (strcmp ("active", str) == 0 || strcmp ("ACTIVE", str) == 0) ++ else if (g_ascii_strcasecmp ("active", str) == 0) + return GTK_STATE_ACTIVE; +- else if (strcmp ("selected", str) == 0 || strcmp ("SELECTED", str) == 0) ++ else if (g_ascii_strcasecmp ("selected", str) == 0) + return GTK_STATE_SELECTED; +- else if (strcmp ("insensitive", str) == 0 || strcmp ("INSENSITIVE", str) == 0) ++ else if (g_ascii_strcasecmp ("insensitive", str) == 0) + return GTK_STATE_INSENSITIVE; ++ else if (g_ascii_strcasecmp ("inconsistent", str) == 0) ++ return GTK_STATE_INCONSISTENT; ++ else if (g_ascii_strcasecmp ("focused", str) == 0) ++ return GTK_STATE_FOCUSED; + else + return -1; /* hack */ + } +@@ -6118,6 +6122,10 @@ meta_gtk_state_to_string (GtkStateType state) + return "SELECTED"; + case GTK_STATE_INSENSITIVE: + return "INSENSITIVE"; ++ case GTK_STATE_INCONSISTENT: ++ return "INCONSISTENT"; ++ case GTK_STATE_FOCUSED: ++ return "FOCUSED"; + } + + return ""; +-- +cgit v0.8.3.1 + diff --git a/mutter-port-testgradients-to-gtk3.patch b/mutter-port-testgradients-to-gtk3.patch new file mode 100644 index 0000000..999c874 --- /dev/null +++ b/mutter-port-testgradients-to-gtk3.patch @@ -0,0 +1,211 @@ +From d746591894d6de2c334361ddb10de1f4219c3859 Mon Sep 17 00:00:00 2001 +From: Benjamin Otte +Date: Thu, 02 Dec 2010 14:50:02 +0000 +Subject: ui: Port testgradient example to GTK3 + +https://bugzilla.gnome.org/show_bug.cgi?id=636301 +--- +diff --git a/src/ui/testgradient.c b/src/ui/testgradient.c +index 2158984..eb20fa9 100644 +--- a/src/ui/testgradient.c ++++ b/src/ui/testgradient.c +@@ -23,19 +23,17 @@ + #include "gradient.h" + #include + +-typedef void (* RenderGradientFunc) (GdkDrawable *drawable, +- cairo_t *cr, ++typedef void (* RenderGradientFunc) (cairo_t *cr, + int width, + int height); + + static void +-draw_checkerboard (GdkDrawable *drawable, +- int width, +- int height) ++draw_checkerboard (cairo_t *cr, ++ int width, ++ int height) + { + gint i, j, xcount, ycount; + GdkColor color1, color2; +- cairo_t *cr; + + #define CHECK_SIZE 10 + #define SPACING 2 +@@ -48,8 +46,6 @@ draw_checkerboard (GdkDrawable *drawable, + color2.green = 50000; + color2.blue = 50000; + +- cr = gdk_cairo_create (drawable); +- + xcount = 0; + i = SPACING; + while (i < width) +@@ -77,13 +73,10 @@ draw_checkerboard (GdkDrawable *drawable, + i += CHECK_SIZE + SPACING; + ++xcount; + } +- +- cairo_destroy (cr); + } + + static void +-render_simple (GdkDrawable *drawable, +- cairo_t *cr, ++render_simple (cairo_t *cr, + int width, int height, + MetaGradientType type, + gboolean with_alpha) +@@ -115,7 +108,7 @@ render_simple (GdkDrawable *drawable, + alphas, G_N_ELEMENTS (alphas), + META_GRADIENT_HORIZONTAL); + +- draw_checkerboard (drawable, width, height); ++ draw_checkerboard (cr , width, height); + } + + gdk_cairo_set_source_pixbuf (cr, pixbuf, 0, 0); +@@ -126,40 +119,35 @@ render_simple (GdkDrawable *drawable, + } + + static void +-render_vertical_func (GdkDrawable *drawable, +- cairo_t *cr, ++render_vertical_func (cairo_t *cr, + int width, int height) + { +- render_simple (drawable, cr, width, height, META_GRADIENT_VERTICAL, FALSE); ++ render_simple (cr, width, height, META_GRADIENT_VERTICAL, FALSE); + } + + static void +-render_horizontal_func (GdkDrawable *drawable, +- cairo_t *cr, ++render_horizontal_func (cairo_t *cr, + int width, int height) + { +- render_simple (drawable, cr, width, height, META_GRADIENT_HORIZONTAL, FALSE); ++ render_simple (cr, width, height, META_GRADIENT_HORIZONTAL, FALSE); + } + + static void +-render_diagonal_func (GdkDrawable *drawable, +- cairo_t *cr, ++render_diagonal_func (cairo_t *cr, + int width, int height) + { +- render_simple (drawable, cr, width, height, META_GRADIENT_DIAGONAL, FALSE); ++ render_simple (cr, width, height, META_GRADIENT_DIAGONAL, FALSE); + } + + static void +-render_diagonal_alpha_func (GdkDrawable *drawable, +- cairo_t *cr, ++render_diagonal_alpha_func (cairo_t *cr, + int width, int height) + { +- render_simple (drawable, cr, width, height, META_GRADIENT_DIAGONAL, TRUE); ++ render_simple (cr, width, height, META_GRADIENT_DIAGONAL, TRUE); + } + + static void +-render_multi (GdkDrawable *drawable, +- cairo_t *cr, ++render_multi (cairo_t *cr, + int width, int height, + MetaGradientType type) + { +@@ -186,32 +174,28 @@ render_multi (GdkDrawable *drawable, + } + + static void +-render_vertical_multi_func (GdkDrawable *drawable, +- cairo_t *cr, ++render_vertical_multi_func (cairo_t *cr, + int width, int height) + { +- render_multi (drawable, cr, width, height, META_GRADIENT_VERTICAL); ++ render_multi (cr, width, height, META_GRADIENT_VERTICAL); + } + + static void +-render_horizontal_multi_func (GdkDrawable *drawable, +- cairo_t *cr, ++render_horizontal_multi_func (cairo_t *cr, + int width, int height) + { +- render_multi (drawable, cr, width, height, META_GRADIENT_HORIZONTAL); ++ render_multi (cr, width, height, META_GRADIENT_HORIZONTAL); + } + + static void +-render_diagonal_multi_func (GdkDrawable *drawable, +- cairo_t *cr, ++render_diagonal_multi_func (cairo_t *cr, + int width, int height) + { +- render_multi (drawable, cr, width, height, META_GRADIENT_DIAGONAL); ++ render_multi (cr, width, height, META_GRADIENT_DIAGONAL); + } + + static void +-render_interwoven_func (GdkDrawable *drawable, +- cairo_t *cr, ++render_interwoven_func (cairo_t *cr, + int width, int height) + { + GdkPixbuf *pixbuf; +@@ -235,31 +219,22 @@ render_interwoven_func (GdkDrawable *drawable, + } + + static gboolean +-expose_callback (GtkWidget *widget, +- GdkEventExpose *event, +- gpointer data) ++draw_callback (GtkWidget *widget, ++ cairo_t *cr, ++ 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), +- cr, +- allocation.width, +- allocation.height); +- +- cairo_destroy (cr); ++ (* func) (cr, ++ gtk_widget_get_allocated_width (widget), ++ gtk_widget_get_allocated_height (widget)); + +- return TRUE; ++ return FALSE; + } + + static GtkWidget* +@@ -280,8 +255,8 @@ create_gradient_window (const char *title, + gtk_window_set_default_size (GTK_WINDOW (window), 175, 175); + + g_signal_connect (G_OBJECT (drawing_area), +- "expose_event", +- G_CALLBACK (expose_callback), ++ "draw", ++ G_CALLBACK (draw_callback), + func); + + gtk_container_add (GTK_CONTAINER (window), drawing_area); +-- +cgit v0.8.3.1 + diff --git a/mutter.changes b/mutter.changes index 9311318..f978660 100644 --- a/mutter.changes +++ b/mutter.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Tue Dec 14 08:42:01 UTC 2010 - dimstar@opensuse.org + +- Add patches from upstream git to fix build with latest gtk3L: + + mutter-gdk_functions.patch: commit 8994e6 + + mutter-port-testgradients-to-gtk3.patch: commit d74659 + + mutter-gtk_states.patch: commit 544c8. + ------------------------------------------------------------------- Tue Nov 30 12:45:03 CET 2010 - dimstar@opensuse.org diff --git a/mutter.spec b/mutter.spec index 83d8304..9703405 100644 --- a/mutter.spec +++ b/mutter.spec @@ -36,6 +36,12 @@ Version: 2.91.3 Release: 1 Summary: Window and compositing manager based on Clutter Source: %{name}-%{version}.tar.bz2 +# PATCH-FIX-UPSTREAM mutter-gdk_functions.patch dimstar@opensuse.org -- Replace GDK macro usage with proper function name, taken from git. +Patch0: mutter-gdk_functions.patch +# PATCH-FIX-UPSTREAM mutter-gtk_states.patch dimstar@opensuse.org -- theme: Handle new GTK+ states, taken from git. +Patch1: mutter-gtk_states.patch +# PATCH-FIX-UPSTREAM mutter-port-testgradients-to-gtk3.patch dimstar@opensuse.org -- ui: Port testgradient example to GTK3, taken from git. +Patch2: mutter-port-testgradients-to-gtk3.patch Url: http://www.gnome.org BuildRoot: %{_tmppath}/%{name}-%{version}-build Requires: zenity @@ -61,6 +67,9 @@ to develop applications that require these. %lang_package %prep %setup -q +%patch0 -p1 +%patch1 -p1 +%patch2 -p1 %build %configure \