Commit graph

1310 commits

Author SHA1 Message Date
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
DreamMaoMao
576e669ee4 update readme 2026-03-01 18:13:52 +08:00
DreamMaoMao
dfa5949977 Revert "Add nix option to enable/disable adding to session manager" 2026-03-01 18:05:09 +08:00
DreamMaoMao
54ea75f078 bump version to 0.12.5 2026-03-01 12:03:36 +08:00
DreamMaoMao
54b56f3425 update website in readme 2026-03-01 11:43:06 +08:00
DreamMaoMao
3be6fccefc rename mangowc to mangowm 2026-03-01 11:38:29 +08:00
DreamMaoMao
7df43679e7 project: rename guix file 2026-03-01 11:36:00 +08:00
DreamMaoMao
e9b8e1aa58 update readme 2026-03-01 11:21:40 +08:00
werapi
794e96d194 fix: pointer events being one event behind 2026-02-28 23:38:37 +08:00
DreamMaoMao
3c5ab60e6a opt: make spawn and spawn_shell log to debug log 2026-02-26 23:23:00 +08:00
Noor Latif
3642fafe49 fix(nix): update deprecated xorg package names to top-level
xcbutilwm → libxcb-wm

This eliminates the deprecation warnings:
- "The xorg package set has been deprecated, 'xorg.xcbutilwm' has been renamed to 'libxcb-wm'"

Changes:
- nix/default.nix:14: xcbutilwm, → libxcb-wm,
- nix/default.nix:60: xcbutilwm → libxcb-wm
2026-02-26 17:53:33 +08:00
DreamMaoMao
2e3c8afe90 opt: optimize monitorrule check 2026-02-26 13:30:54 +08:00
DreamMaoMao
dfc940fd5c fix: avoid opacity exceeds the threshold due to overshot animation curve 2026-02-26 08:29:37 +08:00
DreamMaoMao
376f4b2ab1 bump version to 0.12.4 2026-02-25 21:54:04 +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
af35d3589f opt: remove some portal file comment 2026-02-25 15:24:48 +08:00
Jiatao Liang
daf665bd2f optional-session-manager 2026-02-25 15:24:41 +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
e09028d0bd update readme 2026-02-22 11:51:37 +08:00
Baba
bc9b9725dd include tgmix in README.md 2026-02-22 09:52:05 +08:00
Mujk
dc7924ad7b docs: fix guix installation instructions
- Rename GuixSD to Guix System (the distro was renamed in 2019)
2026-02-22 09:49:25 +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
Emil Miler
4ec2366498 Include packaging status in README 2026-02-20 09:09:40 +08:00
DreamMaoMao
08ea40b6d6 opt: dont fade out shield client when capture 2026-02-19 19:19:14 +08:00
DreamMaoMao
bbd7f5b89c opt: use base surface of client when xytonode in rect node 2026-02-19 19:19:14 +08:00
DreamMaoMao
5615fd554f feat: add shield_when_capture windowrule to disable capture 2026-02-19 19:19:14 +08:00
DreamMaoMao
78e7bc9f34 feat: support index arg in switch_keyboard_layout 2026-02-19 11:23:28 +08:00
DreamMaoMao
08ed32cb3a fix: only apply scroller overspread to head and tail client 2026-02-19 11:17:46 +08:00
DreamMaoMao
58bb672601 feat: add global option prefer_scroller_overspread 2026-02-19 00:01:07 +08:00
DreamMaoMao
aacdcd441c bump versiont to 0.12.3 2026-02-18 13:27:10 +08:00
DreamMaoMao
784c6160a7 opt: remove useless code 2026-02-17 08:33:56 +08:00
Yappaholic
4bae00857a docs: add guix installation instructions 2026-02-16 13:17:22 +08:00
DreamMaoMao
c3b3c19f60 project: version not use latest tag 2026-02-16 11:56:42 +08:00