mirror of
https://github.com/DeeJanuz/frametop.git
synced 2026-10-06 02:00:06 +02:00
Put clicks where the cursor is on scaled desktop screens
With a screen's scale set to anything but 100%, clicks landed away from the cursor, further off the further from the top left (#3). ft-screens hands KWin panel positions in buffer pixels, and KWin's nested Wayland backend (6.2.5, WaylandInputDevice) adds surface coordinates to its output's logical position without dividing by the output's scale. At 125% a click at the middle of a 3440x1440 screen, (1720, 720), reached KWin as logical (1720, 720), pixel (2150, 900). ft-screens now keeps a scale per screen and divides pointer positions by it. ft-layout sends each screen's scale, as KWin reports it after applying, with a new "scale N s" command, whenever it applies scales: at desktop start and from Frametop Display Settings. Screens default to 1, so an ft-layout that never sends it keeps the old behaviour. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
0857a54fab
commit
18aa0fec3a
3 files changed
+39
-5
No files matched your search
+3
-1
@@ -53,12 +53,14 @@ In the last three modes the hotkey shows the screens anyway. Two more settings o
|
||||
|
||||
Input from the lasers reaches KWin through ft-screens' own seat. Keys come from the input relay, from pass-through keyboards and any key a pointer device passes through. Typing follows your last click: after a click on a screen it goes to the desktop, even with the SteamVR dashboard open, and after a mouse click on any other panel (the dashboard, Steam, an app like Spotify) it goes there instead. While it goes to the desktop, the relay grabs pass-through keyboards so gamescope, which reads every keyboard itself, doesn't type them into the Steam app too. A program that watches every keyboard for a hotkey loses a grabbed one; with `SHARE_KEYS=1` in `~/.config/frametop.conf`, their keys also go to `@frametop_keys` for it. That's off by default, since any local process that binds the name first would get everything typed into the desktop. Hidden screens don't take typing.
|
||||
|
||||
KWin's nested backend doesn't undo a screen's scale on pointer input, so ft-screens divides panel positions (in pixels) by it. `ft-layout` sends it each screen's scale as KWin reports it (`scale N s`) whenever it applies scales: at desktop start and from Frametop Display Settings. A scale changed only in Plasma's own display settings is put back to the Frametop layout's the next time `ft-layout` runs.
|
||||
|
||||
ft-screens listens for datagrams on the abstract socket `@ft_screens` and replies to the sender:
|
||||
|
||||
```
|
||||
place N x y z yaw pitch roll width N metres curve N radius|on|off
|
||||
pin N|all left|right [matrix] unpin N|all size N w h
|
||||
get N screens head state key code value
|
||||
get N screens head state key code value scale N s
|
||||
visibility always|dashboard|gesture|toggle wrist degrees gesture left|right degrees
|
||||
hide | show | toggle controllers always|outside_games|dashboard ingames hide|visible
|
||||
```
|
||||
|
||||
Reference in new issue
Block a user