Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Window List icons fail to show on Wayland #1436

Open
DMJC opened this issue Mar 5, 2024 · 29 comments
Open

Window List icons fail to show on Wayland #1436

DMJC opened this issue Mar 5, 2024 · 29 comments

Comments

@DMJC
Copy link

DMJC commented Mar 5, 2024

Expected behaviour

Window List Buttons should display icon images

Actual behaviour

Generic broken image is shown instead, image below
image
Images load/work fine on X11 with the same executable.

Steps to reproduce the behaviour

Run mate-panel on wayland.

MATE general version

1.28

Package version

1.28 (built using debuild)

Linux Distribution

Debian Trixie 13

@lukefromdc
Copy link
Member

lukefromdc commented Mar 6, 2024 via email

@DMJC
Copy link
Author

DMJC commented Mar 6, 2024 via email

@lukefromdc
Copy link
Member

lukefromdc commented Mar 6, 2024 via email

@lukefromdc
Copy link
Member

lukefromdc commented Mar 6, 2024 via email

@DMJC
Copy link
Author

DMJC commented Mar 6, 2024 via email

@lukefromdc
Copy link
Member

lukefromdc commented Mar 6, 2024 via email

@DMJC
Copy link
Author

DMJC commented Mar 6, 2024

Here is a copy of the entire build log. The GTK3 version is 3.24.41.
mate-panel_1.28.0-1_amd64.txt. Apologies for being a pain on this. My understanding of debuild is that it's just automating the autogen/configure/make/packaging stages. From viewing the logs no errors have been thrown, just some warnings about deprecations.

@lukefromdc
Copy link
Member

That tells me the build itself went fine. Can you unpack the .deb and tell me where it installed the mate-panel binary to? The only thing I can imagine here is that it's looking for the icons somewhere other than where they are installed.

I won't be able to debug the automated Debian build itself if this is the problem because I have no experience working with it. Never have I been able to build that way from modified source. The build log didn't tell me much, but any clues could be buried in that much text

@DMJC
Copy link
Author

DMJC commented Mar 6, 2024 via email

@lukefromdc
Copy link
Member

That's the same places my mate-panel files install to, and I am out of ideas as I cannot duplicate this. Only thing I can suggest is (as I said before), removing your build packages and testing an install directly from make install using these build options which match my own exactly:

./autogen.sh  --with-in-process-applets=wncklet,clock,fish,notification-area --prefix=/usr libdir=/usr/lib/x86_64-linux-gnu --sysconfdir=/etc --enable-shared=yes --enable-static=no --disable-maintainer-mode

make

sudo make install

If that works, it's something in your Debian build, if not I am out of ideas. What Debian version are you using? I am on unstable with no way to test anything else

@lukefromdc
Copy link
Member

lukefromdc commented Mar 7, 2024 via email

@lukefromdc
Copy link
Member

lukefromdc commented Mar 7, 2024

The window list icons are set in applets/wncklet/wayland-backend.c under wayland, in x11 libwnck sets them so this is completely different code, which BTW predates my own work with MATE on wayland, has been out a while, and I've never seen it fail except in your case.

In the function below we set the real icon name in line 308:


static void
foreign_toplevel_handle_app_id (void *data,
				struct zwlr_foreign_toplevel_handle_v1 *toplevel,
				const char *app_id)
{
	ToplevelTask *task = data;

	gchar *app_id_lower = g_utf8_strdown (app_id, -1);
	gchar *desktop_app_id = g_strdup_printf ("%s.desktop", app_id_lower);
	GDesktopAppInfo *app_info = g_desktop_app_info_new (desktop_app_id);

	if (app_info) {
		GIcon *icon = g_app_info_get_icon (G_APP_INFO (app_info));
		if (icon) {
			gtk_image_set_from_gicon (GTK_IMAGE (task->icon), icon, GTK_ICON_SIZE_MENU);
			goto cleanup;
		}
	}
	gtk_image_set_from_icon_name (GTK_IMAGE (task->icon), app_id_lower, GTK_ICON_SIZE_MENU);

cleanup:
	if (app_info) {
		g_object_unref (G_OBJECT (app_info));
	}
	g_free (app_id_lower);
	g_free (desktop_app_id);
}

If this fails the default icon was set in the code below in line 555, as we set the window button up before filling it with the real icon and window name


static ToplevelTask *
toplevel_task_new (TasklistManager *tasklist, struct zwlr_foreign_toplevel_handle_v1 *toplevel)
{
	ToplevelTask *task = g_new0 (ToplevelTask, 1);
	GtkWidget *button;
	GtkOrientation orient;

	buttons = buttons + 1;
	orient = gtk_orientable_get_orientation (GTK_ORIENTABLE (tasklist->outer_box));
	task->button = gtk_button_new ();
	g_signal_connect (task->button, "clicked", G_CALLBACK (toplevel_task_handle_clicked), task);

	task->icon = gtk_image_new_from_icon_name ("unknown", icon_size);

@DMJC
Copy link
Author

DMJC commented Mar 7, 2024

I am on debian 13 Trixie. The next release after Bookworm.

@DMJC
Copy link
Author

DMJC commented Mar 7, 2024

Interesting, whatever it is, manually rebuilding/reinstalling mate-panel didn't fix it. I tried both rebuilding the package and building from the tarball source.

@lukefromdc
Copy link
Member

No idea what is different but the icons ALWAYS show up for me. Someone else who can reproduce this may have to work on it.

@mark-herbert42
Copy link

Have same story. I do have icons - but all icons look the same, Just common useless icon-icon,not application specific. But it is loaded - and if I change icon theme in control center the icon changes. But it is still same icon for all apps.

@lukefromdc
Copy link
Member

lukefromdc commented Jun 19, 2024 via email

@mark-herbert42
Copy link

The strange thing that it was working ok for me too. I am on gentoo - so it is rolling distro and I do have wayfire updated to git snapshot, so I did not notice at which point that happened and icons disappeared. I suggest to wait till wayfire 0.9 which is coming soon and allign again then.

@mark-herbert42
Copy link

Funny things happen. I have been running my laptop for a while, some suspens-hibernates, many apps opened and closed. And - opening app and get icon painted well. Actually - new firefox window with alternative profile. And one of the libreoffice documents - icon is OK, The rest icons - crap. So the current code is capable of retrieving the icons but somehow it does not always do it.

The other point I noticed - battery charge monitor. This thing refresh data in a very strange way. It can do it OK - or hang for a couple of hours showing the same %. When you open a properties dialog - it force-triggers refresh. So something is not OK in the panel internals , but in a very difficult way.

@lukefromdc
Copy link
Member

I'm wondering if the difference is an older version of some underlying library such as GTK3 or glib or even an older compositor version, note that I am on Debian Unstable with locally built GTK3 and Glib usually pretty recent

@DMJC
Copy link
Author

DMJC commented Sep 3, 2024

I think the issue might be something underlying. I just today rebuilt everything by downloading the package tarballs and running autogen.sh --prefix=/usr; make; make install; (adding things like the in process flags for applets). I was able to get the panel up with icons, but I broke it when tinkering with some other component. Definitely some sort of packaging issue in Debian.

@lukefromdc
Copy link
Member

I have literally never used Debian's provided packages for MATE. This is because as one of the devs going back to a lot of GTK2->GTK3 transition bugfixes I have always locally compiled all of my MATE packages. I also package them differently than Debian does, one source package to one built package as I find that much simpler.

@DMJC
Copy link
Author

DMJC commented Sep 21, 2024

The cause of this isn't Debian or the packaging, I've determined it is something to do with custom menus/icons. If I create a new user profile the icons display correctly, but in my user account the icons are failing to load/draw.

@DMJC
Copy link
Author

DMJC commented Oct 3, 2024

I've found the cause! It's Wayfire. Under [Workarounds] in wayfire.ini you must set app_id_mode = stock if you set app_id_mode = full it breaks the icons in Mate-Panel.

@lukefromdc
Copy link
Member

I just confirmed the app_id_mode issue with this, note that I had to restart wayfire to make the change effective on my system,

Will add app_id_mode = stock to the session's default wayland.ini file

@DMJC
Copy link
Author

DMJC commented Oct 3, 2024

This is the Wayfire documentation, it sounds like this is a fix to work around a limitation of Wayland regarding App IDs. "In contrast to X, in wayland clients like taskbars, docks, etc. can't just query the icon of a window. They need to obtain it by using some heuristics involving the app-id. However, in GTK3 there is a bug where the application sometimes reports the wrong app-id. There is a custom protocol(gtk-shell1) which can be used to get the correct app-id. The situation will get better in GTK4 where the bug is fixed, but in the meantime we somehow need to supply the dock/taskmanager with both app-ids (the potentially wrong one and the potentially missing one from gtk-shell1). This isn't possible with the regular protocols, that's why wayfire and wf-dock use a custom format (when app_id_mode=full) so that both app-ids can be sent at the same time. This would unfortunately break clients that are unaware of this hack. That's why it's up to the user of Wayfire to select whichever mode works best for them, depending on what clients they use." I can confirm that this affects Wireshark. When I have the stock mode selected, my other icons are drawing normally, but Wireshark where I have a named file open draws with the broken icon. GIMP 2.10 is also affected.
image

@lukefromdc
Copy link
Member

lukefromdc commented Oct 4, 2024 via email

@lukefromdc
Copy link
Member

lukefromdc commented Oct 4, 2024 via email

@lukefromdc
Copy link
Member

Documented this in README.md as part of
mate-desktop/mate-wayland-session@f88796c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants