Hyprland icon indicating copy to clipboard operation
Hyprland copied to clipboard

Dual screen focus shenanigans

Open fxzzi opened this issue 1 year ago • 4 comments

Hyprland Version

System/Version info
Hyprland, built from branch main at commit 3d9ca6381df1cdbf1731d7e2b39ea3f7574fce1e dirty (crashreporter: fix logging of function data (4632)).
Date: Wed Feb 7 09:50:23 2024
Tag: v0.35.0-7-g3d9ca638

flags: (if any)


System Information:
System name: Linux
Node name: Kappa
Release: 6.7.4-zen1-1.1-zen
Version: #1 ZEN SMP PREEMPT_DYNAMIC Wed, 07 Feb 2024 01:57:47 +0000


GPU information: 
07:00.0 VGA compatible controller [0300]: NVIDIA Corporation GA104 [GeForce RTX 3070] [10de:2484] (rev a1) (prog-if 00 [VGA controller])


os-release: NAME="Arch Linux"
PRETTY_NAME="Arch Linux"
ID=arch
BUILD_ID=rolling
ANSI_COLOR="38;2;23;147;209"
HOME_URL="https://archlinux.org/"
DOCUMENTATION_URL="https://wiki.archlinux.org/"
SUPPORT_URL="https://bbs.archlinux.org/"
BUG_REPORT_URL="https://gitlab.archlinux.org/groups/archlinux/-/issues"
PRIVACY_POLICY_URL="https://terms.archlinux.org/docs/privacy-policy/"
LOGO=archlinux-logo


plugins:

Bug or Regression?

Regression

Description

Hey Vax. It seems workspace / window focusing logic has changed since 0.34.0.

Expectation: Focus on workspace. Click on window on another monitor and workspace. Focus switches to that window and active workspace changes to the one on that monitor also.

In Reality: Click on window on another monitor and workspace. Focus switches to that window correctly, but active workspace remains on the original monitor.

On the note of focusing a workspace on another monitor with mouse, this should be possible on empty workspaces too. As in, clicking on an empty workspace on another monitor should focus that monitor and workspace.

Maybe I'm being dumb or maybe a new option was added which I am struggling to find. Any help would be appreciated :)

How to reproduce

Click on window on another monitor and workspace. Focus switches to that window correctly, but active workspace remains on the original monitor.

Crash reports, logs, images, videos

N/A

fxzzi avatar Feb 08 '24 18:02 fxzzi

wdym by active workspace? How can you see that?

vaxerski avatar Feb 09 '24 03:02 vaxerski

wdym by active workspace? How can you see that?

Active workspace as in the one which is focused and the one which newly created windows will open on. I'm seeing it with an active workspace indicator on waybar.

fxzzi avatar Feb 09 '24 04:02 fxzzi

After further usage of 0.35.0, I have experienced other focus issues, including on Minecraft. When playing, the pause screen (esc) would just randomly display causing me to need to refocus the window. Once I have a bit more time I will try and bisect the commit causing these issues and whether these 2 issues are actually related or not.

fxzzi avatar Feb 09 '24 21:02 fxzzi

This happens for me on all games that lock the mouse. Lets say my game is on the right monitor and browser window on the left. If I left click while moving the mouse to the left, the browser gets focused and I have to manually focus the game again.

swz-git avatar Feb 09 '24 23:02 swz-git

I think I've just run into this issue as well. When using gamescope to play Ultrakill (or Nightmare Reaper Demo) while having another program open on the screen to the right of my main screen, and I do a fast mouse swipe to the right (so towards the second screen) and click the game loses focus, keyboard inputs go to the program on the right screen, but the cursor doesn't actually show up. Using MOD+WorkspaceNr doesn't refocus the game, I first have to focus another workspace to be able to refocus the one the game is running on. In Ultrakill, this doesn't happen without gamescope. The --force-grab-cursor gamescope option doesn't seem to change anything here.

Edit: just tested, this behavior doesn't happen on 0.34

nadanke avatar Feb 10 '24 11:02 nadanke

while having another program open on the screen to the right of my main screen, and I do a fast mouse swipe to the right (so towards the second screen) and click the game loses focus

I can confirm these are the exact repro steps to trigger that issue.

However there is still the other issue of the workspace focus behaviour being different. Do y'all observe that issue too or is it just me?

Repro Steps:

mouse_move_focuses_monitor = false in hyprland.conf

Go to workspace on Monitor 1 Open a terminal

Use mouse to go to other monitor and click anywhere to "focus" that workspace Open a terminal Observe that the terminal you opened is unexpectedly on Monitor 1, when it should be on your other monitor.

fxzzi avatar Feb 10 '24 13:02 fxzzi

Downgrading to 0.34 solves it for me too

swz-git avatar Feb 10 '24 14:02 swz-git

can I get a git bisect on this one

vaxerski avatar Feb 10 '24 14:02 vaxerski

can I get a git bisect on this one

Yep yep, working on it as we speak

fxzzi avatar Feb 10 '24 14:02 fxzzi

@vaxerski, bad commit has been found to be cbadf3e3f31ab5ad5d192daac5f2ca930d08b8fb, reverting to one commit earlier (1ed4f1cb254ce4b4e55727d972998be1ef4baf22) and both issues are solved.

fxzzi avatar Feb 10 '24 14:02 fxzzi

Regarding the last dual screen issue I face,

On the note of focusing a workspace on another monitor with mouse, this should be possible on empty workspaces too. As in, clicking on an empty workspace on another monitor should focus that monitor and workspace.

This was originally the behaviour before at most v0.32.0. Testing in v0.30.0 shows that I am able to click on the other monitor with no windows open and still focus it. I will try to bisect this issue too (arguably a bit harder considering how long ago these are)

fxzzi avatar Feb 10 '24 15:02 fxzzi

try reverting this change: image

https://github.com/hyprwm/Hyprland/commit/cbadf3e3f31ab5ad5d192daac5f2ca930d08b8fb#diff-2ba0a4b3fea7c686b5bcf66318fa5912cb5d78a313318bf7ce2d51faf3b7a88aL604-R609

vaxerski avatar Feb 10 '24 15:02 vaxerski

try reverting this change

Reverted that change, seems to have fixed both the focus issues that were brought by v0.35.0.

Now I need to git bisect between v0.30.0 and v0.31.0 which is a pain because the build instructions changed

fxzzi avatar Feb 10 '24 15:02 fxzzi

Sorry for the number of comments, but after further testing, commit fb80cbe415835a7e0c64e2038d0fc56e8aba0ab4 is the culprit for changing the monitor focus behaviour. Before this commit, you could:

  • Click on a monitor which has no windows on it
  • Open a terminal
  • Observe the terminal open on the monitor you clicked on

However with this commit and forward, it goes like:

  • Click on a monitor which has no windows on it
  • Open a terminal
  • Observe the terminal open on the other monitor (the one which you didn't click on)

Was this intended? If it was, could a config option be added to change this behaviour back to how it was before this commit?

Thanks in advance for your help vaxry

fxzzi avatar Feb 10 '24 15:02 fxzzi

patch.txt try

vaxerski avatar Feb 10 '24 17:02 vaxerski

patch.txt try

Patch gave a warning about wlroots submodule but other than that all issues described in this issue have been solved!! Thanks so much vaxry u da best

fxzzi avatar Feb 10 '24 17:02 fxzzi

it's cuz git

vaxerski avatar Feb 10 '24 17:02 vaxerski