maximum free rectangle space

Started by
4 comments, last by theOcelot 14 years, 5 months ago
Hi, This sounds like I want to program my own window manager, but I do not . I just want to contribute to PyTyle! I am wondering if there exist a free implementation of a "maximum free recangle" algorithm, that I could use. With this I mean an algorithm, which gets a set of rectangles as inputs and calculates the the biggest free space between them (given a bounding box). With the bounding box set to the viewport and the set of recangles set to the other windows, this should be a common problem for WMs, should it not? I searched without luck. I found a lot algorithms explained, but all with a little different setting (most free space without any of a given point set in it). Anyone knows a algorithm or implementation suited for this? Thank! Nathan
Advertisement
Cycle through the windows and note the max (left, top) edge and min (right, bottom) edge that you encounter.
Hi,

I think this is a misunderstanding. I do not want to find the biggest rectangle/window but the biggest free space not occupied by any window/rectangle.

Sorry for beeing unclear.

Regards,
Nathan
Quote:Original post by LonelyStarI think this is a misunderstanding. I do not want to find the biggest rectangle/window but the biggest free space not occupied by any window/rectangle.

Sorry for beeing unclear.


Not to be rude, but you're still unclear. [smile] Do you mean the biggest space where you can put a new rectangle without it overlapping any others?
Quote:Original post by theOcelot

Not to be rude, but you're still unclear. [smile] Do you mean the biggest space where you can put a new rectangle without it overlapping any others?


Exactly!

I think that most WM's just don't worry about overlapping. You might have to take a similar approach. Beyond that, I'm not nearly clever enough in that area to help you much. Read about the bin packing problem to find out what kind of water you're getting into.

This topic is closed to new replies.

Advertisement