Summary: | Java app window does not lose focus after single click on a different window | ||
---|---|---|---|
Product: | [Plasma] kwin | Reporter: | Bo <b> |
Component: | general | Assignee: | KWin default assignee <kwin-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | b, ilari.makimattila, kde, notmart, vo.zaeb |
Priority: | NOR | Flags: | thomas.luebking:
ReviewRequest+
|
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Arch Linux | ||
OS: | Linux | ||
URL: | https://git.reviewboard.kde.org/r/122298/ | ||
See Also: | https://bugs.kde.org/show_bug.cgi?id=344080 | ||
Latest Commit: | http://commits.kde.org/kwin/96628a698c92eb96bd8563d0de8e2969d9d23320 | Version Fixed In: | 5.2.1 |
Sentry Crash Report: |
Description
Bo
2015-01-28 02:20:08 UTC
i'm not sure is valid (would more blame the application doing funny things) but more in topic with kwin sounds like the application is holding a keyboard grab. Please go to a tty and execute the following command DISPLAY=:0 xdotool key "XF86LogGrabInfo" and then look into /var/log/Xorg.0.log and check whether it reports a grab. If there is a grab it will show something like: [526989.104] (II) Printing all currently active device grabs: [526989.104] Active grab 0x6200000 (core) on device 'Virtual core keyboard' (3): [526989.104] client pid 28477 kwin_x11 --replace [526989.104] at 526979802 (from active grab) (device thawed, state 1) [526989.104] core event mask 0x3 [526989.104] owner-events false, kb 1 ptr 1, confine 0, cursor 0x0 I'm having the exactly same issue on same platform (Arch Linux 64bit, plasma 5.2) with different java apps (PhpStorm and Arduino IDE). I'm using focus follows mouse and it works just fine, except for java. The active window hilight stays on the java app and every keypress is sent to it. The only way to change focus seems to be alt+tab. Here's the grab info: [ 14257.420] (II) Printing all currently active device grabs: [ 14257.420] (II) End list of active device grabs As there's no grab, it seems the java client re-*setInputFocus() itself. I could assume sth. incredibly silly like "while (iAmTheActiveWindow()) XSetInputFocus();" -> What java? Sun, OpenJDK7 or OpenJDK8? (the arch package name will be sufficient) Oracle java. Package jdk-8u31-2 from AUR. My situation is the same is Ilari's. Xorg.0.log lists: [ 58380.216] (II) Printing all currently active device grabs: [ 58380.216] (II) End list of active device grabs I also have the jdk-8u31-2 from AUR installed *** Bug 343480 has been marked as a duplicate of this bug. *** Confirmed with oracle java (forgot sun sold it) and jedit. Checking why. I think I know the reason (timestamp issue - old timestamp -> java thinks that "this is MYYYYYY focus!!!" ;-) The jedit testcase is not as reliable as i'd like it to be. Can anyone try to apply this patch: diff --git a/client.cpp b/client.cpp index 12fbd50..f560e15 100644 --- a/client.cpp +++ b/client.cpp @@ -1617,6 +1617,7 @@ void Client::takeFocus() previous_focus_timestamp = xTime(); previous_client = this; #endif + updateXTime(); if (rules()->checkAcceptFocus(info->input())) m_client.focus(); else Alternative patch that spares a roundtrip diff --git a/xcbutils.h b/xcbutils.h index 9a03134..465cb0e 100644 --- a/xcbutils.h +++ b/xcbutils.h @@ -1089,7 +1089,7 @@ public: void clear(); void setBackgroundPixmap(xcb_pixmap_t pixmap); void defineCursor(xcb_cursor_t cursor); - void focus(uint8_t revertTo = XCB_INPUT_FOCUS_POINTER_ROOT, xcb_timestamp_t time = xTime()); + void focus(uint8_t revertTo = XCB_INPUT_FOCUS_POINTER_ROOT, xcb_timestamp_t time = XCB_TIME_CURRENT_TIME); void selectInput(uint32_t events); void kill(); operator xcb_window_t() const; Git commit 2390024f69f82ba074a2292e22cb2b431ca6ec39 by Thomas Lübking. Committed on 28/01/2015 at 22:41. Pushed by luebking into branch 'Plasma/5.2'. use xcb_time_current_time as setinputfocus default REVIEW: 122298 FIXED-IN: 5.2.1 M +1 -1 xcbutils.h http://commits.kde.org/kwin/2390024f69f82ba074a2292e22cb2b431ca6ec39 Git commit 96628a698c92eb96bd8563d0de8e2969d9d23320 by Thomas Lübking. Committed on 28/01/2015 at 22:41. Pushed by luebking into branch 'master'. use xcb_time_current_time as setinputfocus default REVIEW: 122298 FIXED-IN: 5.2.1 M +1 -1 xcbutils.h http://commits.kde.org/kwin/96628a698c92eb96bd8563d0de8e2969d9d23320 I just wanted to add that I've got almost the same problem, only with Opera 12 which, as far as I know, has got nothing to do with Java. Double-clicking in the other window also doesn't do the trick, I have to either use Alt+Tab or move the window twice using the title bar. It's not so much about the particular toolkit, but about what the toolkit does on activating a windonw (but the opera hint would have spared me a Oracle JRE installation for testing ;-) |