Linux Window Placement is Unproductive
2009-10-21 15:25 - Linux
Unix has a long-steeped tradition and philosophy which I normally agree with: create small tools that work together to solve bigger problems. It works really well at the command line, with classic tools. Chaining pipes together can get quite a few things done. It's totally failed in the GUI world, however.
I'm used to how all my programs act on Windows. If I launch Firefox (or Thunderbird, or Pidgin, or EditPlus, or Photoshop, or Volume Control or ... the list goes on) and put it in the top-right corner of the screen, close it, and reopen it: it comes back in the top-right corner of the screen, where I put it! I'm extremely used to working this way. It follows the desktop metaphor very well, I put particular things in particular places, and I'm very used to looking at that particular place to find that thing. (Aside: It's one of the things I really dislike about the 30" monitor I have at work now. There's a lot of space, but I'm used to the dual-monitor setup which divides said space into separate places. But I digress.)
It seems that in Windows land, every single program implements the "remember my size and position" logic, and restores said settings next time. The exceptions, which do not do this, get launched in a "cascade" arrangement: starting from the top left, each is down and to the right by a little bit, about (exactly?) the height of the title bar. The command prompt is a classic example of this. It's not useful. But, since Windows offers nothing better in terms of window placement, every (okay, almost every) piece of software solves this problem, and basically all in the same way: launch in the same place that it was last time.
One way to make this clear is to look at Pidgin. By default on Windows, the Pidgin "Buddy List" window, and each "conversation" window launches in the same position it was in last time. On almost every computer I use, for me that is the top-right and bottom-right corner respectively. I usually keep at least a bit of those corners visible at all times, and can easily switch to those windows with the mouse (see Fitt's Law: stuff on the edges, and especially in the corners (both edges) is really easy to get to with the mouse), and can see when something is going on in that window (or if it appears suddenly). And on Windows, this works. On Linux? Not so much.
See, Linux follows the Unix tradition, and things are often built in small cooperating pieces. So the GUI system as a whole delegates to the window manager ("software that controls the placement and appearance of windows within a windowing system in a graphical user interface") all the work of placing, sizing, and interacting with the actual windows holding the programs. As a result people who write Linux software (even cross-platform capable software) seem to think along the lines of, "Pidgin doesn't place the window, it is up to your window manager to decide the position."
But the window manager manages the windows horribly! First, I have to install a package that doesn't come by default (CompizConfig Settings Manager, aka ccsm) to get to the "Place Windows" setting. The choices are cascade, centered, smart, maximized, and random. What do these settings do? Starting from an empty desktop, and opening a few different programs, I see:
- Cascade
- Starts at an inconsistent position, near but not at the top-left corner. Following windows go in a column downards, the left edges aligned, until the vertical space is consumed. The next columns start at the same vertical position as the first window, unless this window is taller than the first window in the previous column, in which case it starts at the same vertical position as a lower window in the previous column. (The top-left corner of the new window starts at the bottom-left of a previous window if possible, otherwise at the top-right corner. Once neither are possible, the scheme starts over at the top-left of the whole screen. Each new window goes in the "first" available space.)
- Centered
- Every single window starts perfectly centered in the screen, all on top of each other.
- Smart
- Each window goes as far towards the top-left corner as it can, without covering any other windows. If there is no empty space big enough to hold it, it goes wherever it covers the most empty space (the desktop) and the least other windows possible.
- Maximized
- Every window takes up the entire screen.
- Random
- Just what it says on the tin. A surprise every time you open the window! Where will it go this time?!
So what are the merits of these schemes? They all stink! Well, I can sorta see the value of maximized on a small screen (netbook). But there are still certain apps (calculator, IM, etc) that have a smaller window and are just fine that way. Cascade is very difficult to predict (look at the description!) and is generally useless unless you're starting a whole bunch of the same program, in which case it will set up a nice grid. But that grid will be offset from both the top and side of the screen, wasting space.
Centered is pointless unless you enjoy spending your time rearranging your windows so that you can see them. Random is just as pointless for (nearly) the same reason. The chance that the window goes where you want it is virtually zero.
Smart is what is left. In certain, rare, cases, it's very useful! When I launch that one-off program, I probably do want it to not overlap anything. I might be firing up a calculator, and want to still be able to read the web page/document/etc that I'm getting the numbers from. But it fails miserably for the programs that I use every single day, and probably multiple times in every day. I want those to be in a particular place, and I want it every time.
As mentioned, it's the viewpoint of (some!) programmers that the window manager should be managing the windows, so i.e. Pidgin leaves me stuck. There is a workaround in the "Place Windows" plugin. But it reveals the reason that the program, and not the window manager, should be responsible. I can't choose carefully enough where which window I want to place. The choices are limited, most programs don't expose any distinguishing information, and even if they did, one big slider from -32767 to 32767 just doesn't get me where I want to go.
Why does it work on Windows? Because Windows doesn't even try. It doesn't try to stuff all this information into a narrow difficult API. Each program knows what windows it has, and how to identify each. And it stores four simple numbers (x, y, width, height) and uses them each time. So simple and easy that nearly every program does it. But that's too tough for Linux. It's even been pointed out, numerous times:
So where am I left? I managed to hack together some rough placement rules. Not many. Some programs (Firefox) get it right. Some programs get it wrong. Both my Prism apps (mail and calendar) start in the right place, except down and to the right by the exact space that the window border/title takes up, and must be moved each time. Eclipse starts in the right place, but is always six pixels too narrow, and nineteen too short. The "smart" placement mode almost gets the rest right. But there are still quite a few cases that I get surprised with where the window ends up, based on some funny coincidence of what screen space happened to already be used, and what desktop space happened to be peeking through at the time. Sigh.
So, to conclude: Where are we and why? Window placement is better on Windows than on Linux. Because the Unix philosophy, combined with the FOSS community, has let us down. The app developers say "the window manager should handle it" They even explicitly disable their window-position-remembering code that's already there, for Linux, because in theory some other layer handles the window management. The window manager developers say "the application should handle it" and "this should be done in user space" and the desktop environment developers say "this is impossible to do in user space". All the while, the users want it and are not getting it. Everyone along the chain claims someone else should do it, and closes the tickets as WONTFIX. And the users continue to suffer. Another item in the list of things that work fine on Windows, but are painful and/or annoying on Linux.
2009-10-26 21:19 - itsjareds
Linux is the kernel, not the operating system. You seem to be talking about X/compiz in particular. Just because they do not manage your windows the way you want them to, that doesn't mean that X as a whole is a less-than-competent window manager. The beauty of open source software is that you can always suggest your ideas.
You might find this article interesting: http://linux.oneandoneis2.org/LNW.htm/