Commit 68e33fb
feat(windowing): generic X11/EWMH window backend (#41)
* feat(windowing): add generic X11/EWMH window backend
Generic wmctrl/xprop backend for list/focus/activate/move/resize on any EWMH-compliant X11 window manager without a dedicated backend (Cinnamon, MATE, Xfce, Openbox, …). Registered last in the backend order so a session-native backend always wins first.
Also dispatch move_window/resize_window by the resolved window's backend instead of hardcoding the GNOME Shell extension, so geometry ops work on X11 too. doctor now reports window listing/focus available on plain X11 sessions.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* fix(windowing): harden X11 backend per review
- list_windows: bail on non-X11 sessions so it never returns XWayland-only windows when a Wayland session falls through to this backend.
- move_window: map a -1 x/y target to -2, since wmctrl -e reads -1 as "preserve current value" and would otherwise drop the move.
- clean: compare "N/A" case-insensitively.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* fix(windowing): gate X11 focus caps on xprop; list x11 in capability map
probe(): the focused flag (and thus focused_window/activate verification) comes from _NET_ACTIVE_WINDOW via xprop, so advertise can_focus_apps/can_focus_windows only when xprop is on PATH. Listing still works with wmctrl alone.
diagnostics: capabilities.window_control hard-coded the named backend fields and omitted i3 and x11, so it was empty on X11-only sessions even though the registry uses the x11 backend. Read i3/x11 from windowing.backends (tried last).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* fix(windowing): reject non-positive X11 resize; fix doctor note when focus unavailable
resize_window: reject width<=0 || height<=0 before wmctrl -e, where a non-positive value is the "preserve current value" sentinel and would report success while leaving a dimension unchanged.
windowing note: when a backend can list windows but cannot verify focus (e.g. wmctrl present but xprop missing on X11, so can_focus_windows=false), say listing-only instead of claiming focused_window and targeted-input verification are available.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* style: format X11 backend changes
---------
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Co-authored-by: Avi Fenesh <aviarchi1994@gmail.com>1 parent 9f2f4f1 commit 68e33fb
6 files changed
Lines changed: 485 additions & 25 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
240 | 240 | | |
241 | 241 | | |
242 | 242 | | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
243 | 260 | | |
244 | 261 | | |
245 | 262 | | |
| |||
578 | 595 | | |
579 | 596 | | |
580 | 597 | | |
581 | | - | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
582 | 601 | | |
583 | 602 | | |
584 | 603 | | |
585 | 604 | | |
586 | 605 | | |
587 | 606 | | |
588 | | - | |
| 607 | + | |
589 | 608 | | |
590 | 609 | | |
591 | 610 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1243 | 1243 | | |
1244 | 1244 | | |
1245 | 1245 | | |
1246 | | - | |
| 1246 | + | |
1247 | 1247 | | |
1248 | 1248 | | |
1249 | 1249 | | |
| |||
1257 | 1257 | | |
1258 | 1258 | | |
1259 | 1259 | | |
1260 | | - | |
1261 | | - | |
1262 | | - | |
| 1260 | + | |
| 1261 | + | |
1263 | 1262 | | |
1264 | 1263 | | |
1265 | 1264 | | |
1266 | 1265 | | |
1267 | 1266 | | |
1268 | 1267 | | |
1269 | | - | |
| 1268 | + | |
1270 | 1269 | | |
1271 | 1270 | | |
1272 | 1271 | | |
| |||
1280 | 1279 | | |
1281 | 1280 | | |
1282 | 1281 | | |
1283 | | - | |
1284 | | - | |
1285 | | - | |
1286 | | - | |
1287 | | - | |
1288 | | - | |
1289 | | - | |
| 1282 | + | |
| 1283 | + | |
1290 | 1284 | | |
1291 | 1285 | | |
1292 | 1286 | | |
| |||
2219 | 2213 | | |
2220 | 2214 | | |
2221 | 2215 | | |
2222 | | - | |
| 2216 | + | |
2223 | 2217 | | |
2224 | 2218 | | |
2225 | 2219 | | |
| |||
2229 | 2223 | | |
2230 | 2224 | | |
2231 | 2225 | | |
2232 | | - | |
| 2226 | + | |
2233 | 2227 | | |
2234 | 2228 | | |
2235 | 2229 | | |
2236 | 2230 | | |
2237 | 2231 | | |
2238 | 2232 | | |
2239 | 2233 | | |
2240 | | - | |
2241 | | - | |
| 2234 | + | |
| 2235 | + | |
2242 | 2236 | | |
2243 | 2237 | | |
2244 | 2238 | | |
2245 | 2239 | | |
2246 | | - | |
| 2240 | + | |
2247 | 2241 | | |
2248 | 2242 | | |
2249 | 2243 | | |
2250 | 2244 | | |
2251 | 2245 | | |
2252 | 2246 | | |
2253 | 2247 | | |
2254 | | - | |
| 2248 | + | |
| 2249 | + | |
| 2250 | + | |
2255 | 2251 | | |
2256 | 2252 | | |
2257 | 2253 | | |
| |||
2269 | 2265 | | |
2270 | 2266 | | |
2271 | 2267 | | |
2272 | | - | |
| 2268 | + | |
2273 | 2269 | | |
2274 | 2270 | | |
2275 | 2271 | | |
| |||
2281 | 2277 | | |
2282 | 2278 | | |
2283 | 2279 | | |
2284 | | - | |
| 2280 | + | |
2285 | 2281 | | |
2286 | 2282 | | |
2287 | 2283 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
0 commit comments