From 7407045388cc7a7d5f955ed9cbf938db8031baa0 Mon Sep 17 00:00:00 2001 From: Morten Johan Sorvig Date: Thu, 12 Jan 2012 12:32:59 +0100 Subject: Cocoa: Send window activation events. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I599b4316f1535bf4855b205bfb2117bbcee63bf0 Reviewed-by: Bradley T. Hughes Reviewed-by: Tor Arne Vestbø --- src/plugins/platforms/cocoa/qcocoawindow.mm | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/plugins/platforms/cocoa/qcocoawindow.mm') diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm index b65d371c63..b4b4bc6857 100644 --- a/src/plugins/platforms/cocoa/qcocoawindow.mm +++ b/src/plugins/platforms/cocoa/qcocoawindow.mm @@ -100,6 +100,16 @@ QCocoaWindow::QCocoaWindow(QWindow *tlw) m_contentView = [[QNSView alloc] initWithQWindow:tlw platformWindow:this]; + [[NSNotificationCenter defaultCenter] addObserver:m_contentView + selector:@selector(windowDidBecomeKey) + name:NSWindowDidBecomeKeyNotification + object:m_nsWindow]; + + [[NSNotificationCenter defaultCenter] addObserver:m_contentView + selector:@selector(windowDidResignKey) + name:NSWindowDidResignKeyNotification + object:m_nsWindow]; + // ### Accept touch events by default. // Beware that enabling touch events has a negative impact on the overall performance. // We probably need a QWindowSystemInterface API to enable/disable touch events. -- cgit v1.2.3