On Tue, Feb 21, 2017 at 7:17 AM, Vincent Lefevre <vinc...@vinc17.net> wrote:
> On 2017-02-16 11:00:09 -0700, Jaimos Skriletz wrote:
>> The original bug in which the patch appears to have fixed is every
>> time a Button was added/removed from FvwmIconMan causing the window to
>> change sizes, the warning would be triggered. Now it appears to be
>> triggered for other reasons, or at least triggered far less often (as
>> in not every time).
>
> In my case, the warnings seem to occur every time a window is opened
> or closed when FvwmIconMan is started via RestartFunction. Otherwise
> not every time.
>

Strange. The patch worked for me for a while, but after doing a full
reboot of my system I now too get it triggered every time. I went and
looked at Dominik Vogt's original patch and noticed that he just did a
work around on the hints by resetting them then setting them after the
FvwmIconMan window has been resized. Seems there was a race condition
where the window wasn't done being resized by the time the window
hints were set still causing the warning to trigger.

I wrote a small patch that adds a small wait to Dominik Vogt's patch
and so far I am not getting these warnings triggered. The patch is
attached and you can find a .deb I built in stretch here

http://fvwmforums.org/fvwm-2.6.7/

patch is attached as well

jaimos
From 227d7ea2597ec3fec304c53934fcc41773ab7e89 Mon Sep 17 00:00:00 2001
From: Jaimos Skriletz <jaimosskril...@gmail.com>
Date: Tue, 28 Feb 2017 17:43:12 -0700
Subject: [PATCH 1/1] Wait until FvwmIconMan is resized to set window HINTS

---
 modules/FvwmIconMan/xmanager.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/modules/FvwmIconMan/xmanager.c b/modules/FvwmIconMan/xmanager.c
index 58eaaedc..b4efe890 100644
--- a/modules/FvwmIconMan/xmanager.c
+++ b/modules/FvwmIconMan/xmanager.c
@@ -439,6 +439,16 @@ static void resize_window(WinManager *man)
     }
     MyXUngrabServer(theDisplay);
   }
+
+  // Wait until the window has resised to fix the HINTS.
+  // counter is used to break an infinte loop.
+  XWindowAttributes attribs;
+  int counter = 20000;
+  while ( counter && (attribs.width != man->geometry.width ||
+          attribs.height != man->geometry.height)) {
+    XGetWindowAttributes(theDisplay, man->theWindow, &attribs);
+    counter--;
+  }
   fix_manager_size(man, man->geometry.width, man->geometry.height);
 }
 
-- 
2.11.0

Reply via email to