zhiyiYo / PyQt-Frameless-Window

A cross-platform frameless window based on pyqt5, support Win32, Linux and macOS.
https://pyqt-frameless-window.readthedocs.io
GNU General Public License v3.0
482 stars 67 forks source link

窗口关闭后显示在通知栏图标,然后再恢复窗口时,窗口边框消失,阴影消失,无法通过边框缩放窗口。 #139

Closed riverbird closed 9 months ago

riverbird commented 9 months ago

Describe the bug A clear and concise description of what the bug is. 窗口关闭后显示在通知栏图标,然后再恢复窗口时,窗口边框消失,阴影消失,无法通过边框缩放窗口。

Environment 环境信息

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

  1. 关闭窗口,执行closeEvent方法;
  2. 在tray icon的菜单中,加入恢复窗口代码,执行__on_action_open_window方法;
  3. 执行后,mainwindow的边框消失,阴影没有出现。

Code 最小复现代码

# 窗口关闭事件
    def closeEvent(self, event: QCloseEvent) -> None:
        if self.tray_icon.isVisible():
            self.close()
# 窗口恢复事件
    def __on_action_open_window(self):
        self.showNormal()

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

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

zhiyiYo commented 9 months ago

你用的是亚克力窗口吗?

riverbird commented 9 months ago

你用的是亚克力窗口吗?

不是的,只是普通窗口,class MainWindow(FramelessMainWindow)

riverbird commented 9 months ago

关闭前

001

恢复后

002

zhiyiYo commented 9 months ago

我之前写的 Groove 也缩小到托盘,但是没遇到过你这个问题,不行的话试下6.4.2或者pyqt5

riverbird commented 9 months ago

问题已解决: def __on_action_open_window(self): self.showNormal() self.updateFrameless() 加了最后一句后,窗口显示正常:)