Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion app/main/createWindow.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ export default ({ src, isDev }) => {
// Show main window on launch only when application started for the first time
}

if (process.platform === 'linux') {
const isKde = process.env.KDE_FULL_SESSION === "true"
Copy link
Member

@PeterDaveHello PeterDaveHello Aug 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to KDE’s official documentation, the value of the environment variable KDE_FULL_SESSION may include version information in the future (for example, true-5.27). Therefore, simply checking for === "true" may fail in the future. A more robust approach is to check whether the variable exists and is not empty.

If you plan on using this variable to detect a running KDE session, check if the value is not empty instead of seeing if it equals true. The value might be changed in the future to include KDE version information.

https://userbase.kde.org/KDE_System_Administration/Environment_Variables#Automatically_Set_Variables

Or, a more general method that complies with the Freedesktop standard is to check the XDG_CURRENT_DESKTOP environment variable.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Single quotes are commonly used in this file, so maybe we should use 'true' to match the usual preference in .eslintrc and the style of the current file.

Suggested change
const isKde = process.env.KDE_FULL_SESSION === "true"
const isKde = process.env.KDE_FULL_SESSION === 'true'

Copy link
Member

@PeterDaveHello PeterDaveHello Aug 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would some notes here be helpful?

Suggested change
const isKde = process.env.KDE_FULL_SESSION === "true"
const isKde = process.env.KDE_FULL_SESSION === "true"
// The 'splash' window type in Electron can cause input and focus issues on
// the KDE Plasma desktop environment. By detecting KDE, we can avoid setting
// this type and prevent the bug.
// See issues: #661, #705
Suggested change
const isKde = process.env.KDE_FULL_SESSION === "true"
const isKde = process.env.KDE_FULL_SESSION === "true"
// On KDE (Plasma), setting type='splash' causes windows to be unable to receive keyboard focus/input (#661, #705)
// Therefore, 'splash' is disabled under KDE, while other Linux distributions still use it.

if (process.platform === 'linux' && !isKde) {
browserWindowOptions.type = 'splash'
}

Expand Down