Commit graph

1826 commits

Author SHA1 Message Date
UjinT34
30367f272c
Merge 5cfa6fcf9f into 6dc42e0f6d 2026-05-06 23:54:58 +12:00
ArchSav
497b48e852
config: add device tags (#13728)
---------

Co-authored-by: Mio Argillander <mio@argillander.me>
2026-05-05 16:30:19 +01:00
fazzi
eff3bfe261
windows/focus: add fallbacks when focussing workspaces (#14270) 2026-05-04 17:00:56 +01:00
fazzi
90fe7c6569
InputManager: add guards to confineToRegion to avoid issues (#14269) 2026-05-03 15:00:16 +01:00
Maximilian Seidler
aa5e38041e
sessionLock: send locked instead of denied when missing a lock frame for 5 seconds (#14271)
The protocol seems to allow this, because it explicitly mentions either
session lock surface or compositor blanking the output in this sentence:

> The locked event must not be sent until a new "locked" frame
  (either from a session lock surface or the compositor blanking the output)
  has been presented on all outputs and no security sensitive normal/unlocked
  content is possibly visible.

Since `locked_screen_delay` is capped to 5 seconds,
after the 5 seconds this timer is registered for, we assume that
all outputs are covered either by lockedead or by an actual lock frame.
Thus sending locked is ok.
2026-05-03 14:58:03 +01:00
Tony Miller
334b361c8d
screenshare: round captureBox after scaling to fix region capture at fractional scales (#14257)
After scaling m_captureBox from logical to pixel coordinates, the box may
have non-integer dimensions (e.g. logical 401x301 at scale 1.25 -> pixel
501.25x376.25). m_bufferSize is then computed as captureBox.size() and
sent to the client as int32 width/height (truncating the fraction), but
m_bufferSize itself stays as a fractional Vector2D.

When the client allocates the integer-sized buffer and submits it,
CScreenshareFrame::share() rejects it with ERROR_BUFFER_SIZE because
Vector2D::operator== is exact double comparison: (501, 376) != (501.25,
376.25). The frame is sent failed, and the client retries forever.

The SHARE_WINDOW path already rounds its bufferSize; the SHARE_REGION
path didn't. Round the captureBox immediately after scaling so all
downstream consumers (m_bufferSize, render translates) see clean integer
pixel coordinates.

Reproducer at scale 1.25 on a 1920x1080 monitor:

  wf-recorder -g '500,200 401x301' -f /tmp/x.mp4
  # "Failed to copy frame, retrying..." until exit

  wf-recorder -g '500,200 400x300' -f /tmp/x.mp4
  # works (400*1.25=500, 300*1.25=375, both integer)
2026-05-02 21:06:00 +01:00
Niko Savola
f60e50da00
internal: improve cursor size logging (#14180) 2026-05-02 20:36:14 +01:00
fazzi
e180c59b46
desktop/windowRule: add confine_pointer window rule (#13379) 2026-05-02 20:34:43 +01:00
Vaxry
a3fa7b4950
keybinds: fix keycode matching on lua (#14254) 2026-05-02 19:18:44 +01:00
19175706eb use a better work space, not linear, only for sdr 2026-05-02 14:11:32 +03:00
Barrett Ruth
f9723133cc
gestures: add live pinch cursor zoom (#14049) 2026-05-02 00:02:01 +01:00
Eren
4ab3a40398
screenshare: adjust session cleanup and event emission order (#14229)
* fix(screenshare): adjust session cleanup and event emission order

Revised the handling of `stoppedListener` initialization in
`getManagedSession` to ensure correct scoping and lifecycle management.
Updated the `stop` method in `CScreenshareSession` to adjust the order
of `screenshareEvents` and `stopped.emit()` to prevent potential
use-after-free scenarios.

* fix(screenshare): ensure managedSession removal uses consistent target reference

This change updates the lambda in the stopped listener to use
a pre-fetched target pointer for comparison when erasing sessions.

* fix(screenshare): use early-return and smart ptr comparison in session cleanup
2026-05-01 23:50:02 +01:00
5f9df52b55
protocolMgr: set m_self properly when updating mirrored outputs
When we have onMonitorModeChange, we can't leave an output with a null m_self as that will fuck up other things wanting a ref

ref https://github.com/basecamp/omarchy/issues/5457
2026-05-01 15:40:11 +01:00
Vaxry
450d8a0bf7
xdg-shell: queue state updates for toplevel (#14227)
ref https://github.com/hyprwm/Hyprland/discussions/14224
2026-04-30 20:41:55 +01:00
MightyPlaza
8884b9e6ce
binds: add an auto_consuming flag (#13919) 2026-04-30 12:59:03 +01:00
phanium
d40860e8e2
config/lua: cannot disable animation (#14215)
* config/lua: cannot disable animation

seems regression from 9ee5ff1f71

* typing typo (auto generated by cmake)
2026-04-30 12:53:51 +01:00
31e025dbe0 desktop/window: refactor over fullscreen state 2026-04-29 22:05:32 +01:00
a92dae5af7 desktop/window: add alpha container for alpha calculations 2026-04-29 22:05:32 +01:00
Vaxry
9ee5ff1f71
animations: add springs (#14171) 2026-04-29 21:31:06 +01:00
Vaxry
342750b56f
config/lua: fix unbind behavior (#14199) 2026-04-29 13:41:09 +01:00
Psilocybin78
c8c66642e4
seat: fix dropped wl_keyboard.enter after stale keyboardFocusResource (#14143)
* seat: fix dropped wl_keyboard.enter after stale keyboardFocusResource

CSeatManager::setKeyboardFocus's leave loop was gated on
m_state.keyboardFocusResource (a WP<CWLSeatResource>). That weak
pointer can expire between focus cycles — most reliably via the
explicit `.reset()` in KeybindManager::passKeys for XWayland
targets, but also in practice after certain wl_seat rebind
sequences from toolkit-level churn. When the WP is expired, the
leave loop's `if (m_state.keyboardFocusResource)` is false, the
loop is skipped, and no wl_keyboard.leave is sent for the previous
focus. The old client's CWLKeyboardResource keeps m_currentSurface
pointing at its old surface.

On the next focus back to that surface,
CWLKeyboardResource::sendEnter's per-keyboard dedup fires
(`if (m_currentSurface == surface) return;`) and the enter is
silently dropped. Net result: client believes it's still focused,
compositor routes keys via m_state.keyboardFocusResource which now
points somewhere else, typed keystrokes silently go to a different
window. A mouse drag resyncs because
InputManager::processMouseDownNormal → refocus() →
mouseMoveUnified(refocus=true) → rawWindowFocus(…, foundSurface)
takes a different path that forces the leave/enter pair through.

Reported and reproducible in discussion #14141.

Fix: iterate PROTO::seat->m_keyboards (the global owning list) in
the leave loop and let sendLeave()'s own m_currentSurface gate
decide whether each keyboard needs the event. sendLeave() and the
sendMods(0,…) that precedes it are already gated on m_currentSurface
being set, so iterating every keyboard is a no-op for any keyboard
that wasn't on the previous focus — identical semantics to the old
code in the healthy case, correct in the broken case.

Enter loop unchanged: it's driven by surf->client() which is a
cached wl_client* on the surface resource, stable across cycles.

Verified against the repro in #14141 (two wev instances cycled via
`hyprctl dispatch focuswindow`). Before the fix both windows get
stuck in a "I am focused" state after ~3 cycles. After the fix
leave/enter pair each dispatch cleanly.

* seat: apply same leave-loop fix to setPointerFocus

Identical failure mode to the keyboard case in the previous commit:
setPointerFocus's leave loop is gated on m_state.pointerFocusResource,
which can expire between focus changes. When it does, the leave is
skipped, the previously-focused client's wl_pointer m_currentSurface
stays stuck, and the next sendEnter's per-pointer dedup silently
drops the enter.

sendPointerButton also early-returns on `if (!m_state.pointerFocusResource)`,
so the visible symptom is "a click on a taskbar / dock / menu button
doesn't register after a layer-shell Overlay surface appeared or
disappeared, until the user moves the mouse." Motion re-syncs focus
via InputManager::mouseMoveUnified → setPointerFocus with a fresh
resource, at which point clicks work again.

Fix is the same: iterate PROTO::seat->m_pointers and let sendLeave's
m_currentSurface gate decide. No-op for pointers not on the old
surface.
2026-04-27 22:39:39 +01:00
Vaxry
80763b13ff
keybindMgr: use legacy behavior for single-key binds on lua (#14176) 2026-04-27 01:10:28 +01:00
a5baf45d69
input: fix device configs for pointer devices 2026-04-26 23:29:18 +01:00
Vaxry
5ba33f8461
config/lua: init lua config manager, use lua if available (#13817)
Adds a new lua config manager, which will automatically be used if there is a lua config present.
2026-04-26 15:16:36 +01:00
Vaxry
ab8e015bc9
screenshare/frame: set m_copied after shm copy succeeds (#14165) 2026-04-25 22:15:14 +01:00
Conner
73f4807796
keybinds: fix missing z-order update on floating toggle (#14100) 2026-04-20 19:45:22 +01:00
Mihail Costea
e12d2b7cc8
input: implement follow_mouse_shrink (#13707)
* input: implement follow_mouse_shrink

Add a new config option `input:follow_mouse_shrink` (INT, 0-300, default 0)
that shrinks inactive window hitboxes by the specified number of pixels for
focus detection purposes. This creates a dead zone in gaps between windows
where moving the cursor will not trigger a focus change.

The shrink only applies to inactive (non-focused) windows and only during
mouse-move focus checks (follow_mouse = 1). Click and scroll interactions
are unaffected — clicking on a window in the shrunk area still works
normally once the window is focused.

Closes #9973

* tests: add integration test for follow_mouse_shrink
2026-04-20 16:56:30 +01:00
Vaxry
a360c31d04
errorOverlay: modernize, refactor, use GPU rendering (#14122)
Improves the overlay's rendering:
- GPU accelerated
- supports gradients
- wraps
- cleaner code a bit
2026-04-19 18:47:49 +01:00
UjinT34
66ea2e2c9e
renderer: Various CM fixes, part 8 of refactors (#13860)
Part 8 of Ujin's refactors.
2026-04-16 19:19:25 +01:00
Nikolai Nechaev
ff459f4a2a
groups: fix movewindoworgroup when moving from group to group (#14086)
* Add test for movewindowgroup

* groups: Fix `movewindoworgroup` moving into group

Fixes `CKeybindManager::moveWindowIntoGroup` to
remove a window from a group before attempting
to add it to another group. Addresses #13843.

But the animation of moving a window from a group
into another group now looks weird: as if the
whole target group is being moved.
2026-04-16 17:54:04 +01:00
Visal Vijay
1ea0a43615
monocle: avoid repeated workspace monitor lock() calls (#14085)
* refactor(monocle): avoid repeated workspace monitor lock() calls

* clang-format

* cleanup: avoid repeated weak_ptr::lock() calls

* style: shorten variable name PMONITORWORKSPACEOWNER to PMONITOR
2026-04-16 17:53:12 +01:00
933a24caa6
screencopy: clear buffer before rendering (#14064)
If reusing wl_buffers when capturing a transparent window, the current
frame would overlay the previous frame instead of replacing it.
2026-04-13 09:17:10 +01:00
Vaxry
814337fdd2
keybinds: fix wrong space assignment in pin (#14061) 2026-04-12 23:04:42 +01:00
Visal Vijay
f7755322fc
input: avoid repeated weak_ptr::lock() and ensure consistent usage (#14039) 2026-04-10 14:38:28 +01:00
75dc67e63f input: lazy cache getWindowIdeal() 2026-04-07 12:07:36 -04:00
Tom Englund
809b9b9e78
egl: move over to use hyprgraphics (#12988)
use the hyprgraphics helpers instead.
2026-04-05 19:37:07 +01:00
Andreas Backx
8edb7c5663
xwayland: pipe through monitor in coordinate mapping (#13700)
* xwayland: prefer monitor-aware hover coords

Introduce monitor-aware XWayland coordinate helpers and keep the X11 hover path anchored to the main surface box while preserving detailed debug logging, reducing dependence on nearest-monitor guesses in layout-sensitive input paths.

* xwayland: use window monitor for reported coords

Report X11 window positions through the window's known monitor instead of the generic nearest-monitor heuristic so boundary-aligned outputs keep stable XWayland coordinates.

* xwayland: use window monitor for real position restore

Convert XWayland geometry back into compositor space using the window's current monitor when available so vertically offset layouts do not round-trip through the wrong output.

* xwayland: use window monitor for unmanaged geometry

Restore override-redirect X11 geometry through the window's known monitor so helper windows and popups avoid nearest-monitor misclassification on offset layouts.

* xwayland: remove monitor conversion debug logging

Drop the temporary XWayland hover and coordinate conversion diagnostics now that the monitor-selection bug is confirmed and the window-monitor based conversions fix the issue.

* xwayland: drop unrelated focused-motion change

Remove the exploratory X11-specific pointer focus scaling from InputManager so the monitor mapping fix stays narrowly scoped to the XWayland coordinate conversion changes that actually resolve the bug.

* clang-format XWaylandManager
2026-04-05 16:54:38 +01:00
Tom Englund
3af9b10890
internal: silence compiler warnings about unused return values (#13997)
* misc: silence warnings about ignoring return value on reads

silence warnings on ignored return values on read() and print an error
if it occurs.

* misc: silence warnings about ignoring return value on writes

silence warnings on ignored return values on write() and print an error
where we can, or pass them the maybe_unused attribute.

* misc: silence warnings about ignoring return value on pipe

silence warnings on ignored return value on pipe(), print an error and
exit on failure.
2026-04-05 14:45:27 +01:00
a151c67165 animation: avoid redundant damage calls in tick
animated variables would independently damage, that's redundant.
2026-04-04 11:53:49 -04:00
Vaxry
29cf6264a2
desktop/window: reduce window deco updates (#13980)
AVARDAMAGE_ENTIRE doesn't mean the geometry changed, so no point in an expensive update
2026-04-04 14:06:07 +01:00
Pppp1116
4c42269ce6 monitor: centralize solitary and scanout eligibility checks 2026-04-04 08:26:24 -04:00
Pppp1116
a84e98d2a8
seat/compositor: fix minor issues (#13958) 2026-04-02 22:29:45 +01:00
UjinT34
38a7f03cf0
renderer: refactor part 7: api fixes (#13631)
Part 7 of ujin's refactors

---------

Co-authored-by: Vaxry <vaxry@vaxry.net>
2026-03-28 21:41:45 +00:00
ssareta
420ee44eed
protocols: allow xdg-foreign to be used by sandboxed apps (#13854)
* allowlist xdgForeignExporter

* also allow importer
2026-03-28 15:35:58 +00:00
littleblack111
1c25bcc811
dispatchers: add moveintoorcreategroup (#13325) 2026-03-28 15:31:04 +00:00
UjinT34
2e5e800e4b
renderer/cm: Support wp-cm-v1 version 2 (#12817) 2026-03-25 23:48:06 +00:00
UjinT34
8196711aaa
screencopy: check share session state (#13839) 2026-03-25 13:37:53 +00:00
Chris Naporlee
63c56bad6f
protocols: reimplement unstable/xdg-foreign-v2 (#13716) 2026-03-23 23:08:58 +00:00
Dregu
64a2e4e263
input: fix the multimon touch fix (#13819) 2026-03-23 12:55:22 +00:00
Vaxry
8726a7363e
config: cleanup the entire config infrastructure (#13785)
Massively refactors the config infrastructure, sorely
needed and will be req'd for the lua stuff
2026-03-20 17:52:37 +00:00