Compare commits

..
Author SHA1 Message Date
c0ea568364 fix alias check for out-of-tree builds 2026-08-03 15:13:45 +02:00
17 changed files with 23 additions and 174 deletions

View file

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

View file

@ -2,8 +2,6 @@
include $(top_srcdir)/Makefile.decl
-include $(INTROSPECTION_MAKEFILE)
INTROSPECTION_GIRS =
INTROSPECTION_SCANNER_ENV = \
CC="$(CC)"
INTROSPECTION_SCANNER_ARGS = \
--warn-all \
--add-include-path=../gdk
@ -215,11 +213,6 @@ Gdk_2_0_gir_CFLAGS = \
-I$(top_builddir) \
-I$(top_builddir)/gdk \
$(INCLUDES)
if OS_WIN32
Gdk_2_0_gir_CFLAGS += -I$(srcdir)/win32 -I$(srcdir)
endif
INTROSPECTION_GIRS += Gdk-2.0.gir
if USE_X11
@ -275,63 +268,6 @@ introspection_files += $(filter-out x11/gdkx.h, $(x11_introspection_files))
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
gir_DATA = $(INTROSPECTION_GIRS)

View file

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

View file

@ -599,25 +599,6 @@
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
{
GdkRectangle gdk_rect;

View file

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

View file

@ -34,20 +34,9 @@ gdk_quartz_osx_version (void)
if (minor == GDK_OSX_UNSUPPORTED)
{
gint32 major = GDK_OSX_UNSUPPORTED;
OSErr err = Gestalt (gestaltSystemVersionMajor, (SInt32*)&major);
OSErr err = Gestalt (gestaltSystemVersionMinor, (SInt32*)&minor);
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)

View file

@ -54,13 +54,7 @@ typedef enum
GDK_OSX_SIERRA = 12,
GDK_OSX_HIGH_SIERRA = 13,
GDK_OSX_MOJAVE = 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_CURRENT = 14,
GDK_OSX_NEW = 99
} GdkOSXVersion;

View file

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

View file

@ -692,7 +692,6 @@ update_keymap (GdkKeymap *gdk_keymap)
if (hkls_len != keymap->layout_handles->len)
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);
g_array_set_size (keymap->layout_handles, hkls_len);
g_array_set_size (keymap->options, hkls_len);

View file

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

View file

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

View file

@ -40,9 +40,6 @@
#include "gtktoolbar.h"
#include <gobject/gobjectnotifyqueue.c>
#include <gobject/gvaluecollector.h>
#ifdef GDK_WINDOWING_QUARTZ
#include "gdk/quartz/gdkquartz.h"
#endif
#include "gtkalias.h"
@ -1360,16 +1357,7 @@ gtk_container_idle_sizer (gpointer data)
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 ();
#endif
return FALSE;
}

View file

@ -2945,10 +2945,6 @@ icon_info_ensure_scale_and_pixbuf (GtkIconInfo *icon_info,
if (mime_type && strcmp (mime_type, "image/svg+xml") == 0)
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);

View file

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

View file

@ -808,8 +808,6 @@ gtk_rc_parse_named (GtkRcContext *context,
gchar *path = NULL;
const gchar *home_dir;
gchar *subpath;
const gchar * const *xdg_data_dirs;
gint i;
if (type)
subpath = g_strconcat ("gtk-2.0-", type,
@ -831,22 +829,6 @@ 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)
{
gchar *theme_dir = gtk_rc_get_theme_dir ();

View file

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

View file

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