Linux app is unusable when "Focus follows mouse"
- Dominant language
- C++
- Stars
- 3.9k
- Forks
- 1k
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 123
Description
### ⚠️ Before submitting, please verify the following: ⚠️
- [x] This is a **bug**, not a question or a configuration issue.
- [x] This issue is **not** already reported on Github (I have searched for it).
- [x] Nextcloud Server and Desktop Client are **up to date**. See [Server Maintenance and Release Schedule](https://github.com/nextcloud/server/wiki/Maintenance-and-Release-Schedule) and [Desktop Releases](https://nextcloud.com/install/#install-clients) for supported versions.
- [x] I agree to follow Nextcloud's [Code of Conduct](https://nextcloud.com/contribute/code-of-conduct/)
### Bug description
If you use "Focus follows mouse" on Linux, the app is unusable.
While you _can_ open the settings window. If you try to open the main app window, "Open Nextcloud Desktop" it will open and then **immediately close again**.
### Steps to reproduce
1. Enable **"Focus follows mouse"** or "Focus on hover" using **GNOME Tweaks**.
a. This is a commonly used GNOME setting that is not exposed in stock Ubuntu settings, but may be shown on other distros, I'm just familiar with Ubuntu.
b. It's helpful because you no longer need to click to focus on a window before you're allowed to use it.
c. GNOME Tweaks is an official GNOME app with more settings that are hidden from the basic settings.
2. Right-click on the Nextcloud top bar icon.
3. Click Open Nextcloud Desktop
4. The main window will flash open and then immediately close because the window is not currently focused.
https://github.com/user-attachments/assets/5742af0f-bf9d-49ba-b649-96a8e87331df
### Expected behavior
When you open the main window it should stay open until you either:
A. Click outside the window.
B. Click on a "Close" button.
These are both design patterns used by Ubuntu and apps on Ubuntu. If you right-click a top bar icon, the menu stays open until you click anywhere else on screen. With Bitwarden if you right-click the icon and click Show/Hide, it shows the main window that stays open until you click the "X" in the top-right.
### Which files are affected by this bug
N/A
### Operating system
Linux
### Which version of the operating system you are running.
Ubuntu 26.04
### Installation method
Official Linux AppImage
### Nextcloud Server version
33.0.2 (a few patches behind Stable)
### Nextcloud Desktop Client version
33.0.6 (Stable - Ubuntu running on xcb)
### Did this occur after an update or on a clean installation?
Clean desktop client installation
### Are you using the Nextcloud Server Encryption module?
No
### Are you using an external user-backend?
- [x] Default internal user-backend
- [ ] LDAP or Active Directory
- [ ] SSO - SAML
- [ ] Other
### Nextcloud Server logs
```shell
N/A
```
### Additional info
Related: #2646
### Possible solutions
1. Add a setting to disable the "close on loss of focus" functionality. I imagine this would require that an "X" button is added to then close the window.
2. Switch to a more traditional app layout with a "Header bar" that allows you to close, minimize, and re-position the window. The settings window already does this and is perfectly cromulent, so hopefully that means it's possible without too much effort on the main window too.
GNOME design guidelines for header bars: https://developer.gnome.org/hig/patterns/containers/header-bars.html
### Design thoughts
I'd love it if Nextcloud just went to a more traditional window design. The current one has this custom design that doesn't follow several GNOME design guidelines. I understand the design needs to apply to a multitude of desktop environments, so it doesn't need to follow GNOME design to a T, but I think there's a few improvements like adding a "Header bar" that would look okay everywhere and improve usability.
While just adding a header bar like the "Settings" window has is enough, _if_ a full GNOME redesign was a possibility, I might imagine it looking something like this:
_(This is a mockup in Inkscape.)_
Contributor guide
Research direction
No affected files or tests are identified. Reproduce the issue on Linux with “Focus follows mouse” enabled, then inspect the main window opened from the top-bar menu; done means it remains open until the user clicks outside it or uses a Close control.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, linux
- Domain
- desktop, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 42/100