On desktop GL, GL 1.5 or GL_ARB_occlusion_query is required to get the
glGenQueries() etc. symbols. This isn’t the case on GLES, where they
are provided by GL_EXT_occlusion_query_boolean, and more importantly
have never been made core.
This patch allows gtk4-demo to start when GDK_DEBUG=gl-gles is set, on
my Mali 400 MP running the Lima driver from Mesa.
Check the text handle role, instead of looking for the other handle
visibility. The other handle may be invisible during selection mode
(e.g. pointing to offscreen contents). This fixes both this code
switching to cursor mode out of the blue, and possible crashes later
on as this handle might be hidden in the process, while its own event
controller is handling events on the parent surface.
The gtk_text_view_set_handle_position() function called some lines above
takes care of handle visibility already, also accounting for other
conditions (e.g. whether the handle points to contents onscreen).
Forcibly showing handles here misbehaves if the handle should stay hidden,
and somewhat expensively as it involves creating and throwing a native
surface every time.
With the scrolledwindow drag gesture not claiming the sequence immediately,
we end up placing the cursor (and undoing the previous selection) each time
we scroll.
There is already handling too short drags in ::drag-end, so let this code
handle touchscreens as well.
If the gesture becomes captured (e.g. from a parent scrolledwindow), we
leave some things in the air. Clean these up properly. This is recurrent
with touch scroll.
In destruction paths of a focused entry, the IM context might first
end up detached from its widget, then destroyed. This currently prevents
the IM context from detaching itself from the GtkIMContextWaylandGlobal.
Make it do so when unsetting the client widget, so the IM context gets
properly unfocused before destruction.
Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/3176
In wayland, popup positioning and event handling are doubly async.
This makes it unreliable to figure out parent surface coordinates
out of the popup position and the events received. This results in
jumpy text handles there.
The best way to deal with parent surface coordinates is to handle
the events there. Make the handles transparent to input, and make
the drag gesture be set up on the parent widget's native.
The gesture is set up in the capture phase, setting it on the native
(as opposed to the parent widget) achieves a feeling similar to it
being a distinct surface, as it should take precedence over other
gestures in the emission chain (e.g. scrolledwindows).
As everything is in parent widget's native's coordinates, the drag
handles become smooth again.
The intended use case of the "presentation" role is
| […] when an element is used to change the look of the page but does not
| have all the functional, interactive, or structural relevance implied
| by the element type, or may be used to provide for an accessible
| fallback in older browsers that do not support WAI-ARIA.
One of the examples is, literally:
| An element whose content is completely presentational (like a spacer
| image, decorative graphic, or clearing element);
Which fits perfectly for the GtkTreeExpander's "indent" builtin icon
widget.
Mark gtk_drag_icon_create_widget_for_value with
GDK_AVAILABLE_IN_ALL, since it is meant to be public.
Also, clarify the documentation a bit.
Fixes: #3325