zaps166 / QMPlay2

QMPlay2 is a video and audio player which can play most formats and codecs.
GNU Lesser General Public License v3.0
841 stars 175 forks source link

Not use system icon theme for app icon #30

Closed varlesh closed 8 years ago

varlesh commented 8 years ago

On Plasma 5 with widget task manager QMPlay2 use its icon (when player run): screenshot_20160622_003127 But if player close - use system app icon theme: screenshot_20160622_003105

I'm add option StartupWMClass="QMPlay2", "QMPlay2" on desktop file, but this not working :(

zaps166 commented 8 years ago

I don't know. I can try on Plasma 5 later (Arch Linux), but I don't know how does it work (I'm using Mate). What is this? Is it an app launcher or system tray?

varlesh commented 8 years ago

This panel launcher "tasks widget (icon only)". Maybe this icon on binary or program not like SVG. You can test this with icon: https://raw.githubusercontent.com/PapirusDevelopmentTeam/papirus-icon-theme-kde/0d2972a72e7bc02437475bb16fdf9be1154a5fac/papirus/48x48/apps/QMPlay2.svg

zaps166 commented 8 years ago

Maybe just export it in Inkscape as PNG (e.g. 128x128) and replace the icon: /usr/share/icons/hicolor/128x128/apps/QMPlay2.png ?

varlesh commented 8 years ago

By the by this symlink /usr/share/icons/hicolor/128x128/apps/QMPlay2.png > ../../../QMPlay2.png

zaps166 commented 8 years ago

sudo rm /usr/share/icons/hicolor/128x128/apps/QMPlay2.png sudo rm /usr/share/icons/QMPlay2.png

And then just paste your new PNG icon here (/usr/share/icons/hicolor/128x128/apps) or maybe SVG will also work.

Which distribution do you use? If Arch Linux you can currently switch to qmplay2-git - it doesn't create the symlink :)

varlesh commented 8 years ago

This not working (also i clear cache icon and plasma): screenshot_20160622_011325

i'm use stable version on Manjaro KDE

varlesh commented 8 years ago

Ok, i'm compile git-version from AUR and check this

zaps166 commented 8 years ago

I don't know if deleting cache doesn't help... Did you restart plasma? This is QMPlay2 independent...

varlesh commented 8 years ago

Yes i'm delete cache and restart plasma:

rm -rf ~/.cache/plasm*
killall plasmashell
varlesh commented 8 years ago

It's strange hm... Git-version: screenshot_20160622_013221

varlesh commented 8 years ago

use xorg icon

zaps166 commented 8 years ago

Check whether /usr/share/icons/QMPlay2.png does not exists. Check whether /usr/share/icons/hicolor/128x128/apps/QMPlay2.png exists.

and check the icon name in *.desktop files.

Delete caches, restart plasma...

varlesh commented 8 years ago

Player closed - use system icon screenshot_20160622_013413

zaps166 commented 8 years ago

Maybe there is another problem - does plasma update the icon from application icon?

varlesh commented 8 years ago

/usr/share/icons/QMPlay2.png does not exists - confirm this /usr/share/icons/hicolor/128x128/apps/QMPlay2.png exists - confirm this. Desktop:

[Desktop Entry]
Exec=QMPlay2 %F
Icon=QMPlay2
Name=QMPlay2
StartupNotify=false
Type=Application
Categories=Qt;AudioVideo;Player;Audio;Video;
MimeType=video/mp4;video/mpeg;video/ogg;video/quicktime;video/x-msvideo;video/x-flv;application/x-shockwave-flash;application/vnd.rn-realmedia;video/vnd.rn-realvideo;video/3gpp;video/3gpp2;video/dv;video/webm;video/x-matroska;application/x-matroska;video/x-ms-asf;video/x-ms-wmv;video/x-ogm+ogg;video/x-theora+ogg;video/mp2t;audio/x-ape;audio/mp4;audio/AMR;audio/aac;audio/webm;audio/x-matroska;audio/ac3;audio/flac;audio/mp2;audio/ogg;audio/x-flac+ogg;audio/x-aiff;audio/x-wav;audio/x-vorbis+ogg;audio/x-tta;audio/x-wavpack;audio/x-musepack;audio/x-ms-wma;audio/x-ms-asx;audio/x-mod;audio/x-s3m;audio/x-stm;audio/x-xi;audio/x-xm;audio/x-it;audio/mpeg;audio/x-mpegurl;audio/x-scpls;audio/prs.sid;audio/x-j2b;audio/x-sfx;audio/x-umx;audio/x-gme;video/x-bink;

Now del cache and restart PC and check

zaps166 commented 8 years ago

I think that Plasma5 just loads the application/window icon instead of system icon if QMPlay2 is open.

zaps166 commented 8 years ago

I think that this line: https://github.com/zaps166/QMPlay2/blob/42c5d1c4b045f6945c9082fcf614cb484210bc06/src/gui/Main.cpp#L570 causes the problem. If yo really want to use other icon then I can try to load the system icon in this place.

varlesh commented 8 years ago

For example, my friend programmer and use this variant: Maybe help this :)

setWindowIcon(QIcon::fromTheme("krudio",QIcon(path+"krudio.svg")));//иконка окна
    if(save){//сохраняем изменения в базу
        QString str;
        QSqlQuery a_query;
        bool b;
        //Вставить значения
        QString str_insert = "UPDATE "+tableSettingName+" SET value = %1 WHERE setting ='%2';";
        str = str_insert.arg(colorNumb).arg("color");
        b = a_query.exec(str);
        if (!b) {qDebug() << "Данные не сохнаняются";}
    }
}
varlesh commented 8 years ago

restart pc and clear cache not solved problem

varlesh commented 8 years ago

Use system icon (if available) or not available use fallback icon from hicolor or another method.

zaps166 commented 8 years ago

Ok, I'll try :)

zaps166 commented 8 years ago

Please recompile & test :)

varlesh commented 8 years ago

ok

varlesh commented 8 years ago

Not working - use xorg icon :(

varlesh commented 8 years ago

screenshot_20160622_022113

zaps166 commented 8 years ago

Hmm, ok, switching to Plasma 5 (please wait)...

varlesh commented 8 years ago

Ok. I'm clear all cache and icons too, restart plasma, convert png to svg and copy to system icons folder... but always show xorg icon

zaps166 commented 8 years ago

No problems (tried with CMake icon :smiley:)... Try to remove rm ~/.cache/icon-cache.kcache or maybe all files from cache directory and then restart Plasma. qmplay2-plasma5-with-cmake-icon

varlesh commented 8 years ago

delete all ~/.cache but not solved. convert svg to png (VLC icon), restart plasma. Please see on /usr/share/applications and hicolor vlc icon, but on launcher xorg screenshot_20160622_024651

zaps166 commented 8 years ago

And what if you close QMPlay2? Still Xorg icon?

varlesh commented 8 years ago

No, close - use system icon (VLC now)

zaps166 commented 8 years ago

I can't reproduce. Everything is OK on my Plasma5 and on Mate. What if you do: sudo ln -s /usr/share/icons/hicolor/128x128/apps/QMPlay2.png /usr/share/icons/QMPlay2.png? Maybe it still remembers the old icon location /usr/share/icons/QMPlay2.png and tries to load non-existing file at runtime? Maybe it has another cache somewhere else?

varlesh commented 8 years ago

I convert vlc.svg to vlc.png on gimp. Moved new QMPlay2.png to /usr/share/icons/breeze/apps/48/ and to /usr/share/icons/hicolor/128x128/apps/ On dolphin and KMenu show VLC icon, also if touch player icon on panel - show VLC icon too (player closed). Bur run player and show Xorg icon on panel

varlesh commented 8 years ago

screenshot_20160622_030629 screenshot_20160622_030618

zaps166 commented 8 years ago

What icon do you have in tray (expand it, the indicator on the left of the temperature) if player is running? What if you copy/move the QMPlay2.png to /usr/share/icons ?

varlesh commented 8 years ago

on systemtray use vlc icon screenshot_20160622_031053

zaps166 commented 8 years ago

The system tray icon is exactly the same icon as on taskbar (see https://github.com/zaps166/QMPlay2/commit/f2facc5734e65a9b2a90cf9216cbffbf1c8ff7f3 - it uses the window icon). Something must be wrong with your KF5. Could you try on Xfce4, Mate or any other DE/WM? You can try to load openbox in Plasma5 yaourt -S openbox; openbox --replace and then try. Then go back to kwin kwin_x11 --replace from "Alt+F2" launcher. Maybe kwin5 has bug? If you are using Manjaro "stable" repo then you probably have old Qt 5.6.0. Qt 5.6.1 is much better than Qt 5.6.0 (less bugs).

varlesh commented 8 years ago

It's strange because other Qt5-apps show system icon, example qbittorrent. Ok i try this latter... and go now sleep :)

zaps166 commented 8 years ago

I think this is Kwin5 or Plasma5 bug (or something wrong with cache), because Qt loads tray icon from window icon and the tray icon is OK, but window icon is not OK on Plasma/Kwin (internally in Qt is OK).

zaps166 commented 8 years ago

Ok, mee too :smiley: 2:20 AM in Poland

Later (if it still will work bad) please try with openbox WM on Plasma5 :)

varlesh commented 8 years ago

I'm check on openbox - use system icon on panel, it's OK. This bug Qt or Kwin. After upgrade Qt5 and Plasma check again. Thx for support :)

zaps166 commented 8 years ago

So probably Kwin5 bug (or unknown other cache) :) According to https://github.com/zaps166/QMPlay2/issues/30#issuecomment-227592517 probably it has problem because of changed icon directory (qmplay2 and qmplay2-git). Sorry, but I can't help, this is out of scope...