Bug 113142 - focus prevention makes kde unusable
Summary: focus prevention makes kde unusable
Status: CLOSED REMIND
Alias: None
Product: kwin
Classification: Plasma
Component: general (other bugs)
Version First Reported In: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-09-23 14:05 UTC by Thomas Zander
Modified: 2006-04-12 17:28 UTC (History)
0 users

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


Attachments
test app (647 bytes, text/x-csrc)
2005-10-03 17:12 UTC, Lubos Lunak
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Zander 2005-09-23 14:05:45 UTC
Version:            (using KDE Devel)
Installed from:    Compiled sources

Using focus prevention 'normal' gives me lots of problems where newly started application windows appear under the existing ones.

Example;
the alt-F2 window never gets initial focus.
clicking on the wallet manager systray icon starts the wallet manager underneath my already running konqueror
the initial wallet dialog (the wizard for first time use) started under my kmail config dialog freezing everything until I did an alt-tab.

I tried different mouse focus policies; they did not seem to make any difference.
Comment 1 Lubos Lunak 2005-10-03 16:47:47 UTC
Worksforme. Please provide more details about your setup.
Comment 2 Thomas Zander 2005-10-03 17:06:21 UTC
3.5 branch.
amd 64
qt-copy
gcc 4.0.1

Anything else that might be of interrest?
Comment 3 Lubos Lunak 2005-10-03 17:12:55 UTC
Created attachment 12832 [details]
test app

Yes, I just don't know what exactly it should be. Giving me the number reported
by the attached testapp might be useful, maybe.
And you can bet I'd be flooded by bugreports if was happening to everybody.
Comment 4 Lubos Lunak 2005-12-12 15:53:57 UTC
Cannot reproduce, don't have enough info to even guess -> closing.
Comment 5 Bernhard Breinbauer 2006-02-28 10:00:00 UTC
I would like to step in here.
I am also able to reproduce the above described behaviour. However it does not happen when "focus stealing prevention level" is set to "none".
Some output values of the above test app (they differ slightly):
-1344241288
-1345474097
-1344236415
Hopefully that means more to you than to me :-)

I didn't see this behaviour a month ago, but I remember changing the focus policy option to see what effect it has. After that I changed it back to "low" which is the default, but it didn't work like it should, but like the initial reporter described.

Some additional info:
KDE 3.5.1, Qt 3.3.4, gcc 3.4.4 
(I don't think it's important, but I also have an amd64 like the initial reporter)
Comment 6 Bernhard Breinbauer 2006-04-10 10:14:18 UTC
Well, back again.
I solved this issue back then, with removing the ~/.kde/share/config/*kwin* files (i believe). But the behaviour is now occuring again, and I have no idea why. I'm sure, I haven't change any kwin related things.
If I remove kwinrc, kill kwin and restart it, the behaviour is correct. But only for windows which were open, when i restarted kwin. So, if an app has focus which was running when restarting kwin and I click on the kopete systray icon, kopete opens and gets focus.
If I start eg. konqueror (after restarting kwin!) and it has focus while clicking on the kopete systray icon, kopete will open in the background without focus.
I have also tested it with a new user and it shows the same behaviour.
I'm willing to provide further info, if necessary.

So even though this bug is marked RESOLVED, it is certainly NOT!

PS: KDE 3.5.2, Qt 3.3.4, gcc 4.1, 
Comment 7 Lubos Lunak 2006-04-11 17:13:28 UTC
64bit architecture seems to be what triggers this problem. I've committed some fixes, if you can still reproduce the problem with KDE3.5.3 (or current SVN) please reopen.
Comment 8 Bernhard Breinbauer 2006-04-12 13:05:42 UTC
Hello Lubos,

thank you for taking care. I've checked out 3.5 svn but can't compile it, 2 functions are missing:
utils.h: In function 'int KWinInternal::timestampCompare(Time, Time)':
utils.h:235: error: 'timestampCompare' is not a member of 'NET'
utils.h: In function 'Time KWinInternal::timestampDiff(Time, Time)':
utils.h:241: error: 'timestampDiff' is not a member of 'NET'
make[1]: *** [workspace.lo] Error 1

Indeed I can't find this member functions anywhere? So where did they go? :-)

regards
Comment 9 Thomas Zander 2006-04-12 14:00:19 UTC
You also need to update kdelibs/kdecore :)
Comment 11 Thomas Zander 2006-04-12 17:28:04 UTC
Over the last couple of months I had kwin crash on me every time I exited KDE, I contributed this to X (which was an unstable cvs version).
After upgrading X the other day, I found I was mistaking.

Many thanks for those set of fixes as they fix my kwin from crashing for good no. :)