Commit Graph
1046 Commits
Author SHA1 Message Date
save196 e451862544 follow the geometry of unmanaged clients and fix formatting 2026-09-17 17:35:49 +00:00
save196 b3223b15e9 fix capturing hidden toplevels 2026-09-17 16:46:41 +00:00
Guido Cella 1fe1b4e66e show popups in fullscreen Xwayland apps
The dialogs opened by clicking items in Xwyland applications' toolbars
are unmanaged clients, so placing them in LyrFloat drew them below their
source client in LyrFS when it is fullscreened.

Add a new dedicated layer for unamanged clients to fix it. Don't put
them in LyrFS to prevent the regular fullscreen client from hiding
unmanaged ones, e.g. by opening dmenu and then clicking the regular
client.

Fixes https://codeberg.org/dwl/dwl/issues/556
2026-09-16 12:47:52 +02:00
Guido Cella 1dae5ba3ed size hints can be -1 2026-09-16 11:50:36 +02:00
Guido Cella 433c325fb2 fix a use-after-free
Prevent a use-after-free when closing a nested dwl with Ctrl+c.

It happened because cleanup() → input_method_relay_finish() frees
input_method_relay, and then closemon() → focusclient() →
input_method_relay_set_focus() uses relay->surface.
2026-09-15 23:29:50 +02:00
Guido Cella 6013835337 keep the focused border color of the old client in certain cases
When focusing an unmanaged client (like dmenu) or a layer shell surface
(like wmenu) keep the focused border color of the regular client, but
still deactivate it. This is consistent with dwm and sway.

This was already done for unmanaged clients but not for layer shell
surfaces.

This is not perfect because you can press MODKEY+j/k or move the cursor
while a program like dmenu is focused and have 2 clients with focused
border color after closing dmenu. But this doesn't work well even in
sway where if you change focus while dmenu is open you can longer focus
it, and after closing a layer shell surface with on-demand keyboard
interactivity all toplevels have the focused border color, so this will
do for now.
2026-09-15 22:17:24 +02:00
Guido Cella f6e3a2826e deactivate the old client when the new one wants focus
I see no issue with winecfg after removing this condition, so I assume
it was fixed upstream.
2026-09-15 22:16:35 +02:00
Guido Cella aa0c1659d3 Reapply "use modifier-independent key symbols in keybindings"
This reverts commit 0f8630282d.
2026-09-15 21:23:47 +02:00
Guido Cella bab3fdadf3 don't run keybindings twice when the shift keysym is the same
For keys like F1-F12 the keysym with the shift is the same as without.
Avoid running keybindings bound to these keys twice.
2026-09-15 21:22:41 +02:00
Guido Cella 0f8630282d Revert "use modifier-independent key symbols in keybindings"
This reverts commit f9c644f0b0.
2026-09-15 20:57:28 +02:00
Guido Cella 4de32d2d5c Reapply "respect size hints"
This reverts commit 31bf1cbaf6.

Fixes https://codeberg.org/dwl/dwl/issues/105
Fixes https://codeberg.org/dwl/dwl/issues/634
Fixes https://codeberg.org/dwl/dwl/issues/1171
2026-09-15 20:03:28 +02:00
Guido Cella 36c80aff03 Revert "don't resize on commit"
This reverts commit 498a0e605c.

Without resizing on every commit the top left of firefox is cropped.
2026-09-15 15:24:45 +02:00
Guido Cella 68c6319e3f Revert "reduce nesting in commitnotify()"
This reverts commit c824886b8c.
2026-09-15 15:24:27 +02:00
Guido Cella c824886b8c reduce nesting in commitnotify() 2026-09-15 12:07:13 +02:00
Guido Cella 498a0e605c don't resize on commit
Fixes https://codeberg.org/dwl/dwl/issues/1229
Reverts 32e66f4

This could be called only on the initial_commit, but it was added to fix
https://github.com/djpohly/dwl/issues/515 which I can't reproduce after
removing it, so let's try to remove it completely.
2026-09-15 12:06:35 +02:00
Guido Cella e7f185ed3e remove c->resize
Unused since 70c33c0.
2026-09-15 09:49:25 +02:00
Andrea ChiavazzaandGuido Cella f9c644f0b0 use modifier-independent key symbols in keybindings
Co-authored-by: Guido Cella <guido@guidocella.xyz>
2026-09-14 17:53:35 +02:00
Leonardo Hernández Hernández dc9a860191 use the new output swapchain manager in outputmgrapplyortest() 2026-09-14 10:45:33 +02:00
Guido Cella d1ebf3c985 fix firefox opening with rounded corners
Fixes https://codeberg.org/dwl/dwl/issues/1169

The c->isfloating check is needed to have the correct floating window
size with e.g. alacritty -o window.dimensions.columns=15
window.dimensions.lines=10.
2026-09-14 10:42:59 +02:00
sewn 8f52e96be4 replicate dwm behavior for snap resize 2026-09-14 02:25:48 +02:00
Guido Cella 5fd19feaff support monitors above and below in focusmon and tagmon
Fixes https://codeberg.org/dwl/dwl/issues/1105
2026-09-13 21:14:10 +02:00
Guido CellaandDreamMaoMao 8ad2c920db use the right cursor after move and resize
Fixes https://codeberg.org/dwl/dwl/issues/1162

Co-authored-by: DreamMaoMao <2523610504@qq.com>
2026-09-13 19:06:54 +02:00
Peter HofmannandGuido Cella e8bf70d639 implement Axis mouse bindings
Co-authored-by: Guido Cella <guido@guidocella.xyz>
2026-09-13 18:14:47 +02:00
Guido Cellaandbrinkpw 99cdc9a825 set seat capabilities for virtual keyboards and pointers
wlr_seat_set_capabilities was never called without a real input device.

Fixes https://codeberg.org/dwl/dwl/issues/1155.

Co-authored-by: brinkpw
2026-09-13 08:38:07 +02:00
Guido Cella 7ba335063f don't crash when clicking an empty area
If l is not initialized, accessing
l->layer_surface->current.keyboard_interactive causes a segmentation
fault. This was hard to see because c above was never initialized but
never caused a crash, and dwl also didn't crash building with ASan.

Also initialize c to be safe.

Fixes 4c54bd8.
Fixes https://codeberg.org/dwl/dwl/issues/1225.
2026-09-13 08:25:20 +02:00
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