Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FvwmRearrange overhaul #1081

Merged
merged 4 commits into from
Nov 7, 2024
Merged

FvwmRearrange overhaul #1081

merged 4 commits into from
Nov 7, 2024

Conversation

somiaj
Copy link
Collaborator

@somiaj somiaj commented Oct 22, 2024

Update, improve, rewrite, and add to the functionality of FvwmRearrange to fix issues, better understand monitors and their working area, make use of window hints when computing window sizes, and more. The following is a summary of the changes.

  • Update fvwm to send the base struts with the monitor information to modules.
  • Add a -screen option. Default to current monitor.
  • Parse Monitor lines from M_CONFIG_INFO to get both the base struts and current desk. The default bounding box is the monitors working area.
  • Compare windows desk against current_desk with -desk option, so now only windows on the same desk are included. If using the global screen, -screen g, this will use the current desk of the last monitor sent.
  • Store windows flags, position and size hints. Use window hints to compute the final size of the window (to match what fvwm would do). This honors ResizeHintOverride style and only uses size hints if that style is not set. Note, aspect ratio hints are not supplied to modules so will be ignored.
  • Skip sending Move/Resize commands to windows whose size or position will not change.
  • Redo math and logic for tiling and cascading functions. This simplifies things, and vertical and horizontal tiling are no
    longer separate loops.
  • Restructure a lot of the options and rename one letter options.
  • Update the manual page to list all the current options and describe new behavior. Options are grouped by tiling options, cascade options, general options, resizing options, filtering options, and ordering options.
  • Cascade windows resizes by default so it is consistent with tiling, remove the -resize option reducing this to a single -noresize flag to stop resizing for both tiling and cascading. The default size for cascading is 75 percent of the bounding box.
  • Add option -cascadew and -cascadeh to specific size to make cascaded windows. This accepts both percent of bounding box and pixel sizes.
  • Honor title bars placed in other locations besides the top, this way the padding due to the frame is correctly computed when using vertical tile bars. Note title bars on the bottom or right will not be visible when cascading windows, but their width will still affect offsets.
  • Add -fill_start and -fill_end options when tiling windows. This will allow empty cells in the grid to be filled by expanding windows in the first row/column or last row/column.
  • Add -auto_tile option which computes the size of the grid to tile in based off the number of windows. Make this behavior default if no options are sent. The default is to keep columns and rows close to equal, but this can be modified with the -max_n option which states the number of more columns (or rows with -h) to use.
  • Add -inc_equal option for cascading windows to make the x and y incremental offsets equal to the maximum of the two computed offsets using the default or combined with -incx, -incy, -flatx, and -flaty options.
  • Rename -h option as -swap, as this is more accurately describing what the option does, swaps the columns and rows before tiling. The old option -h is still accepted as an alias for -swap.
  • Add options to order the windows beyond the default order using the WindowList. These are -order_name, -order_icon, -order_class, -order_resource, -order_xy, -order_yx, -order_hw, and -order_wh.
  • Format FvwmRearrange.c's code.
  • Make FvwmRearrange use an event loop to deal with events instead of waiting for each response. This uses a 10 second timeout (more than enough time) to complete its computation and move/resize windows.

@somiaj somiaj changed the title Js/rearrange improvements FvwmRearrange overhaul Oct 22, 2024
@somiaj somiaj force-pushed the js/rearrange-improvements branch from 6d611e6 to 90bfd5f Compare October 22, 2024 15:08
@ThomasAdam ThomasAdam added type:enhancement Augmenting an existing feature type:new-feature Brand new feature not yet present in fvwm3 relates:module Issue is in module code labels Oct 22, 2024
@ThomasAdam ThomasAdam added this to the 1.1.1 milestone Oct 22, 2024
@somiaj somiaj force-pushed the js/rearrange-improvements branch 5 times, most recently from dc6a9e5 to 4f5d004 Compare October 29, 2024 04:33
ThomasAdam and others added 4 commits October 31, 2024 09:31
Create a boundingbox strut that contains the left, right, top,
and bottom base struts. Use a common place for computing this,
such that we can use it from move_resize, and be able to send
the information to modules.

Add the boundingbox base struts to the monitor information
that is set to modules, so they are area of the base struts
in any computations they want to do.
Update, improve, rewrite, and add to the functionality of
FvwmRearrange to fix issues, better understand monitors and
their working area, make use of window hints when computing
window sizes, and more. The following is a summary of the
changes.

* Add a -screen option. Default to current monitor.
* Parse Monitor lines from M_CONFIG_INFO to get both the base
  struts and current desk. The default bounding box is the
  monitors working area.
* Compare windows desk against current_desk with -desk option,
  so now only windows on the same desk are included. If using
  the global screen, -screen g', this will use the current_desk
  of the last monitor sent.
* Store windows flags, position and size hints. Use window hints
  to compute the final size of the window (to match what fvwm would
  do). This honors ResizeHintOverride style and only uses size hints
  if that style is not set. Note, aspect ratio hints are not supplied
  to modules so will be ignored.
* Skip sending Move/Resize commands to windows whose size or position
  will not change.
* Redo math and logic for tiling and cascading functions. This
  simplifies things, and vertical and horizontal tiling are no
  longer separate loops.
* Restructure a lot of the options and rename one letter options.
* Update the manual page to list all the current options and describe
  new behavior. Options are grouped by tiling options, cascade options,
  general options, resizing options, filtering options, and
  ordering options.
* Cascade windows resizes by default so it is consistent with tiling,
  remove the -resize option reducing this to a single -noresize flag
  to stop resizing for both tiling and cascading. The default size
  for cascading is 75 percent of the bounding box.
* Add option -cascadew and -cascadeh to specific size to make
  cascaded windows. This accepts both percent of bounding box
  and pixel sizes.
* Honor title bars placed in other locations besides the top, this
  way the padding due to the frame is correctly computed when using
  vertical tile bars. Note title bars on the bottom or right will
  not be visible when cascading windows, but their width will still
  affect offsets.
* Add -fill_start and -fill_end options when tiling windows. This
  will allow empty cells in the grid to be filled by expanding
  windows in the first row/column or last row/column.
* Add -auto_tile option which computes the size of the grid to tile
  in based off the number of windows. Make this behavior default
  if no options are sent. The default is to keep columns and rows
  close to equal, but this can be modified with the -max_n option
  which states the number of more columns (or rows with -h) to use.
* Add -inc_equal option for cascading windows to make the x and y
  incremental offsets equal to the maximum of the two computed
  offsets using the default or combined with -incx, -incy, -flatx,
  and -flaty options.
* Rename -h option as -swap, as this is more accurately describing
  what the option does, swaps the columns and rows before tiling.
  The old option -h is still accepted as an alias for -swap.
* Add options to order the windows beyond the default order using
  the WindowList. These are -order_name, -order_icon, -order_class,
  -order_resource, -order_xy, -order_yx, -order_hw, and -order_wh.
Rather than relying on FvwmRearrange not creating a race condition
between gathering a list of windows, and sending commands back to fvwm
to move them, use a common event loop like how every other module does.
@somiaj somiaj force-pushed the js/rearrange-improvements branch from 4f5d004 to 77e8169 Compare October 31, 2024 15:31
@ThomasAdam ThomasAdam self-assigned this Nov 7, 2024
@ThomasAdam ThomasAdam merged commit 5c9b0ae into main Nov 7, 2024
12 checks passed
@ThomasAdam ThomasAdam deleted the js/rearrange-improvements branch November 7, 2024 22:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
relates:module Issue is in module code type:enhancement Augmenting an existing feature type:new-feature Brand new feature not yet present in fvwm3
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants