Maximize Firefox using FvwmEvent add_window rendering bug

I’m using the following configuration to start Firefox maximized. It works in the respect that the window covers the whole screen but the content in Firefox still has the dimensions of the window before it was maximized. Just refreshing the page does not help, instead I need to resize the window for the content to update and render the whole window.

DestroyModuleConfig FE-StartMaximised: *
*FE-StartMaximised: Cmd Function
*FE-StartMaximised: add_window StartAppMaximised

Module FvwmEvent FE-StartMaximised

DestroyFunc StartAppMaximised
AddToFunc   StartAppMaximised
+ I ThisWindow ("Mozilla Firefox", !Maximized, !Transient) Maximize 

It seems intermittent because there have been a few rare occasions where this has not happened. Also, if I start Firefox with the configuration above and then maximize the window using a keyboard shortcut everything works as expected. Could it be a timing issue? Is there a way of delaying maximizing the window somehow to test this?

Thanks!

Hi @hrnick

Yes, it’ll be because the GTK window probably hasn’t had its ConfigureNotify event sent properly.

Can you try this patch (on top of fvwm3’s master branch) to see if that helps?

diff --git a/fvwm/add_window.c b/fvwm/add_window.c
index 697fedf52..1cb47f905 100644
--- a/fvwm/add_window.c
+++ b/fvwm/add_window.c
@@ -2632,6 +2632,10 @@ FvwmWindow *AddWindow(
        /****** inform modules of new window ******/
        UPDATE_FVWM_SCREEN(fw);
        BroadcastConfig(M_ADD_WINDOW,fw);
+       if (!IS_SHADED(fw) && !IS_ICONIFIED(fw)) {
+               SendConfigureNotify(fw, fw->g.frame.x, fw->g.frame.y,
+                   fw->g.frame.width, fw->g.frame.height, 0, False);
+       }
        BroadcastWindowIconNames(fw, True, False);
 
        mon = fw->m;

Thank you! I’ll try it tomorrow when I’m back home again.

Should this patch work against fvwm-3.1.0.2 or would I have to use the master branch? I’m running Gentoo and have a local repository with a branch for the former that would make it easy to apply and test it.

Hi @hrnick

It should apply cleanly to both – it’s not a part of fvwm which changes much. Even if it doesn’t apply cleanly using patch or git-apply, you can do it by hand as it’s only one line.

So I had a dependency conflict when trying to emerge fvwm-3.1.0.2 and ended up adding the patch manually to fvwm-2.6.9 that I am still running because of the KVM issue I opened a bug report for a while back. Would you expect this to work in v2.6.9 as well because unfortunately it did not change the behaviour of Firefox. If now I’ll have another go at solving the dependency conflict and try it in 3.1.0.2.

Thanks!