Reply to topic

Java GUI applications and window focus

luebking
Karma
0
> Client accepts input or input focus: False
The window says that it cannot be activated, unless you've a window rule in place, kwin won't pass the focus (but only make it the active window)
Probably AWT tries to detect when it wants to get the focus and then takes it itself .... *sigh*

Try to add a window rule ("kcmshell4 kwinrules") and in the "appearance & FIXES" tab, set "Accept Focus" to "Force" and "Yes".
Don't know the taskbar code, but if it doesn't try to be extra smart (active != focus, it should not test for this flag), this might do.
Voltago
Registered Member
Posts
11
Karma
0
Hi luebking,

that worked well, thank you.
sergeyse
Registered Member
Posts
2
Karma
0
Maybe this topic is old, but i have the same issue with plasma 5 (5.1.2 with qt 5.4.0) now..
When i working with PhpStorm (or PyCharm, or Netbeans), click on any window in taskbar only switch to that window, but doesn't focus it. Focus remains on PhpStorm.
I need to click on window to focus it.
There are no such problems with Alt+Tab, only with taskbar.
sergeyse
Registered Member
Posts
2
Karma
0
Here is a short screencast showing a bug i described in the last message.
http://youtu.be/HnySOxwXvCQ
When i click twice or more somewhere in the java app window, another windows are not focused with a single click. :(
luebking
Karma
0
User avatar sredna
Registered Member
Posts
225
Karma
1
OS
I use one java gui app, geogebra. No focus problems.
User avatar mykolak
Registered Member
Posts
8
Karma
0
Same issue for me, Plasma 5, NetBeans 8. I've added rule for KWin, window looks active but there is no focus.
luebking
Karma
0
Please export the rule and paste it.
User avatar mykolak
Registered Member
Posts
8
Karma
0
luebking
Karma
0
There'd be the option that netbeans (illegally ;-) alters the class while being mapped.
Can you use that rule to eg. force the window to be in top of others (or keep below or on a certain virtual desktop etc. - anything visible, just to check that the rule matches the window at all)
User avatar mykolak
Registered Member
Posts
8
Karma
0
Rule is definitely matches, cause without this rule NetBeans windows is inactive (both caption&taskbar) and with this rule window is active (both caption&taskbar again) but there is no input focus in it. I've checked "on top of others" to be sure and it works.
luebking
Karma
0
Setting it active (but not passing it the focus) is what should happen *without* the rule.

Where's the focus instead? (Which window receives the input)
User avatar mykolak
Registered Member
Posts
8
Karma
0
Maybe it's a strange, but let me describe what I have.

0. *Without* this rule. If i change a desktop to one where NetBeans is (or click on its taskbar icon), it's window is *inactive*. And no focus in the window. And it looks like no any window has an input focus.

1. *With* this rule. If i change a desktop to one where NetBeans is (or click on its taskbar icon), it's window is *active*. But (still) no focus in the window. And it looks like no any window has an input focus.
User avatar tobik
Registered Member
Posts
72
Karma
0
I can confirm this problem. I even tried to create the rule as it is suggested in this thread but I experienced exactly the same outcome as @mykolak did. The window gets focused but in fact it doesn't because I can't type in the editor.

Originally I thought this was a problem with Intellij IDEA (not Plasma/kwin related issue) so I posted a bug report but then I tried some other software and it was affected as well. So apparently the problem is in Plasma. Judging from my experiments I have a suspicion that only Swing based apps are affected by this. Intellij IDEA (PHPStorm, WebStorm...) and Netbeans don't get focus but Eclipse (which is not a Swing application, at least as far as I know) does. It works as expected.

Anyway, I filed a bug in the KDE bugtracking system: Bug #347153. Add yourself to the CC list to get updates (and to get the devs attention).

My current workaround is that I created a custom shortcut for the IDEA window. The trick is that I have to use the shortcut twice: first hit brings me to the desired desktop and the second focuses the window correctly. This "double-hit" is not that annoying and it's easy to get used to it. The problem is when I have more than one IntellJ window opened. The shortcut always brings me to the first one.
User avatar tobik
Registered Member
Posts
72
Karma
0
I have just updated to 5.3.1 and after some initial testing the bug seems to be fixed.

 
Reply to topic

Bookmarks



Who is online

Registered users: Baidu [Spider], Bing [Bot], daret, Google [Bot], Sogou [Bot]