diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2012-11-29 13:43:08 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2012-11-29 13:43:08 +0000 |
commit | fe733adef79aece577480eb7b58043a1939276ab (patch) | |
tree | 4734258f27651155784dc43226b53e4c92897ce0 | |
parent | 4eca36bb2388cd2b6b259b81316d07e41f3d9912 (diff) |
update GTK patches to reflect state of gtk-2-24 near the end of November 2012
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@13564 d708f5d6-7413-0410-9779-e7cbd77b26cf
-rw-r--r-- | tools/current-gtk-patches/gdk-fixdrawrect.patch | 14 | ||||
-rw-r--r-- | tools/current-gtk-patches/gdk-flushtimer.patch | 172 | ||||
-rw-r--r-- | tools/current-gtk-patches/gdk-noclipwithemptyregion.patch | 62 | ||||
-rw-r--r-- | tools/current-gtk-patches/gdk-noclipwithemptyregion2.patch | 14 | ||||
-rw-r--r-- | tools/current-gtk-patches/gdk-noexposeifclipempty.patch | 38 | ||||
-rw-r--r-- | tools/current-gtk-patches/gdk-norootimage.patch | 20 | ||||
-rw-r--r-- | tools/current-gtk-patches/gdk-staticversion.patch | 19 | ||||
-rw-r--r-- | tools/current-gtk-patches/gnome-canvas-slow-idle.patch | 46 |
8 files changed, 67 insertions, 318 deletions
diff --git a/tools/current-gtk-patches/gdk-fixdrawrect.patch b/tools/current-gtk-patches/gdk-fixdrawrect.patch new file mode 100644 index 0000000000..4ab0e49ad5 --- /dev/null +++ b/tools/current-gtk-patches/gdk-fixdrawrect.patch @@ -0,0 +1,14 @@ +diff --git a/gdk/quartz/GdkQuartzView.c b/gdk/quartz/GdkQuartzView.c +index 77ff5d7..3997a7e 100644 +--- a/gdk/quartz/GdkQuartzView.c ++++ b/gdk/quartz/GdkQuartzView.c +@@ -86,7 +86,7 @@ + if (NSEqualRects (rect, NSZeroRect)) + return; + +- if (!GDK_WINDOW_IS_MAPPED (gdk_window)) ++ if (!GDK_WINDOW_IS_MAPPED (gdk_window) && ((gdk_quartz_osx_version() >= GDK_OSX_LEOPARD) && [self wantsLayer])) + { + /* If the window is not yet mapped, clip_region_with_children + * will be empty causing the usual code below to draw nothing. + diff --git a/tools/current-gtk-patches/gdk-flushtimer.patch b/tools/current-gtk-patches/gdk-flushtimer.patch deleted file mode 100644 index dc7d1acad7..0000000000 --- a/tools/current-gtk-patches/gdk-flushtimer.patch +++ /dev/null @@ -1,172 +0,0 @@ -diff -urp gtk+/gdk/quartz/gdkdrawable-quartz.c gtk+664894/gdk/quartz/gdkdrawable-quartz.c ---- gtk+/gdk/quartz/gdkdrawable-quartz.c 2011-11-23 00:19:24.000000000 -0500 -+++ gtk+664894/gdk/quartz/gdkdrawable-quartz.c 2011-11-29 04:09:38.000000000 -0500 -@@ -768,34 +768,28 @@ void - _gdk_quartz_drawable_flush (GdkDrawable *drawable) - { - static struct timeval prev_tv; -- static gint intervals[4]; -- static gint index; - struct timeval tv; - gint ms; -- -- gettimeofday (&tv, NULL); -+ -+ gettimeofday (&tv, NULL); - ms = (tv.tv_sec - prev_tv.tv_sec) * 1000 + (tv.tv_usec - prev_tv.tv_usec) / 1000; -- intervals[index++ % 4] = ms; -+ prev_tv = tv; - - if (drawable) - { -- ms = intervals[0] + intervals[1] + intervals[2] + intervals[3]; -- -- /* ~25Hz on average. */ -- if (ms > 4*40) -+ if (GDK_IS_WINDOW_IMPL_QUARTZ (drawable)) - { -- if (GDK_IS_WINDOW_IMPL_QUARTZ (drawable)) -+ GdkWindowImplQuartz *window_impl = GDK_WINDOW_IMPL_QUARTZ (drawable); -+ if (ms > (4*GDK_QUARTZ_FLUSH_TIMER_MSEC)) /* first update in a while so immediately flush */ - { -- GdkWindowImplQuartz *window_impl = GDK_WINDOW_IMPL_QUARTZ (drawable); -- - [window_impl->toplevel flushWindow]; - } -- -- prev_tv = tv; -+ else -+ { -+ window_impl->needs_flush = 1; -+ } - } - } -- else -- prev_tv = tv; - } - - void -diff -urp gtk+/gdk/quartz/gdkprivate-quartz.h gtk+664894/gdk/quartz/gdkprivate-quartz.h ---- gtk+/gdk/quartz/gdkprivate-quartz.h 2011-11-23 20:43:12.000000000 -0500 -+++ gtk+664894/gdk/quartz/gdkprivate-quartz.h 2011-11-29 03:36:34.000000000 -0500 -@@ -24,6 +24,8 @@ - #define GDK_QUARTZ_ALLOC_POOL NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init] - #define GDK_QUARTZ_RELEASE_POOL [pool release] - -+#define GDK_QUARTZ_FLUSH_TIMER_MSEC (10) -+ - #include <gdk/gdkprivate.h> - #include <gdk/quartz/gdkpixmap-quartz.h> - #include <gdk/quartz/gdkwindow-quartz.h> -@@ -163,6 +165,9 @@ void _gdk_quartz_window_set_needs_ - - void _gdk_quartz_window_update_position (GdkWindow *window); - -+gboolean _gdk_quartz_window_traverse_and_flush_main_window_stack (gpointer data); -+ -+ - /* Events */ - typedef enum { - GDK_QUARTZ_EVENT_SUBTYPE_EVENTLOOP -diff -urp gtk+/gdk/quartz/gdkwindow-quartz.c gtk+664894/gdk/quartz/gdkwindow-quartz.c ---- gtk+/gdk/quartz/gdkwindow-quartz.c 2011-11-23 20:43:12.000000000 -0500 -+++ gtk+664894/gdk/quartz/gdkwindow-quartz.c 2011-11-29 03:36:34.000000000 -0500 -@@ -34,6 +34,7 @@ static GSList *update_nswindows; - static gboolean in_process_all_updates = FALSE; - - static GSList *main_window_stack; -+static guint flush_timer_id = 0; - - #define FULLSCREEN_DATA "fullscreen-data" - -@@ -874,6 +875,12 @@ _gdk_window_impl_new (GdkWindow *win - GdkDrawableImplQuartz *draw_impl; - GdkWindowImplQuartz *parent_impl; - -+ if(!flush_timer_id) -+ { -+ flush_timer_id = g_timeout_add(GDK_QUARTZ_FLUSH_TIMER_MSEC, -+ _gdk_quartz_window_traverse_and_flush_main_window_stack, NULL); -+ } -+ - GDK_QUARTZ_ALLOC_POOL; - - private = (GdkWindowObject *)window; -@@ -3115,3 +3122,64 @@ gdk_window_impl_iface_init (GdkWindowImp - iface->input_window_destroy = _gdk_input_window_destroy; - iface->input_window_crossing = _gdk_input_window_crossing; - } -+ -+ -+gboolean -+_gdk_quartz_window_traverse_and_flush_main_window_stack (gpointer data) -+{ -+GSList *mws = main_window_stack; -+GSList *tops = NULL; -+GSList *dirty = NULL; -+GSList *iter; -+ -+while(mws) -+ { -+ GdkWindow *w = mws->data; -+ if(w) -+ { -+ if (!GDK_WINDOW_DESTROYED (w)) -+ { -+ GdkWindowObject *private = (GdkWindowObject *)w; -+ GdkWindowImplQuartz *giq = (GdkWindowImplQuartz *)private->impl; -+ NSWindow *nsw; -+ if(giq->needs_flush) -+ { -+ giq->needs_flush = 0; -+ nsw = giq->toplevel; -+ -+ if(!g_slist_find(tops, nsw)) -+ { -+ tops = g_slist_prepend(tops, nsw); -+ dirty = g_slist_prepend(dirty, giq); -+ } -+ } -+ } -+ } -+ -+ mws = g_slist_next(mws); -+ } -+ -+if(tops) -+ { -+ g_slist_free(tops); -+ } -+ -+if(dirty) -+ { -+ iter = dirty; -+ while(iter) -+ { -+ GdkWindowImplQuartz *giq = (GdkWindowImplQuartz *)iter->data; -+ -+ [giq->view lockFocus]; -+ [giq->toplevel flushWindow]; -+ [giq->view unlockFocus]; -+ -+ iter = g_slist_next(iter); -+ } -+ -+ g_slist_free(dirty); -+ } -+ -+return(TRUE); -+} -diff -urp gtk+/gdk/quartz/gdkwindow-quartz.h gtk+664894/gdk/quartz/gdkwindow-quartz.h ---- gtk+/gdk/quartz/gdkwindow-quartz.h 2011-11-23 00:19:24.000000000 -0500 -+++ gtk+664894/gdk/quartz/gdkwindow-quartz.h 2011-11-29 03:36:34.000000000 -0500 -@@ -60,6 +60,9 @@ struct _GdkWindowImplQuartz - GList *sorted_children; - - GdkRegion *needs_display_region; -+ -+ /* experimental periodic flush code */ -+ unsigned needs_flush : 1; - }; - - struct _GdkWindowImplQuartzClass diff --git a/tools/current-gtk-patches/gdk-noclipwithemptyregion.patch b/tools/current-gtk-patches/gdk-noclipwithemptyregion.patch deleted file mode 100644 index 056394a6aa..0000000000 --- a/tools/current-gtk-patches/gdk-noclipwithemptyregion.patch +++ /dev/null @@ -1,62 +0,0 @@ ---- gtk+-2.24.0/gdk/quartz/gdkgc-quartz.c~ 2011-08-19 11:13:31.000000000 -0400 -+++ gtk+-2.24.0/gdk/quartz/gdkgc-quartz.c 2011-08-19 13:19:22.000000000 -0400 -@@ -289,7 +289,10 @@ - private->have_clip_mask = FALSE; - } - -- private->have_clip_region = region != NULL; -+ if (region == NULL || gdk_region_empty (region)) -+ private->have_clip_region = FALSE; -+ else -+ private->have_clip_region = TRUE; - - if (reset_origin) - { -@@ -464,24 +467,29 @@ - gdk_region_get_rectangles (_gdk_gc_get_clip_region (gc), - &rects, &n_rects); - -- if (n_rects == 1) -- cg_rects = ▭ -- else -- cg_rects = g_new (CGRect, n_rects); -- -- for (i = 0; i < n_rects; i++) -- { -- cg_rects[i].origin.x = rects[i].x + gc->clip_x_origin; -- cg_rects[i].origin.y = rects[i].y + gc->clip_y_origin; -- cg_rects[i].size.width = rects[i].width; -- cg_rects[i].size.height = rects[i].height; -- } -- -- CGContextClipToRects (context, cg_rects, n_rects); -- -- g_free (rects); -- if (cg_rects != &rect) -- g_free (cg_rects); -+ if (n_rects) -+ { -+ if (n_rects == 1) -+ cg_rects = ▭ -+ else -+ cg_rects = g_new (CGRect, n_rects); -+ -+ for (i = 0; i < n_rects; i++) -+ { -+ cg_rects[i].origin.x = rects[i].x + gc->clip_x_origin; -+ cg_rects[i].origin.y = rects[i].y + gc->clip_y_origin; -+ cg_rects[i].size.width = rects[i].width; -+ cg_rects[i].size.height = rects[i].height; -+ } -+ -+ CGContextClipToRects (context, cg_rects, n_rects); -+ -+ g_free (rects); -+ if (cg_rects != &rect) -+ g_free (cg_rects); -+ } else { -+ printf ("have clip region, but its empty!\n"); -+ } - } - else if (private->have_clip_mask && private->clip_mask) - { diff --git a/tools/current-gtk-patches/gdk-noclipwithemptyregion2.patch b/tools/current-gtk-patches/gdk-noclipwithemptyregion2.patch new file mode 100644 index 0000000000..eb82c2b2f6 --- /dev/null +++ b/tools/current-gtk-patches/gdk-noclipwithemptyregion2.patch @@ -0,0 +1,14 @@ +--- a/gdk/quartz/gdkgc-quartz.c ++++ b/gdk/quartz/gdkgc-quartz.c +@@ -289,7 +289,10 @@ _gdk_windowing_gc_set_clip_region (GdkGC *gc, + private->have_clip_mask = FALSE; + } + +- private->have_clip_region = region != NULL; ++ if (region == NULL || gdk_region_empty (region)) ++ private->have_clip_region = FALSE; ++ else ++ private->have_clip_region = TRUE; + + if (reset_origin) + { diff --git a/tools/current-gtk-patches/gdk-noexposeifclipempty.patch b/tools/current-gtk-patches/gdk-noexposeifclipempty.patch deleted file mode 100644 index 61284a9989..0000000000 --- a/tools/current-gtk-patches/gdk-noexposeifclipempty.patch +++ /dev/null @@ -1,38 +0,0 @@ -diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c -index f058570..2ae3763 100644 ---- a/gdk/gdkwindow.c -+++ b/gdk/gdkwindow.c -@@ -5418,17 +5418,25 @@ _gdk_window_process_updates_recurse (GdkWindow *window, - if (private->event_mask & GDK_EXPOSURE_MASK) - { - GdkEvent event; -+ GdkRegion *region_copy = gdk_region_copy (expose_region); - -- event.expose.type = GDK_EXPOSE; -- event.expose.window = g_object_ref (window); -- event.expose.send_event = FALSE; -- event.expose.count = 0; -- event.expose.region = expose_region; -- gdk_region_get_clipbox (expose_region, &event.expose.area); -+ gdk_region_intersect (region_copy, private->clip_region_with_children); - -- (*_gdk_event_func) (&event, _gdk_event_data); -+ if (!gdk_region_empty (region_copy)) -+ { -+ event.expose.type = GDK_EXPOSE; -+ event.expose.window = g_object_ref (window); -+ event.expose.send_event = FALSE; -+ event.expose.count = 0; -+ event.expose.region = expose_region; -+ gdk_region_get_clipbox (expose_region, &event.expose.area); -+ -+ (*_gdk_event_func) (&event, _gdk_event_data); -+ -+ g_object_unref (window); -+ } - -- g_object_unref (window); -+ gdk_region_destroy (region_copy); - } - else if (private->bg_pixmap != GDK_NO_BG && - private->window_type != GDK_WINDOW_FOREIGN) diff --git a/tools/current-gtk-patches/gdk-norootimage.patch b/tools/current-gtk-patches/gdk-norootimage.patch new file mode 100644 index 0000000000..3d258533f9 --- /dev/null +++ b/tools/current-gtk-patches/gdk-norootimage.patch @@ -0,0 +1,20 @@ +--- a/gdk/quartz/gdkimage-quartz.c ++++ b/gdk/quartz/gdkimage-quartz.c +@@ -137,6 +137,9 @@ _gdk_quartz_image_copy_to_image (GdkDrawable *drawable, + + if (GDK_WINDOW_IMPL_QUARTZ (drawable) == GDK_WINDOW_IMPL_QUARTZ (GDK_WINDOW_OBJECT (_gdk_root)->impl)) + { ++#if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_4 ++ return image; ++#else + /* Special case for the root window. */ + CGRect rect = CGRectMake (src_x, src_y, width, height); + CGImageRef root_image_ref = CGWindowListCreateImage (rect, +@@ -145,6 +148,7 @@ _gdk_quartz_image_copy_to_image (GdkDrawable *drawable, + kCGWindowImageDefault); + rep = [[NSBitmapImageRep alloc] initWithCGImage: root_image_ref]; + CGImageRelease (root_image_ref); ++#endif + } + else + { diff --git a/tools/current-gtk-patches/gdk-staticversion.patch b/tools/current-gtk-patches/gdk-staticversion.patch new file mode 100644 index 0000000000..218fae5d17 --- /dev/null +++ b/tools/current-gtk-patches/gdk-staticversion.patch @@ -0,0 +1,19 @@ +--- a/gdk/quartz/gdkglobals-quartz.c ++++ b/gdk/quartz/gdkglobals-quartz.c +@@ -30,10 +30,12 @@ GdkWindow *_gdk_root = NULL; + GdkOSXVersion + gdk_quartz_osx_version (void) + { +- gint32 minor; +- OSErr err = Gestalt (gestaltSystemVersionMinor, (SInt32*)&minor); +- g_return_val_if_fail (err == noErr, GDK_OSX_UNSUPPORTED); +- ++ static gint32 minor = GDK_OSX_UNSUPPORTED; ++ if (minor == GDK_OSX_UNSUPPORTED) ++ { ++ OSErr err = Gestalt (gestaltSystemVersionMinor, (SInt32*)&minor); ++ g_return_val_if_fail (err == noErr, GDK_OSX_UNSUPPORTED); ++ } + if (minor < GDK_OSX_MIN) + return GDK_OSX_UNSUPPORTED; + else if (minor > GDK_OSX_CURRENT) diff --git a/tools/current-gtk-patches/gnome-canvas-slow-idle.patch b/tools/current-gtk-patches/gnome-canvas-slow-idle.patch deleted file mode 100644 index d8c737c023..0000000000 --- a/tools/current-gtk-patches/gnome-canvas-slow-idle.patch +++ /dev/null @@ -1,46 +0,0 @@ ---- gnome-canvas.c 2011-01-31 07:19:30.000000000 -0500 -+++ ../../../libgnomecanvas-2.30.3/libgnomecanvas/gnome-canvas.c 2012-11-19 13:10:20.552383069 -0500 -@@ -75,6 +75,7 @@ - - #include <config.h> - -+#include <sys/time.h> - #include <math.h> - #include <string.h> - #include <stdio.h> -@@ -3202,16 +3203,34 @@ - idle_handler (gpointer data) - { - GnomeCanvas *canvas; -+ struct timeval enter, leave, diff; - - GDK_THREADS_ENTER (); - - canvas = GNOME_CANVAS (data); - -+ gettimeofday (&enter, NULL); - do_update (canvas); -+ gettimeofday (&leave, NULL); - -- /* Reset idle id */ -+ /* Reset idle id*/ - canvas->idle_id = 0; - -+ timersub (&leave, &enter, &diff); -+ -+ /* GnomeCanvas can be REALLY REALLY slow at updating/recomputing -+ * lines. During motion handling this can lead to situations where the -+ * next motion event arrives before the update is complete, and -+ * as a result, GTK never gets to run the redraw/expose cycle. -+ * -+ * This cannot be fixed until we replace the canvas, so for -+ * force an actual redraw -+ */ -+ -+ if (diff.tv_sec > 0 || diff.tv_usec > 30000) { -+ gdk_window_process_updates (canvas->layout.bin_window, 1); -+ } -+ - GDK_THREADS_LEAVE (); - - return FALSE; |