Bug 4878 - Interactive Java windows do not retain focus on click.
Status: ASSIGNED
Alias: None
Product: Openbox
Classification: Unclassified
Component: general
Version: 3.5.0
Hardware: PC Linux
: P2 major
Assignee: Dana Jansens
QA Contact:
URL:
Depends on:
Blocks:
 
Reported: 2011-01-13 16:55 EST by skyalmian
Modified: 2013-03-03 18:32:48 EST
2 users (show)

See Also:



Description skyalmian 2011-01-13 16:55:32 EST
Openbox has an issue with focus concerning Java interaction in windows. As explained here:

"Minecraft won't retain focus on click, Openbox to blame"
https://bbs.archlinux.org/viewtopic.php?id=106187

[]
I have been attempting to play minecraft in chrome and firefox (just the classic version). I found that I could walk around just fine, but when I tried to click to place blocks or destroy them, that I would lose focus on the game and the pause screen would come up. After a visit to #MinecraftHelp, I tried a different window manager. I only have twm installed as a backup, but I rebooted X.org with twm and it worked... perfectly.

So, it seems as though there is something going on with openbox that makes me lose focus when I click. I <3 openbox and don't wish to switch, but I would really like to try to find a way to play in the browser, without having to restart X.
[/] -- ltpl4y3r

I have confirmed this focus issue as well via browsers such as SeaMonkey (by Mozilla) and Chromium.
Comment 1 Dana Jansens 2011-08-31 13:42:14 EDT
The way to "fix" this is to stop grabbing the mouse on the client window. Which means that you can't have any client context mouse bindings.

Metacity works because they hard code their mouse behaviour.

The other way to fix this is to have Java not ignore the mouse clicks that we forward to them.  Of course this works for every other application except java applets.

One possible workaround (this is a lot of work around just for broken java applets) would be to have 2 mouse contexts for clients.  One for active clients and one for inactive clients.

What you think Mika?
Comment 2 alex3kov 2012-10-18 14:12:45 EDT
Not sure if this is related or I should another bug:
In SQuirreL buttons do not react to mouse clicks in preferences window. Going through buttons with Tab works. After several Alt-Tabs and minimizing/maximizing SQuirreL window it sort of starts to work.
Switching to xfwm resolved it entirely.
Comment 3 shiruken 2013-03-03 18:32:48 EST
Adding on more me-too that has been bugging me for quite a while now. 

When a Java program, typically yEd graph editor, openbox will sometimes lose the ability to focus with the mouse. I will have to right-click on the window that last had the mouse's focus, then right-click on the window I wish to now control. Keyboard focusing, of course, works just fine, but the back-and-forth with the mouse thing gets extremely irritating after a while and I'll have to restart the X server to fix it because restarting Openbox won't.