[GH-ISSUE #1672] Focus remains on last app used when switching machines, still responsive! #1235

Open
opened 2026-05-05 07:38:33 -06:00 by gitea-mirror · 1 comment
Owner

Originally created by @emacstheviking on GitHub (May 13, 2022).
Original GitHub issue: https://github.com/debauchee/barrier/issues/1672

What happened?

I was watching a film in Firefox from Amazon Prime on an iMac running as server. When I then moved across to the Mac mini, I noticed every time I moved the mouse, the overlays showing the video rewind/forward buttons and cast information kept on appearing.

I tried again with Microsoft Teams, I gave Teams the focus, then switched back the Mac mini, again, despite the mouse being on a different machine, the parts of the Teams application that would respond to a mouse over event kept operating e.g. the icons appearing or menus flickering.

It seems that even though the mouse is not visible, it is still feeding events into the 'other' systems event loop and being processed by the last application that had focus.

The fix would seem to be to explicitly remove the focus from the active app on the machine that is 'losing input focus'. I verified this by manually clicking the desktop on the iMac running Amazon player / Teams and then moving to the other machine. This time there was no unexpected activity. It means that you can't watch anything fullscreen because as soon as you move the mouse on the 'other' machine, it causes the player app to show the usually hidden controls. Irritating!

However, Barrier is a FANTASTIC application, I've Synergy many years ago too. I am a software developer myself and I will download the code and have a look to see if anything jumps out at me in terms of a solution, and maybe a PR will follow but I am no expert on Qt, and my fix might only work for Apple platforms.

Thanks again.

Version

From Git HEAD or commit (specify below)

Git commit hash (if applicable)

No response

If applicable, where did you install Barrier from?

The server is running on a late 2012 intel iMac:

  • version 2.4.0-release-3e0d758b
  • build date 1 November 2021, it was downloaded from the GitHub site.

The M1 version was provided by 'Jason',

What OSes are you seeing the problem on? (Check all that apply)

macOS

What OS versions are you using?

The server machine is a late 2012 intel iMac, running Catalina, 10.15.7
The client machine, a Mac mini, is running Monterey, 12.3.1

Relevant log output

No response

Any other information

No response

Originally created by @emacstheviking on GitHub (May 13, 2022). Original GitHub issue: https://github.com/debauchee/barrier/issues/1672 ### What happened? I was watching a film in Firefox from Amazon Prime on an iMac running as server. When I then moved across to the Mac mini, I noticed every time I moved the mouse, the overlays showing the video rewind/forward buttons and cast information kept on appearing. I tried again with Microsoft Teams, I gave Teams the focus, then switched back the Mac mini, again, despite the mouse being on a different machine, the parts of the Teams application that would respond to a mouse over event kept operating e.g. the icons appearing or menus flickering. It seems that even though the mouse is not visible, it is still feeding events into the 'other' systems event loop and being processed by the last application that had focus. The fix would seem to be to explicitly remove the focus from the active app on the machine that is 'losing input focus'. I verified this by manually clicking the desktop on the iMac running Amazon player / Teams and then moving to the other machine. This time there was no unexpected activity. It means that you can't watch anything fullscreen because as soon as you move the mouse on the 'other' machine, it causes the player app to show the usually hidden controls. Irritating! However, Barrier is a FANTASTIC application, I've Synergy many years ago too. I am a software developer myself and I will download the code and have a look to see if anything jumps out at me in terms of a solution, and maybe a PR will follow but I am no expert on Qt, and my fix might only work for Apple platforms. Thanks again. ### Version From Git HEAD or commit (specify below) ### Git commit hash (if applicable) _No response_ ### If applicable, where did you install Barrier from? The server is running on a late 2012 intel iMac: - version 2.4.0-release-3e0d758b - build date 1 November 2021, it was downloaded from the GitHub site. The M1 version was provided by 'Jason', - https://github.com/debauchee/barrier/issues/960#issuecomment-1062604604 - Version 2.4.0-release-653e4bad, build date 11 February 2022 ### What OSes are you seeing the problem on? (Check all that apply) macOS ### What OS versions are you using? The server machine is a late 2012 intel iMac, running Catalina, 10.15.7 The client machine, a Mac mini, is running Monterey, 12.3.1 ### Relevant log output _No response_ ### Any other information _No response_
Author
Owner

@emacstheviking commented on GitHub (May 13, 2022):

I did a little digging, I figured that hiding the cursor would be the start of the trail, then that led me to:

FILE: src/lib/platform/OSXScreen.mm, line 858

bool
OSXScreen::leave()
{
    hideCursor();

I am not sure what the core graphics call would be to 'remove focus from any particular window' or maybe you'd have to create a dummy offscreen window and give that the focus, I don't know. I guess you would also have to record which window handle had the focus, if any (desktop), and then restore that on OSXScreen::enter() as well.

If I can get it to build, and if I can get the time, I'll have a go but I am up to my neck in side-things, but aren't we all!
All the best, thanks for Barrier, it's an absolute life saver.

<!-- gh-comment-id:1126366970 --> @emacstheviking commented on GitHub (May 13, 2022): I did a little digging, I figured that hiding the cursor would be the start of the trail, then that led me to: FILE: `src/lib/platform/OSXScreen.mm`, line 858 ``` bool OSXScreen::leave() { hideCursor(); ``` I am not sure what the core graphics call would be to 'remove focus from any particular window' or maybe you'd have to create a dummy offscreen window and give that the focus, I don't know. I guess you would also have to record which window handle had the focus, if any (desktop), and then restore that on OSXScreen::enter() as well. If I can get it to build, and if I can get the time, I'll have a go but I am up to my neck in side-things, but aren't we all! All the best, thanks for Barrier, it's an absolute life saver.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/barrier#1235
No description provided.