Squib of the day: On giant displays, place windows near the pointer

NEC 43" super wide DLP displayDid you know that the xrandr extension uses a 16-bit quantity to store the millimetre width of the screen? That gives a maximum screen width under X of about 65½ metres. Granted, this is about three times wider than a good-sized cinema screen, but it’s certainly a limit to try for. Imagine, you could get the whole of Hamlet in your AbiWord window at the same time.

Anyway, GNOME bug 106239 suggests that on “giant” displays (the meaning of “giant” left ambiguous), newly-created windows should appear near the pointer.  If we grant that this is a good idea, should we also do this on small displays?  If not, where’s the cut-off?

(Clue: introducing a GConf key is going to be an unpopular move.)

Photo © naan, cc-by.

Published by

Thomas Thurman

Mostly themes, triaging, and patch review.

8 thoughts on “Squib of the day: On giant displays, place windows near the pointer”

  1. I think it’s always a good idea, it’s irritating when you have two monitors and a window pops up on the opposite corner of the opposite screen to the one your cursor’s on.

    At the same time, there needs to be some sort of intelligent heuristic to decide when tiling a window is better than obscuring an existing window (perhaps if it means the window ends up a particular distance from the cursor?)

  2. I’m guessing that the justification for this feature would be “I’ve just opened a window I want to interact with, and moving the mouse-cursor all the way over *there* would be incredibly tedious so I think new windows should appear *here* instead”.

    I guess I can see the reasoning, but I expect that any display large enough to make mouse-moving tedious is going to be so tedious to use that you’ll want to have some kind of non-mouse-based interaction anyway (like walking over to the window and poking it with a finger or something), so it’s not really worth trying to patch in Metacity.

  3. hmm something like “if the distance one need to move the mouse to the closest point of the tiled window is more than 3x the diagonal length of the window, then don’t tile”?

    although come to think of it, on such a display I probably want to have a way to move my pointer quickly anyway, so I am not sure if it’s a problem worth solving at the window placement level.

  4. New windows should definitely show up on the same (Xinerama) screen that my mouse cursor is in.

    If a single monitor is large enough, I see no harm in positioning new windows near the cursor.

  5. Even on small displays, placing new windows near the cursor is a good idea.

    A simple example is having a laptop with a touchpad. If your mouse is on the top left and a window opens in the lower right corner (like when you start a new application from the gnome menu), you have to move your cursor through the whole screen diagonal. And probably you will have to do it by sliding your finger on your touchpad multiple times.

    That said, the heuristic should probably be a combination of:
    – distance between the cursor and the projected window placement
    – screen size (all computed distances should somewhat be relative to this one)
    – window size

    A simple heuristic to try could be:
    1. compute a window position where the distance from the current cursor position and the window center point is minimal, and the window does not overlap anything.
    2a. if such a position is not found, place the window at cursor position.
    2b. if the distance between this ideal window position and the cursor position is more than half the screen size, place the window at cursor position.

    Placing a window at cursor position should of course involve some adjustment so that the window does not go outside screen borders.

    That said, if I remember correctly (what a long time ago), twm had a mode where when a new window was opened, you had to click somewhere on the screen to place it (it was floating under your cursor, just like you where doing a move).

Leave a Reply

Your email address will not be published. Required fields are marked *

Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported.