Hotfix: Fix window-toggling for KDE.

This commit is contained in:
Manu 2019-03-25 23:14:04 +08:00
parent bf12aca2fb
commit 61f311c573
1 changed files with 4 additions and 2 deletions

View File

@ -1,6 +1,7 @@
import os import os
import sys import sys
import fcntl import fcntl
import sip
from PyQt5 import QtCore from PyQt5 import QtCore
from PyQt5.QtWidgets import QApplication from PyQt5.QtWidgets import QApplication
@ -83,8 +84,9 @@ class VortaApp(QApplication):
self.main_window.raise_() self.main_window.raise_()
def toggle_main_window_visibility(self): def toggle_main_window_visibility(self):
if self.main_window.isVisible(): main_window_open = hasattr(self, 'main_window') and not sip.isdeleted(self.main_window)
self.main_window.hide() if main_window_open:
self.main_window.close()
else: else:
self.open_main_window_action() self.open_main_window_action()