mate-desktop / marco

MATE default window manager
https://mate-desktop.org
GNU General Public License v2.0
196 stars 87 forks source link

Window titles in mate-panel/tasklist (libwnck) show only " (as superuser)" #749

Closed insaner closed 1 year ago

insaner commented 1 year ago

Running an application as root (in my case kwrite) appends " (as superuser)" to the window title (so it shows "Untitled — Kwrite (as superuser)"). However, when viewing the entry in mate-panel, it removes everything else and shows only " (as superuser)" as the title.

Debugging and tracing calls showed that libwnck (which is how mate-panel handles these values) uses the _wnck_get_icon_name call to pull this from "_NET_WM_VISIBLE_ICON_NAME" (you can test by seeing the difference in the displayed title between test-tasklist and test-wnck). In the marco code this seems to be set in /src/core/window-props.c in set_title_text.

I have already written a simple patch that fixes the issue for me, and will be creating a pull request.

You can test by doing:

$ xprop WM_CLASS _NET_WM_NAME _NET_WM_VISIBLE_NAME _NET_WM_VISIBLE_ICON_NAME

(Then click on your superuser-launched window). With the problem it shows:

WM_CLASS(STRING) = "kwrite", "kwrite" _NET_WM_NAME(UTF8_STRING) = "Untitled — KWrite" _NET_WM_VISIBLE_NAME(UTF8_STRING) = "Untitled — KWrite (as superuser)" _NET_WM_VISIBLE_ICON_NAME(UTF8_STRING) = " (as superuser)"

Which instead should show (results from my patch):

WM_CLASS(STRING) = "kwrite", "kwrite" _NET_WM_NAME(UTF8_STRING) = "Untitled — KWrite" _NET_WM_VISIBLE_NAME(UTF8_STRING) = "Untitled — KWrite (as superuser)" _NET_WM_VISIBLE_ICON_NAME: not found.

If _NET_WM_VISIBLE_ICON_NAME is empty, mate-panel shows the correct title.

lukefromdc commented 1 year ago

I am not able to duplicate this, at least not with Caja or Pluma and MATE 1.27.0 from git master. Instead, I get the normal window name with "as superuser" appended but cut off in the mate-panel window list button. Might be a difference in libwnck version though, mine has some changes done locally for hidpi support and to apply my theming to the window menus

zhuyaliang commented 1 year ago

I can't duplicate the problem,Can you elaborate on the reproduction method

insaner commented 1 year ago

Hi. I think the issue might only arise in a combination of situations. In my case it happens 100% of the time when I launch kwrite as superuser. I tried nedit, nedit-ng, and gedit (none of which I use anymore), and those didn't seem to trigger it. I tried kcalc and that does trigger it. I'm guessing many (most?) kde apps do not set the _NET_WM_VISIBLE_ICON_NAME explicitly, unlike gnome apps, and this is the combination that leads to the problem showing up.

sunweaver commented 1 year ago

@lukefromdc @raveit65 Any reason, why this issue is still open? Fix seems to be applied.