Open Bug 397251 Opened 17 years ago Updated 2 years ago

firefox doesn't set WM_WINDOW_ROLE property

Categories

(Core :: Widget: Gtk, enhancement, P3)

x86
Linux
enhancement

Tracking

()

ASSIGNED

People

(Reporter: mattias.fliesberg, Assigned: stransky)

References

Details

User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.6) Gecko/20070825 Firefox/2.0.0.6 Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.6) Gecko/20070825 Firefox/2.0.0.6 I would like firefox to set WM_WINDOW_ROLE property so I can target individual windows in my wm (ion3, ~/.ion3/cfg_kludges.lua) Reproducible: Always Steps to Reproduce: 1. 2. 3. inty@helios ~ % xprop WM_WINDOW_ROLE WM_WINDOW_ROLE: not found.
Hereby I'm confirming this _longstanding_ bug! Reproducible: Always Steps to Reproduce: 1. Start firefox from the CLI like this: $ firefox --name="not-browser" 2. Run the following, also from the CLI: $ xprop WM_WINDOW_ROLE 3. Click on the firefox window Expected Output: WM_WINDOW_ROLE(STRING) = "not-browser" Acutal Output: WM_WINDOW_ROLE(STRING) = "browser" I'd be really happy if someone could invest some time to implement this, as far as I know, this should be a low hanging Fruit, since GDK will do all the work, the only thing needed is calling gtk_init. http://manpages.ubuntu.com/manpages/precise/man7/gtk-options.7.html I'd do it myself, but Firefox is pretty big Project and my C++ experience is rather small, so it'd probably take some days just to get something running on my own. This is the only thing keeping me from using Firefox as default Browser. Currently I'm using Chromium, since its supporting this and differntiating different Instances of my Browser on a WM level is pretty important for my Workflow. In case you just don't see the usage here, please don't just close this as WONTFIX as it was done multiple times before with similar issues (https://bugzilla.mozilla.org/show_bug.cgi?id=496653, https://bugzilla.mozilla.org/show_bug.cgi?id=496653), at least give me some hints where to find FF's GTK initialization code and how to start, then I'll try doing it myself.
Just as a note, it's possible to change the property by running $ xprop -f WM_WINDOW_ROLE 8s -set WM_WINDOW_ROLE not-browser Where "not-browser" is the desired window role Then click on the desired FF window, now the role of that window will be updated to "not-browser". But that's still not sufficent for my need, since I need this to be scriptable and clicking on the window is not an option. xprop has the -id flag that could be used, and I didn't find an easy way to query that id. There is xwininfo which provieds that id, but also requires clicking on the desired window... I'll see if I'm able to find at least a workaround for this tomorrow. P.S: Sorry for making this much nois on such an old issue, but I'd really like to resolve this in some way and maybe my experience will help others so I'd like to document it here, since this is one of the first results when googling for firefox and WM_WINDOW_ROLE.
Not a shell integration bug. Likely would need to be handled by the widget code.
Component: Shell Integration → Widget: Win32
Product: Firefox → Core
Component: Widget: Win32 → Widget: Gtk
Priority: -- → P3

I would like firefox to set WM_WINDOW_ROLE to a special value for pop-up windows, so that I can target those with rules in i3.

Looks like we can use gtk_window_set_role() for it.

nsWindow::SetWindowClass() is used to set the class which is called by nsXULWindow::SyncAttributesToWidget(), WINDOWTYPE_ATTRIBUTE is used.
Unfortunately the WINDOWTYPE_ATTRIBUTE is set only for some windows (some popups and so on) and not for the toplevel window.

For instance PIP player uses that:
https://hg.mozilla.org/integration/autoland/file/969b3828a301038c57540d8bffb51539132d393c/toolkit/components/pictureinpicture/PictureInPicture.jsm

Assignee: nobody → stransky
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true

(In reply to Thayne from comment #5)

I would like firefox to set WM_WINDOW_ROLE to a special value for pop-up windows, so that I can target those with rules in i3.

Do you mean all firefox popups should have the same role or do you want a different role for different popups?

Flags: needinfo?(thayne)

The same role for all popups.

Flags: needinfo?(thayne)

I'm trying out sway (wayland equivalent of i3) and realized that setting WM_WINDOW_ROLE will not fix this problem in wayland. Unfortunately I don't know of a good solution for this problem in wayland/sway, since afaik, there isn't an equivalent of WM_WINDOW_ROLE in xdg-shell.

See Also: → 1720694
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.