We need to free the queued context list in dispose
if we didn't get to register the contexts, and we also
need to free the list properly when we do get to
register them.
This showed up in valgrind as leaked GList structs.
Only the scroll velocity factor is backported here, the scroll unit
event API is notably missing, so this implicitly applies to all smooth
scroll events.
The number also accounts for the 1/10th factor applied in GDK, compared
to the code in main.
Don't return to the main loop, instead force a run of the paint idle.
The paint idle will know to skip all the phases that aren't requested.
This is critically important becuase gdksurface.c assumes the
FLUSH_EVENTS and RESUME_EVENTS phases are matched, and we cannot
guarantee that if we return to the main loop and let various reentrant
code change the frame clock state.
This would lead to bugs with events being paused and never unpaused
again or even crashes.
Fixes#4941
DnD under Windows needed 3 fixes to work with Gtk.DropTarget.
1. The droptarget_w32format_contentformat_map list never gets
filled so the gdk_win32_drop_read_async throws
"No compatible transfer format found".
This is an easy fix and done the same way in the win32 clipboard code.
2. After a drop no gdk_drop_emit_leave_event gets emitted.
This causes a second drop to trigger a bunch of assertion
'self->drop == drop' failed because the first drop is still active.
This is also an easy fix and done the same way by the macos backend.
3. Handling gdk_drop_status/gdk_drop_get_actions interaction.
In gtk_drop_target_do_drop the code
```gdk_drop_finish (self->drop, gdk_drop_get_actions (self->drop));```
calls the finish operation with the actions of the drop which triggers
```g_return_if_fail (gdk_drag_action_is_unique (action));```
in gdk_drop_finish. The code assumes that GdkDrop::actions gets
narrowed down by calling gdk_drop_status. This is hard to assure
because at the same time gdk_drop_get_actions is used by
gtk_drop_target_accept to figure out if a drag is accepted.
GdkDrop::actions serves a double purpose here as the supported source
actions and the currently agreed on action. Both the x11 and the
wayland backend get this wrong somewhat too. Under wayland/x11 when
a drag coming from a source that supports both MOVE and COPY is
first hovering a drop target that only supports COPY it is afterwards
no longer accepted by other drop targets only accepting MOVE.
Under x11 this is permanent for this drag but with wayland the drag
recovers when hovering other widgets. The win32 backend now sets the
supported source actions before any enter/move/drop and narrows them
down in gdk_win32_drop_status.
The patch only touches the win32 backend and fixes all three issues,
for me restoring DnD under windows.
Closes#4498
Gridview fix rubberbanding issues
Closes#3462 and #3445
See merge request GNOME/gtk!4688
(cherry picked from commit 0c052c9a37)
2bcae546 gridview: Move gtk_grid_view_computer_total_height() up for reuse
c6f357e4 gridview: Limit rectangle to gridview columns
1e9a36ff gridview: Allow starting rubberband in empty space below last row
ba909cf9 gridview: Fix get_items_in_rect() selection
f3fc8f5b gridview: Return an empty bitset when selecting only empty space
57c032e6 listbase: Clear selection if rubberband selected an empty set
aba2d994 gridview: Fix typo in docstring for gtk_grid_view_get_cell_at_y()
e14b84ff listview: Return an empty bitset when selecting only empty space
d6fab140 listview: Allow starting rubberband in empty space below last row
a7bbc258 listview: Fix selection for last item in get_items_in_rect
Functions already exist for providing a unique drag action for gdk_drop_finish().
Reuse these functions in the drag_enter/motion callbacks, since they require
a unique action as the return value.
Fixes#3187
DnD Fix Preferred Action for X11
Closes#4259
See merge request GNOME/gtk!4785
(cherry picked from commit 09da4db81f)
c9c48d78 gdkdrop-x11: Fix preferred action
16fd2608 gdkdrop-x11: Use the preferred action if possible
We haven't had any scalable directories in this list.
Add some. Since we seem to have settled on including
just actions and status as subdirectories for each
size, add scalable/actions and scalable/status.
Fixes: #4960
Use a separate queue to dispatch the token object exclusively, just like we
do on the GdkSurface activation paths.
(cherry-picked from commit fb68600d88)
This brings back a subset of what quit-mnemonic.ui tested for, but
trying a lot harder to trigger the label overdrawing its allocation,
which will cause the text to be cut off when clipping is happening.
It should not be an issue at all with GTK4, but keeping that test around
is a good idea.