Compare commits

...
Sign in to create a new pull request.
Author SHA1 Message Date
d8fe4bb226 fix alias check for out-of-tree builds 2026-08-03 15:01:22 +02:00
b82fd01259 docs: use top_srcdir for GDK X11 header reference
Based on the MSYS2 0005-Fix-header-ref.all.patch.

Use an explicit top_srcdir-relative path for gdkx.h in the GDK reference documentation instead of a fragile relative path.
2026-08-03 15:01:22 +02:00
7a1874a0cc introspection: include Win32 keymap declarations
Add gdkwin32keys.h to the Win32 introspection source list so exported Win32 keymap APIs are visible in GdkWin32-2.0.gir.

The corresponding gdk_win32_keymap_get_type() and gdk_win32_keymap_check_compose() symbols are already exported, so this keeps the GIR closer to the installed Win32 API surface.
2026-08-03 15:01:22 +02:00
73360271b8 introspection: add GdkWin32 GIR generation
Based on the MSYS2 0011-gir-for-gdkwin32.mingw.patch.

Add Win32 backend sources to introspection when building the Win32 target and generate GdkWin32-2.0.gir alongside the common Gdk-2.0 GIR.
2026-08-03 15:01:22 +02:00
ac4bf63e24 introspection: pass compiler and GTK DLL path to scanner
Based on the MSYS2 0009-give-cc-to-gir-scanner.mingw.patch and 0010-put-gtk-dll-into-path.mingw.patch.

Pass CC to g-ir-scanner and add the GTK build directory to PATH while scanning GTK, so MinGW builds can run the scanner with the just-built DLLs.
2026-08-03 15:01:22 +02:00
ea118685a9 win32: quote icon cache manifest in resource file
Based on the MSYS2 0024-gtk-update-icon-cache-rc-quote.patch.

Quote the manifest path when generating the gtk-update-icon-cache resource file so windres parses it correctly.
2026-08-03 15:01:22 +02:00
30d4541d98 win32: initialize key state before updating keymap
Based on the MSYS2 0023-gdkkeys-win32.c-fix-initialisation-of-key_state-in-u.patch.

Clear the key_state array before using it during keymap updates so stale state cannot affect layout handling, including Japanese IME input.
2026-08-03 15:01:22 +02:00
ccf110219c icontheme: detect SVG icons by extension on Win32
Based on the MSYS2 0022-icontheme-win32-detect-SVG-files-by-extension.patch.

Some Windows systems report .svg files with a generic or incorrect content type. On Win32, fall back to the .svg extension so SVG icons can still be detected.
2026-08-03 15:01:22 +02:00
99aba6bf1d win32: improve mouse window lookup through transparent children
Based on the MSYS2 0013_fix_mouse_events.patch.

Use CWP_SKIPTRANSPARENT while walking from the desktop window, but stop skipping transparent windows after the first level so transparent child windows are still considered correctly.
2026-08-03 15:01:22 +02:00
682bbbe69d quartz: avoid extra resize-idle updates on Big Sur and newer
Based on part of the MacPorts Big Sur performance patch for GIMP issue 5989.

Keep the existing gdk_window_process_all_updates() call for non-Quartz targets and for older macOS releases, but avoid this extra resize-idle update path on Big Sur and newer where it can contribute to expensive full-window redraw behaviour.
2026-08-03 15:01:22 +02:00
d75686a864 quartz: avoid extra content invalidation on Big Sur and newer
Based on part of the MacPorts Big Sur performance patch for GIMP issue 5989.

Keep the existing Mojave-era setNeedsDisplay workaround for macOS 10.14 and 10.15, but avoid the extra full-window invalidation on Big Sur and newer where it can cause expensive redraw behaviour.
2026-08-03 15:01:22 +02:00
d43c7a964f quartz: request 8-bit layer contents on Big Sur and newer
Based on part of the MacPorts Big Sur performance patch for GIMP issue 5989.

Use a dynamic Objective-C call to request 8-bit layer contents on macOS 11 and newer, avoiding a hard QuartzCore/CALayer compile-time dependency and preserving old behaviour on older macOS releases.
2026-08-03 15:01:22 +02:00
92c319ab4e quartz: avoid screen update suppression on Mojave and newer
Based on part of the MacPorts Big Sur performance patch for GIMP issue 5989.

NSDisableScreenUpdates and NSEnableScreenUpdates are deprecated on newer macOS releases. Keep using them for older macOS versions, but avoid them on Mojave and newer.
2026-08-03 15:01:22 +02:00
0e99248694 quartz: use CGContext accessor on Yosemite and newer
Based on part of the MacPorts Big Sur performance patch for GIMP issue 5989.

Use the modern NSGraphicsContext CGContext accessor on Yosemite and newer, matching the existing Quartz window code, while preserving graphicsPort for older macOS versions.
2026-08-03 15:01:22 +02:00
c844f13c1a quartz: map macOS 11 and newer to internal OS versions
Based on part of the MacPorts Big Sur performance patch for GIMP issue 5989.

GTK2 represents macOS 10.x releases by their minor version. Read the major version as well and map macOS 11 and newer into the same sequence so Big Sur and later releases can be detected correctly.
2026-08-03 15:01:22 +02:00
b5516b9b02 quartz: avoid focus locking on Mojave and newer
Based on part of the MacPorts Big Sur performance patch for GIMP issue 5989.

The NSView focus-locking API is deprecated on newer macOS releases and can cause expensive redraw behaviour. Keep the old path for older macOS versions, but avoid lockFocusIfCanDraw/unlockFocus on Mojave and newer.
2026-08-03 15:01:22 +02:00
9899e80a8e quartz: add newer macOS version constants
Based on the MacPorts patch-gdkquartz-osx-versions.diff.

Extend the Quartz OS version enum so later macOS-specific code can
distinguish Catalina, Big Sur, Monterey, Ventura, Sonoma, and Sequoia
while preserving the existing older constants.
2026-08-03 15:01:22 +02:00
7fa38dd2df build: disable GNU visibility aliases on Apple platforms
Based on the MacPorts patch-aliases.diff.

Keep the existing GNU visibility alias generation on other platforms, but avoid it on Apple targets where this alias mechanism is not suitable.
2026-08-03 15:01:22 +02:00
be9c6f513e gtkrc: search XDG data dirs for themes
Based on the Guix gtk2-theme-paths.patch by Jookia.

Keep the existing ~/.themes and gtk_rc_get_theme_dir() lookup paths, but check g_get_system_data_dirs() in between so profile- and prefix-based theme installations can be found.
2026-08-03 15:01:22 +02:00
ab1bc689b8 tests: fix GtkBuilder signal callback prototypes
Based on the Guix gtk2-fix-builder-test.patch.

The callbacks are connected to notify-style signals and must take a
GParamSpec pointer, not a GParamSpec by value. This avoids stack/register
ABI problems on platforms such as ppc64el.
2026-08-03 15:01:22 +02:00
18 changed files with 183 additions and 25 deletions

View file

@ -37,7 +37,7 @@ IGNORE_HFILES= \
# Extra files to add when scanning (relative to $srcdir) # Extra files to add when scanning (relative to $srcdir)
EXTRA_HFILES= \ EXTRA_HFILES= \
../../../gdk/x11/gdkx.h $(top_srcdir)/gdk/x11/gdkx.h
# CFLAGS and LDFLAGS for compiling scan program. Only needed # CFLAGS and LDFLAGS for compiling scan program. Only needed
# if $(DOC_MODULE).types is non-empty. # if $(DOC_MODULE).types is non-empty.

View file

@ -2,6 +2,8 @@
include $(top_srcdir)/Makefile.decl include $(top_srcdir)/Makefile.decl
-include $(INTROSPECTION_MAKEFILE) -include $(INTROSPECTION_MAKEFILE)
INTROSPECTION_GIRS = INTROSPECTION_GIRS =
INTROSPECTION_SCANNER_ENV = \
CC="$(CC)"
INTROSPECTION_SCANNER_ARGS = \ INTROSPECTION_SCANNER_ARGS = \
--warn-all \ --warn-all \
--add-include-path=../gdk --add-include-path=../gdk
@ -213,6 +215,11 @@ Gdk_2_0_gir_CFLAGS = \
-I$(top_builddir) \ -I$(top_builddir) \
-I$(top_builddir)/gdk \ -I$(top_builddir)/gdk \
$(INCLUDES) $(INCLUDES)
if OS_WIN32
Gdk_2_0_gir_CFLAGS += -I$(srcdir)/win32 -I$(srcdir)
endif
INTROSPECTION_GIRS += Gdk-2.0.gir INTROSPECTION_GIRS += Gdk-2.0.gir
if USE_X11 if USE_X11
@ -268,6 +275,63 @@ introspection_files += $(filter-out x11/gdkx.h, $(x11_introspection_files))
endif # USE_X11 endif # USE_X11
if OS_WIN32
win32_introspection_files = \
win32/gdkapplaunchcontext-win32.c \
win32/gdkcolor-win32.c \
win32/gdkcursor-win32.c \
win32/gdkdisplay-win32.c \
win32/gdkdnd-win32.c \
win32/gdkdrawable-win32.c \
win32/gdkdrawable-win32.h \
win32/gdkevents-win32.c \
win32/gdkfont-win32.c \
win32/gdkgc-win32.c \
win32/gdkgeometry-win32.c \
win32/gdkglobals-win32.c \
win32/gdkimage-win32.c \
win32/gdkim-win32.c \
win32/gdkinput.c \
win32/gdkinput-win32.c \
win32/gdkinput-win32.h \
win32/gdkkeys-win32.c \
win32/gdkmain-win32.c \
win32/gdkpixmap-win32.c \
win32/gdkpixmap-win32.h \
win32/gdkprivate-win32.h \
win32/gdkproperty-win32.c \
win32/gdkscreen-win32.c \
win32/gdkselection-win32.c \
win32/gdkspawn-win32.c \
win32/gdktestutils-win32.c \
win32/gdkvisual-win32.c \
win32/gdkwin32.h \
win32/gdkwin32id.c \
win32/gdkwin32keys.h \
win32/gdkwindow-win32.c \
win32/gdkwindow-win32.h
GdkWin32-2.0.gir: $(gdktargetlib) Gdk-2.0.gir Makefile
GdkWin32_2_0_gir_SCANNERFLAGS = --warn-all --identifier-prefix=Gdk --symbol-prefix=gdk --include-uninstalled=Gdk-2.0.gir
GdkWin32_2_0_gir_INCLUDES = Gio-2.0 Gdk-2.0 GdkPixbuf-2.0 Pango-1.0
GdkWin32_2_0_gir_LIBS = $(gdktargetlib)
GdkWin32_2_0_gir_FILES = $(win32_introspection_files)
GdkWin32_2_0_gir_EXPORT_PACKAGES = gdk-win32-2.0
GdkWin32_2_0_gir_CFLAGS = \
-DGDK_COMPILATION \
-I$(top_srcdir) \
-I$(top_builddir) \
-I$(top_builddir)/gdk \
-I$(srcdir)/win32 \
-I$(srcdir) \
$(INCLUDES) \
-L$(top_builddir)/gdk
INTROSPECTION_GIRS += GdkWin32-2.0.gir
introspection_files += $(filter-out win32/gdkwin32.h, $(win32_introspection_files))
endif # OS_WIN32
girdir = $(datadir)/gir-1.0 girdir = $(datadir)/gir-1.0
gir_DATA = $(INTROSPECTION_GIRS) gir_DATA = $(INTROSPECTION_GIRS)

View file

@ -14,7 +14,7 @@ print <<EOF;
#include <glib.h> #include <glib.h>
#ifdef G_HAVE_GNUC_VISIBILITY #if defined(G_HAVE_GNUC_VISIBILITY) && !defined(__APPLE__)
EOF EOF

View file

@ -599,6 +599,25 @@
gdk_screen_get_rgba_colormap (_gdk_screen); gdk_screen_get_rgba_colormap (_gdk_screen);
} }
-(void)viewWillDraw
{
/* macOS 11 (Big Sur) and newer may use a higher precision backing
* format for layer contents. For GTK2's 8-bit drawing this can add
* avoidable conversion overhead. Use a dynamic Objective-C call here
* instead of a hard QuartzCore/CALayer dependency, so old SDKs and old
* macOS targets keep building and keep their old behaviour.
*/
if (gdk_quartz_osx_version () >= GDK_OSX_BIG_SUR)
{
id layer = [self layer];
if (layer && [layer respondsToSelector: @selector(setContentsFormat:)])
[layer setValue: @"RGBA8Uint" forKey: @"contentsFormat"];
}
[super viewWillDraw];
}
-(void)drawRect: (NSRect)rect -(void)drawRect: (NSRect)rect
{ {
GdkRectangle gdk_rect; GdkRectangle gdk_rect;

View file

@ -893,7 +893,8 @@ gdk_quartz_drawable_release_context (GdkDrawable *drawable,
if (window_impl->in_paint_rect_count == 0) if (window_impl->in_paint_rect_count == 0)
{ {
_gdk_quartz_drawable_flush (drawable); _gdk_quartz_drawable_flush (drawable);
[window_impl->view unlockFocus]; if (gdk_quartz_osx_version () < GDK_OSX_MOJAVE)
[window_impl->view unlockFocus];
} }
} }
else if (GDK_IS_PIXMAP_IMPL_QUARTZ (drawable)) else if (GDK_IS_PIXMAP_IMPL_QUARTZ (drawable))

View file

@ -34,9 +34,20 @@ gdk_quartz_osx_version (void)
if (minor == GDK_OSX_UNSUPPORTED) if (minor == GDK_OSX_UNSUPPORTED)
{ {
OSErr err = Gestalt (gestaltSystemVersionMinor, (SInt32*)&minor); gint32 major = GDK_OSX_UNSUPPORTED;
OSErr err = Gestalt (gestaltSystemVersionMajor, (SInt32*)&major);
g_return_val_if_fail (err == noErr, GDK_OSX_UNSUPPORTED); g_return_val_if_fail (err == noErr, GDK_OSX_UNSUPPORTED);
err = Gestalt (gestaltSystemVersionMinor, (SInt32*)&minor);
g_return_val_if_fail (err == noErr, GDK_OSX_UNSUPPORTED);
/* GTK2 encodes macOS 10.x releases by their minor version.
* Map macOS 11+ into the same sequence:
* 11 -> 16, 12 -> 17, 13 -> 18, ...
*/
if (major > 10)
minor = major + 5;
} }
if (minor < GDK_OSX_MIN) if (minor < GDK_OSX_MIN)

View file

@ -54,7 +54,13 @@ typedef enum
GDK_OSX_SIERRA = 12, GDK_OSX_SIERRA = 12,
GDK_OSX_HIGH_SIERRA = 13, GDK_OSX_HIGH_SIERRA = 13,
GDK_OSX_MOJAVE = 14, GDK_OSX_MOJAVE = 14,
GDK_OSX_CURRENT = 14, GDK_OSX_CATALINA = 15,
GDK_OSX_BIG_SUR = 16,
GDK_OSX_MONTEREY = 17,
GDK_OSX_VENTURA = 18,
GDK_OSX_SONOMA = 19,
GDK_OSX_SEQUOIA = 20,
GDK_OSX_CURRENT = 20,
GDK_OSX_NEW = 99 GDK_OSX_NEW = 99
} GdkOSXVersion; } GdkOSXVersion;

View file

@ -104,7 +104,8 @@ gdk_window_impl_quartz_get_context (GdkDrawable *drawable,
* and for widgets that send fake expose events like the arrow * and for widgets that send fake expose events like the arrow
* buttons in spinbuttons or the position marker in rulers. * buttons in spinbuttons or the position marker in rulers.
*/ */
if (window_impl->in_paint_rect_count == 0) if (window_impl->in_paint_rect_count == 0 &&
gdk_quartz_osx_version () < GDK_OSX_MOJAVE)
{ {
if (![window_impl->view lockFocusIfCanDraw]) if (![window_impl->view lockFocusIfCanDraw])
return NULL; return NULL;
@ -468,7 +469,8 @@ _gdk_windowing_before_process_all_updates (void)
{ {
in_process_all_updates = TRUE; in_process_all_updates = TRUE;
NSDisableScreenUpdates (); if (gdk_quartz_osx_version () < GDK_OSX_MOJAVE)
NSDisableScreenUpdates ();
} }
void void
@ -489,8 +491,9 @@ _gdk_windowing_after_process_all_updates (void)
/* 10.14 needs to be told that the view needs to be redrawn, see /* 10.14 needs to be told that the view needs to be redrawn, see
* https://gitlab.gnome.org/GNOME/gtk/issues/1479 */ * https://gitlab.gnome.org/GNOME/gtk/issues/1479 */
if (gdk_quartz_osx_version() >= GDK_OSX_MOJAVE) if (gdk_quartz_osx_version () >= GDK_OSX_MOJAVE &&
[[nswindow contentView] setNeedsDisplay:YES]; gdk_quartz_osx_version () < GDK_OSX_BIG_SUR)
[[nswindow contentView] setNeedsDisplay:YES];
[nswindow enableFlushWindow]; [nswindow enableFlushWindow];
[nswindow flushWindow]; [nswindow flushWindow];
[nswindow release]; [nswindow release];
@ -502,7 +505,8 @@ _gdk_windowing_after_process_all_updates (void)
in_process_all_updates = FALSE; in_process_all_updates = FALSE;
NSEnableScreenUpdates (); if (gdk_quartz_osx_version () < GDK_OSX_MOJAVE)
NSEnableScreenUpdates ();
} }
static void static void

View file

@ -692,6 +692,7 @@ update_keymap (GdkKeymap *gdk_keymap)
if (hkls_len != keymap->layout_handles->len) if (hkls_len != keymap->layout_handles->len)
keymap->keysym_tab = g_renew (guint, keymap->keysym_tab, keysym_tab_size); keymap->keysym_tab = g_renew (guint, keymap->keysym_tab, keysym_tab_size);
memset (key_state, 0, sizeof(key_state));
memset (keymap->keysym_tab, 0, keysym_tab_size); memset (keymap->keysym_tab, 0, keysym_tab_size);
g_array_set_size (keymap->layout_handles, hkls_len); g_array_set_size (keymap->layout_handles, hkls_len);
g_array_set_size (keymap->options, hkls_len); g_array_set_size (keymap->options, hkls_len);

View file

@ -2767,6 +2767,10 @@ _gdk_windowing_window_at_pointer (GdkDisplay *display,
* WindowFromPoint() can find our windows, we follow similar logic * WindowFromPoint() can find our windows, we follow similar logic
* here, and ignore invisible and disabled windows. * here, and ignore invisible and disabled windows.
*/ */
UINT cwp_flags = CWP_SKIPDISABLED |
CWP_SKIPINVISIBLE |
CWP_SKIPTRANSPARENT;
hwnd = GetDesktopWindow (); hwnd = GetDesktopWindow ();
do { do {
window = gdk_win32_handle_table_lookup ((GdkNativeWindow) hwnd); window = gdk_win32_handle_table_lookup ((GdkNativeWindow) hwnd);
@ -2777,8 +2781,7 @@ _gdk_windowing_window_at_pointer (GdkDisplay *display,
break; break;
screen_to_client (hwnd, screen_pt, &client_pt); screen_to_client (hwnd, screen_pt, &client_pt);
hwndc = ChildWindowFromPointEx (hwnd, client_pt, CWP_SKIPDISABLED | hwndc = ChildWindowFromPointEx (hwnd, client_pt, cwp_flags);
CWP_SKIPINVISIBLE);
/* Verify that we're really inside the client area of the window */ /* Verify that we're really inside the client area of the window */
if (hwndc != hwnd) if (hwndc != hwnd)
@ -2789,6 +2792,8 @@ _gdk_windowing_window_at_pointer (GdkDisplay *display,
hwndc = hwnd; hwndc = hwnd;
} }
/* Only ignore top-level transparent windows */
cwp_flags &= ~CWP_SKIPTRANSPARENT;
} while (hwndc != hwnd && (hwnd = hwndc, 1)); } while (hwndc != hwnd && (hwnd = hwndc, 1));
} }

View file

@ -2,6 +2,9 @@
include $(top_srcdir)/Makefile.decl include $(top_srcdir)/Makefile.decl
-include $(INTROSPECTION_MAKEFILE) -include $(INTROSPECTION_MAKEFILE)
INTROSPECTION_GIRS = INTROSPECTION_GIRS =
INTROSPECTION_SCANNER_ENV = \
CC="$(CC)" \
PATH="$(builddir):$(builddir)/.libs:$${PATH}:"
INTROSPECTION_SCANNER_ARGS = \ INTROSPECTION_SCANNER_ARGS = \
--warn-all \ --warn-all \
--add-include-path=../gdk --add-include-path=../gdk
@ -1139,7 +1142,7 @@ $(GTK_UPDATE_ICON_CACHE_MANIFEST):
echo '</assembly>' ) >$@ echo '</assembly>' ) >$@
$(GTK_UPDATE_ICON_CACHE_RC): $(GTK_UPDATE_ICON_CACHE_RC):
(echo -e '#include <winbase.h>\nCREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST '$(GTK_UPDATE_ICON_CACHE_MANIFEST)) >$@ (echo -e '#include <winbase.h>\nCREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "'$(GTK_UPDATE_ICON_CACHE_MANIFEST)'"') >$@
$(GTK_UPDATE_ICON_CACHE_MANIFEST_OBJECT): $(GTK_UPDATE_ICON_CACHE_RC) $(GTK_UPDATE_ICON_CACHE_MANIFEST) $(GTK_UPDATE_ICON_CACHE_MANIFEST_OBJECT): $(GTK_UPDATE_ICON_CACHE_RC) $(GTK_UPDATE_ICON_CACHE_MANIFEST)
$(WINDRES) --input $< --output $@ --output-format=coff $(WINDRES) --input $< --output $@ --output-format=coff

View file

@ -5,7 +5,14 @@ if test "x$gtk_all_c_sources" = x; then
exit 1 exit 1
fi fi
grep 'IN_FILE' ${srcdir-.}/gtk.symbols | sed 's/.*(//;s/).*//' | grep __ | sort -u > expected-files srcdir=${srcdir-.}
{ cd ${srcdir-.}; grep '^ *# *define __' $gtk_all_c_sources; } | sed 's/.*define //;s/ *$//' | sort > actual-files
grep 'IN_FILE' "$srcdir/gtk.symbols" | sed 's/^[^(]*(//;s/).*//;s/__GTK_MARSHAL_MARSHAL_C__/__gtk_marshal_MARSHAL_C__/' | grep __ | sort -u > expected-files
{
for file in $gtk_all_c_sources; do
test -f "$file" || file="$srcdir/$file"
grep '^ *# *define __' "$file"
done
} | sed 's/.*define //;s/ *$//;s/__GTK_MARSHAL_MARSHAL_C__/__gtk_marshal_MARSHAL_C__/' | sort > actual-files
diff expected-files actual-files && rm -f expected-files actual-files diff expected-files actual-files && rm -f expected-files actual-files

View file

@ -40,6 +40,9 @@
#include "gtktoolbar.h" #include "gtktoolbar.h"
#include <gobject/gobjectnotifyqueue.c> #include <gobject/gobjectnotifyqueue.c>
#include <gobject/gvaluecollector.h> #include <gobject/gvaluecollector.h>
#ifdef GDK_WINDOWING_QUARTZ
#include "gdk/quartz/gdkquartz.h"
#endif
#include "gtkalias.h" #include "gtkalias.h"
@ -1357,7 +1360,16 @@ gtk_container_idle_sizer (gpointer data)
gtk_container_check_resize (GTK_CONTAINER (widget)); gtk_container_check_resize (GTK_CONTAINER (widget));
} }
#ifdef GDK_WINDOWING_QUARTZ
/* macOS 11 and newer can trigger expensive full-window redraws here.
* Keep the traditional update processing path for older Quartz targets,
* but let the normal GDK update idle handle updates on Big Sur and newer.
*/
if (gdk_quartz_osx_version () < GDK_OSX_BIG_SUR)
gdk_window_process_all_updates ();
#else
gdk_window_process_all_updates (); gdk_window_process_all_updates ();
#endif
return FALSE; return FALSE;
} }

View file

@ -2945,6 +2945,10 @@ icon_info_ensure_scale_and_pixbuf (GtkIconInfo *icon_info,
if (mime_type && strcmp (mime_type, "image/svg+xml") == 0) if (mime_type && strcmp (mime_type, "image/svg+xml") == 0)
is_svg = TRUE; is_svg = TRUE;
#ifdef G_OS_WIN32
else if (content_type && strcmp (content_type, ".svg") == 0)
is_svg = TRUE;
#endif
} }
g_object_unref (file_info); g_object_unref (file_info);

View file

@ -67,7 +67,10 @@ _gtk_quartz_create_image_from_pixbuf (GdkPixbuf *pixbuf)
} }
[nsimage lockFocus]; [nsimage lockFocus];
context = (CGContextRef)[[NSGraphicsContext currentContext] graphicsPort]; if (gdk_quartz_osx_version () < GDK_OSX_YOSEMITE)
context = (CGContextRef)[[NSGraphicsContext currentContext] graphicsPort];
else
context = [[NSGraphicsContext currentContext] CGContext];
CGContextDrawImage (context, CGRectMake (0, 0, pixbuf_width, pixbuf_height), image); CGContextDrawImage (context, CGRectMake (0, 0, pixbuf_width, pixbuf_height), image);
[nsimage unlockFocus]; [nsimage unlockFocus];

View file

@ -808,6 +808,8 @@ gtk_rc_parse_named (GtkRcContext *context,
gchar *path = NULL; gchar *path = NULL;
const gchar *home_dir; const gchar *home_dir;
gchar *subpath; gchar *subpath;
const gchar * const *xdg_data_dirs;
gint i;
if (type) if (type)
subpath = g_strconcat ("gtk-2.0-", type, subpath = g_strconcat ("gtk-2.0-", type,
@ -829,6 +831,22 @@ gtk_rc_parse_named (GtkRcContext *context,
} }
} }
if (!path)
{
xdg_data_dirs = g_get_system_data_dirs ();
for (i = 0; xdg_data_dirs[i]; i++)
{
path = g_build_filename (xdg_data_dirs[i], "themes", name, subpath, NULL);
if (g_file_test (path, G_FILE_TEST_EXISTS))
break;
else
{
g_free (path);
path = NULL;
}
}
}
if (!path) if (!path)
{ {
gchar *theme_dir = gtk_rc_get_theme_dir (); gchar *theme_dir = gtk_rc_get_theme_dir ();

View file

@ -14,7 +14,7 @@ print <<EOF;
#include <glib.h> #include <glib.h>
#ifdef G_HAVE_GNUC_VISIBILITY #if defined(G_HAVE_GNUC_VISIBILITY) && !defined(__APPLE__)
EOF EOF

View file

@ -132,7 +132,7 @@ static int object = 0;
static int object_after = 0; static int object_after = 0;
void /* exported for GtkBuilder */ void /* exported for GtkBuilder */
signal_normal (GtkWindow *window, GParamSpec spec) signal_normal (GtkWindow *window, GParamSpec *spec)
{ {
g_assert (GTK_IS_WINDOW (window)); g_assert (GTK_IS_WINDOW (window));
g_assert (normal == 0); g_assert (normal == 0);
@ -142,7 +142,7 @@ signal_normal (GtkWindow *window, GParamSpec spec)
} }
void /* exported for GtkBuilder */ void /* exported for GtkBuilder */
signal_after (GtkWindow *window, GParamSpec spec) signal_after (GtkWindow *window, GParamSpec *spec)
{ {
g_assert (GTK_IS_WINDOW (window)); g_assert (GTK_IS_WINDOW (window));
g_assert (normal == 1); g_assert (normal == 1);
@ -152,7 +152,7 @@ signal_after (GtkWindow *window, GParamSpec spec)
} }
void /* exported for GtkBuilder */ void /* exported for GtkBuilder */
signal_object (GtkButton *button, GParamSpec spec) signal_object (GtkButton *button, GParamSpec *spec)
{ {
g_assert (GTK_IS_BUTTON (button)); g_assert (GTK_IS_BUTTON (button));
g_assert (object == 0); g_assert (object == 0);
@ -162,7 +162,7 @@ signal_object (GtkButton *button, GParamSpec spec)
} }
void /* exported for GtkBuilder */ void /* exported for GtkBuilder */
signal_object_after (GtkButton *button, GParamSpec spec) signal_object_after (GtkButton *button, GParamSpec *spec)
{ {
g_assert (GTK_IS_BUTTON (button)); g_assert (GTK_IS_BUTTON (button));
g_assert (object == 1); g_assert (object == 1);
@ -172,28 +172,28 @@ signal_object_after (GtkButton *button, GParamSpec spec)
} }
void /* exported for GtkBuilder */ void /* exported for GtkBuilder */
signal_first (GtkButton *button, GParamSpec spec) signal_first (GtkButton *button, GParamSpec *spec)
{ {
g_assert (normal == 0); g_assert (normal == 0);
normal = 10; normal = 10;
} }
void /* exported for GtkBuilder */ void /* exported for GtkBuilder */
signal_second (GtkButton *button, GParamSpec spec) signal_second (GtkButton *button, GParamSpec *spec)
{ {
g_assert (normal == 10); g_assert (normal == 10);
normal = 20; normal = 20;
} }
void /* exported for GtkBuilder */ void /* exported for GtkBuilder */
signal_extra (GtkButton *button, GParamSpec spec) signal_extra (GtkButton *button, GParamSpec *spec)
{ {
g_assert (normal == 20); g_assert (normal == 20);
normal = 30; normal = 30;
} }
void /* exported for GtkBuilder */ void /* exported for GtkBuilder */
signal_extra2 (GtkButton *button, GParamSpec spec) signal_extra2 (GtkButton *button, GParamSpec *spec)
{ {
g_assert (normal == 30); g_assert (normal == 30);
normal = 40; normal = 40;