|
@@ -307,7 +307,6 @@ static void handleAnyDeviceErrors(Error * err)
|
|
*/
|
|
*/
|
|
@interface QemuCocoaView : NSView
|
|
@interface QemuCocoaView : NSView
|
|
{
|
|
{
|
|
- NSTrackingArea *trackingArea;
|
|
|
|
QEMUScreen screen;
|
|
QEMUScreen screen;
|
|
pixman_image_t *pixman_image;
|
|
pixman_image_t *pixman_image;
|
|
BOOL isMouseGrabbed;
|
|
BOOL isMouseGrabbed;
|
|
@@ -359,6 +358,19 @@ - (id)initWithFrame:(NSRect)frameRect
|
|
self = [super initWithFrame:frameRect];
|
|
self = [super initWithFrame:frameRect];
|
|
if (self) {
|
|
if (self) {
|
|
|
|
|
|
|
|
+ NSTrackingAreaOptions options = NSTrackingActiveInKeyWindow |
|
|
|
|
+ NSTrackingMouseEnteredAndExited |
|
|
|
|
+ NSTrackingMouseMoved |
|
|
|
|
+ NSTrackingInVisibleRect;
|
|
|
|
+
|
|
|
|
+ NSTrackingArea *trackingArea =
|
|
|
|
+ [[NSTrackingArea alloc] initWithRect:CGRectZero
|
|
|
|
+ options:options
|
|
|
|
+ owner:self
|
|
|
|
+ userInfo:nil];
|
|
|
|
+
|
|
|
|
+ [self addTrackingArea:trackingArea];
|
|
|
|
+ [trackingArea release];
|
|
screen.width = frameRect.size.width;
|
|
screen.width = frameRect.size.width;
|
|
screen.height = frameRect.size.height;
|
|
screen.height = frameRect.size.height;
|
|
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_VERSION_14_0
|
|
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_VERSION_14_0
|
|
@@ -389,41 +401,9 @@ - (BOOL) isOpaque
|
|
return YES;
|
|
return YES;
|
|
}
|
|
}
|
|
|
|
|
|
-- (void) removeTrackingRect
|
|
|
|
-{
|
|
|
|
- if (trackingArea) {
|
|
|
|
- [self removeTrackingArea:trackingArea];
|
|
|
|
- [trackingArea release];
|
|
|
|
- trackingArea = nil;
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-- (void) frameUpdated
|
|
|
|
-{
|
|
|
|
- [self removeTrackingRect];
|
|
|
|
-
|
|
|
|
- if ([self window]) {
|
|
|
|
- NSTrackingAreaOptions options = NSTrackingActiveInKeyWindow |
|
|
|
|
- NSTrackingMouseEnteredAndExited |
|
|
|
|
- NSTrackingMouseMoved;
|
|
|
|
- trackingArea = [[NSTrackingArea alloc] initWithRect:[self frame]
|
|
|
|
- options:options
|
|
|
|
- owner:self
|
|
|
|
- userInfo:nil];
|
|
|
|
- [self addTrackingArea:trackingArea];
|
|
|
|
- [self updateUIInfo];
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
- (void) viewDidMoveToWindow
|
|
- (void) viewDidMoveToWindow
|
|
{
|
|
{
|
|
[self resizeWindow];
|
|
[self resizeWindow];
|
|
- [self frameUpdated];
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-- (void) viewWillMoveToWindow:(NSWindow *)newWindow
|
|
|
|
-{
|
|
|
|
- [self removeTrackingRect];
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- (void) selectConsoleLocked:(unsigned int)index
|
|
- (void) selectConsoleLocked:(unsigned int)index
|
|
@@ -1314,7 +1294,7 @@ - (void)windowDidExitFullScreen:(NSNotification *)notification
|
|
- (void)windowDidResize:(NSNotification *)notification
|
|
- (void)windowDidResize:(NSNotification *)notification
|
|
{
|
|
{
|
|
[cocoaView updateBounds];
|
|
[cocoaView updateBounds];
|
|
- [cocoaView frameUpdated];
|
|
|
|
|
|
+ [cocoaView updateUIInfo];
|
|
}
|
|
}
|
|
|
|
|
|
/* Called when the user clicks on a window's close button */
|
|
/* Called when the user clicks on a window's close button */
|