Bug 237365 - Usability: Not focused after opening from systray
Summary: Usability: Not focused after opening from systray
Status: RESOLVED NOT A BUG
Alias: None
Product: kwin
Classification: Plasma
Component: platform-x11-standalone (other bugs)
Version First Reported In: 5.27.4
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: usability
Depends on:
Blocks:
 
Reported: 2010-05-12 11:43 UTC by Oliver Klee
Modified: 2024-08-07 09:05 UTC (History)
7 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Oliver Klee 2010-05-12 11:43:53 UTC
Version:           4.4.2 (using KDE 4.4.2)
OS:                Linux
Installed from:    Ubuntu Packages

Steps to reproduce:

1. start ktimetracker
2. create and start a task
3. close ktimetracker to minitize it to the systray
4. do some real work
5. after some time, decide to have a break
6. left-click on the ktimetracker systray icon to open the application
7. press Escape to stop the current task

Expected result:
ktimetracker has the focus, and Escape stops the current task.

Actual results:
ktimetracker is visible, but it does not have the focus. So the Escape goes to the currently focused app, not to ktimetracker, and the task happily continues. A second click on the app window is necessary to focus the app before the Escape key gets registered.
Comment 1 Thorsten Staerk 2010-05-14 19:35:24 UTC
Does not sound like the reason was in ktimetracker's source. Cannot try to reproduce because I am on a trip. Will be back in june.
Comment 2 Bartosz Brachaczek 2010-07-05 19:23:00 UTC
Looks like a problem with KStatusNotifierItem class - both KTimeTracker and, for instance, Amarok use it and both have the same problem. It's still an issue as of KDE SC 4.4.5.
Comment 3 Thorsten Staerk 2010-07-06 09:53:51 UTC
Thank you for the hint - this KStatUsNotifierItem stuff has been done by someone else but me - what is it and how can I solve this problem?
Comment 4 Bartosz Brachaczek 2010-07-06 13:03:14 UTC
It's probably a bug in kdeui, although I can't find any existing bug report against that. Maybe ask Aurélien, who committed the change (r1042702)?
Comment 5 Aurelien Gateau 2010-07-07 18:28:36 UTC
(In reply to comment #0)
> Steps to reproduce:
> 
> 1. start ktimetracker
> 2. create and start a task
> 3. close ktimetracker to minitize it to the systray
> 4. do some real work
> 5. after some time, decide to have a break
> 6. left-click on the ktimetracker systray icon to open the application
> 7. press Escape to stop the current task
> 
> Expected result:
> ktimetracker has the focus, and Escape stops the current task.
> 
> Actual results:
> ktimetracker is visible, but it does not have the focus. So the Escape goes to
> the currently focused app, not to ktimetracker, and the task happily continues.
> A second click on the app window is necessary to focus the app before the
> Escape key gets registered.

I just tried to reproduce the bug but it worked for me. Is there a particular thing to do in the 4th step to reproduce it? I just clicked on another window to focus it.
Comment 6 Bartosz Brachaczek 2010-07-07 21:35:01 UTC
> I just tried to reproduce the bug but it worked for me. Is there a particular
> thing to do in the 4th step to reproduce it? I just clicked on another window
> to focus it.

Try this:
1. Start KTimeTracker and minimize it to tray.
2. Start app A, and then app B so app B has focus.
3. Press Alt+Tab. Now app A has focus.
4. Press Alt+Tab. Now app B has focus.
5. Click on KTimeTracker's tray icon. It will get on top of other windows but it doesn't has focus.
Comment 7 Thorsten Staerk 2010-07-24 15:41:23 UTC
I cannot reproduce this.
Comment 8 Bartosz Brachaczek 2010-08-12 21:54:02 UTC
Anyway, it's fixed in KDE SC 4.5.0 (in kdeui, I think). Thanks.
Comment 9 Andrew Crouthamel 2018-09-04 18:53:02 UTC
Hello! Sorry to be the bearer of bad news, but this project has been unmaintained for many years so I will be closing this bug.
Comment 10 Alexander Potashev 2019-12-06 11:00:06 UTC
This or a similar problem is still reproducible with KTimeTracker built from Git master and KF 5.61.0. However KTimeTracker's code does not do anything special, it relies on KStatusNotifierItem's ability to show/hide the main application window.
Comment 11 Alexander Potashev 2019-12-06 11:04:16 UTC
How I reproduce the problem:

1. Start some other app, e.g. Kate
2. Run TimeTracker
3. Click on the KTimeTracker icon in system tray to hide (minimize) it
4. Click inside the Kate window
5. Click on the KTimeTracker's system tray icon again

EXPECTED
KTimeTracker must appear on top of Kate and get focus.

ACTUAL
Plasma taskbar indicates that KTimeTracker's window is now open. However Kate still has focus, and I can't even see KTimeTracker's window because the Kate's maximize window totally obscures KTimeTracker.
Comment 12 Alexander Potashev 2021-09-25 09:59:10 UTC
I can still reproduce in KTimeTracker and Kiten.
Comment 13 Alexander Potashev 2021-09-25 14:38:24 UTC
Here's what I've learnt today (using KF 5.85, Plasma 5.22.4)
1. Not reproducible on Plasma-Wayland.
2. Not reproducible if change window manager from kwin_x11 to fluxbox.

We could hack-fix it in KF5Notifications by calling KWindowSystem::forceActiveWindow() - a patch I've created actually solves the problem. However because it's not reproducible on Fluxbox, I believe it should be fixed in kwin_x11.
Comment 14 Bug Janitor Service 2021-09-25 20:09:43 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/knotifications/-/merge_requests/52
Comment 15 Alexander Potashev 2023-05-18 17:32:29 UTC
The bug described in comment #11 is still reproducible in Plasma 5.27.4 + KF 5.105.0 + Qt 5.15.9 on Fedora 37.
Comment 16 Bug Janitor Service 2023-05-28 20:35:56 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/knotifications/-/merge_requests/102
Comment 17 David Edmundson 2024-08-07 09:05:57 UTC
This is a client issue