Kubuntu 14.04(64 位),带有 KDE 4.13.3、Java Oracle 1.7.0_80-b15
该问题最早出现在 12.04 版中,并且仍然存在。Java 版本不会影响该行为,也就是说,1.6 到 1.8 版也会出现同样的情况。
复制:
- 启动 2-3 个“常规”程序,如 Firefox/Chrome/Kate。
- 启动 Java Swing 应用程序(Intellij Idea/jvisualvm/Visual paradigm/其他)
- 点击“显示桌面”
- 启动“常规”程序(firefox),它会全屏显示
问题:键盘焦点仍然在 Swing 应用程序中,如果您尝试键入,则输入将发送给它。
如果您使用 Intelij 系列的某些 IDE,这会非常烦人,因为通常原本要用于其他应用程序的输入会出现在您的源文件中。
我已经尝试过 KDE 的“焦点窃取预防”的不同设置(系统设置 -> 窗口行为),但无济于事。
未使用 Swing 的 Java 应用程序(例如 Eclipse)不存在此问题。只有 Swing 应用程序才会出现此问题。
有人对这个问题有解决方案吗?或者至少:
- 能够证实这一点
- 将我引导到合适的错误跟踪器(swing?kde?)以便我可以报告它
swing 应用程序的 xprop(Intellij idea):
XdndAware(ATOM) = BITMAP
_MOTIF_DRAG_RECEIVER_INFO(_MOTIF_DRAG_RECEIVER_INFO) = 0x6c, 0x0, 0x5, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x10, 0x0, 0x0, 0x0
WM_CLIENT_LEADER(WINDOW): window id # 0x1e0003c
_NET_WM_PID(CARDINAL) = 3581
_NET_WM_WINDOW_TYPE(ATOM) = _NET_WM_WINDOW_TYPE_DESKTOP
_MOTIF_WM_HINTS(_MOTIF_WM_HINTS) = 0x2, 0x1, 0x0, 0x0, 0x0
WM_PROTOCOLS(ATOM): protocols WM_DELETE_WINDOW, WM_TAKE_FOCUS, _NET_WM_PING, _NET_WM_SYNC_REQUEST
WM_NAME(STRING) = "plasma-desktop"
WM_LOCALE_NAME(STRING) = "en_US.UTF-8"
WM_CLASS(STRING) = "Plasma", "Plasma"
WM_HINTS(WM_HINTS):
Client accepts input or input focus: True
Initial state is Normal State.
bitmap id # to use for icon: 0x1e00235
window id # of group leader: 0x1e0003c
WM_NORMAL_HINTS(WM_SIZE_HINTS):
user specified location: 0, 0
program specified location: 0, 0
user specified size: 1920 by 1080
program specified size: 1920 by 1080
window gravity: Static
WM_CLIENT_MACHINE(STRING) = "OgrePC"
WM_COMMAND(STRING) = { "/usr/bin/plasma-desktop" }
ogre@OgrePC:~/aprojects-src/as_projects/besenica/besenica_core$ xprop
_MOTIF_DRAG_RECEIVER_INFO(_MOTIF_DRAG_RECEIVER_INFO) = 0x6c, 0x0, 0x5, 0x0, 0x45, 0x0, 0x40, 0x3, 0x0, 0x0, 0x0, 0x0, 0x10, 0x0, 0x0, 0x0
XdndAware(ATOM) = BITMAP
_NET_WM_ICON_GEOMETRY(CARDINAL) = 107, 1011, 202, 34
WM_STATE(WM_STATE):
window state: Normal
icon window: 0x0
_NET_WM_ALLOWED_ACTIONS(ATOM) = _NET_WM_ACTION_MOVE, _NET_WM_ACTION_RESIZE, _NET_WM_ACTION_MINIMIZE, _NET_WM_ACTION_SHADE, _NET_WM_ACTION_MAXIMIZE_VERT, _NET_WM_ACTION_MAXIMIZE_HORZ, _NET_WM_ACTION_FULLSCREEN, _NET_WM_ACTION_CHANGE_DESKTOP, _NET_WM_ACTION_CLOSE
_KDE_NET_WM_FRAME_STRUT(CARDINAL) = 0, 0, 20, 0
_NET_FRAME_EXTENTS(CARDINAL) = 0, 0, 20, 0
_NET_WM_DESKTOP(CARDINAL) = 0
_KDE_NET_WM_ACTIVITIES(STRING) = "5c2b1a8d-8274-46bf-abfa-a0db6a775d03"
_NET_WM_WINDOW_TYPE(ATOM) = _NET_WM_WINDOW_TYPE_NORMAL
_MOTIF_WM_HINTS(_MOTIF_WM_HINTS) = 0x3, 0x1, 0x1, 0x0, 0x0
_NET_WM_STATE(ATOM) = _NET_WM_STATE_MAXIMIZED_VERT, _NET_WM_STATE_MAXIMIZED_HORZ
WM_HINTS(WM_HINTS):
Client accepts input or input focus: False
Initial state is Normal State.
_NET_WM_ICON(CARDINAL) = Icon (128 x 128):
_NET_WM_PID(CARDINAL) = 9027
WM_CLIENT_MACHINE(STRING) = "OgrePC"
WM_PROTOCOLS(ATOM): protocols WM_TAKE_FOCUS, WM_DELETE_WINDOW
_KDE_NET_WM_USER_CREATION_TIME(CARDINAL) = 35443779
WM_CLASS(STRING) = "sun-awt-X11-XFramePeer", "jetbrains-idea-ce"
WM_CLIENT_LEADER(WINDOW): window id # 0x3400005
_NET_WM_ICON_NAME(UTF8_STRING) = "gg_platform - [~/aprojects-src/as_projects/gg_platform] - gg_platform_kryo_server - IntelliJ IDEA 14.1.2"
WM_ICON_NAME(STRING) = "gg_platform - [~/aprojects-src/as_projects/gg_platform] - gg_platform_kryo_server - IntelliJ IDEA 14.1.2"
_NET_WM_NAME(UTF8_STRING) = "gg_platform - [~/aprojects-src/as_projects/gg_platform] - gg_platform_kryo_server - IntelliJ IDEA 14.1.2"
WM_NAME(STRING) = "gg_platform - [~/aprojects-src/as_projects/gg_platform] - gg_platform_kryo_server - IntelliJ IDEA 14.1.2"
WM_NORMAL_HINTS(WM_SIZE_HINTS):
user specified location: -3, -3
program specified location: -3, -3
program specified size: 1916 by 984
window gravity: NorthWest
桌面的 xprop:
_NET_WM_USER_TIME(CARDINAL) = 43963890
_KDE_NET_WM_ACTIVITIES(STRING) = "00000000-0000-0000-0000-000000000000"
WM_STATE(WM_STATE):
window state: Normal
icon window: 0x0
_NET_WM_STATE(ATOM) =
_NET_WM_ALLOWED_ACTIONS(ATOM) = _NET_WM_ACTION_CHANGE_DESKTOP
_NET_WM_SYNC_REQUEST_COUNTER(CARDINAL) = 31457847
_KDE_NET_WM_USER_CREATION_TIME(CARDINAL) = 133564
_NET_STARTUP_ID(UTF8_STRING) = "0"
_NET_WM_DESKTOP(CARDINAL) = 4294967295
_NET_WM_ICON(CARDINAL) = Icon (16 x 16):
XdndAware(ATOM) = BITMAP
_MOTIF_DRAG_RECEIVER_INFO(_MOTIF_DRAG_RECEIVER_INFO) = 0x6c, 0x0, 0x5, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x10, 0x0, 0x0, 0x0
WM_CLIENT_LEADER(WINDOW): window id # 0x1e0003c
_NET_WM_PID(CARDINAL) = 3581
_NET_WM_WINDOW_TYPE(ATOM) = _NET_WM_WINDOW_TYPE_DESKTOP
_MOTIF_WM_HINTS(_MOTIF_WM_HINTS) = 0x2, 0x1, 0x0, 0x0, 0x0
WM_PROTOCOLS(ATOM): protocols WM_DELETE_WINDOW, WM_TAKE_FOCUS, _NET_WM_PING, _NET_WM_SYNC_REQUEST
WM_NAME(STRING) = "plasma-desktop"
WM_LOCALE_NAME(STRING) = "en_US.UTF-8"
WM_CLASS(STRING) = "Plasma", "Plasma"
WM_HINTS(WM_HINTS):
Client accepts input or input focus: True
Initial state is Normal State.
bitmap id # to use for icon: 0x1e00235
window id # of group leader: 0x1e0003c
WM_NORMAL_HINTS(WM_SIZE_HINTS):
user specified location: 0, 0
program specified location: 0, 0
user specified size: 1920 by 1080
program specified size: 1920 by 1080
window gravity: Static
WM_CLIENT_MACHINE(STRING) = "OgrePC"
WM_COMMAND(STRING) = { "/usr/bin/plasma-desktop" }
“显示桌面”后启动的程序(firefox)的 xprop
_NET_WM_ICON_GEOMETRY(CARDINAL) = 1163, 1045, 176, 34
WM_STATE(WM_STATE):
window state: Normal
icon window: 0x0
_NET_WM_ALLOWED_ACTIONS(ATOM) = _NET_WM_ACTION_MOVE, _NET_WM_ACTION_RESIZE, _NET_WM_ACTION_MINIMIZE, _NET_WM_ACT
_KDE_NET_WM_FRAME_STRUT(CARDINAL) = 3, 3, 23, 4
_NET_FRAME_EXTENTS(CARDINAL) = 3, 3, 23, 4
_NET_WM_DESKTOP(CARDINAL) = 0
_KDE_NET_WM_ACTIVITIES(STRING) = "5c2b1a8d-8274-46bf-abfa-a0db6a775d03"
_NET_WM_STATE(ATOM) = _NET_WM_STATE_MAXIMIZED_VERT, _NET_WM_STATE_MAXIMIZED_HORZ
WM_HINTS(WM_HINTS):
Client accepts input or input focus: True
Initial state is Normal State.
bitmap id # to use for icon: 0x3e6967d
bitmap id # of mask for icon: 0x3e6967e
window id # of group leader: 0x3e00001
WM_WINDOW_ROLE(STRING) = "browser"
_KDE_NET_WM_USER_CREATION_TIME(CARDINAL) = 44424608
XdndAware(ATOM) = BITMAP
_MOTIF_DRAG_RECEIVER_INFO(_MOTIF_DRAG_RECEIVER_INFO) = 0x6c, 0x0, 0x5, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0
_NET_WM_ICON(CARDINAL) = Icon (16 x 16):
_NET_WM_ICON_GEOMETRY(CARDINAL) = 1163, 1045, 176, 34
WM_STATE(WM_STATE):
window state: Normal
icon window: 0x0
_NET_WM_ALLOWED_ACTIONS(ATOM) = _NET_WM_ACTION_MOVE, _NET_WM_ACTION_RESIZE, _NET_WM_ACTION_MINIMIZE, _NET_WM_ACTION_SHADE, _NET_WM_ACTION_MAXIMIZE_VERT, _NET_WM_ACTION_MAXIMIZE_HORZ, _NET_WM_ACTION_FULLSCREEN, _NET_WM_ACTION_CHANGE_DESKTOP, _NET_WM_ACTION_CLOSE
_KDE_NET_WM_FRAME_STRUT(CARDINAL) = 3, 3, 23, 4
_NET_FRAME_EXTENTS(CARDINAL) = 3, 3, 23, 4
_NET_WM_DESKTOP(CARDINAL) = 0
_KDE_NET_WM_ACTIVITIES(STRING) = "5c2b1a8d-8274-46bf-abfa-a0db6a775d03"
_NET_WM_STATE(ATOM) = _NET_WM_STATE_MAXIMIZED_VERT, _NET_WM_STATE_MAXIMIZED_HORZ
WM_HINTS(WM_HINTS):
Client accepts input or input focus: True
Initial state is Normal State.
bitmap id # to use for icon: 0x3e59b19
bitmap id # of mask for icon: 0x3e59b1a
window id # of group leader: 0x3e00001
_NET_STARTUP_ID(UTF8_STRING) = "OgrePC;1430761118;209192;3581_TIME42982583"
WM_WINDOW_ROLE(STRING) = "browser"
_KDE_NET_WM_USER_CREATION_TIME(CARDINAL) = 42982594
XdndAware(ATOM) = BITMAP
_MOTIF_DRAG_RECEIVER_INFO(_MOTIF_DRAG_RECEIVER_INFO) = 0x6c, 0x0, 0x5, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x10, 0x0, 0x0, 0x0
_NET_WM_ICON(CARDINAL) = Icon (16 x 16):
░░░░
░▒░░░░░
░▒▒░▒░░░▒░
▒░░░▒▒▒▒▒▒
░░░░░░░▒▒▒▒░
░▒░░░▒▒▒▒▒▒░ ░
▒▒░▒▒▒▒▒▓▓▓ ░
▒▒▒▒▒▓▒▒▓▓▓ ░
▒▒▒▒░░░▒▒▓▒ ░
░▒▒▒▒▒▓▓▓▓░░░░
▒▒▒▒▒▒▒▒░░░▒
▒▒▒▒▒▒░░░▒░
░▒▒▒▒▒▒▒▒░
░▒▒▒▒▒▒░
░░
Icon (32 x 32):
░░░░
░░░░░░░░░░░░
░░░░░░░░░░░░░░
░░▒▒▒░░░░░░░░░░░ ░
░ ░▒▒▒▒░░░░░░░░░░░░▒ ░
░▒▒▒▒░░░░░░░░░░░▒▒▒▒░░ ░
▒▒▒░░░░░░▒▒▒▒▒▒▒▒▒▒▒▒ ░
▒░░░░░░░░▒▒▒▒▒▒▒▒▒▒▒▒░
░░░░░░░░▒░░░▒▒▒▒▒▒▒▒▒▒
░░░░░░░░░▒▒▒░▒▒▒▒▒▒▒▒▒▒░
░░░░░░░░░░░ ░▒▒▒▒▒▒▒▒▒▒▒
░▒▒░░░░░░░░░▒▒▒▒▒▒▒▒▒▒▒▒▒
░▒▒▒░░░░░░░▒▒▒▒▒▒▒▒▒▒▓▓▒░ ░
░▒▒▒░░░░▒▒▒▒▒▒▒▒▒▒▒▓▓▓▓▒ ▒
░▒▒▒░░░▒▒▒▓▒▒▒▒▒▒▓▓▓▓▓▓▒ ░▒
░▒▒▒▒░▒▒▒▒▓▓▓▓▓▓▓▓▓▓▓▓▓▒ ░░
░▒▒▒▒▒▒▒░░▒▒▓▓▒▒▒▒▓▓▓▓▓▒ ░
░▒▒▒▒▒▒▒░░░░▒░░░░░▓▓▓▓▒░░ ░
▒▒▒▒▒▒▒▒░░░░░░▒▒▒▓▓▓▓▒░░ ░░░
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓▓▓▓▓▓░░░░░░░
░▒▒▒▒▒▒▒░░▒▓▓▓▓▓▓▓▓▓▒░░░░░░░
▒▒▒▒▒▒▒▒▒░▒▒▓▓▓▓▓▒▒░░░░░░▒░
░▒▒▒▒▒▒▒▒▒░▒▒▒▒▒▒░░░░░░░▒▒
▒▒▒▒▒▒▒▒▒▒▒░░░░░░░░░░░░▒░
▒▒▒▒▒▒▒▒▒▒▒▒▒░░░░░░░▒▒░
░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░
░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░
░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
░▒▒▒▒▒▒▒▒▒▒▒▒▒▒░
░▒▒▒▒▒▒▒▒▒▒░
Icon (48 x 48):
░░░░
░░░░░░░░░░░░░░
░░░░░░░░░░░░░░░░░░
░░░░░░░░░░░░░░░░░░░ ░
░░░░░░░░░░░░░░░░░░░░░▒░
░ ░░░▒▒▒▒▒░░░░░░░░░░░░░░░▒░ ░░
░░ ░░▒▒▒▒▒░░░░░░░░░░░░░░░░░░▒░ ░
░░▒░▒▒▒▒▒▒░░░░▒░░░░░░░░▒▒▒▒▒▒░▒░ ░
░▒▒▒▒░░░░░░░░▒▒▒░░░░░░▒▒▒▒▒▒▒░ ░░ ░░
▒▒▒░░░░░░░░░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░ ░
▒▒░░░░░░░░░░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░
▒░░░░░░░░░░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
░░░░░░░░░░░░▒▒░░░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒░
░░░░░░░░░░░░░▒▒▒░▒░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
░░░░░░░░░░░░░░▒▒░░░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
░░░░░░░░░░░░░░░░░ ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓░
░░▒▒░░░░░░░░░░░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░
░░▒▒▒░░░░░░░░░░░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓▒ ▒ ░░
░░▒▒▒▒░░░░░░░░░░░▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓▓▓▒ ░ ░▒
░▒▒▒▒▒░░░░░░▒▒▒▒░▒▒▒▒▒▒▒▒▒▒▓▓▓▓▓▓▓▒ ▒▒
░▒▒▒▒▒░░░░░▒▒▒▓▓▒▒▒▒▒▒▒▒▒▓▓▓▓▓▓▓▓▓▒ ▒░
░▒▒▒▒▒▒░░░▒▒▒▒▓▓▓▒▒▒▒▒▒▒▒▓▓▓▓▓▓▓▓▓▒ ▒░
░▒▒▒▒▒▒▒░▒▒▒▒░▒▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒ ░░
░▒▒▒▒▒▒▒▒▒▒▒░░░▒▓▓▓▓▓▒▒▒▒▓▓▓▓▓▓▓▓▓▒░ ░░
░▒▒▒▒▒▒▒▒▒▒▒░░░░░▒▒▒▒░░░░░▒▓▓▓▓▓▓▒░░ ░░
▒▒▒▒▒▒▒▒▒▒▒░░░░░░░░░░░░░░░▓▓▓▓▓▓░░░ ░░
░▒▒▒▒▒▒▒▒▒▒▒░░░░░░░░░▒▒▒▒▓▓▓▓▓▓▓░░░ ░░░░░
░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓▓▓▓▓▓▓▓▒ ░░ ░░░░░
▒▒▒▒▒▒▒▒▒▒▒░▒▒▒▒▒▒▒▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░
▒▒▒▒▒▒▒▒▒▒▒▒░░▒▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░▒▒
▒▒▒▒▒▒▒▒▒▒▒▒░░▒▓▓▓▓▓▓▓▓▓▓▓▒▓░░░░░░░░░▒▒
▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░▒▒▓▓▓▓▓▓▓▒░░░░░░░░░░▒▒░
▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░░▒▒▒▒▒▒░░░░░░░░░░░▒▓▒
░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░░░░░░░░░░░░░░░░░▒▒░
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░░░░░░░░░░░▒▒▒▒░
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░░░░░░░▒▒▒▒░
░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░
░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░
░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░
░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▒▒░
░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░
░░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░
░░░▒▒▒▒▒▒▒▒▒▒░░░
_NET_WM_SYNC_REQUEST_COUNTER(CARDINAL) = 65379096
_NET_WM_WINDOW_TYPE(ATOM) = _NET_WM_WINDOW_TYPE_NORMAL
_NET_WM_USER_TIME(CARDINAL) = 42982583
_NET_WM_USER_TIME_WINDOW(WINDOW): window id # 0x3e59b17
WM_CLIENT_LEADER(WINDOW): window id # 0x3e00001
_NET_WM_PID(CARDINAL) = 9597
WM_LOCALE_NAME(STRING) = "en_US.UTF-8"
WM_CLIENT_MACHINE(STRING) = "OgrePC"
WM_NORMAL_HINTS(WM_SIZE_HINTS):
program specified minimum size: 300 by 154
program specified maximum size: 32767 by 32767
window gravity: NorthWest
WM_PROTOCOLS(ATOM): protocols WM_DELETE_WINDOW, WM_TAKE_FOCUS, _NET_WM_PING, _NET_WM_SYNC_REQUEST
WM_CLASS(STRING) = "Navigator", "Firefox"
WM_ICON_NAME(STRING) = "Mozilla Firefox"
_NET_WM_ICON_NAME(UTF8_STRING) = "Mozilla Firefox"
WM_NAME(STRING) = "Mozilla Firefox"
_NET_WM_NAME(UTF8_STRING) = "Mozilla Firefox"
答案1
我不是 KDE 用户,但经过一番搜索,我发现本论坛主题有同样问题的人。解决方案如下:
尝试添加一个窗口规则(“kcmshell4 kwinrules”),并在“外观和修复”选项卡中,将“接受焦点”设置为“强制”和“是”。
答案2
我在使用 Intelij 产品时也遇到了同样的问题,但我使用的是 Gnome 3。例如,如果我启动 RubyMine 并切换到终端继续使用它,Rubymine 在启动时至少会两次窃取焦点。当发生某些事件时,它也会窃取焦点;这通常会导致在 Rubymine 中打开以供编辑的源代码中出现一段 shell 命令。几分钟前,我已经有过在代码中寻找语法错误的色情体验,而代码运行完美。感谢不知名的英雄,他出于好意将它送给了我。
我认为这是 X-server 错误,因为不仅 KDE 受到影响。