QubesOS / qubes-issues

The Qubes OS Project issue tracker
https://www.qubes-os.org/doc/issue-tracking/
542 stars 48 forks source link

Set the window title in the GUI daemon #9554

Open 3hhh opened 2 weeks ago

3hhh commented 2 weeks ago

How to file a helpful issue

The problem you're addressing (if any)

Currently window titles are prefixed by the VM names by all window managers on their own. It would be more efficient to implement that in the GUI daemon only.

The solution you'd like

Implement VM name prefixing for window titles in the GUI daemon similar as the window icon is set by the GUI daemon.

The value to a user, and who that user might be

Shared secure code across window managers.

Easier implementation of features like #9553 in a central place.

Completion criteria checklist

(This section is for developer use only. Please do not modify it.)

alimirjamali commented 1 week ago

Currently window titles are prefixed by the VM names by all window managers on their own. It would be more efficient to implement that in the GUI daemon only.

I am not sure if the above is 100% correct. Looking at xside.c and handle_wmname procedure, it prefixes VM Name on some Window Managers. The comment in xside.h confirms it.

Moreover, sadly the GUID does not set WM_CLIENT_MACHINE XProperty. Which is more standard to _QUBES_VMNAME and could be recognized by wmctrl -l command. If it was set, the patch to XFCE could have used it. p.s. and we could get rid of getQubesVmName function in XFCE patch.

3hhh commented 1 week ago

Currently window titles are prefixed by the VM names by all window managers on their own. It would be more efficient to implement that in the GUI daemon only.

I am not sure if the above is 100% correct. Looking at xside.c and handle_wmname procedure, it prefixes VM Name on some Window Managers. The comment in xside.h confirms it.

Good find! It's even mentioned in man qubes-guid as -T option. So it's already implemented. However if one checks ps aux|grep qubes-guid, one can see that -T is not set by default for whatever reason.

So essentially my feature request becomes: "Please consider setting -T by default in qubes-guid."

Moreover, sadly the GUID does not set WM_CLIENT_MACHINE XProperty. Which is more standard to _QUBES_VMNAME and could be recognized by wmctrl -l command. If it was set, the patch to XFCE could have used it. p.s. and we could get rid of getQubesVmName function in XFCE patch.

WM_CLASS can be used, which is fairly standard. And with -T you could get rid of it, too (which was my initial point).

marmarek commented 1 week ago

Adding the prefix by qubes-guid is done in KDE. It used to be done on KDE with a patch too, mostly to make it in distinguished style (AFAIR VM name was in bold). This way it was even more visible what is the VM name, and even if something went wrong and the prefix would be skipped, the VM couldn't make its own prefix bold. This separate style wasn't carried over to Xfce implementation (mostly due to more limited API), but it may come back at one point.

As for using WM_CLIENT_MACHINE, we have considered that, but unfortunately it isn't very reliable - depending on window manager it is skipped sometimes, or hidden as the first thing if title doesn't fit on the screen. And also it's usually placed after the title which makes it harder to find and separate from the actual title.

alimirjamali commented 1 week ago

one can see that -T is not set by default for whatever reason.

It appears that it only used for KDE. Here.

WM_CLASS can be used, which is fairly standard.

WM_CLASS is set within the existing code. In xside.c and handle_wmclass function.