* add systemd session target
* session: stop graphical-session so we block, near other systemd cleanup
* session: don't start session ourselves if MANAGERPID is set
This avoids doing systemd stuff if we're already in a systemd-managed
session, like UWSM. Env vars and targets and such should already be
handled for us.
* session: store state, rather than rechecking env var at exit
---------
Co-authored-by: Dregu <dregu@dreg.us>
std::memcmp returns a nonzero value when the buffers differ, so
hdrMetadataEqual() returned true for differing metadata and false for
identical metadata. The caller in commitFrame compares
!hdrMetadataEqual(WANTED, CURRENT), which inverted this again: identical
HDR metadata was treated as changed every frame, re-sending
AQ_OUTPUT_STATE_HDR and forcing a full DRM modeset on every commit.
Fixes a per-frame modeset loop on displays with HDR metadata configured
(e.g. cm=hdredid).
Co-authored-by: neonvoidx <me@neonvoid.dev>
* hyprctl(repl): go interactive if no Lua was given via args
The previous check would mess up if `-i` was provided, since it'd see
*an argument* and refuse to go interactive, even when it should've (i.e.
`hyprctl -i 0 repl`).
* ipc(socket1): new escape parsing for batch commands
Semicolons are still the command separator, so those have to be escaped
if they appear anywhere inside of commands (e.g. multi-statement Lua
code). Also, literal backslashes need to be escaped as well.
* tests(ipc): add test for hyprctl batch mode
This test case includes slightly weird stuff (semicolons in Lua code;
square brackets) that would break the old parsing logic.
* format: dang braces
* lua: make HLMonitor:set_workspace "silent" (no focus or mouse move)
* lua: report correct function name when HLMonitor:set_special_workspace errors
* monitor: allow setting special workspace on monitor without focusing that monitor
* lua: make HLMonitor:set_special_workspace also "silent"
* workspace: support not carrying focus with us in moveWorkspaceToMonitor
This leaves focus on the same monitor, rather than carrying it along
with the moved workspace as usual.
* lua: fix HLMonitor:set_workspace placing the same WS on different monitors
I thought this was already handled for me; apparently not.
* lua: support creating new workspaces via HLMonitor:set_workspace(), set_special_workspace()
* monitor: don't send workspace events on non-focusing workspace change
* lua: better handle (non-)?special selectors in HLMonitor:set_workspace(), set_special_workspace()
Both now check that they're given a workspace of the appropriate
special-ness.
* lua: don't require a table arg for HLMonitor:set_workspace(), set_special_workspace()
Also, names given to `set_special_workspace()` no longer require a
`special:` prefix, matching the toggle_special dispatcher's behavior.
* misc: allow getting workspaces relative to a given monitor
Not just the currently focused one.
* lua: reference targeted monitor for relative WS selectors in set_workspace()
Now, e.g. `m+1` selects the next workspace on the *targeted* monitor,
rather than on the focused monitor.
* tests: HLMonitor:set_workspace() behavior
* tests: HLMonitor:set_special_workspace() behavior
* tests: don't force unnecessary refreshes in luaGetWorkspace test
* lua: return workspace name as selector for special workspaces
Previously this would be the ID, which was negative and would then be
interpreted later as a *relative* ID. Normal workspaces can still return
their (positive) IDs, that's fine.
* monitor: properly leave focus behind when stealing a special workspace
* lua: include Lua's error code in eval/repl error responses
* hyprctl: let interactive repl handle multiline input
repl with a simple command (i.e. Lua code provided as a hyprctl arg)
handles multiline input just fine already, but interactive didn't. This
uses the Lua repl's own approach of trying to execute, and letting the
user continue if the exec attempt returns an "unexpected EOF"-type
syntax error. It's a little clunky, but if it's fine for them, it should
be fine for us.
Ref: https://github.com/lua/lua/blob/7579fc9d7ed90240487251dfb69168f8e64e9294/lua.c#L569-L582
* hyprctl: append full multiline command to repl history
* fix format :(
* lua: fix crash on print with no args
Co-authored-by: Dregu <dregu@dreg.us>
---------
Co-authored-by: Dregu <dregu@dreg.us>
* floating: support fitting windows only partially on-screen
* floating: add config for whether existing floating windows are kept on-screen
* floating: apply "floating windows on-screen" config when moving into layout
* floating: add config for whether new floating windows are forced on-screen
* tests: (new_)?float_force_onscreen behavior
* lua: support workspace selectors in `hl.get_workspace()`
* tests: lua `hl.get_workspace()` with selectors
* lua: don't change focus in `hl.get_workspace()`
That results in an expired workspace being returned, when it should just
be `nil` for nonexistent spaces.
* tests: special cases for moving across dwindle splits
Two special cases are covered here:
- Moving across a split whose orientation has been manually toggled,
should not forget that orientation
- Small windows (<50% of their split's area) should still be able to
move straight across that split
Both are currently broken, but these tests are in preparation for fixes.
* layout/dwindle: fix moving small windows across splits
When moving a window, its original node is removed from the layout, and
a new node is created based on a "focus point." Previously, if a) the
original window were too small and b) it were moved toward its split
partner, the resulting focus point would cause the new window to be
placed into the same position as the original. This manifested as small
windows being impossible to move toward/across their immediate split
partners.
Now, we detect whether the target window is being moved toward its
immediate partner, and if so, override the split direction to ensure
it's placed on the opposite side of that partner.
* window: add `stableid:` window selector
Matches against the "stable ID" for a window, which is also the ID
returned to clients that bind to the `ext-foreign-toplevel-list`
protocol. That allows such clients to more easily call `hyprctl` and do
useful things with the IDs they get.
* tests: exact window selectors (address, PID, stable ID)
* config/lua: make `require` throw an actual error for nonexistent modules
`require` uses pcall to catch errors and display them to the user. This
is usually okay, but it also hides errors if Lua tries to load a
nonexistent module, which the Lua config might actually want to detect
and handle on its own (e.g. by loading a different module, or disabling
functionality).
Ref #14534
* config/lua: make vanilla `require` available as `__require`
If `safeLuaRequire()`'s error-catching behavior isn't wanted, this
allows the user to call the original version directly, as `__require`.
Or, they could bring it back as the default by doing e.g.
`require = __require`, which might be desired to avoid breaking
third-party modules that want to catch errors during module load.
This manifested for me as a failure to build plugins with `hyprpm`, but
the root cause was GPG data getting incorporated into `src/version.h`,
like so:
```c
#define GIT_COMMIT_MESSAGE "gpg: Signature made Sun 09 Nov 2025 03:31:36 PM PST
gpg: using EDDSA key E26A4A2AB9676F54149F8EAA665806380871D640
gpg: Can't check signature: No public key
version: bump to 0.52.1"
```
This affected both `GIT_COMMIT_MESSAGE` and `GIT_COMMIT_DATE`, since
those are generated via `git show` (which can generate that extra GPG
info if the user's personal Git config sets `log.showSignature`).
See: https://github.com/hyprwm/Hyprland/discussions/12282