Bug 263932 - The active window is invisible upon session restore.
Summary: The active window is invisible upon session restore.
Status: RESOLVED WORKSFORME
Alias: None
Product: kwin
Classification: Plasma
Component: core (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: NOR wishlist
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-22 01:23 UTC by Christopher Yeleighton
Modified: 2021-06-17 15:48 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christopher Yeleighton 2011-01-22 01:23:54 UTC
Version:           unspecified (using KDE 4.4.4) 
OS:                Linux

The active window is invisible upon session restore.

Reproducible: Always

Steps to Reproduce:
  1. Restore a KDE session.

Actual Results:  
  1. The active window is invisible.

Expected Results:  
  1. Let the front window be active.
Comment 1 Thomas Lübking 2012-03-18 14:38:19 UTC
sorry for the late reply.

please elaborate on "invisible" - is the window minimized, on another virtual desktop or just covered by other windows?
Comment 2 Christopher Yeleighton 2013-06-11 17:57:33 UTC
The window with keyboard focus is not the topmost one; it may be fully covered by other windows at times.
Comment 3 Thomas Lübking 2013-06-11 19:39:57 UTC
Was it when you closed the session?
(The behavior is actually explicit in the code to preserve what you left, i recently stumbled over it)
Comment 4 Christoph Feck 2013-07-12 17:13:41 UTC
Christopher, if you can provide the information requested in comment #3, please add it.
Comment 5 Christopher Yeleighton 2013-10-12 11:58:12 UTC
Mozilla Firefox was active and topmost when I closed the session.
It is hard to tell which window is topmost when I open the session because they appear one after another; however, the active window does not change.  Mozilla Firefox was at the top and Libre Office was active at the time I checked.  That way you do not know what you are typing at.  The workaround is to temporarily configure the active window to always be on top.
Maybe I should raise the focus stealing prevention level, but the default level is Low, and this is what happens at Low.  However, even at that level, this irregularity does not happen after the correspondence between order and focus has been manually restored; it only occurs at session restore.
Comment 6 Thomas Lübking 2013-10-12 13:21:23 UTC
That won't work.
Judging by the invoked clients (which have both a record here ...) i guess what happens is that somebody sets WM2UserTime (witout any actual input) what pollutes the activation permission check on session restorage (it is assumed that you interacted meanwhile and that prevents passing on the focus)

I guess this can be somewhat caught by resorting to the FSP check when there's been "userInteraction" instead of completely forbidding focus transition.

Can you try a patch?
Comment 7 Christopher Yeleighton 2013-10-14 20:55:40 UTC
(In reply to comment #6)

> Can you try a patch?

The last time I tried a patch I ended up spending several days compiling things to make it run from the local prefix, and then another several days to clean up the mess in the default prefix because you cannot remove a KDE application unless you have the manifest, and the manifest is not getting installed, which is just awesome.  As a bonus, a library compiled against more recent KDE pretends to have the version of KDE, which is as insane as it can be, because it means you cannot reinstall the older install in the local prefix, which is necessary to recreate the manifest necessary to remove the very same thing, unless you break everything by recompiling and temporarily installing the version of KDE that the library was originally compiled against, which sometimes works but sometimes it does not, in case if the library was initially also compiled against a still older distro version, which is something you cannot build, and the only recourse is to install the distro version it was originally compiled against.  Looks like a lot of fun, doesn’t it?  A challenge for a true hacker, I would say :-)

BTW, my local prefix still contains old garbage belonging to calligra because the new calligra is bro-ken with respect to the Okular plugin, in that it does not build at all, which results in me being unable to open spreadsheets from the desktop.  As you can see, I am a patching veteran, and my wounds have not healed yet :-(
Comment 8 Nate Graham 2021-06-16 14:45:01 UTC
Cannot reproduce with Plasma 5.22. I've been using session restore for years and never seen this. Is it still happening to you?
Comment 9 Christopher Yeleighton 2021-06-17 15:48:41 UTC
(In reply to Nate Graham from comment #8)
> Cannot reproduce with Plasma 5.22. I've been using session restore for years
> and never seen this. Is it still happening to you?

It does not happen any more, I have Skype installed and it grabs the display for me to unlock the key chain no matter what.