forge icon indicating copy to clipboard operation
forge copied to clipboard

feat: Firefox picture-in-picture should always float

Open nvergottini opened this issue 3 years ago • 21 comments

Is your feature request related to a problem? Please describe. Forge tiles Firefox picture-in-picture like a regular window, which defeats the purpose of PIP. You can toggle float mode with the keyboard shortcut, but that is awkward and shouldn't be necessary. Setting always float affects all Firefox Windows, so that isn't an option.

Describe the solution you'd like Make Firefox PIP always float.

Describe alternatives you've considered I was using Pop Shell, which always allows Firefox PIP to float, but it isn't currently supported on Gnome 45. I was looking at Forge as a permanent alternative to Pop Shell since Pop Shell requires an overlay install on Fedora Silverblue.

Additional context None

nvergottini avatar Sep 21 '23 17:09 nvergottini

Pop shell can uses regex to match wmTitle and it uses this regex to apply the floating exception to all firefox windows except the main one

p1gp1g avatar Oct 23 '23 15:10 p1gp1g

Forge uses a very simple .include() function. And I think adding wmTitle: Mozilla Firefox, wmClass: firefox as a PR should fix it.

jmmaranan avatar Oct 23 '23 15:10 jmmaranan

But that's the opposite that is looking for, all the windows except the ones with "Mozilla Firefox" in its name should float. And that is not a full match, only those which end with this.

p1gp1g avatar Oct 23 '23 15:10 p1gp1g

The windows.json entries in Forge, floats the windows that matches wmClass and wmTitle along with mode: float.

jmmaranan avatar Oct 23 '23 16:10 jmmaranan

Do you mean that it is possible to do something like this ?

{"wmClass": "firefox", "mode": "float"},
{"wmClass": "firefox", "wmTitle":"Mozilla Firefox", "mode": "tile"},

p1gp1g avatar Oct 24 '23 08:10 p1gp1g

This worked for me:

{ "wmClass": "firefox", "wmTitle": "About Mozilla Firefox", "mode": "float" },
{ "wmClass": "firefox", "wmTitle": "Picture-in-Picture", "mode": "float" }

jmmaranan avatar Oct 24 '23 09:10 jmmaranan

I see. Maybe a way to do a not would be useful. For instance titles starting with ! to do something like

{"wmClass": "firefox", "wmTitle":"!Mozilla Firefox", "mode": "float"},

p1gp1g avatar Oct 24 '23 15:10 p1gp1g

Yes, adding the negate syntax should be simple. But to solve this current issue, need to update the default config

jmmaranan avatar Oct 24 '23 17:10 jmmaranan

Hi @nvergottini - I know this has taken long but do you know if you can try the PR branch or do I have to ask to publish to extensions site, first for you to test? If you do not mind @p1gp1g , can you also please confirm that the one/two entries does fix it?

jmmaranan avatar Oct 24 '23 23:10 jmmaranan

Hi @nvergottini - I know this has taken long but do you know if you can try the PR branch or do I have to ask to publish to extensions site, first for you to test? If you do not mind @p1gp1g , can you also please confirm that the one/two entries does fix it?

Unfortunately, I cannot test at the moment. I ended up reinstalling my laptop with Debian 12 for unrelated reasons. I tried installing the fix-firefox-pip branch, but it shows as outdated, so I cannot enable. I'm guessing because Debian 12 is using Gnome 43. I have Silverblue on my desktop, but I'm on vacation until next week, so I don't have access to it.

nvergottini avatar Oct 25 '23 03:10 nvergottini

The following rules works if firefox is in english. Unfortunately, these rules should be written for all available language. It would be way more efficient to introduce the not for this issue too. * (And some other app have too many different titles for non-main window)

{"wmClass": "firefox","wmTitle": "About Mozilla Firefox","mode": "float"},
{"wmClass": "firefox","wmTitle": "Picture-in-Picture","mode": "float"},
{"wmClass": "firefox","wmTitle": "Page Info","mode": "float"}

* I can open a PR for this.

BTW, is it possible to reload the config file without logging out/logging in ?

p1gp1g avatar Oct 25 '23 07:10 p1gp1g

This still isn't working for me. It works on Debian 12 with Gnome 43 (and Firefox ESR), but it isn't working for me on either Fedora 38 (Gnome 44) or Fedora 39 (Gnome 45) using the default Firefox install. Am I missing something?

nvergottini avatar Nov 07 '23 00:11 nvergottini

The latest updates are not in extensions site yet

jmmaranan avatar Nov 07 '23 01:11 jmmaranan

The latest updates are not in extensions site yet

Oh, I assumed it was because it was working for me on Debian 12 when I installed it from the extension site.

nvergottini avatar Nov 07 '23 02:11 nvergottini

Hi @nvergottini - my apologies, unfortunately the latest windows config is in the latest commits which is on GNOME 45- meaning unless you manually edit the file itself - it will not take effect. Someone proposed to make or expose the window floating toggle as a UI instead of tinkering with the config file. Hopefully someone can implement that.

jmmaranan avatar Nov 11 '23 00:11 jmmaranan

I am still having this issue, anyone else?

RazerPC avatar May 04 '24 21:05 RazerPC

I am still having this issue, anyone else?

It seems to be working for me on Gnome 46 (Fedora Silverblue 40).

nvergottini avatar May 08 '24 18:05 nvergottini

Not sure if i am missing something, but still PIP does not float by default on Firefox for me, i have to enable it each time manually

RazerPC avatar Sep 21 '24 10:09 RazerPC

Add this to your window.json, and restart your user session:

    { "wmClass": "firefox", "wmTitle": "!Mozilla Firefox", "mode": "float" },
    { "wmClass": "org.mozilla.firefox.desktop", "wmTitle": "!Mozilla Firefox", "mode": "float" },

p1gp1g avatar Sep 24 '24 13:09 p1gp1g

Add this to your window.json, and restart your user session:

    { "wmClass": "firefox", "wmTitle": "!Mozilla Firefox", "mode": "float" },
    { "wmClass": "org.mozilla.firefox.desktop", "wmTitle": "!Mozilla Firefox", "mode": "float" },

This seem to have caused for all FF windows to float, not PIP only

RazerPC avatar Sep 24 '24 14:09 RazerPC