how to restore windows taskbar thumbnail in PyQt5 if it was manipulate by vlc
-
Then I would check with VLC to see what is going on. You might found an unexpected behaviour.
-
Sorry, what I meant by "I would check" is: if I was at your place, I would start by checking what the VLC folks are doing with the thumbnail.
-
@SGaist I have already raised an issue at Python-VLC GitHubcheck here. they said it is neither Python-VlC nor VLC issue rather I need to ask Pyqt5/Qt. So I came here.If I can reinsert it then it will be a temporary fix for me. So I am asking..
-
One thing you can check is if you have the same behaviour with PySide2.
-
@SGaist I figured out something. When VLC started it forcely set the only video frame to the taskbar thumbnail where it is about to play/render on and when the player stops the taskbar show blank as it(the frame where video was played)does not contain anything after stopping the player . So here we have to do something with thumbnail so that it can cover the entire application.I figured out this by setting that frame background color. It is not actually blank, after hiding that frame anything present in the size range of that frame appears in the thumbnail
.So Is there any way to fix that? -
Can you post where you saw that ?
-
@SGaist 1st image brfore playing
2nd image while playing
3rd image after stopping and hiding that frame
-
@SGaist As you can see in the 1st image, i set the window and videoframe background blue and yellow respectively.i Placed the red button in the size range of videoframe and both buttons are visible clearly in thumbnail( 1st image). and when video started playing it only show the videoframe in thumbnail as you can see in 2nd imagevideo with red button both but not that green button .In the third image you can see only the red button that's because vlc forcely set only that frame to the thumbnail .Any thing in the size range of that frame will be seen in thumbnail section.This is unexpected .
Let me know if you have not understood. -
In your code you replace the showEvent implementation with setthumbnail but you do not call it anywhere else. So unless you trigger it again, it will have no effect.
-
Can you share the latest version of your tests ?
-
@SGaist No, actually I moved on from that part and now I fixed the issue. As I said VLC set that frame into taskbar,and it can also be done using windows API ITaskbarList3::SetThumbnailCliphere and it will create no issue if someone design a media player application only but in my case I am just embedding that for some time.and if after stopping the player the thumbnail will be blank then it will be a problem for me.Finally I asked this issue how to use this API in the stack overflow but got no desired answer ,then I asked in the Discord Python Forums and One person helped me to fix that.You can see here.I think in PyQt5 Qt Windows Extras's QWinThumbnailToolBar Class should also have setThumbnailClip method like setIconicThumbnailPixmap() and others.
-
Thanks for the feedback !
If you would like to have something like that, you should open a feature request on the bug report system. PyQt will likely not provide APIs that are not part of Qt itself.