You are not logged in.

#1 2013-03-15 13:29:13

Pacopag
Member
Registered: 2011-05-29
Posts: 287

[SOLVED] Some apps don't open raised in openbox

Hi.  I'm new to openbox (only been using it a few days), but like it so far.  I'm having one small problem though...

I've got a keybind that launches lilyterm, and one that launches chromium.  Here is the relevant part of rc.xml

<keybind key="W-t">
      <action name="Execute">
        <startupnotify>
          <enabled>true</enabled>
          <name>Terminal</name>
        </startupnotify>
        <command>lilyterm</command>
      </action>
    </keybind>
    <keybind key="W-w">
      <action name="Execute">
        <startupnotify>
          <enabled>true</enabled>
          <name>Browser</name>
        </startupnotify>
        <command>chromium</command>
      </action>
    </keybind>

The thing is, if I launch lilyterm or chromium, their windows open BEHIND the currently focused window, unless the currently focused window is of the same type.  For example, if a lilyterm instance is focused and I launch another lilyterm, then the new on opens on top. But if anything other than lilyterm is focused and I launch lilyterm, it will open behind.

However, if I change <command>lilyterm</command> to <command>xfce4-terminal</command>, the xfce4-terminal always opens properly on top.  Likewise if I switch chromium with midori.  Does anyone know why this is happening?

Googling this problem comes up with some stuff, but none of the fixes work for me.  I noticed here that it's worth a try to remove the <startupnotify> part, but that didn't work either.

Any help?

Last edited by Pacopag (2013-03-17 12:46:56)

Offline

#2 2013-03-15 15:50:50

drcouzelis
Member
From: Connecticut, USA
Registered: 2009-11-09
Posts: 4,092
Website

Re: [SOLVED] Some apps don't open raised in openbox

I noticed this behaviour too with Firefox. If a Firefox window is already open but NOT the active window, then opening a new Firefox window will open it behind the active window. It's annoying. tongue

I think it has to do with applications that open a "new" instance by connecting to the already running instance of the application.

Offline

#3 2013-03-15 15:55:05

Pacopag
Member
Registered: 2011-05-29
Posts: 287

Re: [SOLVED] Some apps don't open raised in openbox

Yes, you're right.  If there is no chromium instance running, then the first one does always open on top.  Subsequently opened instances of chromium open behind.  Strange.

I'm guessing you don't know of a fix for this.  Do you know if there is a bug report?

Offline

#4 2013-03-15 17:47:38

drcouzelis
Member
From: Connecticut, USA
Registered: 2009-11-09
Posts: 4,092
Website

Re: [SOLVED] Some apps don't open raised in openbox

I'm sorry, no, I don't know how to fix it. sad I've search the Internet and bug reports and haven't found anything.

I haven't tried openbox-git.

It might have to do with OpenBox preventing applications from "stealing focus". Maybe OpenBox thinks Firefox is trying to steal focus, whereas it actually me trying to open a new window.

I remember seeing someone post about it on the Arch Linux forms within the past three years, but never a solution. hmm

Offline

#5 2013-03-15 18:03:44

Pacopag
Member
Registered: 2011-05-29
Posts: 287

Re: [SOLVED] Some apps don't open raised in openbox

I wonder if this is a bug (seems like it to me).  It seems like it should be fixable, since other window managers/environments don't seem to have this problem, at least not xfce.

When I get some time to kill, I'll try running crunchbang, which uses openbox, to see if the problem persists there.  Then maybe there's some clues in the crunchbang rc.xml file.  I'll post back if I find anything.

Offline

#6 2013-03-15 18:38:32

drcouzelis
Member
From: Connecticut, USA
Registered: 2009-11-09
Posts: 4,092
Website

Re: [SOLVED] Some apps don't open raised in openbox

Good idea! I'll race you. wink

Offline

#7 2013-03-15 19:32:19

Pacopag
Member
Registered: 2011-05-29
Posts: 287

Re: [SOLVED] Some apps don't open raised in openbox

The same problem exists in crunchbang.  To reproduce, just boot into a live cd, then press Super-t, Super-w, Super-t, Super-w, Super-e, Super-w, and so on.  Every instance of iceweasel (i.e. Super-w) after the first one will open behind the focused window.

With all the crunchbang users out there I would think more stuff would come up about this when googling it (yet I'm admittedly a terrible googler compared to some).  I guess it doesn't bother most people, but it's almost a show stopper for me.

Offline

#8 2013-03-15 20:02:56

drcouzelis
Member
From: Connecticut, USA
Registered: 2009-11-09
Posts: 4,092
Website

Re: [SOLVED] Some apps don't open raised in openbox

Can you find the rc.xml setting that changes how popups are treated? I could have sworn there was a setting that says "Never let an application steal my focus!", although I may be mistaking it with another window manager...

Pacopag wrote:

I'm admittedly a terrible googler

O_o

EDIT: It appears to be fixed in the openbox-git package.

Last edited by drcouzelis (2013-03-15 23:17:52)

Offline

#9 2013-03-16 01:02:20

Pacopag
Member
Registered: 2011-05-29
Posts: 287

Re: [SOLVED] Some apps don't open raised in openbox

Cool.

What exactly is the openbox-git package?  The description in the aur is a bit vague.  Is it just openbox, but pulled from the git "trunk" (i.e. current development release)?  If so, does this mean that the problem will be fixed eventually in an upcoming release in the official arch repos?

Offline

#10 2013-03-16 01:56:46

drcouzelis
Member
From: Connecticut, USA
Registered: 2009-11-09
Posts: 4,092
Website

Re: [SOLVED] Some apps don't open raised in openbox

That's correct. This will eventually become the next release of OpenBox.

But I uninstalled the git version after trying it out. The developer changed the algorithm for "smart window placement". It's currently genius. The future method is stupidly dumb. mad

Offline

#11 2013-03-16 04:44:04

rfk1ll
Member
Registered: 2013-02-01
Posts: 24
Website

Re: [SOLVED] Some apps don't open raised in openbox

Pacopag wrote:

The same problem exists in crunchbang.  To reproduce, just boot into a live cd, then press Super-t, Super-w, Super-t, Super-w, Super-e, Super-w, and so on.  Every instance of iceweasel (i.e. Super-w) after the first one will open behind the focused window.

With all the crunchbang users out there I would think more stuff would come up about this when googling it (yet I'm admittedly a terrible googler compared to some).  I guess it doesn't bother most people, but it's almost a show stopper for me.

I have the same behavior in CrunchBang, but not in ArchBang (13.03.03).
In CrunchBang,  W-t, W-w, W-t produces Term, IW, Term - but the next W-w opens under the Terminal.
ArchBang works as expected, opening each instance above the previous.
Maybe looking at the ArchBang rc.xml would yield some info, I gave it a quick glance but nothing really stood out.


Oderint dum metuant.

Offline

#12 2013-03-16 09:38:00

Mr Green
Forum Fellow
From: U.K.
Registered: 2003-12-21
Posts: 5,893
Website

Re: [SOLVED] Some apps don't open raised in openbox

ArchBang rc.xml code is basically the same as Pacopag, I do have the same problem on my desktop and have just put up with it.

Openbox:

http://openbox.org/wiki/Help:Actions#St … tification

In my case I do not use startupnotify so may not be source of problem.

Last edited by Mr Green (2013-03-16 09:38:38)


Mr Green

Offline

#13 2013-03-16 20:06:06

drcouzelis
Member
From: Connecticut, USA
Registered: 2009-11-09
Posts: 4,092
Website

Re: [SOLVED] Some apps don't open raised in openbox

Mr Green wrote:

ArchBang rc.xml code is basically the same as Pacopag, I do have the same problem on my desktop and have just put up with it.

I downloaded and tried out ArchBang. You're right, OpenBox there seems to behave correctly AND the rc.xml file looks pretty much the same as mine on Arch Linux.

Mr. Green, you don't have any idea of why this bug isn't seen in ArchBang? Is there another ArchBang developer that might have an idea?

Offline

#14 2013-03-16 20:29:12

Mr Green
Forum Fellow
From: U.K.
Registered: 2003-12-21
Posts: 5,893
Website

Re: [SOLVED] Some apps don't open raised in openbox

Seems to be a common problem we do have:

<applications>
<application class="*">
<position>
<monitor>1</monitor>
</position>
<focus>yes</focus>
<maximized>no</maximized>
</application>

in rc.xml, but Arch forums is not the place to discuss ArchBang.


Mr Green

Offline

#15 2013-03-17 01:22:54

sonoran
Member
From: sonoran desert
Registered: 2009-01-12
Posts: 192

Re: [SOLVED] Some apps don't open raised in openbox

In ObConf the first checkbox on the Windows tab, Focusing Windows, is "Focus new windows when they appear." Works here.

Offline

#16 2013-03-17 02:45:37

drcouzelis
Member
From: Connecticut, USA
Registered: 2009-11-09
Posts: 4,092
Website

Re: [SOLVED] Some apps don't open raised in openbox

sonoran wrote:

In ObConf the first checkbox on the Windows tab, Focusing Windows, is "Focus new windows when they appear." Works here.

I have had that option selected since I started using OpenBox. sad

Mr Green wrote:

Arch forums is not the place to discuss ArchBang.

No, it's OK! We're not discussing ArchBang, we're discussing an OpenBox bug. Besides, if I posted it to the ArchBang forums it would just be "ArchBang forums is not the place to discuss Arch". wink

EDIT: I'm getting closer to figuring it out! I copied the OpenBox configuration files from ArchBang to my Arch Linux installation. If I use ArchBang configs, every thing's perfect, switch back to my configs, the problem comes back. I'll go through each config setting one by one to see which one's the trouble maker. smile

Last edited by drcouzelis (2013-03-17 03:50:02)

Offline

#17 2013-03-17 04:41:07

drcouzelis
Member
From: Connecticut, USA
Registered: 2009-11-09
Posts: 4,092
Website

Re: [SOLVED] Some apps don't open raised in openbox

I got it! I think I solved it. smile

I compared the ArchBang configuration files and mine line by line until I got to the very end. Then I discovered that Mr. Green already told me the solution in this thread! But I didn't understand what you meant. (Also, you might not have known that this is the solution) wink

Mr Green wrote:

ArchBang does have:

<applications>
<application class="*">
<position>
<monitor>1</monitor>
</position>
<focus>yes</focus>
<maximized>no</maximized>
</application>

in rc.xml

Put this at the end of your "rc.xml" file, just before "</openbox_config>" (it's the same as above, just trimmed):

<applications>
  <application class="*">
    <focus>yes</focus>
  </application>
</applications>

Now that I know what I'm looking for, it's pretty obvious what these lines do. roll

I'll go ahead and put it in the Arch Linux wiki.

Offline

#18 2013-03-17 12:46:33

Pacopag
Member
Registered: 2011-05-29
Posts: 287

Re: [SOLVED] Some apps don't open raised in openbox

Kick a$$ and chew bubble gum!  Thank you so much.  It might seem like a small issue, but it makes a whole world of difference (at least to me).

Thank you so much for your effort and figuring this out.

Offline

#19 2013-04-08 12:45:31

nierro
Member
From: Milan, Italy
Registered: 2011-09-02
Posts: 849

Re: [SOLVED] Some apps don't open raised in openbox

I only wanted to thank you, drcouzelis! Finally solved this issue smile
Btw, someone said in openbox-git the issue is gone...because rc.xml in -git version has been upgraded with this trick, or it will work out of the box?
Btw, again, thanks!

Offline

#20 2013-04-08 13:43:42

drcouzelis
Member
From: Connecticut, USA
Registered: 2009-11-09
Posts: 4,092
Website

Re: [SOLVED] Some apps don't open raised in openbox

You're welcome. smile

I don't know if this problem is fixed in the code or in the rc.xml file in the development version of Openbox. You can read the latest development version of the rc.xml file here. It does not appear to have this trick in it, so I assume it's fixed in the code.

Offline

Board footer

Powered by FluxBB