[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Ayatana] Papercut or not? Bug #495403 in One Hundred Paper Cuts: “Do not raise windows or dialogs without user input”



2010/6/29 Matthew Paul Thomas <mpt@xxxxxxxxxxxxx>
> If I have chosen to actively use another application/window, the new
> application should never take the focus even if it takes it 24 hours
> to start.
>...

Of course, but that's *still* assuming the question. How do you define
"chosen to actively use"?

Define it by clicks, key presses, and milliseconds. Any other definition
is useless to a window manager.


Click on window, type in window, switch to window (by whatever means, ALT-TAB or any switcher). Actually, for cases where it's possible to clearly identify this, even intent to switch should be enough. The case I think of here is ALT-TAB, if I've initiated ALT-TAB but not chosen a window yet, it still should count as if I had and start any other app unfocused.

Any other thing that anyone can come up with that unambiguously means that I've actively given this window my attention. "Unambiguously" and "actively" are keywords, and I can well imagine that they are hard for many cases, but click, type, switch to - are those unclear? If so, can they be made clear?

I don't see time entering into it at all. I have interacted with a window, or I have not. The interaction happens instantly, on mouse down, key down (or mouse over if using sloppy focus I guess), no milliseconds or anything. Just as the interaction never times out, if it happened after a launch, it stays forever for that launch, so that application can never come to front. (Well, actually, for a complication, I guess it would if all interacted-with windows has gone before it launches, as in: "start OOo, type in gedit, save, exit, gedit is gone, OOo pops up in foreground").

Actually, it's probably trying to be too smart and guessing by timeouts and other things that make the current window managers not work, to the point that most of us think that there is no algorithm at all? I still hardly can believe that it does, because there are no signs whatsoever that the desktop respects my focus choices. :)

I'm not sure though, how the window manager knows when an application is started? Is it that focus is not on any window, since a launcher, menu or similar has been used, so that it can notice interactions with windows after that point in time - or does it actively need to know that something has been started? If I assume the former, the basic suggestion becomes something like:

* WM keeps a list of windows that has been interacted with, defined as:
  - clicked on (mouse down)
  - switched to (by any means given the focus)
  - typed in (if that is possible without any of the others first?)
* Addition to list is instant, according to the above rules no waiting, no timeouts
* WM empties this list when no window has focus, as would be the case when:
  - launcher, panel menu, desktop icon is used
  - or, if that's a bad way to go about it, list empties whenever a new app is launched
  - or, however this point in time is detected  :)
* Window is removed from list when it is closed
* If list is empty upon window creation, it gets to open on top, with focus
* If list is non-empty upon window creation, it opens unfocused, behind
  - It could be discussed if it should open behind all others, or directly behind the last focused window
* Window list is NOT per-user, but per-WM (if that's the problem with the gksu windows popping up all over, otherwise maybe superfluous requirement)
* Special cases may include counting initiated ALT-TAB and similar "intents to switch" as having a non-empty list, though I'm not sure it's necessary or even a good idea - testing perhaps?

Probably not perfect in any way, but are there cases that are unclear in that? Are there cases that are unwanted in that? I've probably overlooked a lot of obvious cases, or don't have an understanding of what is possible, but I do think something like that is at least the base of how I want my system to respect my choice of focus.

/ K