PanelAt answered where the panel goes in coordinates across the whole
layout (the cursor's, from hyprctl cursorpos), and PlacePanel handed them
to Hyprland's move rule. Hyprland counts a move from the corner of the
window's monitor (CDefaultFloatingAlgorithm::newTarget in 0.56.2:
COMPUTED + MONITOR_POS), so the monitor's place was added twice. The
reporter's click on the right of two 1920-wide monitors asked for
3238,40 and got 5158,40, off every screen. The monitor at 0,0 hid it,
and the only setup tried before (bf25a3ae8) had one monitor.
PanelAt now answers from the corner of the monitor under the cursor and
names it. The rule says monitor = that name, so the move counts from the
monitor clicked, not whichever one Hyprland would have opened the panel
on. The panel is still kept PanelGap inside that monitor's work area,
and the room below it is unchanged. ClickedOutside compares the cursor
with the clients' places, both across the layout, and stays as it was.
niri's placement already moves within the working area of the output and
doesn't share this. The fix follows laojianzi's draft (laojianzi/magpie#1).
Run:
- internal/omarchy TestPanelAtMonitorOffScreenOrigin (new), with the
reporter's two 1920x1080 side by side, the right edge, a monitor left
of and above 0,0, and a scaled one below. It plays Hyprland's sum and
checks where the panel lands and that it's inside the clicked
monitor's work area. With the old sum put back by hand it goes red,
landing at 5158,40 for the reporter's case. TestPanelAt's turned
monitor had the old global x written into it, and now has 6.
TestPanelRule checks the rule's text.
- On the omarchy VM (Hyprland 0.56.2), with a headless second output at
1600,0 made for the try and removed after, the same Lua rule on a
throwaway foot window titled magpie-1785-probe (not magpie's rule
name):
- monitor = "PROBE-1785", move = { 100, 40 } landed at 1700,40;
- the old global 1700,40 landed at 3300,40, off the screen;
- monitor = "Virtual-1", move = { 100, 40 } landed at 100,40.
- go vet (darwin, windows; internal/omarchy for linux with nogui).
gofmt is clean.
Not tried: magpie itself on two real monitors under Hyprland. The Linux
GUI build needs cgo and wasn't built here, so placePanel's two changed
lines are covered by the darwin and windows builds (app.go has no OS
tag).