[openbox] Upgraded to openbox 3.5 - strange behaviour with shortcut to open terminal?

Brian Mattern rephorm at rephorm.com
Sat Sep 29 14:20:36 EDT 2012


On Sat, 29 Sep 2012, Ian Zimmerman wrote:

> Pedro> I just checked and that is the case - when an application opens a
> Pedro> new window in the same process, the windows is not focused.
> 
> Pedro> I guess this is a bug? Should it be reported?
> 
> Brian> This issue finally bothered me enough to at least craft a
> Brian> workaround.  (I open a lot of browser windows via a keybinding,
> Brian> and both firefox and chrome launch new windows from the old
> Brian> process and thus were not being focused).  The attached patch
> Brian> will track the last time an 'execute' action occurs.  If a window
> Brian> appears within a second of that, then it is allowed to steal
> Brian> focus.
> 
> This is not happening to me, and I run 3.5 too.  Why?  Maybe the theme
> plays a part?

The theme shouldn't play any role, but there could be some configuration
options that I've missed that affect the focus-stealing-prevention.

I was able to reproduce with vanilla 3.5.0 on a clean user account by doing the following:

1) copy default 3.5 rc.xml to $HOME/.config/openbox/
2) add a keybinding to launch firefox
3) execute that keybinding
4) open a few terminals so that most of the screen is covered. 
5) execute the firefox keybinding again while one of the terminals is
selected.

The new firefox window opens up beneath the selected terminal and is not
focused.

The patch I sent fixes this by allowing focus-stealing within a short
period after an 'execute' action is fired. (Since, as in this case, the
execute action can trigger an existing application to open a new
window.) Although this does make it possible for undesired
focus-stealing to occur (e.g., a different app pops up a dialog shortly
after an 'execute' action is performed), I think that is preferrable to
the current behavior.

Brian


More information about the openbox mailing list