aboutsummaryrefslogtreecommitdiffstats
path: root/sway/desktop/xdg_shell.c
Commit message (Collapse)AuthorAge
* xdg-shell: send WM capabilitiesLibravatar Simon Ser2024-03-08
|
* xdg-shell: implement popup repositioningLibravatar Simon Ser2024-03-08
|
* Define _POSIX_C_SOURCE globallyLibravatar Simon Ser2024-02-23
| | | | See discussion in https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4555
* xdg_shell: Extract struct for popup descriptorLibravatar Alexander Orzechowski2024-02-12
|
* ext-foreign-toplevel-list: Implement protocolLibravatar Merlin Lex2024-02-12
| | | | References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4543
* scene_graph: Implement toplevel clippingLibravatar Alexander Orzechowski2024-01-18
|
* Delete old damage tracking codeLibravatar Alexander Orzechowski2024-01-18
| | | | The new scene graph abstraction handles this for us.
* scene_graph: Port view saved buffersLibravatar Alexander Orzechowski2024-01-18
|
* scene_graph: Port xdg_shellLibravatar Alexander Orzechowski2024-01-18
|
* view: init function should return a success boolLibravatar Alexander Orzechowski2024-01-18
|
* xdg-shell: chase events updateLibravatar Kirill Primak2023-11-23
|
* xdg-shell: send maximized if tiled isn't supportedLibravatar Kirill Primak2023-10-29
| | | | wlroots doesn't do it automatically anymore.
* xdg_shell: don't update wlr_toplevel if the container has no size yetLibravatar Dudemanguy2023-10-27
| | | | | | | | | | 3d5ae9813d390ea747462fc0026ee43b7c77d0f2 added logic to change the underlying wlr_toplevel size for floating containers, but it does it even if the container has no actual coordinates yet. This doesn't really make sense to update the toplevel size in this case since there's many things that could affect the initial coordinates (sway commands, fullscreen state, etc.). Skip this by doing a crude check to see if the current container state has any width.
* xdg_shell: update wlr_toplevel size on client resizesLibravatar Dudemanguy2023-08-28
| | | | | | | | | | | | If a floating client resizes itself, sway updates several of its internal dimensions to match but not wlr_toplevel. This means that the next time wlroots sends a toplevel configure event, it can have wrong coordinates that resize the client back to its old size. To fix this, let's just use wlr_xdg_toplevel_set_size so the wlr_toplevel has the same dimensions as sway. Exactly the same as 0183b9d35d0ce750588e700e536b7d2e367b0d0a but the logic is onlly applied to xdg_shell and not xwayland.
* chore: chase wlroots map logic unificationLibravatar Kirill Primak2023-06-02
|
* xdg_shell: Fix crash if popup generates while toplevel is in the scratchpadLibravatar Alexander Orzechowski2023-04-16
|
* xdg-shell: schedule a configure on maximize requestLibravatar Kirill Primak2022-05-27
| | | | | This commit reverts 03879290dbee26127f6867ef60bc2a7f9a6c8c5f and fc84bcb7fb0ffa29b1f9bed287762241a3473803.
* chore: chase wlroots xdg-shell updateLibravatar Kirill Primak2022-05-27
|
* Don't enter seatop_move_floating when fullscreenLibravatar Thomas Hebb2022-02-24
| | | | | | | | | | | Currently, a floating window that's been fullscreened can send us xdg_toplevel::move, and we'll enter seatop_move_floating, which lets us drag the surface around while it's fullscreen. We don't want this--fullscreen surfaces should always be aligned to the screen--so add the same check that seatop_default already does when entering this mode. Tested with Weston's weston-fullscreen demo, which sends a move request if you click anywhere on its surface.
* xdg-shell: use wlr_xdg_popup in sway_xdg_popupLibravatar Simon Ser2022-02-07
| | | | Improved type safety.
* xdg-shell: use wlr_xdg_toplevel in sway_viewLibravatar Simon Ser2022-02-07
| | | | | | Improved type safety. Closes: https://github.com/swaywm/sway/issues/6813
* Chase wlroots xdg-shell refactorLibravatar Kirill Primak2022-02-03
|
* xdg-shell: use toplevel geometry to adjust the popup boxLibravatar Aleksei Bavshin2022-01-12
| | | | | | | | | | | | | `popup_unconstrain` uses view coordinates to init the output box for popups. However wlroots expects the box to be set in a toplevel surface coordinate system, which is not always equal to view. The difference between those is a window geometry set via xdg-shell. GTK4 reserves some space for client-side decoration and thus has a window with top left corner not matching to (0, 0) of a surface. The box calculated without taking that into account was slightly shifted compared to the actual output and allowed to position part of the popup off screen.
* Fix compile after wlroots commit c3e54021f8bbf3ec1c1e5906459be0ae85f5fb8cLibravatar Tassilo Horn2021-10-07
|
* Chase wlr_xdg_surface breaking changesLibravatar Simon Ser2021-10-01
| | | | | | See [1]. [1]: https://github.com/swaywm/wlroots/pull/3106
* Revert "xdg_shell: schedule configure on maximize requests"Libravatar Kirill Primak2021-09-21
| | | | | This reverts commit 4dd46f06acc520449b980a5ea52be544cc5bfb6d, as the logic is now handled by wlroots.
* xdg-shell: chase wlr xdg toplevel refactorLibravatar Kirill Primak2021-09-21
|
* view: fix child position calcLibravatar Kirill Primak2021-09-08
| | | | | Previously, the position was calculated incorrectly for nested subsurfaces.
* xdg-decoration: let floating clients set bordersLibravatar Dudemanguy2021-08-12
| | | | | | | | | The xdg-decoration protocol allows clients to request whether they want to use server side decorations or client side decorations. Currently, sway ignores this and always enforces whatever the server is currently set to. Although tiled clients cannot be allowed to set borders, there is no harm in listening requests from floating clients. Sidenote: also fix an unrelated style error.
* xdg-shell: ignore unecessary fullscreen request ouput hintsLibravatar Ronan Pigott2021-04-26
|
* shells: Update comment about size change on commitLibravatar Kenny Levinsen2021-02-23
|
* transaction: Note if instructions are server requestsLibravatar Kenny Levinsen2021-02-23
| | | | | | | | | On server request, we need to send configure events to inform the client of the new intended size. If the client changes size itself, sending a configure event will only cause problems. Use transaction_commit_dirty_client to distinguish between the two transaction causes.
* container: Move pending state to state structLibravatar Kenny Levinsen2021-02-16
| | | | | | | | | Pending state is currently inlined directly in the container struct, while the current state is in a state struct. A side-effect of this is that it is not immediately obvious that pending double-buffered state is accessed, nor is it obvious what state is double-buffered. Instead, use the state struct for both current and pending.
* view: Read geometry directly in view_update_sizeLibravatar Kenny Levinsen2021-02-09
|
* shells: Only center tiled views on size changeLibravatar Kenny Levinsen2021-02-09
| | | | | | | The size of a tiled container cannot change in response to new buffer sizes, so there is no need to commit a new transaction. Instead, simply recenter the view with the new geometry, leaving the full transaction flow for floating containers.
* Switch to wlr_xdg_surface_for_each_popup_surfaceLibravatar Simon Ser2021-01-12
| | | | | | | | Instead of calling wlr_xdg_surface_for_each_popup and then wlr_surface_for_each_surface, use the new for_each_popup_surface helper introduced in [1] that does it in one go. [1]: https://github.com/swaywm/wlroots/pull/2609
* Change workspace_layout to match i3 behaviorLibravatar Ronan Pigott2020-12-20
| | | | | | | In i3, the workspace_layout command does not affect the workspace layout. Instead, new workspace level containers are wrapped in the desired layout and the workspace layout always defaults to the output orientation.
* xdg_shell: allow views to change geometry anytimeLibravatar Ronan Pigott2020-11-24
| | | | | | | | | | | Currently, when sway sends a configure with some geometry and the client responds with a different geometry in a commit that acks that configure, sway ignores the new size. Sway applies the surface geometry it had requested to the container, not what was actually committed, in the following transaction. This change allows any client commit to change its surface geometry, even if it is a response to a configure event.
* transaction: validate X transaction completions by geometry, not sizeLibravatar Tudor Brindus2020-10-18
| | | | | | | | | | | Xwayland views are aware of their coordinates, so validating transaction completions should take into account the reported coordinates of the view. Prior to this commit they didn't, and matching dimensions would suffice to validate the transaction. Also introduced `transaction_notify_view_ready_immediately` to support the fix from d0f7e0f without jumping through hoops to figure out the geometry of an `xdg_shell` view.
* xdg_shell: schedule configure on maximize requestsLibravatar Ronan Pigott2020-07-14
|
* input: implement xdg_toplevel interactive resize hintsLibravatar Ronan Pigott2020-07-13
|
* transaction: Mark client resize immediately readyLibravatar Kenny Levinsen2020-06-30
| | | | | | | | | | | | | If a client commits a new size on its own, we create a transaction for the resize like any other. However, this involves sending a configure and waiting for the ack, and wlroots will not send configure events when there has been no change. This leads to transactions timing out. Instead, just mark the view ready immediately by size when the client is already ready, so that we avoid waiting for an ack that will never come. Closes: https://github.com/swaywm/sway/issues/5490
* shells: Resize on commit if geometry x/y changesLibravatar Kenny Levinsen2020-06-03
| | | | | Client-side decorations lead to changes to y position, so make sure we catch that.
* container: Remove useless surface dimensionsLibravatar Kenny Levinsen2020-06-03
| | | | The adjustments to resize logic left them unnecessary.
* Remove all wayland-server.h includesLibravatar Simon Ser2019-07-27
| | | | | | | | | | | | | | | The documentation for wayland-server.h says: > Use of this header file is discouraged. Prefer including > wayland-server-core.h instead, which does not include the server protocol > header and as such only defines the library PI, excluding the deprecated API > below. Replacing wayland-server.h with wayland-server-core.h allows us to drop the WL_HIDE_DEPRECATED declaration. This commit si similar to wlroots' ca45f4490ccc ("Remove all wayland-server.h includes").
* Honor output for xdg_toplevel_set_fullscreenLibravatar Brian Ashworth2019-04-11
| | | | | | | | | | | | | | This honors the fullscreen output request for `xdg_toplevel_set_fullscreen` and `zxdg_toplevel_v6_set_fullscreen`. If the request was sent before mapping, the fullscreen output request will be retrieved from the client_pending state for the toplevel. The output will be passed to `view_map` and if there is a workspace on the output, the view will be placed on that workspace. If the request comes in after being mapped, the view will be moved to the workspace on the output (if there is one) before becoming fullscreen.
* Introduce default seatopLibravatar Ryan Dwyer2019-03-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This introduces a `default` seat operation which is used when no mouse buttons are being held. This means there is now always a seat operation in progress. It allows us to separate `default` code from the standard cursor management code. The sway_seatop_impl struct has gained callbacks `axis`, `rebase` and `end`, and lost callbacks `finish` and `abort`. `axis` and `rebase` are only used by the default seatop. `end` is called when a seatop is being replaced by another one and allows the seatop to free any resources, though no seatop currently needs to do this. `finish` is no longer required, as each seatop can gracefully finish in their `button` callback. And `abort` is not needed, as calling `end` would achieve the same thing. The struct has also gained a bool named allow_set_cursor which allows the client to set a new cursor during `default` and `down` seatops. Seatops would previously store which button they were started with and stop when that button was released. This behaviour is changed so that it only ends once all buttons are released. So you can start a drag with $mod+left, then click and hold right, release left and it'll continue dragging while the right button is held. The motion callback now accepts dx and dy. Most seatops don't use this as they store the cursor position when the seatop is started and compare it with the current cursor position. This approach doesn't make sense for the default seatop though, hence why dx and dy are needed. The pressed_buttons array has been moved from the sway_cursor struct to the default seatop's data. This is only used for the default seatop to check bindings. The total pressed button count remains in the sway_cursor struct though, because all the other seatops check it to know if they should end. The `down` seatop no longer has a `moved` property. This was used to track if the cursor moved and to recheck focus_follows_mouse, but seems to work without it. The logic for focus_follows_mouse has been refactored. As part of this I've removed the call to wlr_seat_keyboard_has_grab as we don't appear to use keyboard grabs. The functions for handling relative motion, absolute motion and tool axis have been changed. Previously the handler functions were handle_cursor_motion, handle_cursor_motion_absolute and handle_tool_axis. The latter two both called cursor_motion_absolute. Both handle_cursor_motion and cursor_motion_absolute did very similar things. These are now simplified into three handlers and a single common function called cursor_motion. All three handlers call cursor_motion. As cursor_motion works with relative distances, the absolute and tool axis handlers convert them to relative first.
* view: set xdg_decoration->view to NULL, check decoration destroyLibravatar Rouven Czerwinski2019-02-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes heap-use-after-free: ==32046==ERROR: AddressSanitizer: heap-use-after-free on address 0x615000064d20 at pc 0x55571ce4d303 bp 0x7fff545c64c0 sp 0x7fff545c64b0 WRITE of size 8 at 0x615000064d20 thread T0 #0 0x55571ce4d302 in xdg_decoration_handle_destroy ../sway/xdg_decoration.c:13 #1 0x7f64009d6f36 in wlr_signal_emit_safe ../util/signal.c:29 #2 0x7f64009d3c46 in toplevel_decoration_handle_resource_destroy ../types/wlr_xdg_decoration_v1.c:65 #3 0x7f6400a19f8d (/usr/lib/x86_64-linux-gnu/libwayland-server.so.0+0x7f8d) #4 0x7f6400a19fed in wl_resource_destroy (/usr/lib/x86_64-linux-gnu/libwayland-server.so.0+0x7fed) #5 0x7f64009d3d1f in toplevel_decoration_handle_surface_destroy ../types/wlr_xdg_decoration_v1.c:82 #6 0x7f64009d6f36 in wlr_signal_emit_safe ../util/signal.c:29 #7 0x7f64009b059c in reset_xdg_surface ../types/xdg_shell/wlr_xdg_surface.c:453 #8 0x7f64009b0688 in destroy_xdg_surface ../types/xdg_shell/wlr_xdg_surface.c:483 #9 0x7f64009af08c in xdg_client_handle_resource_destroy ../types/xdg_shell/wlr_xdg_shell.c:71 #10 0x7f6400a19f8d (/usr/lib/x86_64-linux-gnu/libwayland-server.so.0+0x7f8d) #11 0x7f6400a1e211 (/usr/lib/x86_64-linux-gnu/libwayland-server.so.0+0xc211) #12 0x7f6400a1e6fe (/usr/lib/x86_64-linux-gnu/libwayland-server.so.0+0xc6fe) #13 0x7f6400a1a0ec in wl_client_destroy (/usr/lib/x86_64-linux-gnu/libwayland-server.so.0+0x80ec) #14 0x7f6400a1a1c4 (/usr/lib/x86_64-linux-gnu/libwayland-server.so.0+0x81c4) #15 0x7f6400a1b941 in wl_event_loop_dispatch (/usr/lib/x86_64-linux-gnu/libwayland-server.so.0+0x9941) #16 0x7f6400a1a569 in wl_display_run (/usr/lib/x86_64-linux-gnu/libwayland-server.so.0+0x8569) #17 0x55571ce4c7fd in server_run ../sway/server.c:214 #18 0x55571ce4ad59 in main ../sway/main.c:405 #19 0x7f640071109a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2409a) #20 0x55571ce2cfa9 in _start (/usr/local/bin/sway+0x35fa9) 0x615000064d20 is located 32 bytes inside of 504-byte region [0x615000064d00,0x615000064ef8) freed by thread T0 here: #0 0x7f6401531b70 in free (/usr/lib/x86_64-linux-gnu/libasan.so.5+0xedb70) #1 0x55571ce6c72b in destroy ../sway/desktop/xdg_shell.c:252 #2 0x55571cee3f7b in view_destroy ../sway/tree/view.c:60 #3 0x55571cee4090 in view_begin_destroy ../sway/tree/view.c:73 #4 0x55571ce6dd95 in handle_destroy ../sway/desktop/xdg_shell.c:464 #5 0x7f64009d6f36 in wlr_signal_emit_safe ../util/signal.c:29 #6 0x7f64009b059c in reset_xdg_surface ../types/xdg_shell/wlr_xdg_surface.c:453 #7 0x7f64009b0688 in destroy_xdg_surface ../types/xdg_shell/wlr_xdg_surface.c:483 #8 0x7f64009af08c in xdg_client_handle_resource_destroy ../types/xdg_shell/wlr_xdg_shell.c:71 #9 0x7f6400a19f8d (/usr/lib/x86_64-linux-gnu/libwayland-server.so.0+0x7f8d) previously allocated by thread T0 here: #0 0x7f6401532138 in calloc (/usr/lib/x86_64-linux-gnu/libasan.so.5+0xee138) #1 0x55571ce6df39 in handle_xdg_shell_surface ../sway/desktop/xdg_shell.c:485 #2 0x7f64009d6f36 in wlr_signal_emit_safe ../util/signal.c:29 #3 0x7f64009b0167 in handle_xdg_surface_commit ../types/xdg_shell/wlr_xdg_surface.c:350 #4 0x7f64009ce2a5 in surface_commit_pending ../types/wlr_surface.c:372 #5 0x7f64009ce523 in surface_commit ../types/wlr_surface.c:444 #6 0x7f63ff63ddad in ffi_call_unix64 (/usr/lib/x86_64-linux-gnu/libffi.so.6+0x5dad) Fixes #3759
* Fix close_popups for xdg-shellLibravatar emersion2019-02-05
| | | | | | wlr_xdg_popup_destroy will destroy popups, so we need to walk the tree carefully. It's enough to just destroy all direct children, since destroying the parent will also destroy all children.
* Check xdg_surface's role before using its toplevelLibravatar mwenzkowski2019-01-28
| | | | | | | | Don't access xdg_surface->toplevel if xdg_surface->role is equal to WLR_XDG_SURFACE_ROLE_NONE, since this could lead to crash. The same checks are added for xdg_surface_v6. Fixes #3311