-
Notifications
You must be signed in to change notification settings - Fork 16.4k
Description
Preflight Checklist
- I have read the Contributing Guidelines for this project.
- I agree to follow the Code of Conduct that this project adheres to.
- I have searched the issue tracker for a feature request that matches the one I want to file, without success.
Problem Description
It is my understanding that Windows and macOS impose window border shapes and appearances through their respective window managers. These operating systems also provide native title bar buttons upon request or overlay them automatically.
In contrast, Linux platforms delegate the responsibility for border styles, title bar buttons, their positioning, appearance, and quantity to the Electron application itself.
This approach shifts the burden of proper desktop integration to the application developer. Often, developers opt for a simplified solution: an undrawn square border with three generic buttons (minimize, maximize, and close) positioned in the top-right corner. However, this generic approach may not align with user preferences or conform to the conventions of the current desktop environment.
Proposed Solution
Electron should provide a platform-specific window border and apply two sets of title bar buttons (left and right) to the application upon request.
This system could support multiple desktop environments with unique title bar styling, including but not limited to:
- GNOME
- KDE
- Elementary
- COSMIC
While the extent of matching user preferences may vary, this approach would require exposing a generic interface to the underlying application. This interface would automatically apply the correct title bar button styling and appearance using a strategy pattern.
Alternatives Considered
I've explored the possibility of developing a Web Components library that would provide three key components:
-
A window wrapper component:
- Implements the correct border (and shadow, if necessary) for the platform
- Optionally includes a simple title bar
-
A component for the left bank of title bar buttons
-
A component for the right bank of title bar buttons
This approach would enable developers to incorporate environment-specific window controls without the need to create custom solutions specifically for the Linux platform.
Additional Information
No response