winemac.drv: Fix warnings for constants deprecated by macOS 10.12.
Signed-off-by: Brendan Shanks <bshanks@codeweavers.com> Signed-off-by: Ken Thomases <ken@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
587732acb7
commit
7aa2601f94
|
@ -22,6 +22,41 @@
|
|||
|
||||
#include "macdrv_cocoa.h"
|
||||
|
||||
#if !defined(MAC_OS_X_VERSION_10_12) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_12
|
||||
/* For older SDKs, #define the new names of constants deprecated/renamed in macOS 10.12. */
|
||||
#define NSCompositingOperationSourceOver NSCompositeSourceOver
|
||||
#define NSEventMaskAny NSAnyEventMask
|
||||
#define NSEventMaskLeftMouseDown NSLeftMouseDownMask
|
||||
#define NSEventMaskOtherMouseDown NSOtherMouseDownMask
|
||||
#define NSEventMaskRightMouseDown NSRightMouseDownMask
|
||||
#define NSEventModifierFlagCommand NSCommandKeyMask
|
||||
#define NSEventModifierFlagControl NSControlKeyMask
|
||||
#define NSEventModifierFlagOption NSAlternateKeyMask
|
||||
#define NSEventModifierFlagShift NSShiftKeyMask
|
||||
#define NSEventTypeAppKitDefined NSAppKitDefined
|
||||
#define NSEventTypeApplicationDefined NSApplicationDefined
|
||||
#define NSEventTypeFlagsChanged NSFlagsChanged
|
||||
#define NSEventTypeKeyDown NSKeyDown
|
||||
#define NSEventTypeKeyUp NSKeyUp
|
||||
#define NSEventTypeLeftMouseDown NSLeftMouseDown
|
||||
#define NSEventTypeLeftMouseDragged NSLeftMouseDragged
|
||||
#define NSEventTypeLeftMouseUp NSLeftMouseUp
|
||||
#define NSEventTypeMouseMoved NSMouseMoved
|
||||
#define NSEventTypeOtherMouseDown NSOtherMouseDown
|
||||
#define NSEventTypeOtherMouseDragged NSOtherMouseDragged
|
||||
#define NSEventTypeOtherMouseUp NSOtherMouseUp
|
||||
#define NSEventTypeRightMouseDown NSRightMouseDown
|
||||
#define NSEventTypeRightMouseUp NSRightMouseUp
|
||||
#define NSEventTypeRightMouseDragged NSRightMouseDragged
|
||||
#define NSEventTypeScrollWheel NSScrollWheel
|
||||
#define NSWindowStyleMaskBorderless NSBorderlessWindowMask
|
||||
#define NSWindowStyleMaskClosable NSClosableWindowMask
|
||||
#define NSWindowStyleMaskFullScreen NSFullScreenWindowMask
|
||||
#define NSWindowStyleMaskMiniaturizable NSMiniaturizableWindowMask
|
||||
#define NSWindowStyleMaskResizable NSResizableWindowMask
|
||||
#define NSWindowStyleMaskTitled NSTitledWindowMask
|
||||
#define NSWindowStyleMaskUtilityWindow NSUtilityWindowMask
|
||||
#endif
|
||||
|
||||
#define ERR(...) do { if (macdrv_err_on) LogError(__func__, __VA_ARGS__); } while (false)
|
||||
|
||||
|
|
|
@ -258,7 +258,7 @@ - (void) transformProcessToForeground
|
|||
item = [submenu addItemWithTitle:WineLocalizedString(STRING_MENU_ITEM_HIDE_OTHERS)
|
||||
action:@selector(hideOtherApplications:)
|
||||
keyEquivalent:@"h"];
|
||||
[item setKeyEquivalentModifierMask:NSCommandKeyMask | NSAlternateKeyMask];
|
||||
[item setKeyEquivalentModifierMask:NSEventModifierFlagCommand | NSEventModifierFlagOption];
|
||||
|
||||
item = [submenu addItemWithTitle:WineLocalizedString(STRING_MENU_ITEM_SHOW_ALL)
|
||||
action:@selector(unhideAllApplications:)
|
||||
|
@ -271,7 +271,7 @@ - (void) transformProcessToForeground
|
|||
else
|
||||
title = WineLocalizedString(STRING_MENU_ITEM_QUIT);
|
||||
item = [submenu addItemWithTitle:title action:@selector(terminate:) keyEquivalent:@"q"];
|
||||
[item setKeyEquivalentModifierMask:NSCommandKeyMask | NSAlternateKeyMask];
|
||||
[item setKeyEquivalentModifierMask:NSEventModifierFlagCommand | NSEventModifierFlagOption];
|
||||
item = [[[NSMenuItem alloc] init] autorelease];
|
||||
[item setTitle:WineLocalizedString(STRING_MENU_WINE)];
|
||||
[item setSubmenu:submenu];
|
||||
|
@ -290,7 +290,9 @@ - (void) transformProcessToForeground
|
|||
item = [submenu addItemWithTitle:WineLocalizedString(STRING_MENU_ITEM_ENTER_FULL_SCREEN)
|
||||
action:@selector(toggleFullScreen:)
|
||||
keyEquivalent:@"f"];
|
||||
[item setKeyEquivalentModifierMask:NSCommandKeyMask | NSAlternateKeyMask | NSControlKeyMask];
|
||||
[item setKeyEquivalentModifierMask:NSEventModifierFlagCommand |
|
||||
NSEventModifierFlagOption |
|
||||
NSEventModifierFlagControl];
|
||||
}
|
||||
[submenu addItem:[NSMenuItem separatorItem]];
|
||||
[submenu addItemWithTitle:WineLocalizedString(STRING_MENU_ITEM_BRING_ALL_TO_FRONT)
|
||||
|
@ -317,7 +319,7 @@ - (BOOL) waitUntilQueryDone:(int*)done timeout:(NSDate*)timeout processEvents:(B
|
|||
if (processEvents)
|
||||
{
|
||||
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
|
||||
NSEvent* event = [NSApp nextEventMatchingMask:NSAnyEventMask
|
||||
NSEvent* event = [NSApp nextEventMatchingMask:NSEventMaskAny
|
||||
untilDate:timeout
|
||||
inMode:NSDefaultRunLoopMode
|
||||
dequeue:YES];
|
||||
|
@ -1607,7 +1609,7 @@ - (void) handleWindowDrag:(NSEvent*)anEvent begin:(BOOL)begin
|
|||
- (void) handleMouseMove:(NSEvent*)anEvent
|
||||
{
|
||||
WineWindow* targetWindow;
|
||||
BOOL drag = [anEvent type] != NSMouseMoved;
|
||||
BOOL drag = [anEvent type] != NSEventTypeMouseMoved;
|
||||
|
||||
if ([windowsBeingDragged count])
|
||||
targetWindow = nil;
|
||||
|
@ -1758,11 +1760,11 @@ - (void) handleMouseButton:(NSEvent*)theEvent
|
|||
WineWindow* windowBroughtForward = nil;
|
||||
BOOL process = FALSE;
|
||||
|
||||
if (type == NSLeftMouseUp && [windowsBeingDragged count])
|
||||
if (type == NSEventTypeLeftMouseUp && [windowsBeingDragged count])
|
||||
[self handleWindowDrag:theEvent begin:NO];
|
||||
|
||||
if ([window isKindOfClass:[WineWindow class]] &&
|
||||
type == NSLeftMouseDown &&
|
||||
type == NSEventTypeLeftMouseDown &&
|
||||
![theEvent wine_commandKeyDown])
|
||||
{
|
||||
NSWindowButton windowButton;
|
||||
|
@ -1795,7 +1797,9 @@ - (void) handleMouseButton:(NSEvent*)theEvent
|
|||
|
||||
if ([window isKindOfClass:[WineWindow class]])
|
||||
{
|
||||
BOOL pressed = (type == NSLeftMouseDown || type == NSRightMouseDown || type == NSOtherMouseDown);
|
||||
BOOL pressed = (type == NSEventTypeLeftMouseDown ||
|
||||
type == NSEventTypeRightMouseDown ||
|
||||
type == NSEventTypeOtherMouseDown);
|
||||
CGPoint pt = CGEventGetLocation([theEvent CGEvent]);
|
||||
|
||||
if (clippingCursor)
|
||||
|
@ -1811,7 +1815,7 @@ - (void) handleMouseButton:(NSEvent*)theEvent
|
|||
NSPoint nspoint = [self flippedMouseLocation:NSPointFromCGPoint(pt)];
|
||||
NSRect contentRect = [window contentRectForFrameRect:[window frame]];
|
||||
process = NSMouseInRect(nspoint, contentRect, NO);
|
||||
if (process && [window styleMask] & NSResizableWindowMask)
|
||||
if (process && [window styleMask] & NSWindowStyleMaskResizable)
|
||||
{
|
||||
// Ignore clicks in the grow box (resize widget).
|
||||
HIPoint origin = { 0, 0 };
|
||||
|
@ -1821,7 +1825,7 @@ - (void) handleMouseButton:(NSEvent*)theEvent
|
|||
|
||||
info.kind = kHIThemeGrowBoxKindNormal;
|
||||
info.direction = kThemeGrowRight | kThemeGrowDown;
|
||||
if ([window styleMask] & NSUtilityWindowMask)
|
||||
if ([window styleMask] & NSWindowStyleMaskUtilityWindow)
|
||||
info.size = kHIThemeGrowBoxSizeSmall;
|
||||
else
|
||||
info.size = kHIThemeGrowBoxSizeNormal;
|
||||
|
@ -2063,27 +2067,27 @@ - (BOOL) handleEvent:(NSEvent*)anEvent
|
|||
BOOL ret = FALSE;
|
||||
NSEventType type = [anEvent type];
|
||||
|
||||
if (type == NSFlagsChanged)
|
||||
if (type == NSEventTypeFlagsChanged)
|
||||
self.lastFlagsChanged = anEvent;
|
||||
else if (type == NSMouseMoved || type == NSLeftMouseDragged ||
|
||||
type == NSRightMouseDragged || type == NSOtherMouseDragged)
|
||||
else if (type == NSEventTypeMouseMoved || type == NSEventTypeLeftMouseDragged ||
|
||||
type == NSEventTypeRightMouseDragged || type == NSEventTypeOtherMouseDragged)
|
||||
{
|
||||
[self handleMouseMove:anEvent];
|
||||
ret = mouseCaptureWindow && ![windowsBeingDragged count];
|
||||
}
|
||||
else if (type == NSLeftMouseDown || type == NSLeftMouseUp ||
|
||||
type == NSRightMouseDown || type == NSRightMouseUp ||
|
||||
type == NSOtherMouseDown || type == NSOtherMouseUp)
|
||||
else if (type == NSEventTypeLeftMouseDown || type == NSEventTypeLeftMouseUp ||
|
||||
type == NSEventTypeRightMouseDown || type == NSEventTypeRightMouseUp ||
|
||||
type == NSEventTypeOtherMouseDown || type == NSEventTypeOtherMouseUp)
|
||||
{
|
||||
[self handleMouseButton:anEvent];
|
||||
ret = mouseCaptureWindow && ![windowsBeingDragged count];
|
||||
}
|
||||
else if (type == NSScrollWheel)
|
||||
else if (type == NSEventTypeScrollWheel)
|
||||
{
|
||||
[self handleScrollWheel:anEvent];
|
||||
ret = mouseCaptureWindow != nil;
|
||||
}
|
||||
else if (type == NSKeyDown)
|
||||
else if (type == NSEventTypeKeyDown)
|
||||
{
|
||||
// -[NSApplication sendEvent:] seems to consume presses of the Help
|
||||
// key (Insert key on PC keyboards), so we have to bypass it and
|
||||
|
@ -2094,7 +2098,7 @@ - (BOOL) handleEvent:(NSEvent*)anEvent
|
|||
ret = TRUE;
|
||||
}
|
||||
}
|
||||
else if (type == NSKeyUp)
|
||||
else if (type == NSEventTypeKeyUp)
|
||||
{
|
||||
uint16_t keyCode = [anEvent keyCode];
|
||||
if ([self isKeyPressed:keyCode])
|
||||
|
@ -2105,7 +2109,7 @@ - (BOOL) handleEvent:(NSEvent*)anEvent
|
|||
[window postKeyEvent:anEvent];
|
||||
}
|
||||
}
|
||||
else if (type == NSAppKitDefined)
|
||||
else if (type == NSEventTypeAppKitDefined)
|
||||
{
|
||||
short subtype = [anEvent subtype];
|
||||
|
||||
|
@ -2123,11 +2127,11 @@ - (void) didSendEvent:(NSEvent*)anEvent
|
|||
{
|
||||
NSEventType type = [anEvent type];
|
||||
|
||||
if (type == NSKeyDown && ![anEvent isARepeat] && [anEvent keyCode] == kVK_Tab)
|
||||
if (type == NSEventTypeKeyDown && ![anEvent isARepeat] && [anEvent keyCode] == kVK_Tab)
|
||||
{
|
||||
NSUInteger modifiers = [anEvent modifierFlags];
|
||||
if ((modifiers & NSCommandKeyMask) &&
|
||||
!(modifiers & (NSControlKeyMask | NSAlternateKeyMask)))
|
||||
if ((modifiers & NSEventModifierFlagCommand) &&
|
||||
!(modifiers & (NSEventModifierFlagControl | NSEventModifierFlagOption)))
|
||||
{
|
||||
// Command-Tab and Command-Shift-Tab would normally be intercepted
|
||||
// by the system to switch applications. If we're seeing it, it's
|
||||
|
|
|
@ -44,7 +44,10 @@ @implementation NSEvent (WineExtensions)
|
|||
|
||||
static BOOL wine_commandKeyDown(NSUInteger flags)
|
||||
{
|
||||
return ((flags & (NSShiftKeyMask | NSControlKeyMask | NSAlternateKeyMask | NSCommandKeyMask)) == NSCommandKeyMask);
|
||||
return ((flags & (NSEventModifierFlagShift |
|
||||
NSEventModifierFlagControl |
|
||||
NSEventModifierFlagOption |
|
||||
NSEventModifierFlagCommand)) == NSEventModifierFlagCommand);
|
||||
}
|
||||
|
||||
+ (BOOL) wine_commandKeyDown
|
||||
|
@ -754,7 +757,7 @@ void macdrv_set_query_done(macdrv_query *query)
|
|||
query->done = TRUE;
|
||||
macdrv_release_query(query);
|
||||
|
||||
event = [NSEvent otherEventWithType:NSApplicationDefined
|
||||
event = [NSEvent otherEventWithType:NSEventTypeApplicationDefined
|
||||
location:NSZeroPoint
|
||||
modifierFlags:0
|
||||
timestamp:[[NSProcessInfo processInfo] systemUptime]
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
#import "cocoa_opengl.h"
|
||||
|
||||
#include "macdrv_cocoa.h"
|
||||
#include "cocoa_app.h"
|
||||
#include "cocoa_event.h"
|
||||
|
||||
|
||||
|
@ -53,7 +54,7 @@ + (NSView*) dummyView
|
|||
dispatch_once(&once, ^{
|
||||
OnMainThread(^{
|
||||
dummyWindow = [[NSWindow alloc] initWithContentRect:NSMakeRect(0, 0, 100, 100)
|
||||
styleMask:NSBorderlessWindowMask
|
||||
styleMask:NSWindowStyleMaskBorderless
|
||||
backing:NSBackingStoreBuffered
|
||||
defer:NO];
|
||||
});
|
||||
|
|
|
@ -117,7 +117,9 @@ - (void) postMouseButtonEvent:(NSEvent*)nsevent;
|
|||
event = macdrv_create_event(STATUS_ITEM_MOUSE_BUTTON, nil);
|
||||
event->status_item_mouse_button.item = (macdrv_status_item)self;
|
||||
event->status_item_mouse_button.button = [nsevent buttonNumber];
|
||||
event->status_item_mouse_button.down = (typeMask & (NSLeftMouseDownMask | NSRightMouseDownMask | NSOtherMouseDownMask)) != 0;
|
||||
event->status_item_mouse_button.down = (typeMask & (NSEventMaskLeftMouseDown |
|
||||
NSEventMaskRightMouseDown |
|
||||
NSEventMaskOtherMouseDown)) != 0;
|
||||
event->status_item_mouse_button.count = [nsevent clickCount];
|
||||
event->status_item_mouse_button.x = floor(point.x);
|
||||
event->status_item_mouse_button.y = floor(point.y);
|
||||
|
@ -147,7 +149,7 @@ - (void) drawRect:(NSRect)rect
|
|||
|
||||
[image drawAtPoint:imageOrigin
|
||||
fromRect:NSZeroRect
|
||||
operation:NSCompositeSourceOver
|
||||
operation:NSCompositingOperationSourceOver
|
||||
fraction:1];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
NSWindowCollectionBehaviorFullScreenPrimary = 1 << 7,
|
||||
NSWindowCollectionBehaviorFullScreenAuxiliary = 1 << 8,
|
||||
NSWindowFullScreenButton = 7,
|
||||
NSFullScreenWindowMask = 1 << 14,
|
||||
NSWindowStyleMaskFullScreen = 1 << 14,
|
||||
};
|
||||
|
||||
@interface NSWindow (WineFullScreenExtensions)
|
||||
|
@ -64,13 +64,13 @@ static NSUInteger style_mask_for_features(const struct macdrv_window_features* w
|
|||
|
||||
if (wf->title_bar)
|
||||
{
|
||||
style_mask = NSTitledWindowMask;
|
||||
if (wf->close_button) style_mask |= NSClosableWindowMask;
|
||||
if (wf->minimize_button) style_mask |= NSMiniaturizableWindowMask;
|
||||
if (wf->resizable || wf->maximize_button) style_mask |= NSResizableWindowMask;
|
||||
if (wf->utility) style_mask |= NSUtilityWindowMask;
|
||||
style_mask = NSWindowStyleMaskTitled;
|
||||
if (wf->close_button) style_mask |= NSWindowStyleMaskClosable;
|
||||
if (wf->minimize_button) style_mask |= NSWindowStyleMaskMiniaturizable;
|
||||
if (wf->resizable || wf->maximize_button) style_mask |= NSWindowStyleMaskResizable;
|
||||
if (wf->utility) style_mask |= NSWindowStyleMaskUtilityWindow;
|
||||
}
|
||||
else style_mask = NSBorderlessWindowMask;
|
||||
else style_mask = NSWindowStyleMaskBorderless;
|
||||
|
||||
return style_mask;
|
||||
}
|
||||
|
@ -1058,7 +1058,7 @@ - (void) dealloc
|
|||
- (BOOL) preventResizing
|
||||
{
|
||||
BOOL preventForClipping = cursor_clipping_locks_windows && [[WineApplicationController sharedController] clippingCursor];
|
||||
return ([self styleMask] & NSResizableWindowMask) && (disabled || !resizable || preventForClipping);
|
||||
return ([self styleMask] & NSWindowStyleMaskResizable) && (disabled || !resizable || preventForClipping);
|
||||
}
|
||||
|
||||
- (BOOL) allowsMovingWithMaximized:(BOOL)inMaximized
|
||||
|
@ -1075,11 +1075,11 @@ - (void) adjustFeaturesForState
|
|||
{
|
||||
NSUInteger style = [self styleMask];
|
||||
|
||||
if (style & NSClosableWindowMask)
|
||||
if (style & NSWindowStyleMaskClosable)
|
||||
[[self standardWindowButton:NSWindowCloseButton] setEnabled:!self.disabled];
|
||||
if (style & NSMiniaturizableWindowMask)
|
||||
if (style & NSWindowStyleMaskMiniaturizable)
|
||||
[[self standardWindowButton:NSWindowMiniaturizeButton] setEnabled:!self.disabled];
|
||||
if (style & NSResizableWindowMask)
|
||||
if (style & NSWindowStyleMaskResizable)
|
||||
[[self standardWindowButton:NSWindowZoomButton] setEnabled:!self.disabled];
|
||||
if ([self respondsToSelector:@selector(toggleFullScreen:)])
|
||||
{
|
||||
|
@ -1110,7 +1110,7 @@ - (void) adjustFullScreenBehavior:(NSWindowCollectionBehavior)behavior
|
|||
NSUInteger style = [self styleMask];
|
||||
|
||||
if (behavior & NSWindowCollectionBehaviorParticipatesInCycle &&
|
||||
style & NSResizableWindowMask && !(style & NSUtilityWindowMask) && !maximized &&
|
||||
style & NSWindowStyleMaskResizable && !(style & NSWindowStyleMaskUtilityWindow) && !maximized &&
|
||||
!(self.parentWindow || self.latentParentWindow))
|
||||
{
|
||||
behavior |= NSWindowCollectionBehaviorFullScreenPrimary;
|
||||
|
@ -1120,7 +1120,7 @@ - (void) adjustFullScreenBehavior:(NSWindowCollectionBehavior)behavior
|
|||
{
|
||||
behavior &= ~NSWindowCollectionBehaviorFullScreenPrimary;
|
||||
behavior |= NSWindowCollectionBehaviorFullScreenAuxiliary;
|
||||
if (style & NSFullScreenWindowMask)
|
||||
if (style & NSWindowStyleMaskFullScreen)
|
||||
[super toggleFullScreen:nil];
|
||||
}
|
||||
}
|
||||
|
@ -1134,24 +1134,24 @@ - (void) adjustFullScreenBehavior:(NSWindowCollectionBehavior)behavior
|
|||
|
||||
- (void) setWindowFeatures:(const struct macdrv_window_features*)wf
|
||||
{
|
||||
static const NSUInteger usedStyles = NSTitledWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask |
|
||||
NSResizableWindowMask | NSUtilityWindowMask | NSBorderlessWindowMask;
|
||||
static const NSUInteger usedStyles = NSWindowStyleMaskTitled | NSWindowStyleMaskClosable | NSWindowStyleMaskMiniaturizable |
|
||||
NSWindowStyleMaskResizable | NSWindowStyleMaskUtilityWindow | NSWindowStyleMaskBorderless;
|
||||
NSUInteger currentStyle = [self styleMask];
|
||||
NSUInteger newStyle = style_mask_for_features(wf) | (currentStyle & ~usedStyles);
|
||||
|
||||
if (newStyle != currentStyle)
|
||||
{
|
||||
NSString* title = [[[self title] copy] autorelease];
|
||||
BOOL showingButtons = (currentStyle & (NSClosableWindowMask | NSMiniaturizableWindowMask | NSResizableWindowMask)) != 0;
|
||||
BOOL shouldShowButtons = (newStyle & (NSClosableWindowMask | NSMiniaturizableWindowMask | NSResizableWindowMask)) != 0;
|
||||
if (shouldShowButtons != showingButtons && !((newStyle ^ currentStyle) & NSClosableWindowMask))
|
||||
BOOL showingButtons = (currentStyle & (NSWindowStyleMaskClosable | NSWindowStyleMaskMiniaturizable | NSWindowStyleMaskResizable)) != 0;
|
||||
BOOL shouldShowButtons = (newStyle & (NSWindowStyleMaskClosable | NSWindowStyleMaskMiniaturizable | NSWindowStyleMaskResizable)) != 0;
|
||||
if (shouldShowButtons != showingButtons && !((newStyle ^ currentStyle) & NSWindowStyleMaskClosable))
|
||||
{
|
||||
// -setStyleMask: is buggy on 10.7+ with respect to NSResizableWindowMask.
|
||||
// If transitioning from NSTitledWindowMask | NSResizableWindowMask to
|
||||
// just NSTitledWindowMask, the window buttons should disappear rather
|
||||
// -setStyleMask: is buggy on 10.7+ with respect to NSWindowStyleMaskResizable.
|
||||
// If transitioning from NSWindowStyleMaskTitled | NSWindowStyleMaskResizable to
|
||||
// just NSWindowStyleMaskTitled, the window buttons should disappear rather
|
||||
// than just being disabled. But they don't. Similarly in reverse.
|
||||
// The workaround is to also toggle NSClosableWindowMask at the same time.
|
||||
[self setStyleMask:newStyle ^ NSClosableWindowMask];
|
||||
// The workaround is to also toggle NSWindowStyleMaskClosable at the same time.
|
||||
[self setStyleMask:newStyle ^ NSWindowStyleMaskClosable];
|
||||
}
|
||||
[self setStyleMask:newStyle];
|
||||
|
||||
|
@ -1283,14 +1283,14 @@ - (void) setMacDrvState:(const struct macdrv_window_state*)state
|
|||
{
|
||||
if ([self wouldBeVisible])
|
||||
{
|
||||
if ([self styleMask] & NSFullScreenWindowMask)
|
||||
if ([self styleMask] & NSWindowStyleMaskFullScreen)
|
||||
{
|
||||
[self postDidUnminimizeEvent];
|
||||
discard &= ~event_mask_for_type(WINDOW_DID_UNMINIMIZE);
|
||||
}
|
||||
else
|
||||
{
|
||||
[self setStyleMask:([self styleMask] | NSMiniaturizableWindowMask)];
|
||||
[self setStyleMask:([self styleMask] | NSWindowStyleMaskMiniaturizable)];
|
||||
[super miniaturize:nil];
|
||||
discard |= event_mask_for_type(WINDOW_BROUGHT_FORWARD) |
|
||||
event_mask_for_type(WINDOW_GOT_FOCUS) |
|
||||
|
@ -1765,7 +1765,7 @@ - (void) orderBelow:(WineWindow*)prev orAbove:(WineWindow*)next activate:(BOOL)a
|
|||
|
||||
if (pendingMinimize)
|
||||
{
|
||||
[self setStyleMask:([self styleMask] | NSMiniaturizableWindowMask)];
|
||||
[self setStyleMask:([self styleMask] | NSWindowStyleMaskMiniaturizable)];
|
||||
[super miniaturize:nil];
|
||||
pendingMinimize = FALSE;
|
||||
}
|
||||
|
@ -1814,7 +1814,7 @@ - (void) doOrderOut
|
|||
[parent grabDockIconSnapshotFromWindow:self force:NO];
|
||||
|
||||
[self becameIneligibleParentOrChild];
|
||||
if ([self isMiniaturized] || [self styleMask] & NSFullScreenWindowMask)
|
||||
if ([self isMiniaturized] || [self styleMask] & NSWindowStyleMaskFullScreen)
|
||||
{
|
||||
fakingClose = TRUE;
|
||||
[self close];
|
||||
|
@ -1844,7 +1844,7 @@ - (void) doOrderOut
|
|||
- (void) updateFullscreen
|
||||
{
|
||||
NSRect contentRect = [self contentRectForFrameRect:self.wine_fractionalFrame];
|
||||
BOOL nowFullscreen = !([self styleMask] & NSFullScreenWindowMask) && screen_covered_by_rect(contentRect, [NSScreen screens]);
|
||||
BOOL nowFullscreen = !([self styleMask] & NSWindowStyleMaskFullScreen) && screen_covered_by_rect(contentRect, [NSScreen screens]);
|
||||
|
||||
if (nowFullscreen != fullscreen)
|
||||
{
|
||||
|
@ -2077,7 +2077,7 @@ - (void) postKeyEvent:(NSEvent *)theEvent
|
|||
{
|
||||
[self flagsChanged:theEvent];
|
||||
[self postKey:[theEvent keyCode]
|
||||
pressed:[theEvent type] == NSKeyDown
|
||||
pressed:[theEvent type] == NSEventTypeKeyDown
|
||||
modifiers:adjusted_modifiers_for_settings([theEvent modifierFlags])
|
||||
event:theEvent];
|
||||
}
|
||||
|
@ -2120,9 +2120,9 @@ - (void) postWindowFrameChanged:(NSRect)frame fullscreen:(BOOL)isFullscreen resi
|
|||
NSUInteger style = self.styleMask;
|
||||
|
||||
if (isFullscreen)
|
||||
style |= NSFullScreenWindowMask;
|
||||
style |= NSWindowStyleMaskFullScreen;
|
||||
else
|
||||
style &= ~NSFullScreenWindowMask;
|
||||
style &= ~NSWindowStyleMaskFullScreen;
|
||||
frame = [[self class] contentRectForFrameRect:frame styleMask:style];
|
||||
[[WineApplicationController sharedController] flipRect:&frame];
|
||||
|
||||
|
@ -2302,7 +2302,7 @@ - (void) grabDockIconSnapshotFromWindow:(WineWindow*)window force:(BOOL)force
|
|||
CGContextDrawImage(cgcontext, rect, windowImage);
|
||||
[appImage drawInRect:NSMakeRect(156, 4, 96, 96)
|
||||
fromRect:NSZeroRect
|
||||
operation:NSCompositeSourceOver
|
||||
operation:NSCompositingOperationSourceOver
|
||||
fraction:1
|
||||
respectFlipped:YES
|
||||
hints:nil];
|
||||
|
@ -2431,13 +2431,13 @@ - (void) sendEvent:(NSEvent*)event
|
|||
interface control. For example, Control-Tab switches focus among
|
||||
views. We want to bypass that feature, so directly route key-down
|
||||
events to -keyDown:. */
|
||||
if (type == NSKeyDown)
|
||||
if (type == NSEventTypeKeyDown)
|
||||
[[self firstResponder] keyDown:event];
|
||||
else
|
||||
{
|
||||
if (!draggingPhase && maximized && ![self isMovable] &&
|
||||
![self allowsMovingWithMaximized:YES] && [self allowsMovingWithMaximized:NO] &&
|
||||
type == NSLeftMouseDown && (self.styleMask & NSTitledWindowMask))
|
||||
type == NSEventTypeLeftMouseDown && (self.styleMask & NSWindowStyleMaskTitled))
|
||||
{
|
||||
NSRect titleBar = self.frame;
|
||||
NSRect contentRect = [self contentRectForFrameRect:titleBar];
|
||||
|
@ -2480,7 +2480,7 @@ - (void) sendEvent:(NSEvent*)event
|
|||
}
|
||||
}
|
||||
}
|
||||
else if (draggingPhase && (type == NSLeftMouseDragged || type == NSLeftMouseUp))
|
||||
else if (draggingPhase && (type == NSEventTypeLeftMouseDragged || type == NSEventTypeLeftMouseUp))
|
||||
{
|
||||
if ([self isMovable])
|
||||
{
|
||||
|
@ -2502,7 +2502,7 @@ - (void) sendEvent:(NSEvent*)event
|
|||
|
||||
[self setFrameTopLeftPoint:newTopLeft];
|
||||
}
|
||||
else if (draggingPhase == 1 && type == NSLeftMouseDragged)
|
||||
else if (draggingPhase == 1 && type == NSEventTypeLeftMouseDragged)
|
||||
{
|
||||
macdrv_event* event;
|
||||
NSRect frame = [self contentRectForFrameRect:self.frame];
|
||||
|
@ -2518,7 +2518,7 @@ - (void) sendEvent:(NSEvent*)event
|
|||
draggingPhase = 2;
|
||||
}
|
||||
|
||||
if (type == NSLeftMouseUp)
|
||||
if (type == NSEventTypeLeftMouseUp)
|
||||
[self endWindowDragging];
|
||||
}
|
||||
|
||||
|
@ -2919,7 +2919,7 @@ - (void)windowDidResize:(NSNotification *)notification
|
|||
}
|
||||
|
||||
[self postWindowFrameChanged:frame
|
||||
fullscreen:([self styleMask] & NSFullScreenWindowMask) != 0
|
||||
fullscreen:([self styleMask] & NSWindowStyleMaskFullScreen) != 0
|
||||
resizing:[self inLiveResize]];
|
||||
|
||||
[[[self contentView] inputContext] invalidateCharacterCoordinates];
|
||||
|
|
Loading…
Reference in New Issue