Bug 78984 - Maximize window to best fit screen without overlapping other windows (fill only empty space).
Summary: Maximize window to best fit screen without overlapping other windows (fill on...
Status: RESOLVED WORKSFORME
Alias: None
Product: kwin
Classification: Plasma
Component: general (show other bugs)
Version: unspecified
Platform: Mandrake RPMs Linux
: NOR wishlist
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-04-03 18:25 UTC by jwbroek
Modified: 2021-12-09 07:15 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description jwbroek 2004-04-03 18:25:03 UTC
Version:            (using KDE KDE 3.2.0)
Installed from:    Mandrake RPMs

These days I find that I rarely need to maximize a window to total screen size, thanks to the high resolutions that current monitors support. However, this has given rise to a related situation. I now often have several windows open at once and often want to resize one of them to fill all available unoccupied space around it. In other words, I would like the window to expand as much as possible, without obscuring any neighbouring windows.

It would be great if the maximize button could be configured so that if it is clicked, it would first attempt to fill all surrounding unoccupied space (this is of course equal to normal behaviour if there are no other open windows) and if there is none it will function as normal. Thus, if a user did not want to maximize only to the surrounding empty space, (s)he could simply hit the button again and the window would then maximize to the entire screen.

This still leaves situations in which the window to be maximized already (partly or completely) covers another window. I propose that such a window is ignored in the maximization process. This is helpfull when for instance a browser window is maximized at the back of the window stack and a few windows are in front of it. In such a situation one might want to one of the windows in front to fill all empty space around it, while ignoring the maximized browser window in the back. In effect, the fact that the window is already (partly or not) obscured by the window that is to be maximized, idicates that it is unimportant if it is further obscured.

Thanks!
Comment 1 Iraklis Evangelinos 2005-08-09 21:02:12 UTC
*** This bug has been confirmed by popular vote. ***
Comment 2 tnemeth 2008-07-12 14:26:30 UTC
   I miss this feature since my early uses of unix. This was available in
   fvwm in the "good old days"(r)(c)(tm) :)


+-screen----------------------------------------------------------------------+
|+-win1-------------[][][]+ +-win2----------------[][][]+                     |
||                        | |                           |                     |
||                        | |                           |                     |
||                        | |                           |    empty space      |
||                        | |                           |                     |
||                        | |                           |                     |
||                        | |                           |                     |
|+------------------------+ |                           |                     |
|                           |                           |                     |
|                           |                           |                     |
|                           +---------------------------+                     |
|                                                                             |
|                          empty space                                        |
|                                                                             |
|                    +-win3----------------[][][]+                            |
|                    |                           |                            |
|                    |                           |                            |
|                    |                           |                            |
|                    |                           |                            |
|                    |                           |                            |
|                    +---------------------------+                            |
|                                                                             |
+-----------------------------------------------------------------------------+

MAXIMIZE BUTTON :
			| normal/no mod | modifier			     |
------------------------+---------------+------------------------------------+
mouse button left	| full		| both of below			     |
mouse button middle	| vertical	| use all vertical space available   |
mouse button right	| horizontal	| use all horizontal space available |

With "modifier" could be alt / control / shift or any other combi.
Comment 3 Martin Flöser 2012-03-10 19:13:57 UTC
I want to thank you for your feature request and I am sorry that for such a long time nobody replied to this request.

Unfortunately to implement this behavior quite some heuristics is needed to properly identify the empty space and ignore windows. This is not trivial to implement. Another problem is the change of semantics of the maximized button which would violate the EWMH specification.

From what I understand you want to best use the available space. This is a desirable goal we have followed in the KWin development process. For example we added quick tiling on screenedges allowing you to either fill quarters of the screen or the half of the screen. Furthermore the upcoming development version contains JavaScript bindings allowing users to use their own custom windowing behavior. E.g. it would be possible to write a script which reacts on maximization and calculates a new size based on the other windows available on the same desktop.
Comment 4 Boltronics 2021-12-09 07:15:56 UTC
This request was closed almost 10 years ago because it was deemed too hard to implement, but is this still the case? If not, can this be re-opened?

> Another problem is the change of semantics of the maximized button which would violate the EWMH specification.

That's fair - having such functionality mapped to the maximize button would be unusual. I think most people would settle for a user-defined shortcut, and I don't think jwbroek would mind if we disregard the second paragraph of his original request.

I use the term "unusual" because many other window managers (including lightweight ones such as xfwm) have long supported this behavior, but they do so by way of of a user-defined shortcut. (They also support "quick tiling", etc.). Isn't KDE supposed to be the one desktop that does it all? :)

I'm not aware of anyone having implemented a JavaScript solution, or any other kind of solution.

This report was referenced on StackExchange at https://askubuntu.com/questions/216128/expand-window-to-free-space-on-screen-in-kde

Please let me know if you would prefer a new bug report, as opposed to having this one re-opened. As an aside, I don't know why it was marked "WORKSFORME" since the functionality clearly doesn't exist.