Simon Ser
0f24d27e0b
xdg-shell: rename wlr_xdg_popup.committed to sent_initial_configure
...
We made a similar change to wlr_xdg_toplevel.
2 years ago
Simon Ser
df0c926a7a
xdg-shell: rename wlr_xdg_toplevel.added to sent_initial_configure
...
This is more descriptive, and avoids the confusion with
wlr_xdg_surface.added.
2 years ago
Simon Ser
e1a1dc4be5
xdg-shell: remove unnecessary return
...
We're at the end of the function anyways.
2 years ago
Simon Ser
e69dd909f7
xdg-shell: reset added/committed flag on unmap
...
When a client attaches a NULL buffer to its wl_surface, it's
unmapped. This resets the xdg_surface in its initial state. An
extra NULL commit makes the compositor send an initial configure
event.
Note, wlr_xdg_toplevel.added is separate from wlr_xdg_surface.added.
Closes: https://github.com/swaywm/sway/issues/7397
2 years ago
Simon Ser
0e54b861e9
seat/keyboard: constify wlr_seat_keyboard_notify_enter()
2 years ago
Simon Ser
695d28c250
seat/keyboard: constify wlr_seat_keyboard_notify_modifiers()
2 years ago
Kirill Primak
79248e4961
xdg-shell: use defunct_role_object error
2 years ago
Kirill Primak
c2fb5289c2
xdg-shell: send invalid_size errors
2 years ago
Kirill Primak
099b9de752
compositor: drop role object NULL checks in handlers
...
Instead, move the check to the caller.
2 years ago
Kirill Primak
acd5a64fd1
xdg-shell: use role object destroy handler
2 years ago
Kirill Primak
1243a855d4
xdg-shell: fix geometry types
2 years ago
Kirill Primak
a049d66dd7
xdg-toplevel: send invalid_parent error
2 years ago
Kirill Primak
ebd4c83cd6
xdg-toplevel: validate resize_edge
2 years ago
Alexander Orzechowski
ef4baea0e2
Use wl_signal_emit_mutable
2 years ago
Kenny Levinsen
7abe8352db
xdg_shell: Destroy popups after unmap event
...
This aligns with wlr_layer_shell_v1, and better matches how we normally use
teardown signals.
2 years ago
Kenny Levinsen
668b2740ff
Set mapped before firing map/unmap events
...
This allows whatever the user calls from the signal handlers to react to observe
the new state rather than the old, e.g. that a surface is no longer mapped in
the unmap handler.
2 years ago
Simon Ser
f1e05a6493
xdg-shell: add support for v5
...
This version adds a wm_capabilities event.
2 years ago
Kirill Primak
5c4384a133
xdg-popup: use configure fields
2 years ago
Kirill Primak
8d2fa15e9d
xdg-toplevel: post no memory on strdup() fail
2 years ago
Kirill Primak
e7b217efb9
xdg-shell: improve shell version check
3 years ago
Simon Ser
e383c1f1db
xdg-shell: add support for v4
...
This adds a configure_bounds event to let the client know of the
preferred maximum window geometry size.
3 years ago
Kirill Primak
c1ec71903c
xdg-shell: bump version to 3
3 years ago
Kirill Primak
1761c3bbe2
xdg-popup: add reposition support
3 years ago
Kirill Primak
8a0835c59c
xdg-positioner: add v3 parameters
3 years ago
Kirill Primak
6f1fce9cb4
xdg-popup: use current/pending state pattern
3 years ago
Kirill Primak
4a968576e4
xdg-popup: add proper configure flow
3 years ago
Simon Ser
8fe3aa29da
xdg-shell: specify version in wlr_xdg_shell_create
...
With protocol additions such as [1], compositors currently have no
way to opt out of the version upgrade. The protocol upgrade will
always be backwards-compatible but may require new compositor
features.
The status quo doesn't make it possible to ship a protocol addition
without breaking the wlroots API. This will be an issue for API
stabilization [2].
To address this, let compositors provide a maximum version in the
function creating the global. We need to support all previous versions
of the interface anyways because of older clients.
This mechanism works the same way as Wayland clients passing a version
in wl_global.bind.
[1]: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/3514
[2]: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/1008
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3397
3 years ago
Kirill Primak
8b0d4947cc
xdg-toplevel: store states on the stack
3 years ago
Kirill Primak
dec2565f2b
xdg-toplevel: don't schedule configures on state requests
3 years ago
Kirill Primak
bf3f60ff73
xdg-toplevel: treat unmapped parents as NULL
3 years ago
Kirill Primak
2d623724c3
xdg-positioner: fix sliding regression
...
This commit fixes a regression introduced in
511f137f8f
where GTK tooltips wouldn't be
unconstrained due to no gravity on x axis being set, in which case the
behavior is ambiguous, by sliding to the right/bottom.
3 years ago
Kirill Primak
511f137f8f
xdg-positioner: rewrite unconstraining, untie from xdg-popup
3 years ago
Kirill Primak
5879e77d68
xdg-positioner: rename structs
...
To be consistent with other wlr_xdg_* structs,
wlr_xdg_positioner_resource is renamed to wlr_xdg_positioner and made
public, and wlr_xdg_positioner is renamed to wlr_xdg_positioner_rules.
Functions which operated on wlr_xdg_positioner were renamed and updated
accordingly.
3 years ago
Kirill Primak
b5b15b2625
xdg-{toplevel,popup}: extract destructors
3 years ago
Kirill Primak
c1a2c09ade
xdg-popup: send invalid_positioner to the right resource
3 years ago
Kirill Primak
7ed60c54a0
xdg-surface: avoid emitting signals with their owner object
...
https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/1008#note_1139647
3 years ago
Kirill Primak
34a71eae31
xdg-shell: drop wlr_xdg_toplevel_set_fullscreen_event
...
Instead, compositors can read relevant values from
wlr_xdg_toplevel.requested.
3 years ago
Kirill Primak
fd3a2a0906
xdg-surface: minor consistency renaming
3 years ago
Kirill Primak
88f3040438
xdg-popup: destroy popup-less grab
...
This also fixes a seat destruction segfaulting if xdg-shell was
destroyed first.
3 years ago
Kirill Primak
d2b36b7bd1
xdg-shell: fix potential use-after-free
3 years ago
Kirill Primak
c35d14ecfa
xdg-shell: extract role-specific unmap logic
3 years ago
Kirill Primak
e59aa3e0e7
xdg-toplevel: change object type in event structs
...
This commit replaces wlr_xdg_toplevel_*_event::surface with a toplevel
field.
3 years ago
Kirill Primak
1e4c1a3b58
xdg-toplevel: change parent type to xdg-toplevel
...
This commit changes wlr_xdg_toplevel::parent type from wlr_xdg_surface
to wlr_xdg_toplevel.
3 years ago
Kirill Primak
27c8865a4d
xdg-shell: unify function arguments' names
...
`wlr_xdg_surface`s are now named "surface" everywhere, and
`wlr_surface`s are called "wlr_surface".
3 years ago
Kirill Primak
41412cadbe
xdg-popup: fix functions' main argument type
...
With this commit, `wlr_xdg_popup_*()` functions now expect
a `wlr_xdg_popup` instead of a `wlr_xdg_surface`.
3 years ago
Kirill Primak
affe0d8713
xdg-toplevel: fix functions' main argument type
...
With this commit, `wlr_xdg_toplevel_*()` functions now expect
a `wlr_xdg_toplevel` instead of a `wlr_xdg_surface`.
3 years ago
Kirill Primak
ee52c32915
xdg-shell: fix create_xdg_popup() param type
3 years ago
Kirill Primak
05dd990e43
xdg-shell: rename surface role handlers
3 years ago
Kirill Primak
50827ed7f5
surface: improve role precommit hook
...
Now the role precommit hook is called before the commit, not on
wl_surface.commit request, and takes a state which is to be applied.
3 years ago
Kirill Primak
28248dd83b
xdg-shell: remove redundant NULL buffer check
...
This is already checked in role precommit handler, and if the buffer is
NULL due to failed upload, that means the surface was already unmapped.
3 years ago