Commit Graph

1568 Commits

Author SHA1 Message Date
Matthias Clasen
205a13eaa0 docs: Brush up the Wayland backend docs
Add some content here.
2021-03-11 16:37:31 +00:00
Emmanuele Bassi
6f93e63d21 docs: Move detached sections into their own content file 2021-03-11 16:37:30 +00:00
Benjamin Otte
0a9d075b47 wayland: Fix memleaks when rendering with Cairo
We were leaking buffers. This wasn't caught by valgrind and friends
because it was shared memory (with the compositor), but top(1) would
instantly see memory consumption of the app and the shell go through the
roof.
2021-03-09 19:52:59 +01:00
Benjamin Otte
b63c4d6722 wayland: Don't call _gdk_surface_update_size() all the time
We were calling _gdk_surface_update_size() every frame, even if the
window size didn't change. This would cause us to discard all cached
buffers and redraw the whole screen.

This was BAD.
2021-03-09 19:50:56 +01:00
Carlos Garnacho
68ced9b553 gdk/wayland: Assign logical pointer to touchpad gesture events
These events don't make sense on physical devices (for starters, they
are relative to the logical pointer position). Use this device for
those events, also happens to be what the upper parts expect of them.
2021-02-25 01:08:07 +01:00
Carlos Garnacho
75ae0e04e1 gdk/wayland: Make more matched settings from the portal as valid
Commit 97b5fad131 was a forward port from a gtk3 patch, but the hunk
was applied on the wrong bits of code.

Ensure the initialization paths also do mark settings read from the
portal as valid, so the checks for optional/newer settings actually have
the expected result. It is also desirable to mark settings as valid
after configuration changes (as that patch did effectively do), but not
enough to fix all situations.
2021-02-24 16:41:13 +01:00
Carlos Garnacho
1fbdfe340e gdk/wayland: Look for font settings recursively
Use the infrastructure already available to look up keys, instead.
This does the right thing and looks up the setting across all
sources.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/3680
2021-02-18 16:50:45 +01:00
Matthias Clasen
bf6a40f39b wayland: Complete our buffer format listing
The debug spew for printing out supported buffer
formats was missing a bunch, among them the fp16
formats that are interesting for HDR support.
Add them.

Note that we still only support ARGB8888. But
at least we can print out what don't support.
2021-02-15 16:42:17 -05:00
Matthias Clasen
aec738745a wayland: Set shadow width on popup surfaces
Take the shadow width from the popup layout into account.
2021-02-14 10:11:17 -05:00
Emmanuele Bassi
3a3e029270 wayland: Move from g_memdup() to g_memdup2()
The g_memdup() function is replaced by a safer version in newer versions
of GLib.
2021-02-11 14:22:22 +00:00
Sebastian Keller
04cf5044da wayland: Signal gtk-shell surface destruction to the server
This adds a "release" destructor for the gtk_surface1 interface which
signals to the server that a surface has been destroyed on the client
side, which the current "destroy" does not do.

Ideally the protocol would have specified a destroy request marked as
destructor to handle this automatically, however this is no longer
possible due to the destroy method being implicitly generated in the
absence of an explicit request in the protocol. Adding a destroy request
marked as destructor now would generate a new destroy method that
unconditionally would send the request to the server, which would break
clients running on servers not supporting that request.
2021-01-28 22:31:03 +01:00
Matthias Clasen
6c54abeca7 wayland: Explicitly announce ssd for kwin
Without this, kwin correctly assumes that we are
using client-side decorations. This is a port
of 32ae97f1 from GTK 3.24.

Fixes: #3609
2021-01-21 22:45:47 -05:00
Emmanuele Bassi
75f2d7583f Abort if the shared memory pool cannot be created
If we cannot allocate memory, we cannot create any windowing system
surface. There's no coming back from that.

Fixes: #3607
2021-01-20 19:10:54 +00:00
Matthias Clasen
187d261400 wayland: Notify on surface changes
When the width, height or scale of a surface changes,
emit property change notification.
2021-01-16 15:22:46 -05:00
Carlos Garnacho
97b5fad131 gdk/wayland: Mark matched settings from the portal as valid
Commit e6209de962 added some checks on TranslationEntry.valid in
order to figure out whether using the new font settings or the
old g-s-d ones. However that's only set in the non-sandboxed case.

This makes sandboxed applications fallback to the old (and also
non-existing with modern g-s-d) settings, possibly resulting in
ugly defaults being picked.

Fix this by also marking TranslationEntry elements as valid when
using the settings portal, precisely those entries that we are able
to read and match with our own table.
2021-01-14 15:57:29 +01:00
Matthias Clasen
01d19e2aa4 Merge branch 'fix-tablet-4' into 'master'
Wayland: ignore touch/tablet events on destroyed surfaces [GTK4]

See merge request GNOME/gtk!3065
2021-01-11 14:44:27 +00:00
wisp3rwind
8312b9d9ca Wayland: ignore touch/tablet events on destroyed surfaces
When destroying a wl_surface (e.g. when a window or menu is closed), the
surface may continue to exist in the compositor slightly longer than on
the client side. In that case, the surface can still receive input
events, which need to be ignored gracefully.
In particular, this prevents segfaulting on wl_surface_get_user_data()
in that situation.

Reported in
https://gitlab.gnome.org/GNOME/gtk/-/issues/3296

The same issue for pointers/keyboards was reported in
https://bugzilla.gnome.org/show_bug.cgi?id=693338

and fixed with in
bfd7137ffb
3625f17857
a8fc099a72
2021-01-10 12:31:37 +01:00
wisp3rwind
992f092968 wayland: avoid set_cursor() when unchanged or invisible
In pointer_surface_update_scale(), only rescale the cursor surface when
the scale has actually changed and the cursor is on at least one output.

fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/3350

Right now, this issue is not completely understood, so it might also
involve some questionable handling of cursor surface by sway/wlroots.

However, irrespective of that issue, this patch avoids unnecessary calls to the
compositor, and there should be no drawback: Whenever the pointer enters
a new output, pointer_surface_update_scale() will be called again, such
that correct scaling of the cursor is still ensured.

There is a slight difference: When the cursor leaves the last output,
previously the image was reset to scale factor 1. Now, it keeps whatever
was last. That might be more sensible than the previous behaviour,
assuming that it's likely that when the cursor enter an output again, it
has the same scaling. Alternatively, if one cares about resource usage
at this level, it might make more sense to destroy the surface than
rescaling to 1.
2021-01-09 11:42:59 +01:00
Timm Bäder
d978ba31d6 glcontext-wayland: Whitespace 2021-01-03 11:01:28 +01:00
Timm Bäder
d7f15c15e9 glcontext-wayland: Avoid heap-alloacting small arrays...
every frame.
2021-01-03 11:01:28 +01:00
Timm Bäder
fff570538c glcontext-wayland: Only allocate configs we use
We only use the first one, so don't allocate space for more than that.
2021-01-03 11:01:28 +01:00
Matthias Clasen
b5fe434fea Revert "Merge branch 'gtk_egl_wayland' into 'master'"
This reverts merge request !3011
2020-12-30 03:32:18 +00:00
Vivek Kasireddy
3344bcaf92 gdk/wayland/surface: Expose gdk_wayland_surface_get_wl_egl_window()
Some GTK based applications such as Qemu UI create and manage
EGLSurfaces associated with the relevant GdkSurfaces. In order to create
an EGLSurface, there needs to be a way to pass the native window
object to eglCreateWindowSurface(). While running in an X environment,
the native window object can be obtained by calling
gdk_x11_surface_get_xid(). Likewise, the native window object can be
obtained by calling gdk_wayland_surface_get_wl_egl_window() while
running in a Wayland environment. Therefore, this API needs to be
exposed to apps.

Signed-off-by: Vivek Kasireddy <vivek.kasireddy@intel.com>
2020-12-28 18:20:04 -08:00
Jonas Ådahl
142f7862ed gdk/toplevellayout: Change API to be about intent, not full state
When being fullscreen, and wanting to unfullscreen but not caring about
whether to go unmaximized or maximized (as this information is lost), if
the GdkToplevelLayout represents the full intended state, we won't be
able to do the right thing.

To avoid this issue, make the GdkToplevelLayout API intend based, where
if one e.g. doesn't call gdk_toplevel_set_maximized() with anything, the
backend will not attempt to change the maximized state.

This means we can also remove the old 'initially_maximized' and
'initially_fullscreen' fields from the private GtkWindow struct, as we
only deal with intents now.
2020-12-16 14:16:08 +01:00
Emmanuele Bassi
99e0929d6c build: Use a consistent style for Meson files 2020-12-15 12:46:59 +00:00
Emmanuele Bassi
7975bbfcaa build: Remove linker flags from static libraries
We only need hardening linker flags on the libgtk shared library;
internal static libraries don't really need them.
2020-12-15 11:36:20 +00:00
Jonas Ådahl
d2c95a1b13 gdk: Replace 'WITHDRAWN' state with async 'is-mapped' boolean
It was used by all surfaces to track 'is-mapped', but still part of the
GdkToplevelState, and is now replaced with a separate boolean in the
GdkSurface structure.

It also caused issues when a widget was unmapped, and due to that
unmapped a popover which hid its corresponding surface. When this
surface was hidden, it emitted a state change event, which would then go
back into GTK and queue a resize on popover widget, which would travel
back down to the widget that was originally unmapped, causing confusino
when doing future allocations.

To summarize, one should not hide widgets during allocation, and to
avoid this, make this new is-mapped boolean asynchronous when hiding a
surface, meaning the notification event for the changed mapped state
will be emitted in an idle callback. This avoids the above described
reentry issue.
2020-12-07 20:37:30 +01:00
Jonas Ådahl
ac17217c69 wayland/toplevel: Don't alwyas skip changing xdg_toplevel state
We only called xdg_toplevel.(un)set_maximize() if the toplevel layout
changed, but this misses the case when the compositor had changed the
maximized state. Change it to call the xdg_toplevel request if either
the local layout changed, or if the layout differs from the current
state.

This fixes an issue where one couldn't unmaximize a window by double
clicking the titlebar that, had previously been maximized e.g. using a
keyboard binding.

Do the same for fullscreen.
2020-12-07 20:37:29 +01:00
Jonas Ådahl
3bbeb891c4 gdk/surface: Allow inhibit layout from backend
If compute_size() returns TRUE, the layout will not be propagated to
GTK. This will be used by the X11 backend to queue asynchronous resizes
that shouldn't yet allocate in GTK.
2020-12-07 20:37:29 +01:00
Jonas Ådahl
8396bdb759 wayland/surface: Reset last sent min/max size when hiding
As with the window geometry, the last sent min/max values must be reset
so they are sent again next time the surface is shown.
2020-12-07 20:37:29 +01:00
Jonas Ådahl
351d88f7ae wayland/surface: Clear shadow width when hiding
Not doing this means the next time the same surface is shown, if the
shadow size wasn't changed, it wouldn't be sent to the compositor, which
then would result in compositor deriving its own window geometry which
would include the shadow margin.

This fixes an issue where the file chooser dialog would grow each time
it opened.
2020-12-07 20:37:29 +01:00
Jonas Ådahl
6ee7535af0 gdk/toplevelsize: Rename 'margin' to 'shadow' and 'shadow_width'
This makes it more consistent with everywhere else.
2020-12-07 20:37:29 +01:00
Jonas Ådahl
3f96d4b6da gdk: Always get shadow width via GdkToplevelSize
This removes the gdk_surface_set_shadow_width() function and related
vfuncs. The point here is that the shadow width and surface size can now
be communicated to GDK atomically, meaning it's possible to avoid
intermediate stages where the surface size includes the shadow, but
without the shadow width set, or the other way around.
2020-12-07 09:46:39 +01:00
Jonas Ådahl
0dcd4a5bdb wayland: Stop emitting size-changed
It's dealt with by GdkSurface::layout now.
2020-12-07 09:46:39 +01:00
Jonas Ådahl
e51c32b9c1 gdk/wayland: Always compute-size if GTK asked fer layout 2020-12-07 09:46:39 +01:00
Jonas Ådahl
048a0172a0 gdk/wayland: Always configured size when resizing
GTK4 doesn't support arbitrary constraints when resizing a window (e.g.
steps, or aspect ratio), so we don't need to care about the result from
compute-size when doing interactive resizing.
2020-12-07 09:46:39 +01:00
Jonas Ådahl
ecd40fa265 wayland: Layout drag icon from GdkSurface::layout 2020-12-07 09:46:39 +01:00
Jonas Ådahl
d38f81999e wayland: Communicate popup layout changes via GdkSurface::layout
By moving popup layout emission to the layout phase, the current
GdkPopup::poup-layout-changed signal has no value on its own as it'd be
ignored by GtkPopover.

Make the Wayland backend communicate the popup layout changes via the
common signal; but leave the rest intact until other backends catch up.
2020-12-07 09:46:39 +01:00
Jonas Ådahl
efcfd23652 wayland/surface: Restructure fields used for the next layout
Put them in a anonymous struct, and separate the toplevel specific ones
into another anonymous struct inside the first one. Later popup related
fields will be added.
2020-12-07 09:46:39 +01:00
Jonas Ådahl
13931463bd wayland/surface: Compute size on layout
Stop using the 'compute-size' phase of the frame clock, use the layout
phase instead, now that GTK isn't using the layout phase anymore.
2020-12-07 09:46:39 +01:00
Jonas Ådahl
8d4f8f0cfc wayland: Concentrate size computation to 'compute-size' phase
This includes computing the surface size, including shadow margin,
setting the surface size, during the 'compute-size' clock phase.
2020-12-07 09:46:39 +01:00
Jonas Ådahl
289b50785b wayland/surface: Don't save uninitialized size
GdkSurface's are initialized to have the size 1x1, as otherwise we'd
receive an X11 error, would a corresponding X11 window be created.

This confuses the "saved size" mechanisms in the Wayland backend, as
treats 0 as uninitialized, and not 1.

Fix this simply not saving size that if it's smaller or equal than 1.
2020-12-07 09:46:39 +01:00
Jonas Ådahl
251bd15597 wayland: Apply new surface state at the beginning of a frame
Concentrate state application to the start of a frame; this is to avoid
having GTK going back and forth between different state if so would
happen between two frames.
2020-12-07 09:46:39 +01:00
Jonas Ådahl
18d92c3f16 wayland: Keep pending initial state separate
Queue it, and then wait for it to actually take effect, i.e. be
confirmed via a configure event from the compositor, before setting the
actual GdkSurface::state value.
2020-12-07 09:46:39 +01:00
Jonas Ådahl
641915974b gdk/toplevel: Make gdk_toplevel_present() async
The plan is to concencrate size computations as part of the frame clock
dispatch, meaning we shouldn't do it synchronously in the present()
function.

Still, in Wayland, and maybe elsewhere, it is done in the present()
function, e.g. when no state change was made, but this will eventually
be changed.
2020-12-07 09:46:39 +01:00
Jonas Ådahl
528ec4dded wayland: Only set mapped state when mapped
Mapping a surface under Wayland is an asynchronous process, where one
creates a surface and commits an initial state without having drawn
anything, then waiting for a configuration, which then is acknowledged
and content is painted and committed. Not until having received this
configuration is a surface actually mapped, so wait with setting the
mappedness until this.
2020-12-07 09:46:39 +01:00
Jonas Ådahl
366b946f5b wayland/popup: Use maybe_notify_mapped() helper 2020-12-07 09:46:38 +01:00
Jonas Ådahl
9e6a55a086 wayland: Decouple mapped state from surface creation 2020-12-07 09:46:38 +01:00
Matthias Clasen
7551f85d4c Merge branch 'wayland-minimize' into 'master'
wayland: Implement minimization

Closes #2688

See merge request GNOME/gtk!2861
2020-11-18 14:23:56 +00:00
Matthias Clasen
3f1bc740e4 wayland: Implement minimization
Use the set_minimized method of the xdg_toplevel
interface to implement minimization as well as possible.
It is not possible, since there is no corresponding
state that we could use to update our surface state,
but in practice, it works well enough.

Fixes: #2688
2020-11-17 19:57:56 -05:00
Carlos Garnacho
745cbc6c91 gdk/wayland: Update to gtk_shell1 version 3
Bring in line with gtk3, in terms of startup notification and
activation support.
2020-11-18 00:41:46 +01:00
Qiu Wenbo
437f902c9d Fix a warning caused by difference between prototype and definition
This commit fix the warning:

../gdk/wayland/gdkdisplay-wayland.c:1079: Warning: GdkWayland: gdk_wayland_display_set_cursor_theme: unknown parameter 'name' in documentation comment, should be 'theme'
2020-11-17 14:59:14 +08:00
Matthias Clasen
1d86086434 gdk: Docs cosmetics
Add a few missing parameters in doc comments.
2020-11-16 07:44:17 -05:00
Matthias Clasen
06fbad0b26 wayland: Plug listmodel memory leaks
We were leaking references returned from g_list_model_get_item
in some places.
2020-11-10 09:05:55 -05:00
Carlos Garnacho
80f5be8b13 gdk/wayland: Ensure to update input area on map
If a surface is hidden, then shown again, it should preserve the
input area specified. Make sure that happens.
2020-11-05 21:29:20 +01:00
Sophie Herold
cd0bef9390 Add some missing nullable return annotations 2020-10-17 15:32:36 +02:00
Matthias Clasen
bf58b6f88c Merge branch 'ebassi/for-master' into 'master'
GdkWayland API cleanups

Closes #3249

See merge request GNOME/gtk!2688
2020-10-15 16:55:19 +00:00
Matthias Clasen
1d40f29776 wayland: Make gdk_wayland_device_pad_set_feedback private
It is not a generally useful api, and awkwardly named.
2020-10-15 12:00:00 -04:00
Jonas Ådahl
7dfb25f124 wayland/surface: Clear has_uncommitted_ack_configure when hiding
The 'has_uncommitted_ack_configure' state was added to make sure we're
responding to 'xdg_surface.configure' events with
'xdg_surface.ack_configure' requests, as is necessary according to spec.
What we didn't do was to clear this state when hiding, meaning that if
we hid the surface after a configure event, but before the frame
finished and we processed the 'has_uncommitted_ack_configure', we'd try
to acknowledge the surface configuration after having destroyed the
surface.

Closes: #3262
2020-10-15 14:56:06 +02:00
Emmanuele Bassi
9377192102 Correctly annotate gdk_wayland_seat_get_wl_seat()
We expect a `GdkWaylandSeat` as the instance parameter.
2020-10-14 11:57:06 +01:00
Emmanuele Bassi
da007ac97b Add a public header for GdkWaylandSeat
We have public API requiring it as a type.
2020-10-14 11:55:34 +01:00
Emmanuele Bassi
13aa053f6b Rename libgtk_only symbol in GdkWaylandToplevel
All public non-exported symbols in GDK can be used by GTK.
2020-10-12 16:49:10 +01:00
Emmanuele Bassi
38304fc138 Hide gdk_wayland_display_prefers_ssd()
The function is not exported, so it should not be in a public header.
2020-10-12 16:44:05 +01:00
Emmanuele Bassi
da6c0f3ecb Move private GdkSurface Wayland API into its own header
This allows us to hide private API from installed headers,
documentation, and introspection.
2020-10-12 16:40:19 +01:00
Emmanuele Bassi
f83ee2ab6a Add type annotations for GdkWayland API
The GdkWayland API takes generic GDK types and performs a run time
check, which means we need to properly annotate the actual expected
type in order to have methods recognised as such.
2020-10-12 14:07:26 +01:00
Emmanuele Bassi
33e84edf0c Skip GdkWayland symbols that use wayland-client types
The wayland-client API does not have introspection annotations, so we
can't use these types anyway.
2020-10-12 14:07:26 +01:00
Matthias Clasen
e602d67e59 wayland: Stop using gdk_surface_new_temp
No need to roundtrip through the frontend to create
one of our own surfaces.
2020-10-07 21:02:22 -04:00
Matthias Clasen
082edd957e wayland: Don't forget to reapply margins
When using the saved size because the compositor
told us to, we were forgetting to readd the margins.

The visible symptom of this was the window getting
smaller every time we went to tiled state and back.
2020-10-05 20:17:50 -04:00
Matthias Clasen
e5cd2568c8 wayland: Don't save size when tiled
Don't remember the surface size when we are in tiled
state either. This matches the 'fixed_size' condition
in gdk_wayland_surface_configure_toplevel.

This change fixes an issue where moving a window first
to tiled, then to maximized state and back would lead
to the unmaximized window having the tiled dimensions.
2020-10-05 20:15:33 -04:00
Matthias Clasen
d51608a2c9 wayland: Don't emit premature configure events
We should not emit configure events before we are realized - size
changes at this point are not relevant.

This gets rid of a mysterious emission of GdkSurface::size-changed
with a size of 52x52, that is happening when GtkWindow sets the
shadow_width before the window is mapped.
2020-10-05 17:18:14 -04:00
Matthias Clasen
165768b6ad wayland: Match header and doc arguments
gtk-doc doesn't take this lightly.
2020-09-29 07:04:07 -04:00
Robert Mader
9ea0469ab0 gdk/wayland: Replace gtk-primary-selection with primary-selection-unstable-v1
The later is the public upstream version, while identical implementation wise.

https://gitlab.gnome.org/GNOME/gtk/-/issues/2591
2020-09-27 16:23:42 +02:00
Matthias Clasen
bb402a1f1d wayland: Fix grabbing popup
A typo snuck into commit 3023a61e1d that
caused us to fail all grabbing popups with
"grab failed: not viewable". Fix that.
2020-09-20 10:02:53 -04:00
Matthias Clasen
93cfa3855c Merge branch 'wayland-backend-api-cleanup' into 'master'
wayland: Change backend api to use GdkToplevel

See merge request GNOME/gtk!2598
2020-09-19 18:19:18 +00:00
Matthias Clasen
dd0da0f3cc passwordentry: Add an ::activate signal
GtkSearchEntry has one, no reason why GtkPasswordEntry
should not as well.

Fixes: #3174
2020-09-19 13:25:03 -04:00
Matthias Clasen
3023a61e1d wayland: Change backend api to use GdkToplevel
Most of the surface api we have in the Wayland backend
only makes sense for toplevels, so reshuffle things to
take a GdkToplevel instead of a GdkSurface.

Update all callers and the docs.
2020-09-19 13:07:11 -04:00
Jonas Ådahl
4200936f21 wayland/surface: Make sure to commit ack_configure
We must wl_surface.commit after xdg_surface.ack_configure to make it
have an effect. We failed to do so when a configure event didn't result
in new updates, so make sure we fall back on an simple
wl_surface.commit if there was no new actual frame painted.

Closes: #2910
2020-09-17 18:20:08 +02:00
Jonas Ådahl
1abcd6f304 wayland: Commit surface from cairo context
In order to make the cairo renderer/context behave more similar to how
the OpenGL and Vulkan renderer/context behaves, request a frame callback
and commit in the end frame vfunc.

This means the end frame vfunc in cairo does

 * attach buffer
 * request frame callback
 * sync surface state
 * commit

Where as e.g. the OpenGL version of the same flow does

 * attach buffer
 * request frame callback
 * sync surface state
 * eglSwapBuffers()

where eglSwapBuffers() indirectly calls wl_surface_commit().
2020-09-17 17:35:35 +02:00
Jonas Ådahl
f87de393b5 wayland/surface: Remove 'committed' signal
It wasn't used by anything anymore, lets remove it.
2020-09-17 16:01:08 +02:00
Matthias Clasen
929a56e53c Clean up lots of GTK+ -> GTK
Replace most remaining uses of GTK+ in the docs and
user-visible strings by GTK. Also remove some leftover
"Was added in 3.x" sentences from the docs.
2020-09-12 12:01:04 -04:00
Matthias Clasen
93078e52c0 gdk: Rename GdkSurfaceState to GdkToplevelState
That is what it is.

Fixes: #2790
2020-09-10 00:39:03 -04:00
Matthias Clasen
ccb447da02 Merge branch 'wip/baedert/for-master' into 'master'
Wip/baedert/for master

Closes #2777

See merge request GNOME/gtk!2503
2020-08-31 16:30:21 +00:00
Julien Ropé
665955b81e Fix resource leak in gdk_display_close() under Wayland
When using the gdk_display_close(), the handle to the Wayland compositor was not released. This could cause the consumption of all available handles, preventing other processes from accessing the display.

Fixing this by calling wl_display_disconnect() when releasing the GdkWaylandDisplay object.

Signed-off-by: Julien Ropé <jrope@redhat.com>
2020-08-31 17:46:18 +02:00
Timm Bäder
b0d89b1882 wayland: Fix a GSettingsSchema leak 2020-08-29 16:46:28 +02:00
Matthias Clasen
81e113d8aa Merge branch 'wip/carlosg/shuffle-font-mouse-settings' into 'master'
Look up font and mouse settings in gsettings-desktop-schemas

See merge request GNOME/gtk!2489
2020-08-27 00:08:45 +00:00
Alexander Mikhaylenko
0a59429dc8 wayland: Fix dnd hotspot movement
_gdk_wayland_surface_offset_next_wl_buffer() moves the surface relatively
to its current position, pass it a delta instead of new position.
2020-08-27 04:04:48 +05:00
Carlos Garnacho
6421355065 gdk/wayland: Use double-click/drag-threshold settings from g-d-s
Handle both these settings, and the older settings-daemon ones for
backwards compatibility. The keys are already checked for existence
in the schema, so it will just use the existing ones.
2020-08-27 00:27:50 +02:00
Carlos Garnacho
536966e848 gdk/wayland: Look for font settings in gsettings-desktop-schemas
Prefer this location, but also look for the old location in
settings-daemon for backwards compatibility. This applies to both
direct settings lookups and via the settings portal.
2020-08-27 00:18:09 +02:00
Matthias Clasen
0d82fcf76f wayland: Drop unused argument from query_state
Now that this is backend-only api, we can just
drop unused arguments.
2020-08-26 17:56:41 -04:00
Matthias Clasen
0091de63b4 wayland: Fix return value of get_device_state
We need to look a the position, not the child surface.
2020-08-26 17:56:41 -04:00
Matthias Clasen
8c9e1e7444 wayland: Stop using the query_state vfunc
Just call the backend implementation directly.
2020-08-26 17:56:41 -04:00
Matthias Clasen
125ed52ccb Merge branch 'new-sysprof' into 'master'
Port profiling to sysprof-collector api

See merge request GNOME/gtk!2457
2020-08-21 23:58:09 +00:00
Matthias Clasen
d4e069a629 Port tracing to the sysprof collector api
Use the new sysprof collector api to do tracing.
2020-08-21 10:55:01 -04:00
Björn Daase
6315cd977c *: Fix spelling mistakes found by codespell 2020-08-21 15:29:34 +02:00
Matthias Clasen
3d7343144f wayland: Drop unused surface type hint field
This wasn't used at all.
2020-08-13 22:24:06 -04:00
Matthias Clasen
a85fc0008c wayland: Don't send invalid anchor rectangles
When we send an anchor rectangle with a width or
height of 0, mutter reponds with "Invalid anchor
rectangle size". So, don't do that.

This was seen as sudden disappearance of gtk4-demo
when you click the fishbowl benchmark all the way
through to the menubuttons.

Fixes: #3027
2020-08-09 16:02:25 -04:00
Jonas Ådahl
6724d4250f wayland/toplevel: Don't leak wl_callback used during present() 2020-08-07 14:01:16 +02:00
Jonas Ådahl
c27f811462 wayland/surface: Destroy toplevel present callback if ignored
We might break the loop early, e.g. if we're unmapped before the round
trip finishes, and to avoid the callback to write to invalid stack
memory, destroy the callback so it won't be invoked.

Fixes: #3026
2020-08-07 09:06:21 +02:00
Jonas Ådahl
3590923c8b wayland/surface: Fix toplevel present roundtrip condition
We should round trip until we both have received callback and have
ensured we received the initial configuration.
2020-08-07 09:06:21 +02:00
Matthias Clasen
12450cfcef wayland: Don't leak content formats
We were not unreffing the formats here.
2020-08-06 20:02:33 -04:00