Window rule for Firefox no longer sets window size

I have a window rule for Firefox that sets the size and position when I open it.

The position is still working, but the size rule stopped working a few days ago. I see Firefox open to the correct position, and the window looks like it is opening to the desired size very briefly, but then the size shrinks.

I’ve tried Force, and Remember, but no help.

Plasma 6 and Wayland.

You could try re-setting the window class using the detect window property tool to pick the details from your Firefox window, it could be a change within Firefox that has caused it.

I deleted the rule and recreated it, a few times, with Detect Window Properties.

The rule is firing and placing the window where I want it, upper left corner.

I suppose it could be a recent update of Firefox that is overriding the size that kwin applies very briefly.

Are you using the plasma title bar?
I. e. is it ticked, right click next to url bar, Costumize and tick Title Bar on the very bottom left?

Yes, Title Bar is checked.

Are you using Firefox from Flatpak, snap or a local system install?

1 Like

Local install. I download the tarball from Mozilla and unpack it directly.

If you set it to “force” it still opens at the correct size briefly and then resize?

Yes, same behavior with Apply Initially, Force, and Remember.

After I restarted Firefox and the window shrank in size, I opened the window rule, selected Apply Now for Size, and the window expanded to the size I have set in the rule.

I set Size back to Apply Initially, and New Window and New Private Window both open to the desired size.

I opened the debug console and confirmed what I thought, that the window is resizing to the “default” size (the size with no window rule).

Start Firefox with the window rule - it opens, shrinks, and I see:

frameGeometry 0,0 1283x750

Correct position, top left corner, but wrong size.

I delete the window rule and restart Firefox and see:

frameGeometry 382,182 1283x750

A centered window with the “default” 1283x750 size.

The position rule working, but the size rule getting overridden is odd.

1 Like

I have no idea what can be the problem, but perhaps you can workaround by creating a custom kwin script that “waits” a bit before resizing the window. If this may be a solution for you I can guide you through the procedure

PS it just came to my mind an old problem I had with Firefox that I solved by setting an environmental variable to force Wayland instead of x11 as backend. I think this should be the default now, but never say never. Try to look for “Firefox force Wayland” for the procedure

Thanks for the offer on a kwin script, tubbadu. I’m going to just resize after the rare reboot for now.

I do have that env variable set:

$ env | grep MOZ

1 Like