We were getting our gl and dmabuf texture mixed up and ending
up freeing the Texture structs while they were still used as
callback data for dmabuf texture destroys. Avoid that by keeping
separate pointers for the gl and dmabuf textures.
Fixes: #6623
The goal is to generate an offscreen at 1x scale.
When not ceil()ing the numbers the offscreen code would do it *and*
adjust the scale accordingly, so we'd end up with something like a
1.01x scale.
And that would cause the code to reenter this codepath with the goal to
generate an offscreen at 1x scale.
And indeed, this would lead to infinite recursion.
Tests included.
Fixes#6553
The parsing for a `GTK_TYPE_SHORTCUT_ACTION` on a GtkShortcut in a
builder file can fail, resulting in a `NULL` GtkShortcutAction. This
currently does not result in any warnings, potentially making typos in
builder files tricky to debug.
Since `gtk_shortcut_action_parse_builder()` already sets an error if it
fails, we can just use that and simply return false.
This drops cursor and eraser source names to account for their removal
from GdkInputSource so that GDK_DEBUG=input debug message correctly
prints source type in X11 environment.
Fixes: c1d90273 ("gdk: Drop GDK_SOURCE_ERASER")
Fixes: 3285f52d ("gdk: Drop GDK_SOURCE_CURSOR")
Closes: #6619
When we look for the texture to attach to the subsurface, keep
track of transforms we see along the way, and look at their scale
component to determine if the texture needs to be flipped.
We currently don't allow rotations here.
This fixes glarea rendering being upside-down when offloaded.
Allow to specify a D₂ transform when attaching a texture to a
subsurface, to handle flipped and rotated content. The Wayland
implementation handles these transforms by setting a buffer
transform on the subsurface.
All callers have been updated to pass GDK_TEXTURE_TRANSFORM_NORMAL.
GtkShortcutManager allows adding controllers to it. For the default
implementation, they get added to one of two models, based on the
propagation phase (either GTK_PHASE_CAPTURE or GTK_PHASE_BUBBLE).
However, when a controller is removed, its presence in the manager gets
checked against the current propagation phase of the controller, which
may have changed from when it was added. This can lead to crashes if the
controller was not disposed properly since it still has a reference in
one of the two models of the GtkShortcutManager.
To fix this, add a callback for `notify::propagation-phase`, which
removes the controller from all possible models and readds it again with
its current phase. This callback is only disconnected permanently when
the controller is manually removed with
`gtk_shortcut_manager_default_remove_controller()`.
Closes#6246