tabbed, floating & focus

Hello, I need a hint on how to fix a weird behavior of the Tabbed layout: imagine you have 2 windows in tabbed: A and B. A has focus. Now you call up a floating window C, like Scratchpad, and it takes focus. Then you move your mouse and, without hiding C, click on B tab, B gets focus. Now, if only you somehow give focus back to C (like drag the mouse over it) - tabbed will switch back to A. In the other words you can't switch tabs after you've added a floating window: as soon as floating gets focus again, tabbed restores it's state as it was before the floating window was added. It's quite annoying and I'd like to fix it, but X.L.Decoration logic is too complicated to me. Or maybe I should look at some other place?

* On Saturday, May 30 2009, Konstantin Sobolev wrote:
Hello,
[...]
In the other words you can't switch tabs after you've added a floating window: as soon as floating gets focus again, tabbed restores it's state as it was before the floating window was added. It's quite annoying and I'd like to fix it, but X.L.Decoration logic is too complicated to me. Or maybe I should look at some other place?
This affects all layouts as far as I can tell. I suspect it has something to do with this defect: http://code.google.com/p/xmonad/issues/detail?id=4
_______________________________________________ xmonad mailing list xmonad@haskell.org http://www.haskell.org/mailman/listinfo/xmonad

On Sat, May 30, 2009 at 10:32 PM, Adam Vogt
In the other words you can't switch tabs after you've added a floating window: as soon as floating gets focus again, tabbed restores it's state as it was before the floating window was added. It's quite annoying and I'd like to fix it, but X.L.Decoration logic is too complicated to me. Or maybe I should look at some other place?
This affects all layouts as far as I can tell. I suspect it has something to do with this defect: http://code.google.com/p/xmonad/issues/detail?id=4
Makes sense. I've suspected something like this, tiling layer has to remember it's focus position when giving focus away to floating. No easy fix then :( Or maybe it's possible to write a layout modifier that will do such focus state management..

On Sat, May 30, 2009 at 10:32:48PM -0400, Adam Vogt wrote:
* On Saturday, May 30 2009, Konstantin Sobolev wrote:
Hello,
[...]
In the other words you can't switch tabs after you've added a floating window: as soon as floating gets focus again, tabbed restores it's state as it was before the floating window was added. It's quite annoying and I'd like to fix it, but X.L.Decoration logic is too complicated to me. Or maybe I should look at some other place?
This affects all layouts as far as I can tell. I suspect it has something to do with this defect: http://code.google.com/p/xmonad/issues/detail?id=4
Yeah, the problem, if I recall correctly, is that floating and non-floating windows are stored in the same zipper, so there is no way to remember which non-floating window was last focused. The floating and tiled layers really ought to be separated out more cleanly, but it will take a lot of work and no one's sat down to do it yet. This is one possible thing I am thinking of working on at Hac phi. -Brent

Hi
On Sat, May 30, 2009 at 10:32 PM, Adam Vogt
In the other words you can't switch tabs after you've added a floating window: as soon as floating gets focus again, tabbed restores it's state as it was before the floating window was added. It's quite annoying and I'd like to fix it, but X.L.Decoration logic is too complicated to me. Or maybe I should look at some other place?
This affects all layouts as far as I can tell. I suspect it has something to do with this defect: http://code.google.com/p/xmonad/issues/detail?id=4
OK, attached is a hack from my xmonad.hs The idea is very dumb: I essentially intercept runLayout and memorize last focused window w from passed Stack such that w == current->workspace->stack->focus ,i.e. if a window actually having focus is the one focused in Stack. Then as soon as focused window is floating I change Stack's focus (back) to w. Seems to work for me: tabbed no longer switches tabs by itself when there're floating windows around.

I've just tested your hack and it worked, but not very well. When I placed a floating window on a tabbed workspace, changed the focus from floating and tiled alternately, it worked as expected. But when I closed the floating window, the tiled windows just switched as before, which is not a big problem. The real problem happened when I tried to float a tiled window, xmonad got crazy. xmonad process got a 100% usage on a core and the 'screen' were not updated anymore, only the later window had the focus. No way to change the focus or do anything. Hopefully this window I tried to float were a terminal and was able to kill xmonad and re-run it without kill X or logging ssh. (xmonad --restart didn't worked) Anyway, this switching focus problem is really annoying. I'm willing to test anymore hacks you build :P Henrique G. Abreu On Wed, Jun 10, 2009 at 15:24, Konstantin Sobolev < konstantin.sobolev@gmail.com> wrote:
Hi
On Sat, May 30, 2009 at 10:32 PM, Adam Vogt
https://mail.google.com/mail?view=cm&tf=0&to=vogt.adam@gmail.com> wrote: In the other words you can't switch tabs after you've added a floating window: as soon as floating gets focus again, tabbed restores it's state as it was before the floating window was added. It's quite annoying and I'd like to fix it, but X.L.Decoration logic is too complicated to me. Or maybe I should look at some other place?
This affects all layouts as far as I can tell. I suspect it has something to do with this defect: http://code.google.com/p/xmonad/issues/detail?id=4
OK, attached is a hack from my xmonad.hs
The idea is very dumb: I essentially intercept runLayout and memorize last focused window w from passed Stack such that w == current->workspace->stack->focus ,i.e. if a window actually having focus is the one focused in Stack. Then as soon as focused window is floating I change Stack's focus (back) to w.
Seems to work for me: tabbed no longer switches tabs by itself when there're floating windows around.
_______________________________________________ xmonad mailing list xmonad@haskell.orghttps://mail.google.com/mail?view=cm&tf=0&to=xmonad@haskell.org http://www.haskell.org/mailman/listinfo/xmonad

On Wed, Jul 1, 2009 at 10:39 PM, Henrique G. Abreu
I've just tested your hack and it worked, but not very well. When I placed a floating window on a tabbed workspace, changed the focus from floating and tiled alternately, it worked as expected. But when I closed the floating window, the tiled windows just switched as before, which is not a big problem. The real problem happened when I tried to float a tiled window, xmonad got crazy. xmonad process got a 100% usage on a core and the 'screen' were not updated anymore, only the later window had the focus. No way to change the focus or do anything. Hopefully this window I tried to float were a terminal and was able to kill xmonad and re-run it without kill X or logging ssh. (xmonad --restart didn't worked)
Anyway, this switching focus problem is really annoying. I'm willing to test anymore hacks you build :P
yep, there was a bug, I didn't post a fix since nobody was interested. See fixed version attached. It still has some minor issues but works good enough for me :)

Yeah, it works fine! (with miner issues as you said) I think it'd be good to attach this hack to issue 4http://code.google.com/p/xmonad/issues/detail?id=4 . Thanks a lot, Henrique G. Abreu On Wed, Jul 1, 2009 at 16:22, Konstantin Sobolev < konstantin.sobolev@gmail.com> wrote:
On Wed, Jul 1, 2009 at 10:39 PM, Henrique G. Abreu
https://mail.google.com/mail?view=cm&tf=0&to=hgabreu@gmail.com> wrote: I've just tested your hack and it worked, but not very well. When I placed a floating window on a tabbed workspace, changed the focus from floating and tiled alternately, it worked as expected. But when I closed the floating window, the tiled windows just switched as before, which is not a big problem. The real problem happened when I tried to float a tiled window, xmonad got crazy. xmonad process got a 100% usage on a core and the 'screen' were not updated anymore, only the later window had the focus. No way to change the focus or do anything. Hopefully this window I tried to float were a terminal and was able to kill xmonad and re-run it without kill X or logging ssh. (xmonad --restart didn't worked)
Anyway, this switching focus problem is really annoying. I'm willing to test anymore hacks you build :P
yep, there was a bug, I didn't post a fix since nobody was interested. See fixed version attached. It still has some minor issues but works good enough for me :)
participants (4)
-
Adam Vogt
-
Brent Yorgey
-
Henrique G. Abreu
-
Konstantin Sobolev