Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. how to restore windows taskbar thumbnail in PyQt5 if it was manipulate by vlc
QtWS25 Last Chance

how to restore windows taskbar thumbnail in PyQt5 if it was manipulate by vlc

Scheduled Pinned Locked Moved Unsolved Qt for Python
21 Posts 2 Posters 2.3k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    hacker6914
    wrote on 30 Nov 2020, 17:56 last edited by hacker6914
    #1

    hello,I am embedding python vlc in pyqt5 to make a video player.I never noticed whats going on taskbar,suddenly i came to know that when video starts to play it takes entire taskbar thumbnail to show only its video not other items present in the window screen.And after closing the video the taskbar becomes totally blank white, not showing anything .Is there any method to restore it normal.
    i have posted my every details with images for better understanding .in the stackoverflow look here.But wont get any desired answer.
    You might ask this, why i am using vlc and this is not a PyQt5 related issue.But the thing is i know vlc is manipulating the taskbar thumbnail to render its video but in PyQt5 there is a classQt Windows Extras Available and As per doc we can set setIconicLivePreviewPixmap(const QPixmap &) thumbnail. So can we reset/reassert the window taskbar thumnail like before ,after closing the vlc player or even while playing.?I am very curious to do that but dont know how to do??
    I am using PyQt 5.15.2 in windows8.1 32 bit
    Any help will be appreciated.Let me know if u dont understand my problem ,i think the stackoverflow link will be enough to make you clearly understand.

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 30 Nov 2020, 19:08 last edited by
      #2

      Hi,

      Why are you replacing showEvent of your videoframe object ?

      You are likely breaking some stuff doing that.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      H 1 Reply Last reply 30 Nov 2020, 19:23
      0
      • S SGaist
        30 Nov 2020, 19:08

        Hi,

        Why are you replacing showEvent of your videoframe object ?

        You are likely breaking some stuff doing that.

        H Offline
        H Offline
        hacker6914
        wrote on 30 Nov 2020, 19:23 last edited by
        #3

        @SGaist Please help me how to fix that I mean how to restore the thumbnail.

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 30 Nov 2020, 19:25 last edited by
          #4

          If you need to do something when showEvent is called, then you should rather implement a custom QFrame to properly overload that method and do what you want there.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          H 1 Reply Last reply 30 Nov 2020, 19:35
          0
          • S SGaist
            30 Nov 2020, 19:25

            If you need to do something when showEvent is called, then you should rather implement a custom QFrame to properly overload that method and do what you want there.

            H Offline
            H Offline
            hacker6914
            wrote on 30 Nov 2020, 19:35 last edited by hacker6914
            #5

            @SGaist basically once VLC started playing it covers entire thumbnail and it no longer in the control of my application even when I stopped playing and hide that frame the thumbnail is completely blank white .So Is there any way to extract live thumbnail from application or reinsert it. Or is there any way like grabmaouse()/grab keyboard() so I can grab my application thumbnail back?

            1 Reply Last reply
            0
            • S Offline
              S Offline
              SGaist
              Lifetime Qt Champion
              wrote on 30 Nov 2020, 19:36 last edited by
              #6

              Then I would check with VLC to see what is going on. You might found an unexpected behaviour.

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              H 1 Reply Last reply 30 Nov 2020, 19:47
              0
              • S SGaist
                30 Nov 2020, 19:36

                Then I would check with VLC to see what is going on. You might found an unexpected behaviour.

                H Offline
                H Offline
                hacker6914
                wrote on 30 Nov 2020, 19:47 last edited by hacker6914
                #7

                @SGaist Yes, go with my stackoverflow code .It will be easier for you.

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on 30 Nov 2020, 19:50 last edited by
                  #8

                  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.

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  H 2 Replies Last reply 30 Nov 2020, 20:02
                  0
                  • S SGaist
                    30 Nov 2020, 19:50

                    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.

                    H Offline
                    H Offline
                    hacker6914
                    wrote on 30 Nov 2020, 20:02 last edited by hacker6914 12 Jan 2020, 06:08
                    #9

                    @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..

                    1 Reply Last reply
                    0
                    • S SGaist
                      30 Nov 2020, 19:50

                      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.

                      H Offline
                      H Offline
                      hacker6914
                      wrote on 1 Dec 2020, 09:59 last edited by
                      #10

                      @SGaist Is there any way?

                      1 Reply Last reply
                      0
                      • S Offline
                        S Offline
                        SGaist
                        Lifetime Qt Champion
                        wrote on 1 Dec 2020, 20:22 last edited by
                        #11

                        One thing you can check is if you have the same behaviour with PySide2.

                        Interested in AI ? www.idiap.ch
                        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                        H 2 Replies Last reply 2 Dec 2020, 14:09
                        0
                        • S SGaist
                          1 Dec 2020, 20:22

                          One thing you can check is if you have the same behaviour with PySide2.

                          H Offline
                          H Offline
                          hacker6914
                          wrote on 2 Dec 2020, 14:09 last edited by hacker6914 12 Feb 2020, 15:30
                          #12

                          @SGaist I checked with PySide2,Same problem.I think VLC is somehow controlling thumbnail. So we need to reinsert it again.

                          1 Reply Last reply
                          0
                          • S SGaist
                            1 Dec 2020, 20:22

                            One thing you can check is if you have the same behaviour with PySide2.

                            H Offline
                            H Offline
                            hacker6914
                            wrote on 3 Dec 2020, 16:09 last edited by hacker6914 12 Mar 2020, 16:17
                            #13

                            @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?

                            1 Reply Last reply
                            0
                            • S Offline
                              S Offline
                              SGaist
                              Lifetime Qt Champion
                              wrote on 3 Dec 2020, 18:09 last edited by
                              #14

                              Can you post where you saw that ?

                              Interested in AI ? www.idiap.ch
                              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                              H 1 Reply Last reply 4 Dec 2020, 09:52
                              0
                              • H Offline
                                H Offline
                                hacker6914
                                wrote on 4 Dec 2020, 09:03 last edited by
                                #15

                                @SGaist 1st image brfore playing
                                bandicam 2020-12-04 14-22-35-996.jpg
                                2nd image while playing
                                bandicam 2020-12-04 14-16-21-573.jpg
                                3rd image after stopping and hiding that frame
                                bandicam 2020-12-04 14-32-19-009.jpg

                                1 Reply Last reply
                                0
                                • S SGaist
                                  3 Dec 2020, 18:09

                                  Can you post where you saw that ?

                                  H Offline
                                  H Offline
                                  hacker6914
                                  wrote on 4 Dec 2020, 09:52 last edited by hacker6914 12 Apr 2020, 20:04
                                  #16

                                  @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.

                                  1 Reply Last reply
                                  0
                                  • S Offline
                                    S Offline
                                    SGaist
                                    Lifetime Qt Champion
                                    wrote on 4 Dec 2020, 19:48 last edited by
                                    #17

                                    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.

                                    Interested in AI ? www.idiap.ch
                                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                                    H 1 Reply Last reply 4 Dec 2020, 20:01
                                    0
                                    • S SGaist
                                      4 Dec 2020, 19:48

                                      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.

                                      H Offline
                                      H Offline
                                      hacker6914
                                      wrote on 4 Dec 2020, 20:01 last edited by hacker6914 12 Apr 2020, 20:03
                                      #18

                                      @SGaist Though I have not written in that code but I attempted several times in different different experiment for curiosity,but that has no effect.

                                      1 Reply Last reply
                                      0
                                      • S Offline
                                        S Offline
                                        SGaist
                                        Lifetime Qt Champion
                                        wrote on 4 Dec 2020, 20:35 last edited by
                                        #19

                                        Can you share the latest version of your tests ?

                                        Interested in AI ? www.idiap.ch
                                        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                                        H 1 Reply Last reply 5 Dec 2020, 18:40
                                        0
                                        • S SGaist
                                          4 Dec 2020, 20:35

                                          Can you share the latest version of your tests ?

                                          H Offline
                                          H Offline
                                          hacker6914
                                          wrote on 5 Dec 2020, 18:40 last edited by hacker6914 12 May 2020, 18:55
                                          #20

                                          @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.

                                          1 Reply Last reply
                                          0

                                          1/21

                                          30 Nov 2020, 17:56

                                          • Login

                                          • Login or register to search.
                                          1 out of 21
                                          • First post
                                            1/21
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • Users
                                          • Groups
                                          • Search
                                          • Get Qt Extensions
                                          • Unsolved