Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QtWebEngine
  4. Flickering of webengineview when showing webGL content AND having an secondary screen attached

Flickering of webengineview when showing webGL content AND having an secondary screen attached

Scheduled Pinned Locked Moved Unsolved QtWebEngine
3 Posts 2 Posters 692 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.
  • R Offline
    R Offline
    raphm01
    wrote on last edited by raphm01
    #1

    I implement an application based on pyqt6 with a webengine view which shows a web page with webgl content. I noticed that a quite weird bug:
    When I connect a secondary screen to the laptop, and only then, in an unpredictable fashion, the webengineview content starts and stops to flicker.

    OS: Windows 11
    pyqt version: 6.6.1
    pyqt6-webengine: 6.6.0

    Hardware:

    • Lenovo Ideapad 330 with secondary screen attached (important!)
    • CPU: Intel i5 8250U
    • GPU: Intel UHD Graphics 620

    Example code:

    #!/usr/bin/env python
    # -*- coding: utf-8 -*-
    """
    WebGL Windows Flickering example, stripped down from original application
    
    Hardware:
    * Lenovo Ideapad 330 with secondary screen attached (important!)
    * CPU: Intel i5 8250U
    * GPU: Intel UHD Graphics 620
    """
    
    import sys
    
    from PyQt6.QtCore import QUrl
    from PyQt6.QtWebEngineWidgets import QWebEngineView
    from PyQt6.QtWidgets import QApplication, QMainWindow, QWidget, QVBoxLayout
    
    
    class MainWindow(QMainWindow):
        def __init__(self):
            super().__init__()
    
            wgt_main = QWidget()
            self.layout_main = QVBoxLayout()
            wgt_main.setLayout(self.layout_main)
            self.setCentralWidget(wgt_main)
    
            self.wbv_main = QWebEngineView()
            self.wbv_main.load(QUrl("https://threejs.org/examples/#webgl_animation_keyframes"))
            self.wbv_main.show()
    
            self.layout_main.addWidget(self.wbv_main)
            self.showMaximized()
    
    
    if __name__ == "__main__":
        # Start QT app
        app = QApplication(sys.argv)
    
        window = MainWindow()
        window.show()
        app.exec()
    

    If I open the same web page with Chrome, I do not get any flickering at all.
    The bug does not show up on Ubuntu or if no secondary screen is attached.

    Can anybody make sense of this?

    1 Reply Last reply
    0
    • R Offline
      R Offline
      raphm01
      wrote on last edited by
      #2

      Anybody?
      I know that the bug is quite specific, but it is a showstopper, still since the environment described is very common (windows laptop with external screen)

      1 Reply Last reply
      0
      • D Offline
        D Offline
        Dao Fa Nature
        wrote on last edited by
        #3

        self.showMaximized()Put it in front,
        Because the initial window is small, flickering is when the window suddenly maximizes
        from PyQt6.QtCore import QUrl
        from PyQt6.QtWebEngineWidgets import QWebEngineView
        from PyQt6.QtWidgets import QApplication, QMainWindow, QWidget, QVBoxLayout

        class MainWindow(QMainWindow):
        def init(self):
        super().init()
        self.showMaximized()
        wgt_main = QWidget()
        self.layout_main = QVBoxLayout()
        wgt_main.setLayout(self.layout_main)
        self.setCentralWidget(wgt_main)

            self.wbv_main = QWebEngineView()
            self.wbv_main.load(QUrl("https://threejs.org/examples/#webgl_animation_keyframes"))
            self.wbv_main.show()
        
            self.layout_main.addWidget(self.wbv_main)
        

        if name == "main":
        # Start QT app
        app = QApplication(sys.argv)

        window = MainWindow()
        window.show()
        app.exec()
        
        1 Reply Last reply
        0

        • Login

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