diff options
author | Josh Faust <jfaust@suitabletech.com> | 2013-03-14 15:13:34 -0700 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-04-26 14:18:16 +0200 |
commit | c90d9b697f6ef549d33047332a9c44b40ded63f5 (patch) | |
tree | ef7c7686cfbc86ba6055831a14088b3531cd3026 /src/gui/kernel/qwindowsysteminterface_p.h | |
parent | e12d384d7b898f949bc5ad27a473eee2ec92a711 (diff) |
Fix ignoring close events on OSX
QNSWindowDelegate was not handling windowShouldClose, which is how you
can tell Cocoa that your window should not close if the close button is
pressed. This change moves the close handling from windowWillClose to
windowShouldClose, and adds an optional "accepted" pointer to
QWindowSystemInterface::handleCloseEvent so that QNSWindowDelegate can
return a true/false value for whether the window should actually close
Task-number: QTBUG-28965
Change-Id: I67c6296ad42cbeeb71413e05411467d4e558adb4
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
Diffstat (limited to 'src/gui/kernel/qwindowsysteminterface_p.h')
-rw-r--r-- | src/gui/kernel/qwindowsysteminterface_p.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gui/kernel/qwindowsysteminterface_p.h b/src/gui/kernel/qwindowsysteminterface_p.h index f1bc4667f7..a6ea15c5f2 100644 --- a/src/gui/kernel/qwindowsysteminterface_p.h +++ b/src/gui/kernel/qwindowsysteminterface_p.h @@ -105,9 +105,11 @@ public: class CloseEvent : public WindowSystemEvent { public: - explicit CloseEvent(QWindow *w) - : WindowSystemEvent(Close), window(w) { } + explicit CloseEvent(QWindow *w, bool *a = 0) + : WindowSystemEvent(Close), window(w), accepted(a) + { } QPointer<QWindow> window; + bool *accepted; }; class GeometryChangeEvent : public WindowSystemEvent { |