* 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
Compare the metadata we would send against what is already committed and
send if there is any difference.
Found this testing whether MaxCLL influences in-panel tonemapping.
setHDRMetadata was only called when the monitor entered or left HDR or
in some cases surrounding direct scanout. Changes to the metadata itself
while the monitor stayed in HDR was computed and stored in the image
description, but never sent.
This particularly effects mastering data and min/max/max_avg luminance
changes.
Signed-off-by: Will Temple <will@wtemple.net>
the clear was scissored to m_renderData.damage while we fakeDamaged full
monitor. so in render pass when m_blurFBShouldRender is hit the FB was
cleared over partial damage but rendered over whole monitor causing
stale blur blends into the new outside damage. so save old damage,
render fakeDamage, restore old damage.
invalidate({GL_DEPTH_STENCIL_ATTACHMENT}) at end of
renderTextureWithBlurInternal cant set m_cleared = false because its not
invalidated the COLOR_ATTACHMENT, so guard invalidate.
* Fix group members not having uniform size when FSed
* fix the same bug - but for scrolling
* format
* fix include
* ditto
* groups are evil
* format
* TEST - Default handled FS -- tested in dwindle
Co-authored-by: Aqa-Ib <16420574+Aqa-Ib@users.noreply.github.com>
* TEST - Default handled FS -- tested in scrolling
Co-authored-by: Aqa-Ib <16420574+Aqa-Ib@users.noreply.github.com>
* TEST - layout handled FS -- Scrolling
Co-authored-by: Aqa-Ib <16420574+Aqa-Ib@users.noreply.github.com>
* format and comment fix
* spelling is hard
* slight fix for posterity
* spelling is very hard
* thankyouclangdverycool
* revert change that made all windows in a group show up as FS in hyprctl clients
* change test to reflect the reversion
* mirror mirror can you tell me who forgot to revert that change after it was redundant?
* tribute to the magic mirror
* clean up includes
* format
* Hope is the first step on the road to disappointment
Fix tests failing
---------
Co-authored-by: Aqa-Ib <16420574+Aqa-Ib@users.noreply.github.com>
we cant drop dmabuf damage until we have actually hit a frame that reads
it, otherwise clients like firefox attaches a buffer with damage,
eventually sends a .frame() and .commit() then we clear the damage and
the render has nothing to use.
* 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
if we dont reset surface metadata, the monitor is stuck in using the
surfaces metadata, and doesnt restore back ours. meaning after DS and
gaming and returning, colors stay stuck fringed until a new metadata
modeset.
however this causes a modeset on returning that isnt wanted if a
notification temporarly shows and vanishes. but a future PR in perhaps
using a timer if DS reenters in a short bit we dont care about the notif
fringing?
better then leaving the monitor permanently wrong colors.
* 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: 7579fc9d7e/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>
Native wayland popups attached to layers with keyboard interactivity set
to exclusive didn't receive any mouse event, the layer was eating it
all.
In practice this resulted in many popups outright closing on click,
since very often clicking outside of the popup makes the application
close the popup.
Only affects applications making use of native wayland popups of course.
the constructor, and destructor already add and remove from the
registry() so bindInternal's push_back added duplicates, also
invalidating the iterators causing a crash on hyprctl reload full-reset
* fullscreen: resolve fs handlers once per query
getFullscreenHandlerName() resolved the handlers twice by calling
getFsHandler() for both the layout and default case, and getFsHandler()
itself re-walked the workspace algorithm chain on every call.
Resolve SFsHandlersForWorkspace once and pass it to an overload of
getFullscreenHandlerName(), derive layoutHandled from the resolved
handler name instead of a second layoutManagedFS() pass, and hoist the
repeated algorithm()/tiledAlgo()/floatingAlgo() lookups in
getFsHandlersForWorkspace() into locals.
* damage: compute the surface box once in damageSurface
getSurfaceBoxGlobal() was computed twice per damage event: once for the
frame scheduling hack and again inside computeDamage(). Compute it once
in damageSurface() and pass it into computeDamage(), which now takes the
box as an argument.
* sync: check the timeline before making an eventfd
since most points are signaled when we reach this, we reduce the
churn of making eventfd, ioctl, and poll + close.
* bindings/dispatchers: Don't inherit key state modmask during key sym lookup
Discussion: https://github.com/hyprwm/Hyprland/discussions/14772
In some cases, such as with bind -> sendshortcut, the key sym lookup
will fail resulting in a 'key not found' error when the cached xkb
state is used for lookup.
This can happen if, for example, the SHIFT key is bound in `hl.bind`.
Consider the following case, where SHIFT+1 is mapped to 2:
```lua
hl.bind("SHIFT + 1", hl.dsp.send_shortcut({mods = "", key = "2"}))
````
`resolveKeycode` will fail to lookup 2 because SHIFT is depressed in
the modmask.
Here, I've modified the lookup to use a fresh key state with no modmask.
After lookup, `ConfigActions::pass` will clear the modmask before
sending keys anyway, so an empty modmask can be used for lookup
in `resolveKeycode` safely.
* hyprtester/plugins: Update xkb state for test keyboard
* hyprtester/plugins: Add keybind_modmask plugin
This is different than keybind/keybind2 in that it takes a list of mods,
and applies the mods to the xkb state as well, which the other two do not.
* hyprtester/tests: Add set_shortbut bind tests involving SHIFT
---------
Co-authored-by: Max Asnaashari <max@masnax.org>
* renderer: enable fp16 by default when supported
this enables fp16 by default when supported on 10bit monitors.
also remove invalidate_fp16 config option and just make a general
debug:invalidate_buffers thats on by default, if "debugging" is
required.
* config: deprecate debug:invalidate_fp16
add deprecation notice for invalidate_fp16
* compositor: add notif warning on startup if no fp16
warn about missing fp16 gpu support on startup.
* core: add fp16 to systeminfo output
add fp16 info if suppported or not in systeminfo.
Scale is a precise number that may be read back by certain tools via
`hyprctl monitors -j` so it's important to not lose any precision to
avoid non-integer pixel counts when scaling certain display sizes.
e.g.
3840 / 1.33333 = 2880
1.33333 -> 1.33
3840 / 1.33 = 2887.22 (!!!)
Fixes: https://github.com/hyprwm/Hyprland/discussions/15151
Signed-off-by: Joe Groocock <me@frebib.net>
previously we tried using stencil only GL_STENCIL_INDEX8 but some
drivers just simply sucks and gave us incomplete framebuffers. so we are
actually creating GL_DEPTH24_STENCIL8 but disabling the depth with glDisable(GL_DEPTH_TEST);
but this means we need to invalidate the depth too, even if we really
didnt use it.