Commit Graph
1021 Commits
Author SHA1 Message Date
Guido CellaandZuki Air fb4102b5ae support screenshare of single windows
Supersedes https://codeberg.org/dwl/dwl/pulls/1157.

Co-authored-by: Zuki Air <zukirust@gmail.com>
2026-09-12 10:28:05 +02:00
Guido CellaandZuki Air 721f70ea8b implement ext-foreign-toplevel-list
This is used by lswt which lists toplevel ids and titles.
keyd-application-mapper will also support it hopefully.

This will also be needed to support screenshare of single windows
(https://codeberg.org/dwl/dwl/pulls/1157).

Co-authored-by: Zuki Air <zukirust@gmail.com>
2026-09-12 08:02:27 +02:00
0a6dc6d548 add support for layer-shell on-demand keyboard interactivity
Supersedes https://codeberg.org/dwl/dwl/pulls/674

Co-authored-by: Leonardo Hernández Hernández <leohdz172@proton.me>
Co-authored-by: MayOrMayNotBeACat <maybeacat804@gmail.com>
2026-09-12 08:00:20 +02:00
Guido Cella 4c54bd8113 implement xytonode() with toplevel_from_wlr_surface()
xytonode() does not return the layer surface under the cursor because
pnode->data is always NULL. It was not noticed because it is not passed
the LayerSurface argument anywhere. But it is noticeable after
implementing layer shell on-demand keyboard interactivity because layer
shell surfaces are never focused by sloppyfocus.

Rather than figuring out how to fix it, just replace its implementation
with toplevel_from_wlr_surface() which works and also reduces the SLOC.
2026-09-11 23:55:17 +02:00
Guido CellaandDreamMaoMao 2f3fe0671d add IME support
Based on mangowm, which is based on labwc, which is based on sway, so
this should be covered by LICENSE.sway.

Fixes https://codeberg.org/dwl/dwl/issues/6
Fixes https://codeberg.org/dwl/dwl/issues/710
Fixes https://codeberg.org/dwl/dwl/issues/1176
Fixes https://codeberg.org/dwl/dwl/issues/1185

Co-authored-by: DreamMaoMao <2523610504@qq.com>
2026-09-10 22:34:08 +02:00
Andrea Chiavazza f6800e95ee fix some key binding events being passed to clients 2026-09-09 21:50:41 +01:00
Siva Mahadevan 7fb20244c6 move util.c to util.h
This allows single-source compilation and whole-program optimization using something like:

make CFLAGS='-flto -ffunction-sections -fdata-sections -Wl,--gc-sections'

Furthermore, move more compositor-agnostic utility functions/macros to util.h,
similar to the original dwm sources.
2026-09-09 09:37:07 -04:00
julmajustus 70c33c015a Remove rendermon pending resize frame skip
This is no longer needed as wlroots => 0.19 handles this internally via scene-level surface state tracking and
linux-drm-syncobj explicit sync.

The manual commit skip now causes the c->resize to be stuck on non-zero
state which leads to choppy resizing experience.
2026-09-08 17:28:19 +02:00
A Frederick Christensen 132606e133 add support for ext-image-copy-capture-v1 and ext-image-capture-source-v1 (wlroots!4545) 2026-09-08 11:44:44 +02:00
Thanatos 49ca434514 Bumped to 0.9 for wlroots-0.20.0. Updated cursor image buffer handling for xwayland 2026-09-08 11:44:44 +02:00
save196 babccfe6dc Preserve asleep disabled outputs in output config 2026-09-08 11:39:37 +02:00
klim 4847f97678 Clear surface->data on unmap to fix idle-inhibitor use-after-free
mapnotify() stores the client's scene tree in client_surface(c)->data;
checkidleinhibitor() later reads it back as a wlr_scene_tree and calls
wlr_scene_node_coords() on it. unmapnotify() frees the scene tree with
wlr_scene_node_destroy() but leaves surface->data dangling, so the next
arrange() -> checkidleinhibitor() dereferences freed memory and crashes
(SIGSEGV) whenever an idle inhibitor outlives the unmap.

Reset the pointer to NULL on unmap so the existing !tree guard handles it.
2026-09-08 09:30:56 +02:00
Alex Denes 04279f28e0 Remove decoration event listeners on destroynotify
When destroynotify doesn't clean up these listeners it causes a crash once the cleanup of the decoration is triggered

Thanks to kennylevinsen - https://codeberg.org/dwl/dwl/issues/1205#issuecomment-22424401
2026-09-06 13:52:31 +00:00
Alex Denes f4dfdabd0b NULL out decoration on destroy 2026-09-06 13:52:31 +00:00
Diego Viola cb4cc3ae8f Fix typos 2026-02-25 02:38:09 -03:00
Guido Cella ca4123072d add support for the data control protocol
Enables the protocol documented at
https://wayland.app/protocols/ext-data-control-v1

It is the upstreamed version of the old wlr_data_control.

It is used e.g. by mpv to read and write the clipboard.
2026-02-12 01:47:40 +01:00
jackinfurs 9837ea5729 fix: ignore case of keysyms in keybindings 2025-12-27 21:26:26 +00:00
A Frederick Christensen ab4cb6e283 Revert "add support for ext-image-copy-capture-v1 and ext-image-capture-source-v1 (wlroots!4545)"
This reverts commit b28674e0ca.

This PR is not yet finalized. (Screen freezes).
2025-08-04 16:27:34 -05:00
Leonardo Hernández Hernández b28674e0ca add support for ext-image-copy-capture-v1 and ext-image-capture-source-v1 (wlroots!4545)
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4545
2025-08-04 23:08:53 +02:00
Guido Cella ea263a0ed5 float sub-windows matching a rule
Currently when a rule that doesn't make windows floating matches, even
sub-windows of float type get tiled rather than just the main window.
This is inconsistent with dwm and other compositors. Fix this by making
these windows floating after applying rules.

Fixes #1142.
2025-06-14 22:27:25 +02:00
kilpilainen 02f8744a48 Use all-scroll instead of fleur xcursor shape for window dragging
When there are no xcursor themes available, Wayland uses its own built-in shapes [1].
Wayland (and thus to extend wlroots) is based on the XDG's cursor spec [2],
which itself is based on CSS' [3][4], neither of which define `fleur` shape. So dwl,
without any external themes, falls back to `default` shape when dragging a window.
There is `all-scroll` shape that is being symlinked to (or vice versa) by `move`,
`dnd-move`, `grabbed` and `fleur` shapes by various themes.

Since `all-scroll` is being symlinked to anyway, and has been part of all relevant
specs as the shape for this use case for a very long time now, use it instead.

[1] https://gitlab.freedesktop.org/wayland/wayland/-/blob/main/cursor/cursor-data.h#L559
[2] https://www.freedesktop.org/wiki/Specifications/cursor-spec
[3] https://drafts.csswg.org/css-ui/#cursor
[4] https://developer.mozilla.org/en-US/docs/Web/CSS/cursor
2025-06-09 13:39:40 -06:00
Nikita Ivanov d1880b4422 Fix crash disabling monitor with locked surface 2025-06-09 13:33:02 -06:00
A Frederick Christensen de57f6c315 Cleanup comments 2025-06-07 16:17:30 -05:00
DreamMaoMao 4456f4536a fix: shouldn't configure uninitialized layer_surface 2025-03-13 20:36:18 +00:00
DreamMaoMao e0f531d508 fix: crash when open some x11 app 2025-03-12 16:27:47 +08:00
korei999 aa69ed81b5 allocate with LISTEN_STATIC
Fixes: https://codeberg.org/dwl/dwl/issues/723
Supersedes: https://codeberg.org/dwl/dwl/pulls/724
2025-02-01 22:34:58 -06:00
Leonardo Hernández Hernández d1c2f43498 rename some listeners
To keep consistency with the rest of listeners
2025-01-19 17:27:16 -06:00
Leonardo Hernández Hernández da13a95683 destroy keyboard group after unlinking listeners
Last commit addressing the issue mentioned in
0925fe956a
2025-01-19 17:26:28 -06:00
Leonardo Hernández Hernández 9a9f67db1c unlink global listeners on destroy
Continuation of 0925fe956a
2025-01-19 17:26:02 -06:00
Leonardo Hernández Hernández 4e7e2999d4 Partially revert "Line saver: LISTEN_STATIC macro"
This reverts commit 33bcd2e4ca.

We keep LISTEN_STATIC for three instances where we use it. We use
simple listeners for the rest of signals.

This is the continuation of 0925fe956a
2025-01-19 17:24:54 -06:00
Leonardo Hernández Hernández 0925fe956a unlink some destroy listeners
Recently wlroots was updated to assert that signals do not have listeners
attached on destroy.

This is just a preliminar work to fix dwl. At the moment dwl will trigger the
assertions at exit.

References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4918
2025-01-17 21:03:28 -06:00
Leonardo Hernández Hernández 26504f9a6f do not call waitid(2) in the signal handler when Xwayland is enabled
waitid(2) is not a async-signal-safe function acording to signal-safety(7)

We can stop doing this because wlroots!4926 allows compositors to install
signal handlers for SIGCHLD.

References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4926
2025-01-14 12:23:55 -06:00
Leonardo Hernández Hernández 6f34a6d3a6 use wlr_xwayland_surface_has_window_type() (wlroots!4553)
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4553
2025-01-14 12:23:55 -06:00
Leonardo Hernández Hernández 30f5063474 manually call updatemons in powermgrsetmode()
Fixes: https://codeberg.org/dwl/dwl/issues/713
2024-12-10 22:49:09 -06:00
Leonardo Hernández Hernández 84245764e2 specify version for presentation-time (wlroots!4858)
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4858
2024-10-27 20:37:15 -06:00
Leonardo Hernández Hernández 6ca87210d4 check if the backend supports explicit sync before creating the object (wlroots!4848)
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4848
2024-10-27 20:37:15 -06:00
Guido Cella 8206cc8889 fix a use after free
This line makes dwl crash after closing mpv with the switchtotag patch.
2024-09-12 04:33:19 +00:00
choc d34be5d545 remove unused link member from KeyboardGroup
unnecessary since grouping Keyboard wl_list to use wlr_keyboard_group in 023efce

ΔSLOC: -1
2024-08-27 23:12:00 -06:00
Leonardo Hernández Hernández c49312f084 disable scene node unless it is unmanaged 2024-08-27 23:09:46 -06:00
Leonardo Hernández Hernández f899060965 send a configure to unmanaged clients when mapping 2024-08-27 23:09:46 -06:00
Leonardo Hernández Hernández cc72df11d6 configure xdg_toplevels after configuring it's decoration 2024-08-27 23:09:46 -06:00
Leonardo Hernández Hernández 0312720ae8 remove a space before parenthesis in function calls 2024-08-27 23:09:46 -06:00
Leonardo Hernández Hernández 6de87121e2 destroy popups when we can't get it's parent or they don't have monitor 2024-08-27 23:09:46 -06:00
Leonardo Hernández Hernández bbc00d88a4 remove a redundant check
resize() now does the same check
2024-08-27 23:09:46 -06:00
Leonardo Hernández Hernández 54b546121b avoid using a else block 2024-08-27 23:09:46 -06:00
Leonardo Hernández Hernández 43016bdad8 introduce client_set_scale() 2024-08-27 23:09:41 -06:00
Leonardo Hernández Hernández b616476c85 remove unnecessary LayerShell.geom
We only used geom.x and geom.y. We can access those variables directly from the
scene node.
2024-08-27 23:09:08 -06:00
Leonardo Hernández Hernández d4ad37354e update comment about first fields of Client and LayerSurface order 2024-08-27 23:09:08 -06:00
Leonardo Hernández Hernández 5db05e82bd fix style in configurex11() 2024-08-27 23:09:08 -06:00
Leonardo Hernández Hernández 8ec5e52e06 fix crash when a client is created while all outputs are disabled 2024-08-26 21:56:10 -06:00