Cocoa: Send window activation events.
Change-Id: I599b4316f1535bf4855b205bfb2117bbcee63bf0 Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@nokia.com>bb10
parent
56b2a229a3
commit
7407045388
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -62,6 +62,8 @@ class QCocoaWindow;
|
|||
- (void)setImage:(QImage *)image;
|
||||
- (void)drawRect:(NSRect)dirtyRect;
|
||||
- (void)updateGeometry;
|
||||
- (void)windowDidBecomeKey;
|
||||
- (void)windowDidResignKey;
|
||||
|
||||
- (BOOL)isFlipped;
|
||||
- (BOOL)acceptsFirstResponder;
|
||||
|
|
|
|||
|
|
@ -138,6 +138,16 @@ static QTouchDevice *touchDevice = 0;
|
|||
QWindowSystemInterface::handleSynchronousGeometryChange(m_window, geo);
|
||||
}
|
||||
|
||||
- (void)windowDidBecomeKey
|
||||
{
|
||||
QWindowSystemInterface::handleWindowActivated(m_window);
|
||||
}
|
||||
|
||||
- (void)windowDidResignKey
|
||||
{
|
||||
QWindowSystemInterface::handleWindowActivated(0);
|
||||
}
|
||||
|
||||
- (void) setImage:(QImage *)image
|
||||
{
|
||||
CGImageRelease(m_cgImage);
|
||||
|
|
|
|||
Loading…
Reference in New Issue