Discussion:
FVWM: Smart maximize
Piotr Isajew
2012-11-24 12:16:20 UTC
Permalink
Hi,

I wonder, if there is a command to do "smart maximize" in fvwm?
The command would move and resize current window to use the
largest free area of desktop, but not covering any other
windows. Is there something like this?

Kind regards,

Piotr
Dan Espen
2012-11-24 12:53:16 UTC
Permalink
Post by Piotr Isajew
Hi,
I wonder, if there is a command to do "smart maximize" in fvwm?
The command would move and resize current window to use the
largest free area of desktop, but not covering any other
windows. Is there something like this?
Try this one:

Key F2 A 4 Maximize grow grow
--
Dan Espen
Piotr Isajew
2012-11-24 13:25:34 UTC
Permalink
Post by Dan Espen
Key F2 A 4 Maximize grow grow
Thanks, Dan. It's almost what I want. It expands the window using
all the available space based on it's current location. What I'm
looking for is a way to do the same, but in the largest available
area of the screen. So for complete solution I need also a way to
move that window to the largest free area of the screen before
that maximize. But it's a move forward anyway, so thanks once
again :)
Dan Espen
2012-11-24 13:37:03 UTC
Permalink
Post by Piotr Isajew
Post by Dan Espen
Key F2 A 4 Maximize grow grow
Thanks, Dan. It's almost what I want. It expands the window using
all the available space based on it's current location. What I'm
looking for is a way to do the same, but in the largest available
area of the screen. So for complete solution I need also a way to
move that window to the largest free area of the screen before
that maximize. But it's a move forward anyway, so thanks once
again :)
I guess you are thinking of the largest free rectangular area.
I'm not aware of any such feature.
--
Dan Espen
Piotr Isajew
2012-11-24 13:55:47 UTC
Permalink
Post by Dan Espen
I guess you are thinking of the largest free rectangular area.
yes, that's right
Post by Dan Espen
I'm not aware of any such feature.
I'll try to look for a solution myself. If I find something I'll
post it to the list.
Dan Espen
2012-11-24 14:14:36 UTC
Permalink
Post by Piotr Isajew
Post by Dan Espen
I guess you are thinking of the largest free rectangular area.
yes, that's right
Post by Dan Espen
I'm not aware of any such feature.
I'll try to look for a solution myself. If I find something I'll
post it to the list.
If you want to go that far,
I recommend using FvwmPerl and the module interface.
You can ask Fvwm for a list of windows with Send_Windowlist.
--
Dan Espen
Piotr Isajew
2012-11-28 16:24:48 UTC
Permalink
If you want to go that far, I recommend using FvwmPerl and the
module interface. You can ask Fvwm for a list of windows with
Send_Windowlist.
Thanks. I've tried the module interface. It will be probably the
best option for what I need.

Regards,

Piotr
Bastian
2012-11-28 17:17:11 UTC
Permalink
Have you tried to set the Style MinPlaceOverlap to subjected window and
then call PlaceAgain on it?

This works for me:

DestroyFunc movetofreeplace
AddToFunc movetofreeplace
+ I WindowStyle MinOverlapPlacement
+ I PlaceAgain
Post by Piotr Isajew
If you want to go that far, I recommend using FvwmPerl and the
module interface. You can ask Fvwm for a list of windows with
Send_Windowlist.
Thanks. I've tried the module interface. It will be probably the
best option for what I need.
Regards,
Piotr
Jaimos F Skriletz
2012-11-28 18:45:57 UTC
Permalink
Post by Bastian
Have you tried to set the Style MinPlaceOverlap to subjected window and
then call PlaceAgain on it?
DestroyFunc movetofreeplace
AddToFunc movetofreeplace
+ I WindowStyle MinOverlapPlacement
+ I PlaceAgain
First please do not top post (read the rules of the mailing list).

The problem with this method is that it will find the first available
free (or min overlap) region it can place the window. If there are
multiple rectangles on the screen that are free of windows it will
always pick the first one it finds (not the biggest rectangle). So
though it was a suggestion to look at there is really no nice way I can
see to mix it to be able to grow a window to fit in the biggest possible
rectangle it can find.

A FvwmPerl script will end up being the the best way I can think of to
first find the biggest free rectangle and then to move/resize the window
to fit in that rectangle. The hard part will be the problem of finding
the biggest open rectangle (this is a logic/math problem). Once you have
that it is fairly straight forward to move the window to that rectangle
and maximize grow grow (or just resize it) to the right size.

jaimos
Thomas Adam
2012-12-07 08:35:21 UTC
Permalink
WindowId 0x%x ResizeMove %dp %dp %dp %dp
I find it dubious you need to use the WindowID command here at all.
is there any way, besides of coding that logic into module, to
make this command operate in toggle mode, like Maximize does?
ResizeMoveMaximize

-- Thomas Adam
Thomas Adam
2012-12-07 12:18:20 UTC
Permalink
Post by Thomas Adam
WindowId 0x%x ResizeMove %dp %dp %dp %dp
I find it dubious you need to use the WindowID command here at all.
Without WindowID being there I always got interactive selection
mode, when that command was executed.
I meant more that there's other ways of specifying the window. I'd
need to see this module to critique it properly though.

-- Thomas Adam

Jaimos Skriletz
2012-11-25 00:02:00 UTC
Permalink
Post by Piotr Isajew
Post by Dan Espen
I guess you are thinking of the largest free rectangular area.
yes, that's right
Post by Dan Espen
I'm not aware of any such feature.
I'll try to look for a solution myself. If I find something I'll
post it to the list.
The only thing similar I can think of is MinOverlapPlacement policy as it does what you want (sort of). I cannot think of a simple way to mix that placement policy (and replace your window) with trying to do this smart maximization. But if you know a bit of C that is something you can look up to see how it is done in terms of logic in determining the bigest open rectangle.

Just mentioning that placement policy because then you don't have to rebuild the logic from nothing and you can use it as a starting place to figuring out where the biggest rectangle is.

jaimos
Dan Espen
2012-11-25 00:10:18 UTC
Permalink
Post by Jaimos Skriletz
Post by Piotr Isajew
Post by Dan Espen
I guess you are thinking of the largest free rectangular area.
yes, that's right
Post by Dan Espen
I'm not aware of any such feature.
I'll try to look for a solution myself. If I find something I'll
post it to the list.
The only thing similar I can think of is MinOverlapPlacement policy as
it does what you want (sort of). I cannot think of a simple way to mix
that placement policy (and replace your window) with trying to do this
smart maximization. But if you know a bit of C that is something you
can look up to see how it is done in terms of logic in determining the
bigest open rectangle.
Just mentioning that placement policy because then you don't have to
rebuild the logic from nothing and you can use it as a starting place
to figuring out where the biggest rectangle is.
I haven't looked at MinOverlap, but Google offers:

http://stackoverflow.com/questions/7245/puzzle-find-largest-rectangle-maximal-rectangle-problem
--
Dan Espen
Oleksandr Gavenko
2012-12-01 09:51:45 UTC
Permalink
Post by Piotr Isajew
Post by Dan Espen
Key F2 A 4 Maximize grow grow
Thanks, Dan. It's almost what I want. It expands the window using
all the available space based on it's current location. What I'm
looking for is a way to do the same, but in the largest available
area of the screen. So for complete solution I need also a way to
move that window to the largest free area of the screen before
that maximize. But it's a move forward anyway, so thanks once
again :)
This can be noise and this links in my TODO list so I don't read they yet but
hope it will be useful (I collect it when search for tiling in Fvwm):

https://github.com/urob/fvwm-tiling
FvwmRearrange(1)
http://dryice.name/blog/freebsd/tiling-window-management-with-fvwm/
http://noone.org/blog/English/Computer/X/How%20I%20use%20my%20virtual%20desktops.html

https://github.com/rubykat/FvwmPiazza
https://github.com/ThomasAdam/FvwmPiazza

http://search.cpan.org/dist/FvwmPiazza/
https://metacpan.org/release/FvwmPiazza
http://forums.gentoo.org/viewtopic-p-6664393.html
--
Best regards!
Loading...