Search
lxdream.org :: lxdream/src/cocoaui/cocoa_win.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/cocoaui/cocoa_win.c
changeset 839:51f1c4195790
prev837:4eae2ddccf9c
next874:e3007b8799f3
author nkeynes
date Tue Sep 02 03:34:00 2008 +0000 (13 years ago)
permissions -rw-r--r--
last change Implement absolute positioning mouse mode when not grabbed
enable/disable grab on dreamcast start/stop where it's requested
by the controllers
file annotate diff log raw
1.1 --- a/src/cocoaui/cocoa_win.c Thu Aug 28 01:39:51 2008 +0000
1.2 +++ b/src/cocoaui/cocoa_win.c Tue Sep 02 03:34:00 2008 +0000
1.3 @@ -132,6 +132,7 @@
1.4 backing: NSBackingStoreBuffered defer: NO ] == nil ) {
1.5 return nil;
1.6 } else {
1.7 + useGrab = NO;
1.8 isGrabbed = NO;
1.9 video = (LxdreamVideoView *)video_osx_create_drawable();
1.10 [video setFrameOrigin: NSMakePoint(0.0,STATUSBAR_HEIGHT)];
1.11 @@ -222,13 +223,27 @@
1.12 [video setIsGrabbed: isGrabbed];
1.13 }
1.14 }
1.15 -- (void)viewRequestedGrab: (id)sender
1.16 +- (void)setUseGrab:(BOOL)grab
1.17 {
1.18 - [self setIsGrabbed: YES];
1.19 + if( grab != useGrab ) {
1.20 + if( !grab && isGrabbed ) {
1.21 + [self setIsGrabbed: NO];
1.22 + }
1.23 + useGrab = grab;
1.24 + }
1.25 }
1.26 -- (void)viewRequestedUngrab: (id)sender
1.27 +
1.28 +- (id)viewRequestedGrab: (id)sender
1.29 +{
1.30 + if( useGrab ) {
1.31 + [self setIsGrabbed: YES];
1.32 + }
1.33 + return useGrab ? self : nil;
1.34 +}
1.35 +- (id)viewRequestedUngrab: (id)sender
1.36 {
1.37 [self setIsGrabbed: NO];
1.38 + return useGrab ? self : nil;
1.39 }
1.40 @end
1.41
.