Bug 514306 - "Detect Window Properties" delay control resets to 0 when losing focus
Summary: "Detect Window Properties" delay control resets to 0 when losing focus
Status: RESOLVED FIXED
Alias: None
Product: systemsettings
Classification: Applications
Component: kcm_kwinrules (other bugs)
Version First Reported In: unspecified
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2026-01-08 04:33 UTC by ultimatebaka
Modified: 2026-01-22 16:32 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In: 6.5.91
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ultimatebaka 2026-01-08 04:33:23 UTC
**SUMMARY**
In the Window Rules (kcm_kwinrule) module, the delay functionality for "Detect Window Properties" is broken. When a user enters a number of seconds, the input field automatically formats it into a human-readable string (e.g., "After 5 seconds"), but the input validation then fails to recognize its own formatted string and resets the value back to "Instantly" upon losing focus.

**STEPS TO REPRODUCE**
1. Open **System Settings** -> **Window Management** -> **Window Rules**.
2. Click **"Add New Rule..."** (or edit an existing one).
3. Click the **"Detect Window Properties"** button area.
4. In the delay input box next to the button, type a number (e.g., `5`).
5. Observe that the text automatically changes to `"After 5 seconds"`.
6. Click anywhere else to move the focus away from the input box.

**OBSERVED RESULT**
The input box immediately reverts to `"Instantly"`, and the delay is lost. Clicking "Detect Window Properties" after this reset will trigger the detection immediately instead of waiting for the specified seconds.

**EXPECTED RESULT**
The input field should retain the specified delay (e.g., `"After 5 seconds"`) and correctly trigger the delayed detection after the button is clicked.

**SOFTWARE/OS VERSIONS**
Operating System: Fedora Linux 43
KDE Plasma Version: 6.5.4
KDE Frameworks Version: 6.21.0
Qt Version: 6.10.1
Kernel Version: 6.17.12-300.fc43.x86_64 (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 7 7735H with Radeon Graphics
Memory: 16 GiB of RAM (14.9 GiB usable)
Graphics Processor 1: AMD Radeon 680M
Graphics Processor 2: NVIDIA GeForce RTX 4060 Laptop GPU

**ADDITIONAL INFORMATION**
1. It seems like there is a conflict between the display formatting logic and the input validation/parsing logic in the KCM. The UI formats the raw integer into a localized string, but the validator likely fails to parse the "After X seconds" string back into an integer.
2. I have reviewed Bug 389863 (https://bugs.kde.org/show_bug.cgi?id=389863) and believe my issue is different: In my case, even if I click the button while the input field displays "After X seconds", it still reverts to "Instantly" and triggers the pick-window action immediately, making the delay function completely unusable.
3. Note: This bug report was translated and prepared with the assistance of AI.
Comment 1 madness742 2026-01-18 12:11:01 UTC
I can confirm.

Workaround for the bug: Use the scroll wheel on the input box, instead of the arrows or typing it manually.

Operating System: Fedora Linux 43
KDE Plasma Version: 6.5.5
KDE Frameworks Version: 6.22.0
Qt Version: 6.10.1
Kernel Version: 6.18.5-200.fc43.x86_64 (64-bit)
Graphics Platform: Wayland
Processors: 32 × AMD Ryzen 9 7950X3D 16-Core Processor
Memory: 64 GiB of RAM (62,4 GiB usable)
Graphics Processor: AMD Radeon RX 7900 XTX
Manufacturer: Micro-Star International Co., Ltd.
Product Name: MS-7D75
System Version: 1.0
Comment 2 Ismael Asensio 2026-01-21 18:29:11 UTC
This looks like a regression in the QML component itself.

I've been testing and, as the comments report, the spinbox's value resets to 0 when the text input loses focus. Which makes it not usable unless using the suggested workaround (just use the scroll wheel). In this case, the control never gains or loses the keyboard focus.

A possible solution/workaround is to disable the numeric text input. This still allows to use the graphic arrows, the scroll wheel and the keyboard arrows to select the desired value.
Comment 3 Ismael Asensio 2026-01-21 19:01:28 UTC
> 1. It seems like there is a conflict between the display formatting logic and the input validation/parsing logic in the KCM. The UI formats the raw integer into a localized string, but the validator likely fails to parse the "After X seconds" string back into an integer.

Never mind, you were totally right with this suspicion. There's a fix incoming
Comment 4 Bug Janitor Service 2026-01-21 19:46:31 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/8689
Comment 5 Vlad Zahorodnii 2026-01-22 10:37:07 UTC
Git commit cdf9a428038e376e24802fb330cb6704384642ec by Vlad Zahorodnii, on behalf of Ismael Asensio.
Committed on 22/01/2026 at 10:03.
Pushed by vladz into branch 'master'.

kcms/rules: Fix delayed detection spinbox resetting

Along with the custom `textFromValue()` function, we need to also
provide a matching `valueFromText()` function. Otherwise, the spinbox
will use the default function and reset to the initial value (0) when
losing focus.

See https://qt-project.atlassian.net/browse/QTBUG-51114
FIXED-IN: 6.5.91

M  +4    -0    src/kcms/rules/ui/RulesEditor.qml

https://invent.kde.org/plasma/kwin/-/commit/cdf9a428038e376e24802fb330cb6704384642ec
Comment 6 Ismael Asensio 2026-01-22 16:32:13 UTC
Git commit df6b40daa3a36b312f9ebf6ecaa96459d572ac34 by Ismael Asensio.
Committed on 22/01/2026 at 14:11.
Pushed by iasensio into branch 'Plasma/6.6'.

kcms/rules: Fix delayed detection spinbox resetting

Along with the custom `textFromValue()` function, we need to also
provide a matching `valueFromText()` function. Otherwise, the spinbox
will use the default function and reset to the initial value (0) when
losing focus.

See https://qt-project.atlassian.net/browse/QTBUG-51114
FIXED-IN: 6.5.91


(cherry picked from commit cdf9a428038e376e24802fb330cb6704384642ec)

Co-authored-by: Ismael Asensio <isma.af@gmail.com>

M  +4    -0    src/kcms/rules/ui/RulesEditor.qml

https://invent.kde.org/plasma/kwin/-/commit/df6b40daa3a36b312f9ebf6ecaa96459d572ac34