On Mon, Feb 15, 2021 at 09:25:44PM +0530, Mandar Mitra wrote:
> Dominik Vogt wrote (Sun, Feb 14, 2021 at 12:05:26PM +0100):

> I have no idea what I'm doing wrong, but something does seem to
> be messing with window focus. For a while, the list is nicely
> maintained in MRU order, then suddenly, a window that I haven't
> focused for a while jumps up to the middle of the list.

The focus order is implemented as a doubly linked list.  Windows
can not just "jump" around in the list.  The list only ever
modified in two places in the code:

1) When a window gets focus it's pulled from it's current position
   and put at the beginning of the list.

2) When a new window is opend, it starts at the end of the list.

So, if windows appear at the top of the list which you do not
expect, watch closely for reasons why unexpected windows get
focus, even for a short while.  (For example with MouseFocus if
you move the pointer across small visible pieces of other
windows.)

> Sometimes
> its Emacs, sometimes its zathura (a pdf viewer). I copy pasted the
> destroyfunc and addtofunc that you provided above into
> FvwmConsole, but neither FvwmConsole itself, nor .xsession-errors
> had anything to report while the list was being re-ordered,
> apparently randomly.

Maybe you could try to figure out some reproducable instructions
to make that happen (preferrably with a minimal config).  It's of
course not impossible that there might be a bug in the code, that
is highly unlikely, because the focus order is on of the most used
pieces of code in fvwm, and if there were list inconsistencies,
fvwm would have crashed 20 years ago.

> The alternative you suggested won't help me, because I was
> looking to address precisely the situation when I have a page
> "cluttered with many windows, all atop each other".

I bet this has something to do with your problem.

--

Have you tried using multiple pages?  For example, I use six (2x3)
pages.  Each has a keyboard shortcut assigned to it.  Shells and
editors are on page (0 0), browsers are on (1 0), text processors
+ xpdf are on page (0 1) and so on.  This makes it really easy to
find windows and keeps the desktop usable.

--
#// paging (like on the console)
Key F1 A M GotoPage 0 0
Key F2 A M GotoPage 1 0
Key F3 A M GotoPage 2 0
Key  1 A M GotoPage 0 1
Key  2 A M GotoPage 1 1
Key  3 A M GotoPage 2 1

# Menu to move windows around
# (inconsistent with abouce bindongs; menus cannot use function keys)
Key p TSIWF  CM  Menu PutOnPageMenu
AddToMenu PutOnPageMenu
+ "Put on page" Title
+ "&1: page (0 0)" MoveToPage 0 0
+ "&2: page (1 0)" MoveToPage 1 0
+ "&3: page (2 0)" MoveToPage 2 0
+ "&q: page (0 1)" MoveToPage 0 1
+ "&w: page (1 1)" MoveToPage 1 1
+ "&e: page (2 1)" MoveToPage 2 1

# Start programs on specific pages
Style Gnumeric StartsOnPage 1 1, SkipMapping
Style Firefox* StartsOnPage 0 1, SkipMapping, MaxWindowSize 99 97
Style Firefox* fixedpposition
Style Firefox* NoTransientPPosition, NoFuncHint
Style Emacs StartsOnPage 0 0, SkipMapping
--

> For now, I've just disabled SelectOnRelease, and use the Fvwm
> assigned number to quickly jump to the window I want. This saves
> me from having to keep typing Tab to get where I want in the list.
> I suppose it'll just take a little while for muscle memory to
> reset itself to this usage pattern.

Why not simply assign letters to your programs?  E.g.

--
Key tab A   M   Menu GotoWindowMenu
AddToMenu GotoWindowMenu
+ "Go to window" Title
+ "&emacs" Prev (emacs) RaiseAndWarp
+ "&ipe" Prev (ipe) RaiseAndWarp
+ "&zathura" Prev (zathura) RaiseAndWarp
...
--

Much more intuitive than numbers that change all the time.

> Idle curiosity: do you use ipe too? Nice to discover such
> commonalities in an unrelated list.

No, sorry that I fooled you; i just instlled it to see what it's
doing.

Ciao

Dominik ^_^  ^_^

--

Dominik Vogt

Reply via email to