From commit 601c5c294a6a48fd402fbfca02b62142796167eb

>    * Improved use of sizehints to set both minimum window size, and to
>       preserve aspect ratio when resizing the pager. The aspect ratio is
>       set to the initial size of the window unless the user sets window
>       size with the Geometry option.

x_pager.c:
> +         sizehints.flags = (sizehints.flags | PAspect);
> +         sizehints.min_aspect.x = sizehints.max_aspect.x = window_w;
> +         sizehints.min_aspect.y = sizehints.max_aspect.y = window_h;

I'm against this change.

 1) It breaks sliding the pager from a panel button.
 2) fvwm's module were always supposed to deal with any size, even
    1x1 or 65535x65535.
 3) It makes it virtually impossible to have the pager fill the whole
    allocated area inside FvwmButtons.

I see no benefit in these new limits.  Nobody resizes the pager
manually, and insde FvwmButtons it's really harmful.  Can I remove
this please?  (See attached patch.)

Ciao

Dominik ^_^  ^_^

--

Dominik Vogt
From 72857bb298ac74707efbdd372fc83943218a3219 Mon Sep 17 00:00:00 2001
From: Dominik Vogt <dominik.v...@gmx.de>
Date: Sat, 27 Nov 2021 21:57:29 +0100
Subject: [PATCH] Remove aspect ratio from pager.

---
 modules/FvwmPager/x_pager.c | 15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)

diff --git a/modules/FvwmPager/x_pager.c b/modules/FvwmPager/x_pager.c
index 4718cd56..ab806d1a 100644
--- a/modules/FvwmPager/x_pager.c
+++ b/modules/FvwmPager/x_pager.c
@@ -122,7 +122,7 @@ Window icon_win;	       /* icon window */

 static int MyVx, MyVy;		/* copy of Scr.Vx/y for drag logic */

-static void adjust_for_sizehints(int, int, bool);
+static void adjust_for_sizehints(int, int);
 static rectangle CalcGeom(PagerWindow *, bool);
 static rectangle set_vp_size_and_loc(void);
 static void fvwmrec_to_pager(rectangle *, bool);
@@ -446,7 +446,7 @@ void initialize_balloon_window(void)
  * should get added to a clean up TODO at some point.
  */
 static void
-adjust_for_sizehints(int VxPages, int VyPages, bool check_aspect)
+adjust_for_sizehints(int VxPages, int VyPages)
 {
 	/* Resize increments are one pixel per visible page. */
 	sizehints.width_inc = Columns * VxPages;
@@ -470,10 +470,6 @@ adjust_for_sizehints(int VxPages, int VyPages, bool check_aspect)
  		pwindow.height = pwindow.height * sizehints.height_inc +
 			sizehints.base_height;
 	}
-	if (check_aspect && sizehints.min_aspect.x > 0) {
-		sizehints.min_aspect.x = sizehints.max_aspect.x = pwindow.width;
-		sizehints.min_aspect.y = sizehints.max_aspect.y = pwindow.height;
-	}

 	desk_w = (pwindow.width - Columns + 1) / Columns;
 	desk_h = (pwindow.height - Rows * label_h - Rows + 1) / Rows;
@@ -714,14 +710,11 @@ void initialize_pager(void)
 		  pwindow.height = (VyPages * vHeight * Rows) / Scr.VScale +
 			  label_h * Rows + Rows;
 	  }
-	  sizehints.flags = (sizehints.flags | PAspect);
-	  sizehints.min_aspect.x = sizehints.max_aspect.x = pwindow.width;
-	  sizehints.min_aspect.y = sizehints.max_aspect.y = pwindow.height;
   }
   /* Adjust the window to handle these new sizehints.  This is also called
    * from ReConfigure().
    */
-  adjust_for_sizehints(VxPages, VyPages, true);
+  adjust_for_sizehints(VxPages, VyPages);

   if (is_transient)
   {
@@ -1462,7 +1455,7 @@ void ReConfigure(void)
   }
   is_size_changed = (old_ww != pwindow.width || old_wh != pwindow.height);

-  adjust_for_sizehints(VxPages, VyPages, false);
+  adjust_for_sizehints(VxPages, VyPages);

   XSetWMNormalHints(dpy,Scr.Pager_w,&sizehints);

--
2.30.2

Reply via email to