mate-desktop / mate-panel

MATE panel
https://mate-desktop.org
GNU General Public License v2.0
184 stars 115 forks source link

Skype icon starts tiling after panel size 29 #793

Closed jarrard closed 5 years ago

jarrard commented 6 years ago

skypematepanelissue

Expected behaviour Skype Icon to scale correctly or just a single icon to appear centered at its scale bracket size.

Actual behaviour The Skype icon starts to tile itself resulting in a 1 1/2 icon at panel size 29 and a double icon at panel size 41.

Steps to reproduce the behaviour Occurs when panel is set to size 29 or above.

MATE general version 1.20.1

Package version mate-panel-1.20.1-1

Linux Distribution Manjaro MATE x86_64

Link to downstream report of your Distribution unknown

mmishut commented 6 years ago

mate-panel Agree about a problem. In my case it occurs with panel size 22 and more.

Package: mate-panel (1.20.1-3ubuntu1)

Linux: Ubuntu MATE 18.04

muktupavels commented 6 years ago

My guess it might be skype bug, after skype update I see similar thing with gnome-panel... Is that only app or similar bug happens with other icons too?

jarrard commented 6 years ago

The icons are provided by mate-panel (or mate theme package) and not skype I believe as its part of the theme package. Also the issue affects any skype spin-off that uses those icons such as ghetto-skype.

valeryvdr commented 6 years ago

I am also affected, freshly installed Debian Stretch + Mate 1.18.0. Skype tray icon is tailing at panel size = 24

SuddenGunter commented 6 years ago

image Manjaro, Mate - similar issue

danieltomasz commented 6 years ago

Im on gnome panel and I have the same issue, using different icon set (for example from hardcode-tray) partly fixes it - the tiled icon is present only in "do not disturb mode"

vkotovv commented 6 years ago

I have a similar problem with Guake icon (and also Skype icon). As you can see, Guake icon on the screenshot (it it the 1st one) starts tiling also. Happened to me after Mate 1.18 -> 1.20.1 update (Ubuntu 16.04 -> 18.04).

selection_066

@muktupavels Looks like it affects not only Skype icon.

lukefromdc commented 6 years ago

By any chance does this happen with all apps that offer only small png icons and nothing scalable for the tray?

iLGunners commented 6 years ago

image

image

ander-san commented 6 years ago

missing Same here, upgraded from Ubuntu-MATE 16.04 to 18.04. Not only Skype has problems. For example, Dropbox only showed in tray when I start it using "dbus-launch dropbox start -i" Workarround for Skype: just start it with "export XDG_CURRENT_DESKTOP=Unity && skypeforlinux "

jarrard commented 6 years ago

That appears to work, cheers.

rilian-la-te commented 6 years ago

Yes, this force Skype to use SNI protocol, not XEmbed)

jarrard commented 6 years ago

Although I wasn't able to get that command working in autostart/startup applications so had to redirect it to a bash script instead. Shrug...

EDIT: It fixes the icon but on bootup has a shadow window appear which you need to open skype and close the window to remove. So a bit glitchy.

tambel commented 6 years ago

i know this is not a solution, but its fine on panel size - 19 :)

ander-san commented 6 years ago

i know this is not a solution, but its fine on panel size - 19 :)

it works, but is not a good idea for high resolutions (too small)

ander-san commented 6 years ago

Well, skype was updated today and the problem still occurs, so I found a good workarround for that:

1) Edit /usr/bin/skypeforlinux and find the line that starts with "nohup" comand, like: nohup "$SKYPE_PATH" --executed-from="$(pwd)" --pid=$$ "$@" > "$SKYPE_LOGS/skype-startup.log" 2>&1 &

2) Let it as bellow: XDG_CURRENT_DESKTOP=Unity nohup "$SKYPE_PATH" --executed-from="$(pwd)" --pid=$$ "$@" > "$SKYPE_LOGS/skype-startup.log" 2>&1 & XDG_CURRENT_DESKTOP=MATE 3) Pay-me a beer ;)

ander-san commented 5 years ago

printer system-config-printers does the same.

phocean commented 5 years ago

Not that the same issue happens with pcloud. The workaround does the trick, also, thanks!

I just edit each desktop file this way:

[Desktop Entry]
Name=pcloud
Comment=pCloud Drive Client built using electron and node.js. Distributed with A
ppImage.
Exec=env XDG_CURRENT_DESKTOP=Unity "/opt/pcloud" %U
ghost commented 5 years ago

Debian 9.5 x64 LXDE -- That "fix" is not working on my box :(

lukefromdc commented 5 years ago

Are these all QT apps? We've had lots of problems with these icons set by QT apps before

ghost commented 5 years ago

Setting panel height to 22 and icon size to 20 gets me a proper icon. Thinking it may be caused by a 16x16 icon not scaling as expected, but /usr/share/pixmaps/skypeforlinux.png is actually 256x256. Hm...

graywolf2 commented 5 years ago

Yes, XDG_CURRENT_DESKTOP=Unity fixes the icon problem. But with it another bug appeared: the left click (and double click) on skype icon does not show the main window. The right click shows the skype context menu normally in both cases.

The icon problem exists if the panel size is > 20. I use 22 size.

Fedora 28. Mate 1.20.3. mate-panel 1.20.3. Skype 8.33.0.41.

lukefromdc commented 5 years ago

That makes me wonder if skype(which I do not use) is using the desktop environment to set up icon size and override what is set for the tray and indicators as a whole?

underwit commented 5 years ago

bug ALT Linux Same problem with system-config-printer and network-manager-applet. Panel size not matter. mate-panel versions 1.20.3 and 1.12.2

lukefromdc commented 5 years ago

Audacious ships with two icons: a 48X24 and an svg icon. If I kill them both, drop in a 24x24 icon, and remake the icon cache this icon gets scaled, not tiled as I enlarge the panel

lukefromdc commented 5 years ago

problem CONFIRMED with system-config-printer icon

lukefromdc commented 5 years ago

I just found that using Inkscape to create a full set of scalable .svg icons for network-manager-applet makes them scale with the panel, now to try this for system-config-printer and see what happens

lukefromdc commented 5 years ago

OK, replacing the 24x24 png "notification-printer" icon in my icon theme stopped the tiling of that icon on larger panels, an issue occurring if the panel was much larger than 24 px but smaller than 48px where the next largest icon became available.

Question: does this happen in another panel such as XFCE's panel (whose tray does share a lot of code with mate-panel though)? This is a traditional tray icon, and that means the image displayed in the tray is one exported from the application's own instance of GtkStatusIcon, and thus not something we can fix in the tray at all. The problem you are having is most likely in Skype itself.

If so, there is a workaround: Find the default Skype icon, copy it to your desktop, open it in Inkscape, and "save as" back to the desktop. You get an SVG icon, either replace the skype icon with it (and redo this every time Skype updates, or drop it into your icon theme in the correct directory to be used instead of Skype's icon, so as an "extra" file (at least in Debian) your package manager won't remove it on updates. Having done the latter you will need to remake your icon cache for that theme if one is used.

graywolf2 commented 5 years ago

If so, there is a workaround: Find the default Skype icon, copy it to your desktop, open it in Inkscape, and "save as" back to the desktop. You get an SVG icon, either replace the skype icon with it (and redo this every time Skype updates.

Fedora 28. I tried to replace the following png files with their svg versions: /usr/share/icons/hicolor/16x16/apps/skypeforlinux.png /usr/share/icons/hicolor/32x32/apps/skypeforlinux.png /usr/share/pixmaps/skypeforlinux.png No success. The bug was not fixed.

I cannot understand what other png file is used for tray icon. I don't believe that it is 256x256 or larger. Maybe it is internal image resource in skype, not png. $ rpm -ql skypeforlinux | grep png /usr/share/icons/hicolor/1024x1024/apps/skypeforlinux.png /usr/share/icons/hicolor/16x16/apps/skypeforlinux.png /usr/share/icons/hicolor/256x256/apps/skypeforlinux.png /usr/share/icons/hicolor/32x32/apps/skypeforlinux.png /usr/share/icons/hicolor/512x512/apps/skypeforlinux.png /usr/share/pixmaps/skypeforlinux.png

lukefromdc commented 5 years ago

Since some of these icons are in hicolor you must run gtk-update-icon-cache -q -t -f /usr/share/icons/hicolor to update the icon cache or the new icons won't be used as they are not in the cache that is actually loaded.

It is also poossible that you have a skype icon somewhere in your theme that is being used instead of the provided icon. If so, that one too would need to change. I don't have Skype installed (no account there) so cannot test that application directly. Certainly something internal is possible but I have not looked at their code.

graywolf2 commented 5 years ago

$ gtk-update-icon-cache -q -t -f /usr/share/icons/hicolor gtk-update-icon-cache: Failed to open file /usr/share/icons/hicolor/.icon-theme.cache : Permission denied

$ sudo gtk-update-icon-cache -q -t -f /usr/share/icons/hicolor There was no error in the terminal but the bug was not fixed.

lukefromdc commented 5 years ago

OK, no further ideas on my part about that particular application. I am almost certain however that this is not a problem in mate-panel's tray at all, but rather that Skype itself is passing a bad icon window image to mate-panel.

This is because of how GtkStatusIcon https://developer.gnome.org/gtk3/stable/GtkStatusIcon.html https://specifications.freedesktop.org/systemtray-spec/systemtray-spec-0.3.html relies on Xembed to pass the contents of an icon window drawn by the application to the tray rather than showing a window containing that icon drawn by the application. The drawing of the icon is NOT controlled by the tray in which that status icon is "embedded" as the window there just passively receives what is being sent to it, and (I think) passes clicks on itself back to the application sending the icon window contents to it.

Since we cannot fix this in mate-panel (it has to be fixed in Skype and every other app with this problem), we should probably close this report.

ander-san commented 5 years ago

Well, skype was updated today and the problem still occurs, so I found a good workarround for that:

  1. Edit /usr/bin/skypeforlinux and find the line that starts with "nohup" comand, like: nohup "$SKYPE_PATH" --executed-from="$(pwd)" --pid=$$ "$@" > "$SKYPE_LOGS/skype-startup.log" 2>&1 &
  2. Let it as bellow: XDG_CURRENT_DESKTOP=Unity nohup "$SKYPE_PATH" --executed-from="$(pwd)" --pid=$$ "$@" > "$SKYPE_LOGS/skype-startup.log" 2>&1 & XDG_CURRENT_DESKTOP=MATE
  3. Pay-me a beer ;)

you guys after that can:

1) Try to remove libappindicator1 if it is installed (dropbox and other icons should be OK) 2) run the command chattr +i /usr/bin/skypeforlinux to prevent this file to be changed by an update.

Little bit disappointed with these annoying bugs.

lukefromdc commented 5 years ago

My guess is that Skype is using one or more GtkStatusIcon that used to work just fine (so no problems when this was GNOME 2 they were supporting) but now have become buggy. My advice to the Skype team would be to use SNI/indicator support whenever it is available(see https://github.com/mate-desktop/mate-panel/issues/793#issuecomment-419495666).

I saw a mention of use of another icon theme also fixing this. We don't ship any skype icons in mate-icon-themes, if you have a theme that works consider copying those icons into your normal theme. Your package manager won't remove them when updating that theme (at least not in Debian based distros), as they were not provided by it.

Closing as corrupted GtkStatusIcon window contents sent to the tray by another application can't be fixed on this end. The real problem might be that GNOME is not maintaining GtkStatusIcon, as they don't use it and it is removed from the upcoming GTK4. I myself had to drop a proposed microphone volume slider for mate-volume-control-applet because in trying to use a GtkStatusIcon feature necessary for that job I got too many cut-off, corrupted icons.

muktupavels commented 5 years ago

Well closing bug based on your guess is not nice...

If you think that it is GtkStatusIcon bug then create simple reproducer and report that to gtk. Or even better - find problem in gtk and submit fix for it.

lukefromdc commented 5 years ago

There is no way we can fix this here. To write a reproducer for this exceeds my skill, but you already have one in GNOME: system-config-printer-applet.

I had trouble creating and holding an account with GNOME's former Bugzilla, as my browser security settings (extreme locked down) do not work with it. In general I don't like to have more and more online accounts and have given up on filing any kind or bug reports or PR's against GNOME due to these issues.

This can be reopened if anyone finds a possible fix for it on the tray side of GtkStatusIcon, but I have been chasing GtkStatusIcon issues for over a year in the tray with little result other than improving the force-redraw code to catch the case of applications that initially send a corrupted window but then get it right.

@monsta, @raveit65 what do you think? Close this again, or do you think we can fix it? We would need a reproducer that does not involve installing a closed-source app, which is why I did not keep my icon fix for system-config-printer-applet but left it able to tile.

raveit65 commented 5 years ago

I don't use skype and isn't skype not closed-source software? I don't see it in official fedora repos, only at rpmfusion which is the place for nonfree software. Did any one filed out a report against skype and asked the code-writer of this applet for help? I am still wondering that people thinks that gtk+ will ever fixed issues with deprecated GtkStatusIcon.

lukefromdc commented 5 years ago

Skype being closed is why I cannot install it for testing on machines from which closed apps are forbidden for security reasons.

jarrard commented 5 years ago

You can test one of the other apps that has this issue which is open source ( a few examples given above if you read )

I don't use Mate anymore because it just has too many little glitches and issues like this one.

lukefromdc commented 5 years ago

We are a small team and the undelying libraries have changed a hell of a lot since GNOME 2.32 back in fall 2010.

On 12/11/2018 at 4:44 PM, "jarrard" notifications@github.com wrote:

You can test one of the other apps that has this issue which is open source ( a few examples given above if you read )

I don't use Mate anymore because it just has too many little glitches and issues like this one.

-- You are receiving this because you modified the open/close state. Reply to this email directly or view it on GitHub: https://github.com/mate-desktop/mate-panel/issues/793#issuecomment- 446373662

raveit65 commented 5 years ago

About icons from rpm package which you can download from skype (microsoft) https://www.skype.com/de/get-skype/ The only icon from the rpm which will be installed in hicolor dir, is for the desktop file for starting skype. That means the icon from systray is one internal from closed-source skype binary. No chance to debug this.

You can test one of the other apps that has this issue which is open source ( a few examples given above if you read )

The icon from system-config-printer displays well here with fedora Linux and gtk+-3.24.1. The screenshot from https://github.com/mate-desktop/mate-panel/issues/793#issuecomment-444457838 with system-config-printer is probably another problem caused by gtk+ itself and fixed with 3.24.0. .....i tried hard but beside from this one i see only screenshots with skype here.

.....I don't use Mate anymore because it just has too many little glitches and issues like this one.

Closing this as origin reporter don't need help any more.

muktupavels commented 5 years ago

I am still wondering that people thinks that gtk+ will ever fixed issues with deprecated GtkStatusIcon.

Most GTK if not all developers use desktop environments that does not have tray icons. So even if there is bug on GTK side how would they know it? Also I think development focus has moved to GTK 4...

Closing this as origin reporter don't need help any more.

What about others? Do you want that each user with same problem reports new bug?

I understand that you are small team, but you have signed up to maintain whole desktop... What did you expect? 1 hour work at weekend at most? You are developers here, most users are not... Even if bug is not on your side, you should help users.

New Skype (skypeforlinux) is electron app, right? Or something else? I know that old client was QT app, but new one is not QT. This bug has comment that pcloud also has same problem and it is also electron app... That could indicate that problem has with electron.

I hope I wont reveal any secret, but electron is available here (and not closed source): https://github.com/electron/electron

GitHub also has search if one don't want to clone the repository and or read all files. By quick search I found following files that could be related to status icons:

Header files does not look interesting. Same with tray_icon.cc... Looking at tray_icon_gtk.cc is also boring, only "interesting" thing is CreateLinuxStatusIcon that is not available in/from electron repository. Electron uses chromium, lets try or luck there...

Now things gets interesting because there could be two paths. AppIndicator path or GtkStatusIcon path... Considering that I get old try icon on Ubuntu 19.04 I would say that AppIndicator path is broken or apps use electron version before this commit: https://github.com/chromium/chromium/commit/6e40caade1e6ae35c34127ca6b4fda7a9eaf3e38

Good that it is removed because it is wrong. First appindicator has fallback path to GtkStatusIcon if desktop env has no Status Notifier support. That check just limited functionality and because of that under GNOME-Flashback and/or MATE desktops apps always used GtkStatusIcon...

And if one wants to check Status Notifier availability it should be always checked by checking that org.kde.StatusNotifierWatcher (if I remember correctly) is available + ask watcher if there is any host that will be able to show items...

https://github.com/chromium/chromium/commit/7e85c0922ce2aa01c8e2fad91afd18eb000019b7 Not sure, but this might indicate that appindicator path has been broken?! Bet this bug has comments that XDG_CURRENT_DESKTOP=Unity trick "works". Just tried, but Skype icon did not look too good... Looked too small.

Tried status notifier applet (gnome-panel) and Skype icon was upscaled, but that is by design. Status Notifier spec is designed/written in a way that you are allowed to throw any shit and hope that implementations will be able to show your shit... There is no way to communicate needed icon size in that stupid spec. In this case Skype sets some small icon.

Anyway I am bit lost at this point. I think best thing would be to get some electron app with tray icon that using electron from master and check / test following cases:

More related files in chromium for 3rd case:

I see same problem with guake. As I said I am on Ubuntu 19.04 and gtk version currently is 3.24.1-1ubuntu2.

Guake use GTK so in the end bug reported here has nothing to do with electron and/or chromium and telling Skype is proprietary does not help... Skype does not directly depend gtk so I am sure they don't care. MATE devs don't care either... What should users do? I am sure regular skype user have no clue what is gtk and that skype could use...

Now I think that it is GTK bug and there is one common thing between gtk and chromium! They both use gtk_status_icon_set_from_pixbuf. Guake does that indirectly by using gtk_status_icon_set_from_file. Both use small icons...

https://developer.gnome.org/gtk3/stable/GtkStatusIcon.html#GtkStatusIcon-size-changed Status icon have signal that is emitted when icon is needed at different size. Nobody cares about. Status notifier has gone if farther and does not offer such option. Good luck with 20x20px icon on HiDPI monitors especially if one proffers bigger panel with bigger icons on it then default.

Hint to to those developers who provides status icons. Use gtk_status_icon_set_from_icon_name or gtk_status_icon_set_from_gicon if you can, otherwise connect to size-changed signal and update your icon with requested size!

https://gitlab.gnome.org/GNOME/gtk/blob/gtk-3-24/gtk/deprecated/gtkstatusicon.c#L1392 This could be entry to search for gtk bug...

Here simple reproducer:

/*
 * compile with:
 * gcc -Wall `pkg-config --cflags gtk+-3.0` -o tray-icon tray-icon.c `pkg-config --libs gtk+-3.0`
 * ./tray-icon
 */

#include <gtk/gtk.h>

static void
icon_1_size_changed_cb (GtkStatusIcon *status_icon,
                        gint           size,
                        gpointer       user_data)
{
  g_warning ("icon_1_size_changed_cb: %d, but I will be fine!", size);
}

static void
icon_2_size_changed_cb (GtkStatusIcon *status_icon,
                        gint           size,
                        gpointer       user_data)
{
  g_warning ("icon_2_size_changed_cb: %d, I beg you, give me new pixbuf!", size);
}

static void
icon_3_size_changed_cb (GtkStatusIcon *status_icon,
                        gint           size,
                        gpointer       user_data)
{
  g_warning ("icon_3_size_changed_cb: %d, but I will be fine!", size);
}

int
main (void)
{
  GtkStatusIcon *icon1;
  GtkStatusIcon *icon2;
  GtkStatusIcon *icon3;

  gtk_init (NULL, NULL);

  icon1 = gtk_status_icon_new ();
  gtk_status_icon_set_from_icon_name (icon1, "system-shutdown");
  g_signal_connect (icon1, "size-changed", G_CALLBACK (icon_1_size_changed_cb), NULL);

  icon2 = gtk_status_icon_new ();
  gtk_status_icon_set_from_file (icon2, "/usr/share/icons/hicolor/22x22/actions/system-shutdown.png");
  g_signal_connect (icon1, "size-changed", G_CALLBACK (icon_2_size_changed_cb), NULL);

  icon3 = gtk_status_icon_new ();
  gtk_status_icon_set_from_file (icon3, "/usr/share/icons/hicolor/scalable/actions/system-shutdown.svg");
  g_signal_connect (icon1, "size-changed", G_CALLBACK (icon_3_size_changed_cb), NULL);

  gtk_main ();

  return EXIT_SUCCESS;
}

I did choose wrong wrong icon, it did not have big png version to see what happens size is big enough or bigger, but I would guess then there is no problem.

https://gitlab.gnome.org/GNOME/gtk/blob/gtk-3-24/gtk/deprecated/gtkstatusicon.c#L1416 Pixbuf should be scaled...

https://gitlab.gnome.org/GNOME/gtk/blob/gtk-3-24/gtk/gtkiconhelper.c#L340 Lets check what happens when force_scale_pixbuf is set to TRUE. Scaling happens only if pixbuf is bigger then needed size. Well I guess that is expected... How wants to see big ugly upscaled icon?

https://gitlab.gnome.org/GNOME/gtk/blob/gtk-3-24/gtk/deprecated/gtkstatusicon.c#L1420 https://gitlab.gnome.org/GNOME/gtk/blob/gtk-3-24/gtk/gtkiconhelper.c#L519 https://gitlab.gnome.org/GNOME/gtk/blob/gtk-3-24/gtk/gtkiconhelper.c#L377 Looking at code it seems that surface will bet at pixbuf size.

https://gitlab.gnome.org/GNOME/gtk/blob/gtk-3-24/gtk/deprecated/gtkstatusicon.c#L1423 Resulting pixbuf that is set as GtkImage is created here. So I guess we should look what happens what it does when we request pixbuf that is bigger then original surface.

https://gitlab.gnome.org/GNOME/gtk/blob/gtk-3-24/gdk/gdkpixbuf-drawable.c#L238 Read documentation it starts to feel that we might have on right track. "Width in pixels of region to get", note that original surface is smaller.

Documentation does not mention anything about surface being smaller then requested size. My blind guess would be that surface must be bigger or equal to requested size. If so then documentation should be updated and some extra checks should be added there that would indicate programmer errors...

Anyway proper fix depends on discussion with GTK developers... Easiest fix would be to get width and height from surface returned by gtk_icon_helper_load_surface and use with gdk_pixbuf_get_from_surface. Tested and it works! Bet real fix might involve fixing gdk_pixbuf_get_from_surface...

Why did I spend my time on this...

raveit65 commented 5 years ago

@muktupavels I am waiting for a PR from you. Re-open again

lukefromdc commented 5 years ago

I will have to have a look at mate-media and mate-power-manager for these, as mate-power-manager still cuts icons on my laptop some of the time and mate-volume-control-applet used to until my redraw fix.

muktupavels commented 5 years ago

https://gitlab.gnome.org/GNOME/gtk/merge_requests/451

I don't know if that will be final fix... But my quick tests shows that it works. Now everyone owes me a beer. :P

But that is partial fix... Apps really should be ready to provide icons at correct size. In GtkStatusIcon case it means to use size property and/or size-changed signal. So theoretically this still cold be forwarded to electron/chromium...

P.S. I don't know if that was best way to find problem, but if you followed my comment than you will see that there was no magic involved...

lukefromdc commented 5 years ago

I will test that here, as I normally build GTK 3 from source anyway

muktupavels commented 5 years ago

Are you able to reproduce problem? If so why did you close bug... If not what are you going to test?

lukefromdc commented 5 years ago

I was able to get the system-config-printer-applet icon to tile. The reason for closing this report was that problems with GtkStatusIcon usage in an application can't be fixed on the tray end.

lukefromdc commented 5 years ago

OK, I have a successful build and install of GTK 3.24 with the PR commits (both that I saw) applied and it stop the system-config-printer-applet icon from tiling as the panel is enlarged. I will also try it on my laptop to see if the battery icon stops getting cut off

I cannot install skype for testing as this is an encrypted machine on which no closed apps can be installed for security reasons, but ideally someone who has skype installed would test it (maybe the skype devs?).

muktupavels commented 5 years ago

But tray problems are your problems... :P Good to hear that it helps. :)