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.
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.
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 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
Hi tubbadu
I’m interested in the custom kwin script you offered:
“… script that “waits” a bit before resizing the window.”
I restart often and getting tired of resizing the Firefox window after it overrides my kwin rule.
The script should register a handler for the windowAdded signal: kwin will call the handler function anytime a new window is created. The handler should check if the window is a Firefox window, and if it is it should wait some time (can be achieved with a JavaScript timer or something like that), and then resize the window
If you want to try to write it it’s not that hard, otherwise I’ll write it for you as soon as I can
(Note: the APIs are plasma 6 specific. The plasma 5 APIs are slightly different)
Okay, thank you. Yes, I’m using Plasma 6. I haven’t written a script previously, but will have a look at the link when I have more time on the weekend.
Cheers
Sorry for the very late reply, I completely forgot about it
here’s an example script to wait for 2 seconds before resizing the firefox window when it is created:
you can adjust position, size and timer interval to fit your use case
you can try to run it using plasma-interactiveconsole, but make sure to log out and log back in everytime you change some values in the script, because otherwise multiple copies of the script will run concurrently, leading to unexpected behavior.
once you’re happy with your script you can install it following this simple guide.
Let me know if it works for you or if you find any problem!
Just curiosity. What exactly version of Plasma do you have?
After kinfocenter:
Operating System: Fedora Linux 40
KDE Plasma Version: 6.1.1
KDE Frameworks Version: 6.4.0
Qt Version: 6.7.1
Kernel Version: 6.8.5-301.fc40.x86_64 (64-bit)
Graphics Platform: Wayland
In my system I checked your problem, and Firefox 130.0.1 started at the chosen place and size without any problems.
Radek
PS.: Can you check if you can change theme for borders. I want mark private Firefox mode with diff color on title bar. Thanks.
Hi Radek
I have:
Operating System: openSUSE Tumbleweed 20241005
KDE Plasma Version: 6.1.5
KDE Frameworks Version: 6.6.0
Qt Version: 6.7.3
Kernel Version: 6.11.0-1-default (64-bit)
Graphics Platform: Wayland
4K screen scaled to 150%
Currently running the Flatpak version of Firefox - 131.0
Regarding the theme for boarders, changing the window decorations border option, say to ‘tiny’, has no effect even after logging out & back in. It seems only the theme’s default ‘normal’ boarder option is able to take effect.
I have no option to change just the Firefox title bar.
I’ve started my journey learning about scripting tubbadu, but it’s taking me some time to work out how to do this properly. I’ll hopefully have more time this week to learn more and work on trying this out.