joewing / jwm

Joe's Window Manager
http://joewing.net/projects/jwm
MIT License
517 stars 85 forks source link

Enhancement: another type of default window placement - book sheet tiles #283

Open dumblob opened 8 years ago

dumblob commented 8 years ago

Recently I got motivated by https://github.com/joewing/jwm/issues/269 to write the following proposal.

Over the last 7 years I've developed a lot of different adjustments to different existing window placement algorithms as well as came up with totally different and usually quite complex ones (many of them tested on FVWM). But now I'm already more than 2 years successfully using the following simple algorithm (both on small and larger screens).

The main idea is to divide the screen only vertically and thus arranging windows in one horizontal row while stretching (or shrinking) them into equally sized tiles (if the window didn't request a smaller width in which case the request is satisfied and we have more space to divide for other windows). If it's not possible to change window size, then centering window vertically in the tile and narrowing/expanding the tile horizontally to fit the window width. In case of too small height or width of the screen/virtual_desktop, falling back to purely manual placement for this specific virtual desktop (this might happen e.g. after connecting your wide-screen high-resolution notebook to an old 4:3 projector with very low resolution).

If the width of the tile with stretchable/shrinkable window should be lower than a specified value (usually in the form of a fraction from the whole screen width - e.g. 1/3), then the tiles are left with the 1/3 width, but stacked in the form of book sheets while having the newly appeared window on top:

2016-02-07-092716_1680x1050 0 0_imlib2_grab

If the number of windows on one desktop should decrease, then the algorithm is run again and takes, of course, into consideration the initially requested window sizes by windows (e.g. when the last but one window has been removed, the last remaining window should get precisely the initially requested size potentially cut down to fit the screen if the initially requested size exceeded either height or width or both).

This placing algorithm is also triggered when moving windows between virtual desktops.

I've experimented with generalization to use more than one row of the "book sheets", but it didn't work well (it became too complex and was useful only in very weird situations - e.g. when one uses extremely tiny fonts).

This algorithm has quite a few very nice properties, especially that it preserves the dimension (not position) wishes of the windows if there is enough space. E.g. if you're using Gimp with separated tool window and the main drawing window, then the tool window will request and get only a narrow tile and the main drawing window will have the whole rest. An open dialog will then shrink the main drawing window by half and once the open dialog is closed, the main drawing window will again double it's width.

Maximalization of windows works the same way as in purely manual placement mode except for the fact, that the placement algorithm is triggered after demaximalization (that's very useful, because some stretchable/shrinkable windows request too small sizes and to "convince" them to become larger one would need to use mouse; but if one maximizes the window and then again minimizes which triggers the algorithm, which in turn will cut down the size from the maximized state to fit the tile - all that without touching a mouse and chasing pixels one by one by hand; this gets also quite important when moving windows between desktops).

Tip: it's very convenient to add keyboard shortcuts to move window focus (including raising the window) to the window on the left and on the right neighbouring side as well as left & right shortcuts for swapping two neighbouring windows (be it tiles or "book sheets") - this way one can propagate any window anywhere using bubble sort :wink:.

This was btw the first placement algorithm which handled about 40 open PDFs on one virtual desktop on 15" screen (the minimum width for a window was a fraction 1/2 of the screen width), while still being usable.

ghost commented 8 years ago

https://www.desktopneo.com/ or the video http://www.youtube.com/watch?v=9WZVPM-zZWM This describes a desktop similar to what you want. There are other things in this video also, such as a persistent 'home' screen desktop window, and file management based on hashtags. But I did like the tiling idea, which is very similar to your proposal.

some of this functionality is partially built in in JWM. we have maxright/maxleft @joewing also recently added smarter tiling support.

The other part of the idea would be adding swiping features to JWM. Such as 3 finger swipes, etc... And this would also make JWM very usable on a touch screen, having this 'book' mode

dumblob commented 8 years ago

@Israel- thanks, Desktop Neo looks really good to me (I didn't know about it). The main issue is, that Desktop Neo doesn't exist :wink:. In that context my proposal may be percieved as a transitional technology between the current desktop full of totally inconsistent GUI applications and the highly integrated Desktop Neo approach.

Either way, my proposal seems to fit very well the current inconsistent world of GUI apps and also includes the ability to easily handle tenths of windows on one virtual desktop while still being highly productive. With Desktop Neo already more than 2 windows/panels are getting quite cumbersome, because there are only two solutions - minimization to a vertical bar, and swiping - both without overlap and both requiring user input in comparison to the fully automated approach I've proposed :smile:.

Add also the Desktop Neo's requirement to use touchpad and pointing device extensively (which is probably not what e.g. power users like @joewing or me want as they might use vi-like keybindings and will want to leave their hands on the keyboard all the time nearly without touching any TrackPoint :wink:).

dumblob commented 8 years ago

For those interested, Desktop Neo was highly inspired by http://10gui.com/ .

ghost commented 8 years ago

@dumblob I also prefer using keyboard shortcuts to mouse gestures, I am sure many of the people here feel the same way, however making it available for users (like on touch screen devices) might be something to think about. Your proposal of enhancing an existing desktop with more functionality is a good one. Making JWM more functional for a larger set of use cases could only be a good thing, as long as it does not drop too much functionality. A blend between modern (all the nice svg icons and user friendly menus we can use in JWM) and functionality (like your custom vi-like bindings for JWM), so both power users and 'consumer users' can use JWM. I will check your link out, thanks