Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b123ca5fd8 | |||
| 1ae5c7beec | |||
| 06974f39fc | |||
| 4cde9b16fd | |||
| cc3ccba88d | |||
| 442630afe5 | |||
| 45fc03183e | |||
| e42049b412 | |||
| cd4145185c | |||
| b305265dea | |||
| 243fcad89f | |||
| 3b177953c1 | |||
| 032c5f1efd | |||
| ceb158a3e1 | |||
| 35e2e048fc | |||
| eebe1148c1 | |||
| 8347521bfd | |||
| 2d1ba49ab4 | |||
| 385df5517b | |||
| a221e0da4c |
18 changed files with 175 additions and 24 deletions
|
|
@ -37,7 +37,7 @@ IGNORE_HFILES= \
|
|||
|
||||
# Extra files to add when scanning (relative to $srcdir)
|
||||
EXTRA_HFILES= \
|
||||
../../../gdk/x11/gdkx.h
|
||||
$(top_srcdir)/gdk/x11/gdkx.h
|
||||
|
||||
# CFLAGS and LDFLAGS for compiling scan program. Only needed
|
||||
# if $(DOC_MODULE).types is non-empty.
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@
|
|||
include $(top_srcdir)/Makefile.decl
|
||||
-include $(INTROSPECTION_MAKEFILE)
|
||||
INTROSPECTION_GIRS =
|
||||
INTROSPECTION_SCANNER_ENV = \
|
||||
CC="$(CC)"
|
||||
INTROSPECTION_SCANNER_ARGS = \
|
||||
--warn-all \
|
||||
--add-include-path=../gdk
|
||||
|
|
@ -213,6 +215,11 @@ 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
|
||||
|
|
@ -268,6 +275,63 @@ 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)
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ print <<EOF;
|
|||
|
||||
#include <glib.h>
|
||||
|
||||
#ifdef G_HAVE_GNUC_VISIBILITY
|
||||
#if defined(G_HAVE_GNUC_VISIBILITY) && !defined(__APPLE__)
|
||||
|
||||
EOF
|
||||
|
||||
|
|
|
|||
|
|
@ -599,6 +599,25 @@
|
|||
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;
|
||||
|
|
|
|||
|
|
@ -893,7 +893,8 @@ gdk_quartz_drawable_release_context (GdkDrawable *drawable,
|
|||
if (window_impl->in_paint_rect_count == 0)
|
||||
{
|
||||
_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))
|
||||
|
|
|
|||
|
|
@ -34,9 +34,20 @@ gdk_quartz_osx_version (void)
|
|||
|
||||
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);
|
||||
|
||||
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)
|
||||
|
|
|
|||
|
|
@ -54,7 +54,13 @@ typedef enum
|
|||
GDK_OSX_SIERRA = 12,
|
||||
GDK_OSX_HIGH_SIERRA = 13,
|
||||
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
|
||||
} GdkOSXVersion;
|
||||
|
||||
|
|
|
|||
|
|
@ -104,7 +104,8 @@ 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)
|
||||
if (window_impl->in_paint_rect_count == 0 &&
|
||||
gdk_quartz_osx_version () < GDK_OSX_MOJAVE)
|
||||
{
|
||||
if (![window_impl->view lockFocusIfCanDraw])
|
||||
return NULL;
|
||||
|
|
@ -468,7 +469,8 @@ _gdk_windowing_before_process_all_updates (void)
|
|||
{
|
||||
in_process_all_updates = TRUE;
|
||||
|
||||
NSDisableScreenUpdates ();
|
||||
if (gdk_quartz_osx_version () < GDK_OSX_MOJAVE)
|
||||
NSDisableScreenUpdates ();
|
||||
}
|
||||
|
||||
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
|
||||
* https://gitlab.gnome.org/GNOME/gtk/issues/1479 */
|
||||
if (gdk_quartz_osx_version() >= GDK_OSX_MOJAVE)
|
||||
[[nswindow contentView] setNeedsDisplay:YES];
|
||||
if (gdk_quartz_osx_version () >= GDK_OSX_MOJAVE &&
|
||||
gdk_quartz_osx_version () < GDK_OSX_BIG_SUR)
|
||||
[[nswindow contentView] setNeedsDisplay:YES];
|
||||
[nswindow enableFlushWindow];
|
||||
[nswindow flushWindow];
|
||||
[nswindow release];
|
||||
|
|
@ -502,7 +505,8 @@ _gdk_windowing_after_process_all_updates (void)
|
|||
|
||||
in_process_all_updates = FALSE;
|
||||
|
||||
NSEnableScreenUpdates ();
|
||||
if (gdk_quartz_osx_version () < GDK_OSX_MOJAVE)
|
||||
NSEnableScreenUpdates ();
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
|||
|
|
@ -692,6 +692,7 @@ 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);
|
||||
|
|
|
|||
|
|
@ -2767,6 +2767,10 @@ _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);
|
||||
|
|
@ -2777,8 +2781,7 @@ _gdk_windowing_window_at_pointer (GdkDisplay *display,
|
|||
break;
|
||||
|
||||
screen_to_client (hwnd, screen_pt, &client_pt);
|
||||
hwndc = ChildWindowFromPointEx (hwnd, client_pt, CWP_SKIPDISABLED |
|
||||
CWP_SKIPINVISIBLE);
|
||||
hwndc = ChildWindowFromPointEx (hwnd, client_pt, cwp_flags);
|
||||
|
||||
/* Verify that we're really inside the client area of the window */
|
||||
if (hwndc != hwnd)
|
||||
|
|
@ -2789,6 +2792,8 @@ _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));
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,9 @@
|
|||
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
|
||||
|
|
@ -1139,7 +1142,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
|
||||
|
|
|
|||
|
|
@ -710,7 +710,7 @@ gtk_calendar_init (GtkCalendar *calendar)
|
|||
for (i=0; i<7; i++)
|
||||
{
|
||||
#ifndef G_OS_WIN32
|
||||
tmp_dt = g_date_time_new_utc (2001, 1, i + 1, 12, 0, 0.0);
|
||||
tmp_dt = g_date_time_new_utc (2001, 1, i + 7, 12, 0, 0.0);
|
||||
if (tmp_dt)
|
||||
{
|
||||
tmp_str = g_date_time_format (tmp_dt, "%a");
|
||||
|
|
|
|||
|
|
@ -40,6 +40,9 @@
|
|||
#include "gtktoolbar.h"
|
||||
#include <gobject/gobjectnotifyqueue.c>
|
||||
#include <gobject/gvaluecollector.h>
|
||||
#ifdef GDK_WINDOWING_QUARTZ
|
||||
#include "gdk/quartz/gdkquartz.h"
|
||||
#endif
|
||||
#include "gtkalias.h"
|
||||
|
||||
|
||||
|
|
@ -1357,7 +1360,16 @@ 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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2945,6 +2945,10 @@ 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);
|
||||
|
|
|
|||
|
|
@ -67,7 +67,10 @@ _gtk_quartz_create_image_from_pixbuf (GdkPixbuf *pixbuf)
|
|||
}
|
||||
[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);
|
||||
|
||||
[nsimage unlockFocus];
|
||||
|
|
|
|||
18
gtk/gtkrc.c
18
gtk/gtkrc.c
|
|
@ -808,6 +808,8 @@ 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,
|
||||
|
|
@ -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)
|
||||
{
|
||||
gchar *theme_dir = gtk_rc_get_theme_dir ();
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ print <<EOF;
|
|||
|
||||
#include <glib.h>
|
||||
|
||||
#ifdef G_HAVE_GNUC_VISIBILITY
|
||||
#if defined(G_HAVE_GNUC_VISIBILITY) && !defined(__APPLE__)
|
||||
|
||||
EOF
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue