Skip to content

Commit

Permalink
Update qt.py to match GTK behavior in PR r0x0r#1180
Browse files Browse the repository at this point in the history
  • Loading branch information
p4bl0- committed Jul 23, 2023
1 parent cceb890 commit ff82d84
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions webview/platforms/qt.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,6 @@ def __init__(self, window):
self.js_bridge.window = window

self.is_fullscreen = False
self.confirm_close = window.confirm_close
self.text_select = window.text_select

self._file_name_semaphore = Semaphore(0)
Expand Down Expand Up @@ -456,7 +455,13 @@ def on_set_on_top(self, top):
self.show()

def closeEvent(self, event):
if self.confirm_close:
should_cancel = self.pywebview_window.events.closing.set()

if should_cancel:
event.ignore()
return

if self.pywebview_window.confirm_close:
reply = QMessageBox.question(
self,
self.title,
Expand All @@ -469,12 +474,6 @@ def closeEvent(self, event):
event.ignore()
return

should_cancel = self.pywebview_window.events.closing.set()

if should_cancel:
event.ignore()
return

event.accept()
BrowserView.instances[self.uid].close()
del BrowserView.instances[self.uid]
Expand Down

0 comments on commit ff82d84

Please sign in to comment.