See crash reliably reproduced on GIMP when a popup is destroyed on a
drag-begin callback and Wayland data listener callbacks calls the
enter() callback with a NULL surface.
Cf. https://gitlab.gnome.org/GNOME/gimp/-/issues/10515
On Quartz the drawing region must be padded out to a multiple of 4 px
on regular displays and 8 px on Retina ones. Failing to do so used to
cause smearing on multi-monitor mixed-DPI systems but that seems to
have been fixed. There remains a visible flicker in animations.
Padding the GdkWindow width as well as the content frame and cairo
surface causes the frame clock to get frozen if multiple calls to
gtk_window_resize use the same size because
gdk_window_move_resize_internal sees a difference between the window
size and the requested size (the latter isn't padded out) and freezes updates. GdkQuartzNSWindow
windowDidResize is supposed to thaw them, but because the padded-out
width set for the frame doesn't change the window isn't resized and
the frame clock is never thawed.
Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/7188
dfea8c31d9 added a check for portal settings array length but what it really checks is the amount of dbus out arguments.
This commit makes it do what gtk4 does: really check array length.
Fixes: #3838
The Wayland protocols around outputs are truly a disaster.
This is a backport of 854e40c60c0d32 from main in the hope
of getting monitor geometry to work across compositors.
Fixes: #6939
This is a backport from the GTK-4.x update, so that we can aim to
support gtkglsink in gst-plugins-good even on Windows, beyond using
just Cairo in gstsink for rendering.
From the commit message in GTK-4.x, in commit 627ee674:
We might be dealing with GL contexts from different threads, which have more
gotchas when we are using libepoxy, so in case the function pointers for
these are invalidated by wglMakeCurrent() calls outside of GTK/GDK, such as
in GstGL, we want to use these functions that are directly linked to
opengl32.dll provided by the system/ICD, by linking to opengl32.lib.
This will ensure that we will indeed call the "correct" wgl* functions that
we need.
It's mandatory to reply to a xdg_surface.configure with a
xdg_surface.ack_configure, as well as a wl_surface.commit to have the
ack_configure to have any effect. We failed to do that if the new
configuration didn't cause any actual anything to change, meaning we'd
just ack_configure, but potentially never commit.
Fix this by requesting a 'after-paint' frame clock phase, while setting
the pending commit state to true. If we were already to paint, the new
requested phase would happen anyway, but to avoid double
wl_surface.commit when also using eglSwapBuffers*(), also avoid
performing the commit if we know the swap buffers will happen.
Cursor themes have recently started to reduce their coverage of
'legacy' cursor names, and reduced to the standard names. Support
this for the few cursor types that are still used in GTK.
This fixes https://bugzilla.mozilla.org/show_bug.cgi?id=1871627
All GTK3/4 apps on non-GNOME desktops aren't resizable if they are
tiled.
This patch makes the non-tiled edges resizable if we have per-edge
tiling, but not per-edge resizing information.
We might want to make all edges resizable, but that might not be fine
for tiling compositors.
The first time this function is called, has_xdg_output() returns
true, but haven't yet received all the xdg-output events, so wait
for that to be done. Otherwise, the logical size is 0, and nothing
useful comes from that.
This is the gtk3 version of !6722.
This fixes a problem that is apparent in
https://bugzilla.mozilla.org/show_bug.cgi?id=1869724, but that also
reproduces on any GTK application as described in
https://bugzilla.mozilla.org/show_bug.cgi?id=1869724#c16.
xdg_output sizes might be physical if the compositor doesn't scale them,
it seems. So to report the correct logical geometry in GDK pixels, we
need to detect this case. We do this by checking whether the wl_output
size matches the xdg_output size.
Some of the listeners connected during the initial roundtrip assume a
non-NULL selection, when they finally invoke functions such as
gdk_wayland_selection_ensure_offer(),
gdk_wayland_selection_ensure_primary_offer() or
gdk_wayland_selection_set_offer(). The GdkWaylandSelection should
therefore be initialized before the second series of roundtrips, as the
compositor may have already sent a selection by then.
[NSView frame] returns a rectangle in the superview's coordinates, and the
superview of an NSWindow's content view (which is the only NSView that
GdkQuartz instantiates) is an undocumented NSThemeFrame. While it happens
to have the same origin as the content view and the same size as the
window's frame this isn't documented and so could change without notice.
Convert the window frame coordinates to the view's coordinate system to
ensure consistency.
Use the view's bounds instead of its frame: The bounds rectangle is in the
view's coordinate system. Use the parent NSWindow's frame instead of the
private NSThemeFrame's. This ensures that all coordinate comparisons have
the same reference.
Finally, the macOS coordinate systems origin is at the bottom left, so the
title bar is between the content view's height and the window's height,
not in negative y in the view's coordinates. Adjust the y comparisons
accordingly.
Fixes#6297
On Windows with certain keyboard layout combinations you can get a
benign terminal warning like this:
Could not open registry key 'SYSTEM\CurrentControlSet\Control\Keyboard
Layouts\D0010413'
When using a lot of plug-ins, like GIMP does, this warning can show up
a lot of times.
The code after this warning, still has another last check, that, when it
fails, will show a warning.
We change the first g_warning to a g_debug statement, to reduce the
amount of warning messages.
Closes#5109
This fixes potential runtime crashes in some somewhat unlikely
configurations, like a modern compositor but gtk built against an old
wayland protocols version.
We only need v2 for the tiling fixes, so request that.
cairo_image_surface_get_width() and cairo_image_surface_get_height()
return the image size that's in the device pixels.
On the other hand, _gdk_wayland_display_create_shm_surface() takes a
surface size in the logical pixels.
Given that _gdk_wayland_display_get_cursor_for_surface() provides the
desired surface size in device pixels, a much bigger shm surface is
created, which then breaks damage tracking code in
gdk_wayland_device_update_window_cursor().
Fixes#6242
And get the embedder before continuing, as the backend-specific
get_monitor_at_window () only knows about its own windows.
In order to check for offscreen windows, we introduce a new function
gdk_window_is_impl_offscreen (). Unlike gdk_window_is_offscreen (),
it doesn't rely on the window_type field, but actually checks whether
GDK_WINDOW_IMPL_GET_CLASS (window->impl) is GdkOffscreenWindow.
See previous commit for informations.
Checking for offscreen windows with gdk_window_is_offscreen ()
is not enough in this case. What we want here is that the impl
classes match, as backends are meant to know only about their
windows. Instead gdk_window_is_offscreen () checks whether the
GdkWindow.window_type field is GDK_WINDOW_OFFSCREEN.
In the case of child windows in offscreen windows, the window
type is GDK_WINDOW_CHILD, even though their impl is still
GdkOffscreenWindow.
So actually check whether GDK_WINDOW_IMPL_GET_CLASS (window)
matches GDK_WINDOW_IMPL_GET_CLASS (parent).
We may also consider getting the toplevels from child windows,
as transient-for relationships are really about toplevels, but
child windows doesn't seem to cause problems in practice.
The Adwaita cursor theme is moving to shipping just standard cursor
names, so we should fall back to 'default' instead of 'left_ptr' if
a named cursor can't be found.
Fixes: #6259