mirror of https://github.com/OpenTTD/OpenTTD
Codechange: [OSX] Remove unused 'app active' flag.
parent
9c8721922b
commit
c78e559e88
|
@ -39,8 +39,7 @@ private:
|
||||||
uint32 palette[256]; ///< Colour Palette
|
uint32 palette[256]; ///< Colour Palette
|
||||||
|
|
||||||
public:
|
public:
|
||||||
bool active; ///< Whether the window is visible
|
bool setup; ///< Window is currently being created.
|
||||||
bool setup;
|
|
||||||
|
|
||||||
OTTD_CocoaWindow *window; ///< Pointer to window object
|
OTTD_CocoaWindow *window; ///< Pointer to window object
|
||||||
OTTD_CocoaView *cocoaview; ///< Pointer to view object
|
OTTD_CocoaView *cocoaview; ///< Pointer to view object
|
||||||
|
|
|
@ -111,7 +111,6 @@ VideoDriver_Cocoa::VideoDriver_Cocoa()
|
||||||
this->buffer_depth = 0;
|
this->buffer_depth = 0;
|
||||||
this->window_buffer = nullptr;
|
this->window_buffer = nullptr;
|
||||||
this->pixel_buffer = nullptr;
|
this->pixel_buffer = nullptr;
|
||||||
this->active = false;
|
|
||||||
this->setup = false;
|
this->setup = false;
|
||||||
|
|
||||||
this->window = nil;
|
this->window = nil;
|
||||||
|
|
|
@ -32,11 +32,8 @@ extern NSString *OTTDMainLaunchGameEngine;
|
||||||
@interface OTTD_CocoaWindow : NSWindow
|
@interface OTTD_CocoaWindow : NSWindow
|
||||||
- (instancetype)initWithContentRect:(NSRect)contentRect styleMask:(NSUInteger)styleMask backing:(NSBackingStoreType)backingType defer:(BOOL)flag driver:(VideoDriver_Cocoa *)drv;
|
- (instancetype)initWithContentRect:(NSRect)contentRect styleMask:(NSUInteger)styleMask backing:(NSBackingStoreType)backingType defer:(BOOL)flag driver:(VideoDriver_Cocoa *)drv;
|
||||||
|
|
||||||
- (void)miniaturize:(id)sender;
|
|
||||||
- (void)display;
|
- (void)display;
|
||||||
- (void)setFrame:(NSRect)frameRect display:(BOOL)flag;
|
- (void)setFrame:(NSRect)frameRect display:(BOOL)flag;
|
||||||
- (void)appDidHide:(NSNotification*)note;
|
|
||||||
- (void)appDidUnhide:(NSNotification*)note;
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
/** Subclass of NSView to support mouse awareness and text input. */
|
/** Subclass of NSView to support mouse awareness and text input. */
|
||||||
|
|
|
@ -370,13 +370,6 @@ void CocoaDialog(const char *title, const char *message, const char *buttonLabel
|
||||||
- (instancetype)initWithContentRect:(NSRect)contentRect styleMask:(NSUInteger)styleMask backing:(NSBackingStoreType)backingType defer:(BOOL)flag driver:(VideoDriver_Cocoa *)drv
|
- (instancetype)initWithContentRect:(NSRect)contentRect styleMask:(NSUInteger)styleMask backing:(NSBackingStoreType)backingType defer:(BOOL)flag driver:(VideoDriver_Cocoa *)drv
|
||||||
{
|
{
|
||||||
if (self = [ super initWithContentRect:contentRect styleMask:styleMask backing:backingType defer:flag ]) {
|
if (self = [ super initWithContentRect:contentRect styleMask:styleMask backing:backingType defer:flag ]) {
|
||||||
/* Make our window subclass receive these application notifications */
|
|
||||||
[ [ NSNotificationCenter defaultCenter ] addObserver:self
|
|
||||||
selector:@selector(appDidHide:) name:NSApplicationDidHideNotification object:NSApp ];
|
|
||||||
|
|
||||||
[ [ NSNotificationCenter defaultCenter ] addObserver:self
|
|
||||||
selector:@selector(appDidUnhide:) name:NSApplicationDidUnhideNotification object:NSApp ];
|
|
||||||
|
|
||||||
self->driver = drv;
|
self->driver = drv;
|
||||||
|
|
||||||
[ self setContentMinSize:NSMakeSize(64.0f, 64.0f) ];
|
[ self setContentMinSize:NSMakeSize(64.0f, 64.0f) ];
|
||||||
|
@ -391,17 +384,6 @@ void CocoaDialog(const char *title, const char *message, const char *buttonLabel
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Minimize the window
|
|
||||||
*/
|
|
||||||
- (void)miniaturize:(id)sender
|
|
||||||
{
|
|
||||||
/* window is hidden now */
|
|
||||||
driver->active = false;
|
|
||||||
|
|
||||||
[ super miniaturize:sender ];
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method fires just before the window deminaturizes from the Dock.
|
* This method fires just before the window deminaturizes from the Dock.
|
||||||
* We'll save the current visible surface, let the window manager redraw any
|
* We'll save the current visible surface, let the window manager redraw any
|
||||||
|
@ -418,9 +400,6 @@ void CocoaDialog(const char *title, const char *message, const char *buttonLabel
|
||||||
|
|
||||||
/* restore visible surface */
|
/* restore visible surface */
|
||||||
[ self restoreCachedImage ];
|
[ self restoreCachedImage ];
|
||||||
|
|
||||||
/* window is visible again */
|
|
||||||
driver->active = true;
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Define the rectangle we draw our window in
|
* Define the rectangle we draw our window in
|
||||||
|
@ -431,20 +410,6 @@ void CocoaDialog(const char *title, const char *message, const char *buttonLabel
|
||||||
|
|
||||||
driver->AllocateBackingStore();
|
driver->AllocateBackingStore();
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* Handle hiding of the application
|
|
||||||
*/
|
|
||||||
- (void)appDidHide:(NSNotification*)note
|
|
||||||
{
|
|
||||||
driver->active = false;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Unhide and restore display plane and re-activate driver
|
|
||||||
*/
|
|
||||||
- (void)appDidUnhide:(NSNotification*)note
|
|
||||||
{
|
|
||||||
driver->active = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
@ -1122,26 +1087,6 @@ void CocoaDialog(const char *title, const char *message, const char *buttonLabel
|
||||||
|
|
||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
/** Handle key acceptance */
|
|
||||||
- (void)windowDidBecomeKey:(NSNotification*)aNotification
|
|
||||||
{
|
|
||||||
driver->active = true;
|
|
||||||
}
|
|
||||||
/** Resign key acceptance */
|
|
||||||
- (void)windowDidResignKey:(NSNotification*)aNotification
|
|
||||||
{
|
|
||||||
driver->active = false;
|
|
||||||
}
|
|
||||||
/** Handle becoming main window */
|
|
||||||
- (void)windowDidBecomeMain:(NSNotification*)aNotification
|
|
||||||
{
|
|
||||||
driver->active = true;
|
|
||||||
}
|
|
||||||
/** Resign being main window */
|
|
||||||
- (void)windowDidResignMain:(NSNotification*)aNotification
|
|
||||||
{
|
|
||||||
driver->active = false;
|
|
||||||
}
|
|
||||||
/** Window entered fullscreen mode (10.7). */
|
/** Window entered fullscreen mode (10.7). */
|
||||||
- (void)windowDidEnterFullScreen:(NSNotification *)aNotification
|
- (void)windowDidEnterFullScreen:(NSNotification *)aNotification
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue