src/video/cocoa/SDL_cocoaevents.m
author Alex Szpakowski
Sat, 21 May 2016 00:20:52 -0300
changeset 10176 3115d38204aa
parent 10022 30807689ca1b
child 10441 5eac139165bc
permissions -rw-r--r--
Removed Mac OS 10.5 support (bug #3137). Also fixed a warning about deprecated Carbon code when using SDL_audio (bug #3127, thanks Dominik!)
slouken@1931
     1
/*
slouken@5535
     2
  Simple DirectMedia Layer
slouken@9998
     3
  Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
slouken@1931
     4
slouken@5535
     5
  This software is provided 'as-is', without any express or implied
slouken@5535
     6
  warranty.  In no event will the authors be held liable for any damages
slouken@5535
     7
  arising from the use of this software.
slouken@1931
     8
slouken@5535
     9
  Permission is granted to anyone to use this software for any purpose,
slouken@5535
    10
  including commercial applications, and to alter it and redistribute it
slouken@5535
    11
  freely, subject to the following restrictions:
slouken@1931
    12
slouken@5535
    13
  1. The origin of this software must not be misrepresented; you must not
slouken@5535
    14
     claim that you wrote the original software. If you use this software
slouken@5535
    15
     in a product, an acknowledgment in the product documentation would be
slouken@5535
    16
     appreciated but is not required.
slouken@5535
    17
  2. Altered source versions must be plainly marked as such, and must not be
slouken@5535
    18
     misrepresented as being the original software.
slouken@5535
    19
  3. This notice may not be removed or altered from any source distribution.
slouken@1931
    20
*/
icculus@8093
    21
#include "../../SDL_internal.h"
slouken@6044
    22
slouken@6044
    23
#if SDL_VIDEO_DRIVER_COCOA
slouken@3120
    24
#include "SDL_timer.h"
slouken@1931
    25
slouken@1931
    26
#include "SDL_cocoavideo.h"
slouken@2738
    27
#include "../../events/SDL_events_c.h"
icculus@8648
    28
#include "SDL_assert.h"
alfred@9820
    29
#include "SDL_hints.h"
slouken@1931
    30
icculus@9364
    31
/* This define was added in the 10.9 SDK. */
icculus@9364
    32
#ifndef kIOPMAssertPreventUserIdleDisplaySleep
icculus@9364
    33
#define kIOPMAssertPreventUserIdleDisplaySleep kIOPMAssertionTypePreventUserIdleDisplaySleep
icculus@9364
    34
#endif
icculus@9364
    35
slouken@8239
    36
@interface SDLApplication : NSApplication
slouken@8239
    37
slouken@8239
    38
- (void)terminate:(id)sender;
slouken@8239
    39
slouken@8239
    40
@end
slouken@8239
    41
slouken@8239
    42
@implementation SDLApplication
slouken@8239
    43
slouken@8239
    44
// Override terminate to handle Quit and System Shutdown smoothly.
slouken@8239
    45
- (void)terminate:(id)sender
slouken@8239
    46
{
slouken@8239
    47
    SDL_SendQuit();
slouken@8239
    48
}
slouken@8239
    49
slouken@8239
    50
@end // SDLApplication
slouken@8239
    51
slouken@1931
    52
/* setAppleMenu disappeared from the headers in 10.4 */
slouken@1931
    53
@interface NSApplication(NSAppleMenu)
slouken@1931
    54
- (void)setAppleMenu:(NSMenu *)menu;
slouken@1931
    55
@end
slouken@1931
    56
slouken@8986
    57
@interface SDLAppDelegate : NSObject <NSApplicationDelegate> {
jorgen@7801
    58
@public
jorgen@7469
    59
    BOOL seenFirstActivate;
jorgen@7469
    60
}
jorgen@7469
    61
jorgen@7469
    62
- (id)init;
slouken@1937
    63
@end
slouken@1937
    64
slouken@1937
    65
@implementation SDLAppDelegate : NSObject
jorgen@7469
    66
- (id)init
jorgen@7469
    67
{
jorgen@7469
    68
    self = [super init];
jorgen@7469
    69
    if (self) {
icculus@9419
    70
        NSNotificationCenter *center = [NSNotificationCenter defaultCenter];
icculus@9419
    71
jorgen@7469
    72
        seenFirstActivate = NO;
icculus@9419
    73
icculus@9419
    74
        [center addObserver:self
icculus@9419
    75
                   selector:@selector(windowWillClose:)
icculus@9419
    76
                       name:NSWindowWillCloseNotification
icculus@9419
    77
                     object:nil];
icculus@9419
    78
icculus@9419
    79
        [center addObserver:self
icculus@9419
    80
                   selector:@selector(focusSomeWindow:)
icculus@9419
    81
                       name:NSApplicationDidBecomeActiveNotification
icculus@9419
    82
                     object:nil];
jorgen@7469
    83
    }
jorgen@7469
    84
jorgen@7469
    85
    return self;
jorgen@7469
    86
}
jorgen@7469
    87
jorgen@7801
    88
- (void)dealloc
jorgen@7801
    89
{
icculus@9419
    90
    NSNotificationCenter *center = [NSNotificationCenter defaultCenter];
icculus@9419
    91
icculus@9419
    92
    [center removeObserver:self name:NSWindowWillCloseNotification object:nil];
icculus@9419
    93
    [center removeObserver:self name:NSApplicationDidBecomeActiveNotification object:nil];
icculus@9419
    94
jorgen@7801
    95
    [super dealloc];
jorgen@7801
    96
}
jorgen@7801
    97
icculus@9419
    98
- (void)windowWillClose:(NSNotification *)notification;
icculus@9419
    99
{
icculus@9419
   100
    NSWindow *win = (NSWindow*)[notification object];
icculus@9419
   101
icculus@9419
   102
    if (![win isKeyWindow]) {
icculus@9419
   103
        return;
icculus@9419
   104
    }
icculus@9419
   105
icculus@9419
   106
    /* HACK: Make the next window in the z-order key when the key window is
icculus@9419
   107
     * closed. The custom event loop and/or windowing code we have seems to
icculus@9419
   108
     * prevent the normal behavior: https://bugzilla.libsdl.org/show_bug.cgi?id=1825
icculus@9419
   109
     */
icculus@9419
   110
icculus@9419
   111
    /* +[NSApp orderedWindows] never includes the 'About' window, but we still
icculus@9419
   112
     * want to try its list first since the behavior in other apps is to only
icculus@9419
   113
     * make the 'About' window key if no other windows are on-screen.
icculus@9419
   114
     */
icculus@9419
   115
    for (NSWindow *window in [NSApp orderedWindows]) {
icculus@9419
   116
        if (window != win && [window canBecomeKeyWindow]) {
slime73@10176
   117
            if (![window isOnActiveSpace]) {
slime73@10176
   118
                continue;
icculus@9419
   119
            }
icculus@9419
   120
            [window makeKeyAndOrderFront:self];
icculus@9419
   121
            return;
icculus@9419
   122
        }
icculus@9419
   123
    }
icculus@9419
   124
slime73@10176
   125
    /* If a window wasn't found above, iterate through all visible windows in
slime73@10176
   126
     * the active Space in z-order (including the 'About' window, if it's shown)
slime73@10176
   127
     * and make the first one key.
icculus@9419
   128
     */
slime73@10176
   129
    for (NSNumber *num in [NSWindow windowNumbersWithOptions:0]) {
slime73@10176
   130
        NSWindow *window = [NSApp windowWithWindowNumber:[num integerValue]];
slime73@10176
   131
        if (window && window != win && [window canBecomeKeyWindow]) {
slime73@10176
   132
            [window makeKeyAndOrderFront:self];
slime73@10176
   133
            return;
icculus@9419
   134
        }
icculus@9419
   135
    }
icculus@9419
   136
}
icculus@9419
   137
jorgen@7801
   138
- (void)focusSomeWindow:(NSNotification *)aNotification
jorgen@7466
   139
{
jorgen@7469
   140
    /* HACK: Ignore the first call. The application gets a
jorgen@7469
   141
     * applicationDidBecomeActive: a little bit after the first window is
jorgen@7469
   142
     * created, and if we don't ignore it, a window that has been created with
icculus@9419
   143
     * SDL_WINDOW_MINIMIZED will ~immediately be restored.
jorgen@7469
   144
     */
jorgen@7469
   145
    if (!seenFirstActivate) {
jorgen@7469
   146
        seenFirstActivate = YES;
jorgen@7469
   147
        return;
jorgen@7469
   148
    }
jorgen@7469
   149
jorgen@7466
   150
    SDL_VideoDevice *device = SDL_GetVideoDevice();
slouken@8986
   151
    if (device && device->windows) {
jorgen@7466
   152
        SDL_Window *window = device->windows;
jorgen@7466
   153
        int i;
slouken@8986
   154
        for (i = 0; i < device->num_displays; ++i) {
jorgen@7466
   155
            SDL_Window *fullscreen_window = device->displays[i].fullscreen_window;
slouken@8986
   156
            if (fullscreen_window) {
jorgen@7466
   157
                if (fullscreen_window->flags & SDL_WINDOW_MINIMIZED) {
jorgen@7466
   158
                    SDL_RestoreWindow(fullscreen_window);
jorgen@7466
   159
                }
jorgen@7466
   160
                return;
jorgen@7466
   161
            }
jorgen@7466
   162
        }
jorgen@7466
   163
jorgen@7466
   164
        if (window->flags & SDL_WINDOW_MINIMIZED) {
jorgen@7466
   165
            SDL_RestoreWindow(window);
jorgen@7466
   166
        } else {
jorgen@7466
   167
            SDL_RaiseWindow(window);
jorgen@7466
   168
        }
jorgen@7466
   169
    }
jorgen@7466
   170
}
jorgen@7466
   171
slouken@6091
   172
- (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename
slouken@6091
   173
{
icculus@10022
   174
    return (BOOL)SDL_SendDropFile(NULL, [filename UTF8String]) && SDL_SendDropComplete(NULL);
slouken@6091
   175
}
slouken@1937
   176
@end
slouken@1937
   177
jorgen@7801
   178
static SDLAppDelegate *appDelegate = nil;
jorgen@7801
   179
slouken@1931
   180
static NSString *
slouken@1931
   181
GetApplicationName(void)
slouken@1931
   182
{
slouken@8237
   183
    NSString *appName;
slouken@1931
   184
slouken@1931
   185
    /* Determine the application name */
slouken@8237
   186
    appName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"];
slouken@8986
   187
    if (!appName) {
slouken@8237
   188
        appName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleName"];
slouken@8986
   189
    }
slouken@7191
   190
slouken@8986
   191
    if (![appName length]) {
slouken@1931
   192
        appName = [[NSProcessInfo processInfo] processName];
slouken@8986
   193
    }
slouken@1931
   194
slouken@1931
   195
    return appName;
slouken@1931
   196
}
slouken@1931
   197
slouken@1931
   198
static void
slouken@1931
   199
CreateApplicationMenus(void)
slouken@1931
   200
{
slouken@1931
   201
    NSString *appName;
slouken@1931
   202
    NSString *title;
slouken@1931
   203
    NSMenu *appleMenu;
slouken@6515
   204
    NSMenu *serviceMenu;
slouken@1931
   205
    NSMenu *windowMenu;
slouken@7952
   206
    NSMenu *viewMenu;
slouken@1931
   207
    NSMenuItem *menuItem;
icculus@8653
   208
    NSMenu *mainMenu;
slouken@7191
   209
slouken@7511
   210
    if (NSApp == nil) {
jorgen@7508
   211
        return;
jorgen@7508
   212
    }
icculus@8653
   213
icculus@8653
   214
    mainMenu = [[NSMenu alloc] init];
icculus@8653
   215
slouken@1931
   216
    /* Create the main menu bar */
icculus@8653
   217
    [NSApp setMainMenu:mainMenu];
icculus@8653
   218
icculus@8653
   219
    [mainMenu release];  /* we're done with it, let NSApp own it. */
icculus@8653
   220
    mainMenu = nil;
slouken@1931
   221
slouken@1931
   222
    /* Create the application menu */
slouken@1931
   223
    appName = GetApplicationName();
slouken@1931
   224
    appleMenu = [[NSMenu alloc] initWithTitle:@""];
slouken@7191
   225
slouken@1931
   226
    /* Add menu items */
slouken@1931
   227
    title = [@"About " stringByAppendingString:appName];
slouken@1931
   228
    [appleMenu addItemWithTitle:title action:@selector(orderFrontStandardAboutPanel:) keyEquivalent:@""];
slouken@1931
   229
slouken@1931
   230
    [appleMenu addItem:[NSMenuItem separatorItem]];
slouken@1931
   231
slouken@6515
   232
    [appleMenu addItemWithTitle:@"Preferences…" action:nil keyEquivalent:@","];
slouken@6515
   233
slouken@6515
   234
    [appleMenu addItem:[NSMenuItem separatorItem]];
slouken@6515
   235
slouken@6515
   236
    serviceMenu = [[NSMenu alloc] initWithTitle:@""];
slouken@6515
   237
    menuItem = (NSMenuItem *)[appleMenu addItemWithTitle:@"Services" action:nil keyEquivalent:@""];
slouken@6515
   238
    [menuItem setSubmenu:serviceMenu];
slouken@6515
   239
slouken@6515
   240
    [NSApp setServicesMenu:serviceMenu];
slouken@6836
   241
    [serviceMenu release];
slouken@5377
   242
slouken@5377
   243
    [appleMenu addItem:[NSMenuItem separatorItem]];
slouken@5377
   244
slouken@1931
   245
    title = [@"Hide " stringByAppendingString:appName];
slouken@6515
   246
    [appleMenu addItemWithTitle:title action:@selector(hide:) keyEquivalent:@"h"];
slouken@1931
   247
slouken@6515
   248
    menuItem = (NSMenuItem *)[appleMenu addItemWithTitle:@"Hide Others" action:@selector(hideOtherApplications:) keyEquivalent:@"h"];
slouken@1931
   249
    [menuItem setKeyEquivalentModifierMask:(NSAlternateKeyMask|NSCommandKeyMask)];
slouken@1931
   250
slouken@1931
   251
    [appleMenu addItemWithTitle:@"Show All" action:@selector(unhideAllApplications:) keyEquivalent:@""];
slouken@1931
   252
slouken@1931
   253
    [appleMenu addItem:[NSMenuItem separatorItem]];
slouken@1931
   254
slouken@1931
   255
    title = [@"Quit " stringByAppendingString:appName];
slouken@6515
   256
    [appleMenu addItemWithTitle:title action:@selector(terminate:) keyEquivalent:@"q"];
slouken@7191
   257
slouken@1931
   258
    /* Put menu into the menubar */
slouken@1931
   259
    menuItem = [[NSMenuItem alloc] initWithTitle:@"" action:nil keyEquivalent:@""];
slouken@1931
   260
    [menuItem setSubmenu:appleMenu];
slouken@1931
   261
    [[NSApp mainMenu] addItem:menuItem];
slouken@1931
   262
    [menuItem release];
slouken@1931
   263
slouken@1931
   264
    /* Tell the application object that this is now the application menu */
slouken@1931
   265
    [NSApp setAppleMenu:appleMenu];
slouken@1931
   266
    [appleMenu release];
slouken@1931
   267
slouken@1931
   268
slouken@1931
   269
    /* Create the window menu */
slouken@1931
   270
    windowMenu = [[NSMenu alloc] initWithTitle:@"Window"];
slouken@7191
   271
slouken@6515
   272
    /* Add menu items */
slouken@6515
   273
    [windowMenu addItemWithTitle:@"Minimize" action:@selector(performMiniaturize:) keyEquivalent:@"m"];
slouken@7191
   274
slouken@6515
   275
    [windowMenu addItemWithTitle:@"Zoom" action:@selector(performZoom:) keyEquivalent:@""];
slouken@6515
   276
slouken@1931
   277
    /* Put menu into the menubar */
slouken@1931
   278
    menuItem = [[NSMenuItem alloc] initWithTitle:@"Window" action:nil keyEquivalent:@""];
slouken@1931
   279
    [menuItem setSubmenu:windowMenu];
slouken@1931
   280
    [[NSApp mainMenu] addItem:menuItem];
slouken@1931
   281
    [menuItem release];
slouken@7191
   282
slouken@1931
   283
    /* Tell the application object that this is now the window menu */
slouken@1931
   284
    [NSApp setWindowsMenu:windowMenu];
slouken@1931
   285
    [windowMenu release];
slouken@7952
   286
slouken@7952
   287
slouken@7952
   288
    /* Add the fullscreen view toggle menu option, if supported */
slime73@10176
   289
    if (floor(NSAppKitVersionNumber) > NSAppKitVersionNumber10_6) {
slouken@7952
   290
        /* Create the view menu */
slouken@7952
   291
        viewMenu = [[NSMenu alloc] initWithTitle:@"View"];
slouken@7952
   292
slouken@7952
   293
        /* Add menu items */
slouken@7952
   294
        menuItem = [viewMenu addItemWithTitle:@"Toggle Full Screen" action:@selector(toggleFullScreen:) keyEquivalent:@"f"];
slouken@7952
   295
        [menuItem setKeyEquivalentModifierMask:NSControlKeyMask | NSCommandKeyMask];
slouken@7952
   296
slouken@7952
   297
        /* Put menu into the menubar */
slouken@7952
   298
        menuItem = [[NSMenuItem alloc] initWithTitle:@"View" action:nil keyEquivalent:@""];
slouken@7952
   299
        [menuItem setSubmenu:viewMenu];
slouken@7952
   300
        [[NSApp mainMenu] addItem:menuItem];
slouken@7952
   301
        [menuItem release];
slouken@7952
   302
slouken@7952
   303
        [viewMenu release];
slouken@7952
   304
    }
slouken@1931
   305
}
slouken@1931
   306
slouken@1931
   307
void
slouken@1931
   308
Cocoa_RegisterApp(void)
slouken@9087
   309
{ @autoreleasepool
slouken@1931
   310
{
icculus@6639
   311
    /* This can get called more than once! Be careful what you initialize! */
slouken@1931
   312
slouken@6848
   313
    if (NSApp == nil) {
slouken@8239
   314
        [SDLApplication sharedApplication];
icculus@8648
   315
        SDL_assert(NSApp != nil);
slouken@1931
   316
alfred@9820
   317
        const char *hint = SDL_GetHint(SDL_HINT_MAC_BACKGROUND_APP);
philipp@9826
   318
        if (!hint || *hint == '0') {
slime73@10176
   319
            [NSApp setActivationPolicy:NSApplicationActivationPolicyRegular];
alfred@9820
   320
            [NSApp activateIgnoringOtherApps:YES];
alfred@9820
   321
		}
alfred@9820
   322
		
slouken@6848
   323
        if ([NSApp mainMenu] == nil) {
slouken@6848
   324
            CreateApplicationMenus();
slouken@1931
   325
        }
slouken@6848
   326
        [NSApp finishLaunching];
slouken@8289
   327
        NSDictionary *appDefaults = [[NSDictionary alloc] initWithObjectsAndKeys:
slouken@8290
   328
            [NSNumber numberWithBool:NO], @"AppleMomentumScrollSupported",
slouken@8290
   329
            [NSNumber numberWithBool:NO], @"ApplePressAndHoldEnabled",
jorgen@8718
   330
            [NSNumber numberWithBool:YES], @"ApplePersistenceIgnoreState",
slouken@8290
   331
            nil];
slouken@7739
   332
        [[NSUserDefaults standardUserDefaults] registerDefaults:appDefaults];
icculus@8648
   333
        [appDefaults release];
slouken@1931
   334
    }
jorgen@7801
   335
    if (NSApp && !appDelegate) {
jorgen@7801
   336
        appDelegate = [[SDLAppDelegate alloc] init];
jorgen@7801
   337
jorgen@7801
   338
        /* If someone else has an app delegate, it means we can't turn a
jorgen@7801
   339
         * termination into SDL_Quit, and we can't handle application:openFile:
jorgen@7801
   340
         */
jorgen@7801
   341
        if (![NSApp delegate]) {
slouken@8986
   342
            [(NSApplication *)NSApp setDelegate:appDelegate];
jorgen@7801
   343
        } else {
jorgen@7801
   344
            appDelegate->seenFirstActivate = YES;
jorgen@7801
   345
        }
slouken@6848
   346
    }
slouken@9087
   347
}}
slouken@1931
   348
slouken@1931
   349
void
slouken@1931
   350
Cocoa_PumpEvents(_THIS)
slouken@9087
   351
{ @autoreleasepool
slouken@1931
   352
{
slouken@3025
   353
    /* Update activity every 30 seconds to prevent screensaver */
icculus@9364
   354
    SDL_VideoData *data = (SDL_VideoData *)_this->driverdata;
icculus@9364
   355
    if (_this->suspend_screensaver && !data->screensaver_use_iopm) {
slouken@3025
   356
        Uint32 now = SDL_GetTicks();
slouken@3025
   357
        if (!data->screensaver_activity ||
slouken@7857
   358
            SDL_TICKS_PASSED(now, data->screensaver_activity + 30000)) {
slouken@3025
   359
            UpdateSystemActivity(UsrActivity);
slouken@3025
   360
            data->screensaver_activity = now;
slouken@3025
   361
        }
slouken@3025
   362
    }
slouken@3025
   363
slouken@6848
   364
    for ( ; ; ) {
slouken@6848
   365
        NSEvent *event = [NSApp nextEventMatchingMask:NSAnyEventMask untilDate:[NSDate distantPast] inMode:NSDefaultRunLoopMode dequeue:YES ];
slouken@6848
   366
        if ( event == nil ) {
slouken@6848
   367
            break;
slouken@1931
   368
        }
slouken@7191
   369
slouken@6848
   370
        switch ([event type]) {
slouken@6848
   371
        case NSLeftMouseDown:
slouken@6848
   372
        case NSOtherMouseDown:
slouken@6848
   373
        case NSRightMouseDown:
slouken@6848
   374
        case NSLeftMouseUp:
slouken@6848
   375
        case NSOtherMouseUp:
slouken@6848
   376
        case NSRightMouseUp:
slouken@6848
   377
        case NSLeftMouseDragged:
slouken@6848
   378
        case NSRightMouseDragged:
slouken@6848
   379
        case NSOtherMouseDragged: /* usually middle mouse dragged */
slouken@6848
   380
        case NSMouseMoved:
slouken@6848
   381
        case NSScrollWheel:
slouken@6848
   382
            Cocoa_HandleMouseEvent(_this, event);
slouken@6848
   383
            break;
slouken@6848
   384
        case NSKeyDown:
slouken@6848
   385
        case NSKeyUp:
slouken@6848
   386
        case NSFlagsChanged:
slouken@6848
   387
            Cocoa_HandleKeyEvent(_this, event);
slouken@6848
   388
            break;
slouken@6848
   389
        default:
slouken@6848
   390
            break;
slouken@6848
   391
        }
slouken@6848
   392
        /* Pass through to NSApp to make sure everything stays in sync */
slouken@6848
   393
        [NSApp sendEvent:event];
slouken@1931
   394
    }
slouken@9087
   395
}}
slouken@1931
   396
icculus@9364
   397
void
icculus@9364
   398
Cocoa_SuspendScreenSaver(_THIS)
icculus@9364
   399
{ @autoreleasepool
icculus@9364
   400
{
icculus@9364
   401
    SDL_VideoData *data = (SDL_VideoData *)_this->driverdata;
icculus@9364
   402
icculus@9364
   403
    if (!data->screensaver_use_iopm) {
icculus@9364
   404
        return;
icculus@9364
   405
    }
icculus@9364
   406
icculus@9364
   407
    if (data->screensaver_assertion) {
icculus@9364
   408
        IOPMAssertionRelease(data->screensaver_assertion);
icculus@9364
   409
        data->screensaver_assertion = 0;
icculus@9364
   410
    }
icculus@9364
   411
icculus@9364
   412
    if (_this->suspend_screensaver) {
icculus@9364
   413
        /* FIXME: this should ideally describe the real reason why the game
icculus@9364
   414
         * called SDL_DisableScreenSaver. Note that the name is only meant to be
icculus@9364
   415
         * seen by OS X power users. there's an additional optional human-readable
icculus@9364
   416
         * (localized) reason parameter which we don't set.
icculus@9364
   417
         */
icculus@9364
   418
        NSString *name = [GetApplicationName() stringByAppendingString:@" using SDL_DisableScreenSaver"];
icculus@9364
   419
        IOPMAssertionCreateWithDescription(kIOPMAssertPreventUserIdleDisplaySleep,
icculus@9364
   420
                                           (CFStringRef) name,
icculus@9364
   421
                                           NULL, NULL, NULL, 0, NULL,
icculus@9364
   422
                                           &data->screensaver_assertion);
icculus@9364
   423
    }
icculus@9364
   424
}}
icculus@9364
   425
slouken@6044
   426
#endif /* SDL_VIDEO_DRIVER_COCOA */
slouken@6044
   427
slouken@1931
   428
/* vi: set ts=4 sw=4 expandtab: */