Commit graph

305 commits

Author SHA1 Message Date
DreamMaoMao
b1875f4663 feat: add custom option to monitorrule 2026-03-06 18:22:05 +08:00
DreamMaoMao
dcea22bfda feat: support the repeated exchange of the same two clients 2026-03-06 14:31:59 +08:00
DreamMaoMao
81fcf208a4 opt: fix potential issues caused by uninitialization 2026-03-06 13:25:35 +08:00
DreamMaoMao
66d14a0a0e opt: support restore size per when master change 2026-03-05 20:59:47 +08:00
DreamMaoMao
4f93589884 fix: popup unconstrain cross monitor 2026-03-05 08:28:21 +08:00
DreamMaoMao
6fda036dec feat: use monitor spec to match windowrule monitor field 2026-03-04 12:18:03 +08:00
DreamMaoMao
2868f07179 feat: add windowrule option indleinhibit_when_focus 2026-03-03 14:51:53 +08:00
DreamMaoMao
9732aa23bf opt: rename hide_source var to hide_cursor_source 2026-03-03 14:01:52 +08:00
DreamMaoMao
1c35e1f42f opt: always arrangelayers if layer commit 2026-03-02 20:54:04 +08:00
DreamMaoMao
7f05771df6 fix: last_cursor surface destroy detect error 2026-03-02 09:41:31 +08:00
Han Boetes
9a43368279 Fix use-after-free crash in cursor surface handling
### Problem

`setcursor()` stores the client-provided `wlr_surface` pointer in
`last_cursor.surface`, but never registers a destroy listener on it.
When the client exits (e.g. closing a launcher like fuzzel), the surface
is destroyed, but `last_cursor.surface` still holds the stale pointer.

If the cursor hide timeout fires while the cursor surface is alive, and
the client then exits, the next mouse movement calls
`handlecursoractivity()`, which passes the dangling pointer to
`wlr_cursor_set_surface()`. This causes a SIGSEGV in `wl_list_insert()`
inside libwayland-server, as the `wl_list` embedded in the destroyed
surface struct has been freed.

A secondary issue exists in `setcursorshape()`: when a client switches
from a custom cursor surface to a shape cursor, `last_cursor.surface` is
set to NULL but the destroy listener (if registered) is not removed,
leaving a dangling listener on the destroyed surface.

The crash only manifests when `cursor_hidden` is true at the moment of
the mouse movement, which is why it is intermittent and difficult to
reproduce.

### Root cause

Confirmed via `coredumpctl debug` and `bt full`:

```
#0  wl_list_insert (libwayland-server.so)
#1  wlr_cursor_set_surface (libwlroots)
#2  handlecursoractivity (mango.c)
#3  motionnotify (mango.c)
#4  motionrelative (mango.c)
#5  wl_signal_emit_mutable
#6  handle_libinput_readable
```

### Fix

- Add a `wl_listener` (`last_cursor_surface_destroy_listener`) that
clears `last_cursor.surface` and removes itself when the surface is
destroyed.
- Initialize the listener's link in `setup()` so `wl_list_empty()`
checks are reliable from the start.
- In `setcursor()`, remove any existing listener before registering a
new one on the incoming surface.
- In `setcursorshape()`, remove the destroy listener when switching to a
shape cursor.
- Add a NULL guard in `handlecursoractivity()` as a safety net.
2026-03-02 09:41:24 +08:00
DreamMaoMao
4b35b3b4a9 opt: avoid unnecessary action when layer surface commit 2026-03-02 08:36:07 +08:00
DreamMaoMao
b99620d41b opt: optimize layer focus change logic 2026-03-02 08:17:57 +08:00
DreamMaoMao
96cc712e48 opt: only set on_demand layer focus when it request in init_commit 2026-03-02 00:58:28 +08:00
werapi
794e96d194 fix: pointer events being one event behind 2026-02-28 23:38:37 +08:00
DreamMaoMao
dfc940fd5c fix: avoid opacity exceeds the threshold due to overshot animation curve 2026-02-26 08:29:37 +08:00
DreamMaoMao
8b30eb8e61 feat: monitor arg support multi spec match in disptach 2026-02-25 19:16:13 +08:00
DreamMaoMao
72898a165c opt: remove useless code 2026-02-25 17:35:26 +08:00
DreamMaoMao
5ee0d5c627 opt: remove useless code 2026-02-25 17:25:20 +08:00
qaqland
4c3ef70f9a opt: remove unused variable in function rendermon
Signed-off-by: qaqland <anguoli@uniontech.com>
2026-02-25 17:25:14 +08:00
DreamMaoMao
65378f4dc8 fix: popup position constrain not work for some app 2026-02-25 15:24:41 +08:00
DreamMaoMao
a06774d494 feat: set dbus env auto 2026-02-24 21:41:14 +08:00
DreamMaoMao
ebdfb14654 opt: optimize frame skip logic 2026-02-23 08:04:22 +08:00
DreamMaoMao
d2d5cfc5c8 opt: optimize code struct 2026-02-22 12:28:24 +08:00
DreamMaoMao
6bfa0ab658 fix: auto set monitor coordinate when no match monitor rule 2026-02-21 18:53:02 +08:00
DreamMaoMao
a66d475544 opt: if app open when no monitor, init tags and size in updatemons 2026-02-21 17:01:27 +08:00
DreamMaoMao
bcace97c30 opt: improve some risk judgments 2026-02-21 16:37:48 +08:00
DreamMaoMao
5615fd554f feat: add shield_when_capture windowrule to disable capture 2026-02-19 19:19:14 +08:00
DreamMaoMao
58099e04cb opt: optimize code struct 2026-02-16 10:08:13 +08:00
DreamMaoMao
79b4e30f67 opt: don't skip frame when grab client 2026-02-16 07:46:54 +08:00
DreamMaoMao
7add8975e8 feat: support frame skip for x11 app resize 2026-02-15 12:51:00 +08:00
DreamMaoMao
b6fe983af4 opt: optimize frame skip logic 2026-02-15 10:31:31 +08:00
DreamMaoMao
9746e37707 feat: add skip timer to avoid rermanently block rendering 2026-02-15 09:04:52 +08:00
DreamMaoMao
00dab81dbd fix: some client property missing init 2026-02-15 08:38:01 +08:00
DreamMaoMao
ff18d96e9e fix: some app frame skip fail when disable animaitons 2026-02-15 08:37:51 +08:00
Daniel Jampen
52703a638f support isfakefullscreen as windowrule property 2026-02-14 08:46:55 +08:00
DreamMaoMao
dfedc205e8 feat: support restore stack from non-tile state 2026-02-13 20:23:19 +08:00
DreamMaoMao
2dfb7b2a23 opt: the tagset is current tagset when open window in ov mode 2026-02-13 18:16:13 +08:00
DreamMaoMao
af5cd19719 opt: not back to ov tag when view prev tag 2026-02-13 18:11:28 +08:00
DreamMaoMao
ca89e07be8 opt: better x11 coordinate adjust 2026-02-12 18:57:18 +08:00
DreamMaoMao
9343874a22 opt: make x11 floating window coordinate auto ajust the monitor change 2026-02-12 18:12:26 +08:00
DreamMaoMao
8d07b6e0b8 opt: make x11 unmanaged window coordinate auto ajust the monitor change 2026-02-12 18:12:21 +08:00
DreamMaoMao
0fe3197574 feat: make force_tiled_state as a option 2026-02-12 11:19:55 +08:00
DreamMaoMao
910bb78dab fix: crash when pointerfocus to a null scene client 2026-02-11 20:45:05 +08:00
DreamMaoMao
de867294dc opt: tell the synckeymap timer not need to call anymore 2026-02-11 08:31:41 +08:00
DreamMaoMao
121ff2daeb feat: support match monitor make model serial 2026-02-10 10:33:35 +08:00
DreamMaoMao
6e4dabef8e opt: allow none mode in some mouse button 2026-02-09 11:18:25 +08:00
DreamMaoMao
8b6ef770ba opt: turn keymap sync into XWAYLAND macro 2026-02-08 12:45:04 +08:00
DreamMaoMao
570ea57eda feat: allow single mod keybind 2026-02-08 12:19:54 +08:00
DreamMaoMao
63c356afc0 opt: sync keymap to xwayland after xwayland ready 2026-02-08 12:14:19 +08:00