Set the display for each event that we put.
Also reorganize the dnd_event_put() function a bit, giving it a surface
directly instead of setting it by implication.
https://bugzilla.gnome.org/show_bug.cgi?id=773299
dest_surface is going to always be NULL for source contexts.
Previously we used to put the root window there to pass this check,
but root windows are gone (and root surfaces never existed to begin
with), so we have to adapt.
https://bugzilla.gnome.org/show_bug.cgi?id=773299
This affects gdk_device_query_state() for the virtual device. It has
no window, and is forced to query the display itself, and display
defaults its scale to 1 even for HiDPI desktops. Use the same
"query scale of a NULL monitor" trick that we use in other places
to get the global desktop scale.
https://bugzilla.gnome.org/show_bug.cgi?id=773299
A side effect of vkQueuePresentKHR is the Vulkan implementation calling
wl_surface_commit() on the corresponding Wayland surface. Thus, before
this, we must synchronize the surface state (e.g. opaque region, window
geometry, etc) that changed since last time. Prior to this commit this
was done after calling vkQueuePresentKHR(), causing the surface state to
always correspond to the previous buffer state. As of this commit this
is now done before calling vkQueuePresentKHR(), thus before
wl_surface_commit().
A side effect of eglSwapBuffers* is the EGL implementation calling
wl_surface_commit() on the corresponding Wayland surface. Thus, before
swapping buffers, we must synchronize the surface state (e.g. opaque
region, window geometry, etc) that changed since the last buffer swap.
Prior to this commit, this was done after eglSwapBuffers*, causing the
surface state to always correspond to the previous buffer state. As of
this commit this is now done before swapping the buffers, thus before
wl_surface_commit().
If you want transparent region, you can just render them transparent.
If you want input shaping, use gdk_surface_input_shape_combine_region().
Also remove gtk_widget_shape_combine_region().
... and its implementation in the X11 backend.
GDK does lots of work trying to reduce the region in expose events
so that when the server sends multiple expose events, touching the
same area we can make sure to only redraw stuff once. However:
(1) this is only relevant of there's tons of delay and multiple
expose events get sent
(2) we coalesce multiple events into a single expose event anyway
(3) we do this on the frame clock
But most importantly:
(4) Since the invention of compositing, servers caches all contents
anyway
When building GTK through the CI infrastructure, it would help to have
some ways of testing it; for instance, if we want to verify that theme
changes are useful, or if we want to run the result without necessarily
build it locally.
This is where flatpak comes in handy. By having the CI build a flatpak
buundle, and storing it as an artifact, of the GTK demos, we can easily
point developers and designers to an installable binary that won't break
their system, nor will require development tools and environments to
run.
If a surface is unmapped by the client while gdk is processing updates,
(for example Firefox un-mapping its window on Expose events), the
windowing backend resources might be lost (for example with Wayland)
which can cause a crash in end_paint().
Make sure we drop the cairo surfaces as well when hiding the surface,
that will avoid the crash in gdk_surface_impl_wayland_end_paint() when
trying to attach the staging cairo surface to a released wl_surface,
these will be recreated when needed when the surface becomes visible
again and there is no need to keep such buffers around for a surface
which is not visible anyway.
https://bugzilla.gnome.org/show_bug.cgi?id=793062