Commit graph

875 commits

Author SHA1 Message Date
tonybanters
73616f07c4 opt: use config.xxx instead of global presets 2026-03-13 11:41:35 +08:00
DreamMaoMao
f39c61b633 opt: optimize popup unconstrain 2026-03-09 13:28:16 +08:00
DreamMaoMao
8c8b4b34df opt: set scroller stack to same first tag 2026-03-08 20:20:23 +08:00
DreamMaoMao
44fb6ce512 opt: reset size per when toggleview 2026-03-08 20:00:55 +08:00
DreamMaoMao
bc34afae58 fix: miss judge isdrag when resize stack in scroller 2026-03-08 08:46:28 +08:00
DreamMaoMao
443809a43d opt: fix a minor judgment error 2026-03-07 23:14:47 +08:00
DreamMaoMao
57f28e2880 opt: optimize center tile layout resizewin 2026-03-07 22:54:41 +08:00
DreamMaoMao
ddb1fc146f opt: optimize size per caculate when resizewin 2026-03-07 21:41:48 +08:00
DreamMaoMao
297983409e opt: change some default config 2026-03-07 17:29:52 +08:00
DreamMaoMao
c82d281a14 feat: export drag interval to able configure 2026-03-07 17:22:31 +08:00
DreamMaoMao
60fc68b498 opt: optimize resizewin setp with keyboard 2026-03-07 16:17:40 +08:00
DreamMaoMao
ebcf238bd3 fix: avoid mutual influence of monitor rules 2026-03-07 14:04:08 +08:00
DreamMaoMao
29a4f93b4e opt: add some comment 2026-03-07 14:04:08 +08:00
DreamMaoMao
b0f24c6fe1 opt: opt the old size per init 2026-03-07 12:55:01 +08:00
kanvolu
6438edc2b7 Added cycling both ways for switch_proportion_preset
Now switch_proportion_preset requires an argument "prev" or "next" to
determine cycle direction
2026-03-07 12:45:21 +08:00
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
57e02d6217 opt: clear some comment 2026-03-05 23:04:25 +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
3c5ab60e6a opt: make spawn and spawn_shell log to debug log 2026-02-26 23:23:00 +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
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
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