[GH-ISSUE #1134] Application window loses focus when mouse leaves screen. #911

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

Originally created by @ichisadashioko on GitHub (Apr 18, 2021).
Original GitHub issue: https://github.com/debauchee/barrier/issues/1134

Describe the bug
Application window loses focus when mouse leaves its screen.

To Reproduce

Steps to reproduce the behavior:

  1. Click on window A on the server screen.
  2. Move mouse to the client screen.
  3. Window A on the server loses focus. Window B on the client gains focus.
  4. Move mouse back to the server screen.
  5. Window B on the client screen loses focus. Window B on the client loses focus.

Expected behavior
It should be a setting for turning on/off this behavior. As some application will not work if it loses focus (it will be paused).

Desktop (please complete the following information):

  • OS: Windows, Ubuntu 20.04
  • Barrier version: 2.3.3
Originally created by @ichisadashioko on GitHub (Apr 18, 2021). Original GitHub issue: https://github.com/debauchee/barrier/issues/1134 **Describe the bug** Application window loses focus when mouse leaves its screen. **To Reproduce** Steps to reproduce the behavior: 1. Click on window A on the server screen. 2. Move mouse to the client screen. 3. Window A on the server loses focus. Window B on the client gains focus. 4. Move mouse back to the server screen. 5. Window B on the client screen loses focus. Window B on the client loses focus. **Expected behavior** It should be a setting for turning on/off this behavior. As some application will not work if it loses focus (it will be paused). **Desktop (please complete the following information):** - OS: Windows, Ubuntu 20.04 - Barrier version: 2.3.3
Author
Owner

@ichisadashioko commented on GitHub (Apr 18, 2021):

I am intending to remove this focusing/un-focusing window behavior for personal use. After running scc to get an overview of the codebase, it estimated that the current codebase took around 27 months to "write".

scc                       
───────────────────────────────────────────────────────────────────────────────
Language                 Files     Lines   Blanks  Comments     Code Complexity
───────────────────────────────────────────────────────────────────────────────
C Header                   452    103603    13005     29815    60783        954
C++                        250     63896     8617      9546    45733       7310
TypeScript                  48     68059      715         0    67344       1102
CMake                       21      1341      195       344      802         83
Autoconf                     8      2205      568      1059      578         93
Batch                        6       136       24         4      108         16
Gherkin Specificati…         6         6        0         0        6          3
Objective C                  6       645       94       105      446         10
SVG                          4       476       67         1      408          0
Shell                        4       155       23        27      105         31
License                      3       418       52         0      366          0
Markdown                     3       136       47         0       89          0
Plain Text                   3        34        9         0       25          0
YAML                         3       192        8         3      181          0
gitignore                    3        36        0         3       33          0
C                            2       258       38        10      210          6
Powershell                   2        38        3         0       35          0
LaTeX                        1       422       89         1      332          0
Objective C++                1      2164      319       218     1627        281
Pascal                       1       329        4        15      310          0
Prolog                       1        16        0         0       16          0
Properties File              1         7        0         3        4          0
XML                          1        46        0         0       46          0
───────────────────────────────────────────────────────────────────────────────
Total                      830    244618    23877     41154   179587       9889
───────────────────────────────────────────────────────────────────────────────
Estimated Cost to Develop (organic) $6,289,034
Estimated Schedule Effort (organic) 27.661515 months
Estimated People Required (organic) 20.198723
───────────────────────────────────────────────────────────────────────────────
Processed 9435689 bytes, 9.436 megabytes (SI)
───────────────────────────────────────────────────────────────────────────────
  • Where should I start on hacking the codebase?
  • Does barrier use SetFocus() to set window's focus on Windows as I cannot find any SetFocus string in the current codebase?
<!-- gh-comment-id:821977033 --> @ichisadashioko commented on GitHub (Apr 18, 2021): I am intending to remove this focusing/un-focusing window behavior for personal use. After running `scc` to get an overview of the codebase, it estimated that the current codebase took around 27 months to "write". ``` scc ─────────────────────────────────────────────────────────────────────────────── Language Files Lines Blanks Comments Code Complexity ─────────────────────────────────────────────────────────────────────────────── C Header 452 103603 13005 29815 60783 954 C++ 250 63896 8617 9546 45733 7310 TypeScript 48 68059 715 0 67344 1102 CMake 21 1341 195 344 802 83 Autoconf 8 2205 568 1059 578 93 Batch 6 136 24 4 108 16 Gherkin Specificati… 6 6 0 0 6 3 Objective C 6 645 94 105 446 10 SVG 4 476 67 1 408 0 Shell 4 155 23 27 105 31 License 3 418 52 0 366 0 Markdown 3 136 47 0 89 0 Plain Text 3 34 9 0 25 0 YAML 3 192 8 3 181 0 gitignore 3 36 0 3 33 0 C 2 258 38 10 210 6 Powershell 2 38 3 0 35 0 LaTeX 1 422 89 1 332 0 Objective C++ 1 2164 319 218 1627 281 Pascal 1 329 4 15 310 0 Prolog 1 16 0 0 16 0 Properties File 1 7 0 3 4 0 XML 1 46 0 0 46 0 ─────────────────────────────────────────────────────────────────────────────── Total 830 244618 23877 41154 179587 9889 ─────────────────────────────────────────────────────────────────────────────── Estimated Cost to Develop (organic) $6,289,034 Estimated Schedule Effort (organic) 27.661515 months Estimated People Required (organic) 20.198723 ─────────────────────────────────────────────────────────────────────────────── Processed 9435689 bytes, 9.436 megabytes (SI) ─────────────────────────────────────────────────────────────────────────────── ``` - Where should I start on hacking the codebase? - Does `barrier` use [`SetFocus()`](https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-setfocus) to set window's focus on Windows as I cannot find any `SetFocus` string in the current codebase?
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#911
No description provided.