summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/platforms/cocoa')
-rw-r--r--src/plugins/platforms/cocoa/qcocoawindow.h1
-rw-r--r--src/plugins/platforms/cocoa/qcocoawindow.mm2
-rw-r--r--src/plugins/platforms/cocoa/qnswindowdelegate.h3
-rw-r--r--src/plugins/platforms/cocoa/qnswindowdelegate.mm15
4 files changed, 20 insertions, 1 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoawindow.h b/src/plugins/platforms/cocoa/qcocoawindow.h
index d9e94735ac..cc87e17d01 100644
--- a/src/plugins/platforms/cocoa/qcocoawindow.h
+++ b/src/plugins/platforms/cocoa/qcocoawindow.h
@@ -352,6 +352,7 @@ public: // for QNSView
// This object is tracked by QCocoaWindowPointer,
// preventing the use of dangling pointers.
QObject sentinel;
+ bool m_hasWindowFilePath;
};
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm
index 91ce91004f..524276e3a2 100644
--- a/src/plugins/platforms/cocoa/qcocoawindow.mm
+++ b/src/plugins/platforms/cocoa/qcocoawindow.mm
@@ -384,6 +384,7 @@ QCocoaWindow::QCocoaWindow(QWindow *tlw)
, m_topContentBorderThickness(0)
, m_bottomContentBorderThickness(0)
, m_normalGeometry(QRect(0,0,-1,-1))
+ , m_hasWindowFilePath(false)
{
qCDebug(lcQpaCocoaWindow) << "QCocoaWindow::QCocoaWindow" << window();
@@ -950,6 +951,7 @@ void QCocoaWindow::setWindowFilePath(const QString &filePath)
QFileInfo fi(filePath);
[m_nsWindow setRepresentedFilename: fi.exists() ? QCFString::toNSString(filePath) : @""];
+ m_hasWindowFilePath = fi.exists();
}
void QCocoaWindow::setWindowIcon(const QIcon &icon)
diff --git a/src/plugins/platforms/cocoa/qnswindowdelegate.h b/src/plugins/platforms/cocoa/qnswindowdelegate.h
index ac1e8d62eb..5cb4b2aca2 100644
--- a/src/plugins/platforms/cocoa/qnswindowdelegate.h
+++ b/src/plugins/platforms/cocoa/qnswindowdelegate.h
@@ -57,7 +57,8 @@
- (void)windowWillMove:(NSNotification *)notification;
- (BOOL)windowShouldClose:(NSNotification *)notification;
- (BOOL)windowShouldZoom:(NSWindow *)window toFrame:(NSRect)newFrame;
-
+- (BOOL)window:(NSWindow *)window shouldPopUpDocumentPathMenu:(NSMenu *)menu;
+- (BOOL)window:(NSWindow *)window shouldDragDocumentWithEvent:(NSEvent *)event from:(NSPoint)dragImageLocation withPasteboard:(NSPasteboard *)pasteboard;
@end
QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSWindowDelegate);
diff --git a/src/plugins/platforms/cocoa/qnswindowdelegate.mm b/src/plugins/platforms/cocoa/qnswindowdelegate.mm
index faa53b06ef..320a7890bf 100644
--- a/src/plugins/platforms/cocoa/qnswindowdelegate.mm
+++ b/src/plugins/platforms/cocoa/qnswindowdelegate.mm
@@ -115,4 +115,19 @@
return YES;
}
+- (BOOL)window:(NSWindow *)window shouldPopUpDocumentPathMenu:(NSMenu *)menu
+{
+ Q_UNUSED(window);
+ Q_UNUSED(menu);
+ return m_cocoaWindow && m_cocoaWindow->m_hasWindowFilePath;
+}
+
+- (BOOL)window:(NSWindow *)window shouldDragDocumentWithEvent:(NSEvent *)event from:(NSPoint)dragImageLocation withPasteboard:(NSPasteboard *)pasteboard
+{
+ Q_UNUSED(window);
+ Q_UNUSED(event);
+ Q_UNUSED(dragImageLocation);
+ Q_UNUSED(pasteboard);
+ return m_cocoaWindow && m_cocoaWindow->m_hasWindowFilePath;
+}
@end