Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修改背景为暗色后,窗口从隐藏状态切换为显示状态会出现白色闪屏现象 #130

Open
amos-repository opened this issue Oct 20, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@amos-repository
Copy link

Describe the bug
A clear and concise description of what the bug is.
问题的简要描述。
当我修改窗口背景为暗色后,然后将窗口从隐藏状态切换为显示状态时,窗口会先短暂的显示白色,然后才会显示为我设置的背景色
image

Environment
环境信息

  • OS: Windows11
  • DPI scaling: 125%
  • Python: 3.9 64-bit
  • PyQt5: 5.15.2

To Reproduce
复现问题的步骤,推荐使用 gif 进行演示。
Steps to reproduce the behavior(you can use GIF to demonstrate :):
如图所示:
image

  1. 点击隐藏
  2. 然后点击显示
  3. 可以看到窗口会先短暂的显示白色,然后才会显示为我设置的背景色

Code
最小复现代码

# class Window(FramelessWindow):
    def __init__(self, parent=None):
        super().__init__(parent=parent)
        # change the default title bar if you like
        self.setTitleBar(CustomTitleBar(self))

        # self.label = QLabel(self)
        # self.label.setScaledContents(True)
        # self.label.setPixmap(QPixmap("screenshot/shoko.png"))

        # self.setWindowIcon(QIcon("screenshot/logo.png"))
        self.setWindowIcon(QIcon("image/logo128.ico"))
        self.setWindowTitle("Bridge")
        self.setStyleSheet("background:rgb(39,40,34)")

main函数:

    w1 = Window()
    w2 = QWidget()
    w2.resize(100,100)
    b1=QPushButton("w1隐藏",w2)
    b2=QPushButton("w1显示",w2)
    b1.clicked.connect(w1.hide)
    b2.clicked.connect(w1.show)
    b2.move(0,30)
    w2.show()
    w1.show()

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

@amos-repository amos-repository added the bug Something isn't working label Oct 20, 2023
@suterberg
Copy link

suterberg commented Nov 18, 2023

应该是系统问题,最大最小化都会有类似的情况,这个没得修,你win10 调成暗色模式 然后类似操作也会闪白底,
看了下调用,是用的windows的dll来实现的,如果系统dll有问题那么这个插件也没法解决。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants