Commit 32fb017d authored by Brendan Shanks's avatar Brendan Shanks Committed by Alexandre Julliard

winemac.drv: Remove workarounds for Mac OS X 10.6 and earlier.

parent deff68bb
...@@ -299,15 +299,12 @@ static NSString* WineLocalizedString(unsigned int stringID) ...@@ -299,15 +299,12 @@ static NSString* WineLocalizedString(unsigned int stringID)
[submenu addItemWithTitle:WineLocalizedString(STRING_MENU_ITEM_ZOOM) [submenu addItemWithTitle:WineLocalizedString(STRING_MENU_ITEM_ZOOM)
action:@selector(performZoom:) action:@selector(performZoom:)
keyEquivalent:@""]; keyEquivalent:@""];
if ([NSWindow instancesRespondToSelector:@selector(toggleFullScreen:)])
{
item = [submenu addItemWithTitle:WineLocalizedString(STRING_MENU_ITEM_ENTER_FULL_SCREEN) item = [submenu addItemWithTitle:WineLocalizedString(STRING_MENU_ITEM_ENTER_FULL_SCREEN)
action:@selector(toggleFullScreen:) action:@selector(toggleFullScreen:)
keyEquivalent:@"f"]; keyEquivalent:@"f"];
[item setKeyEquivalentModifierMask:NSEventModifierFlagCommand | [item setKeyEquivalentModifierMask:NSEventModifierFlagCommand |
NSEventModifierFlagOption | NSEventModifierFlagOption |
NSEventModifierFlagControl]; NSEventModifierFlagControl];
}
[submenu addItem:[NSMenuItem separatorItem]]; [submenu addItem:[NSMenuItem separatorItem]];
[submenu addItemWithTitle:WineLocalizedString(STRING_MENU_ITEM_BRING_ALL_TO_FRONT) [submenu addItemWithTitle:WineLocalizedString(STRING_MENU_ITEM_BRING_ALL_TO_FRONT)
action:@selector(arrangeInFront:) action:@selector(arrangeInFront:)
......
...@@ -36,20 +36,6 @@ ...@@ -36,20 +36,6 @@
#import "cocoa_opengl.h" #import "cocoa_opengl.h"
#if !defined(MAC_OS_X_VERSION_10_7) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7
enum {
NSWindowCollectionBehaviorFullScreenPrimary = 1 << 7,
NSWindowCollectionBehaviorFullScreenAuxiliary = 1 << 8,
NSWindowFullScreenButton = 7,
NSWindowStyleMaskFullScreen = 1 << 14,
};
@interface NSWindow (WineFullScreenExtensions)
- (void) toggleFullScreen:(id)sender;
@end
#endif
#if !defined(MAC_OS_X_VERSION_10_12) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_12 #if !defined(MAC_OS_X_VERSION_10_12) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_12
/* Additional Mac virtual keycode, to complement those in Carbon's <HIToolbox/Events.h>. */ /* Additional Mac virtual keycode, to complement those in Carbon's <HIToolbox/Events.h>. */
enum { enum {
...@@ -1091,11 +1077,8 @@ static CVReturn WineDisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTi ...@@ -1091,11 +1077,8 @@ static CVReturn WineDisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTi
[[self standardWindowButton:NSWindowMiniaturizeButton] setEnabled:!self.disabled]; [[self standardWindowButton:NSWindowMiniaturizeButton] setEnabled:!self.disabled];
if (style & NSWindowStyleMaskResizable) if (style & NSWindowStyleMaskResizable)
[[self standardWindowButton:NSWindowZoomButton] setEnabled:!self.disabled]; [[self standardWindowButton:NSWindowZoomButton] setEnabled:!self.disabled];
if ([self respondsToSelector:@selector(toggleFullScreen:)])
{
if ([self collectionBehavior] & NSWindowCollectionBehaviorFullScreenPrimary) if ([self collectionBehavior] & NSWindowCollectionBehaviorFullScreenPrimary)
[[self standardWindowButton:NSWindowFullScreenButton] setEnabled:!self.disabled]; [[self standardWindowButton:NSWindowFullScreenButton] setEnabled:!self.disabled];
}
if ([self preventResizing]) if ([self preventResizing])
{ {
...@@ -1115,8 +1098,6 @@ static CVReturn WineDisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTi ...@@ -1115,8 +1098,6 @@ static CVReturn WineDisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTi
- (void) adjustFullScreenBehavior:(NSWindowCollectionBehavior)behavior - (void) adjustFullScreenBehavior:(NSWindowCollectionBehavior)behavior
{ {
if ([self respondsToSelector:@selector(toggleFullScreen:)])
{
NSUInteger style = [self styleMask]; NSUInteger style = [self styleMask];
if (behavior & NSWindowCollectionBehaviorParticipatesInCycle && if (behavior & NSWindowCollectionBehaviorParticipatesInCycle &&
...@@ -1133,7 +1114,6 @@ static CVReturn WineDisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTi ...@@ -1133,7 +1114,6 @@ static CVReturn WineDisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTi
if (style & NSWindowStyleMaskFullScreen) if (style & NSWindowStyleMaskFullScreen)
[super toggleFullScreen:nil]; [super toggleFullScreen:nil];
} }
}
if (behavior != [self collectionBehavior]) if (behavior != [self collectionBehavior])
{ {
...@@ -2480,12 +2460,7 @@ static CVReturn WineDisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTi ...@@ -2480,12 +2460,7 @@ static CVReturn WineDisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTi
for (i = 0; i < sizeof(buttons) / sizeof(buttons[0]); i++) for (i = 0; i < sizeof(buttons) / sizeof(buttons[0]); i++)
{ {
NSButton* button; NSButton* button = [self standardWindowButton:buttons[i]];
if (buttons[i] == NSWindowFullScreenButton && ![self respondsToSelector:@selector(toggleFullScreen:)])
continue;
button = [self standardWindowButton:buttons[i]];
if ([button hitTest:[button.superview convertPoint:event.locationInWindow fromView:nil]]) if ([button hitTest:[button.superview convertPoint:event.locationInWindow fromView:nil]])
{ {
hitButton = YES; hitButton = YES;
......
...@@ -1248,7 +1248,6 @@ static BOOL init_gl_info(void) ...@@ -1248,7 +1248,6 @@ static BOOL init_gl_info(void)
kCGLPFADisplayMask, displayMask, kCGLPFADisplayMask, displayMask,
0 0
}; };
#if defined(MAC_OS_X_VERSION_10_7) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
CGLPixelFormatAttribute core_attribs[] = CGLPixelFormatAttribute core_attribs[] =
{ {
kCGLPFADisplayMask, displayMask, kCGLPFADisplayMask, displayMask,
...@@ -1256,7 +1255,6 @@ static BOOL init_gl_info(void) ...@@ -1256,7 +1255,6 @@ static BOOL init_gl_info(void)
kCGLPFAOpenGLProfile, (CGLPixelFormatAttribute)kCGLOGLPVersion_3_2_Core, kCGLPFAOpenGLProfile, (CGLPixelFormatAttribute)kCGLOGLPVersion_3_2_Core,
0 0
}; };
#endif
CGLPixelFormatObj pix; CGLPixelFormatObj pix;
GLint virtualScreens; GLint virtualScreens;
CGLError err; CGLError err;
...@@ -1308,7 +1306,6 @@ static BOOL init_gl_info(void) ...@@ -1308,7 +1306,6 @@ static BOOL init_gl_info(void)
CGLSetCurrentContext(old_context); CGLSetCurrentContext(old_context);
CGLReleaseContext(context); CGLReleaseContext(context);
#if defined(MAC_OS_X_VERSION_10_7) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
err = CGLChoosePixelFormat(core_attribs, &pix, &virtualScreens); err = CGLChoosePixelFormat(core_attribs, &pix, &virtualScreens);
if (err != kCGLNoError || !pix) if (err != kCGLNoError || !pix)
{ {
...@@ -1340,7 +1337,6 @@ static BOOL init_gl_info(void) ...@@ -1340,7 +1337,6 @@ static BOOL init_gl_info(void)
sscanf(str, "%u.%u", &gl_info.max_major, &gl_info.max_minor); sscanf(str, "%u.%u", &gl_info.max_major, &gl_info.max_minor);
CGLSetCurrentContext(old_context); CGLSetCurrentContext(old_context);
CGLReleaseContext(context); CGLReleaseContext(context);
#endif
return TRUE; return TRUE;
} }
...@@ -1397,14 +1393,6 @@ static BOOL create_context(struct wgl_context *context, CGLContextObj share, uns ...@@ -1397,14 +1393,6 @@ static BOOL create_context(struct wgl_context *context, CGLContextObj share, uns
CGLError err; CGLError err;
BOOL core = major >= 3; BOOL core = major >= 3;
#if !defined(MAC_OS_X_VERSION_10_7) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7
if (core)
{
WARN("OS X version >= 10.7 is required to be able to create core contexts\n");
return FALSE;
}
#endif
pf = get_pixel_format(context->format, TRUE /* non-displayable */); pf = get_pixel_format(context->format, TRUE /* non-displayable */);
if (!pf) if (!pf)
{ {
...@@ -1480,7 +1468,6 @@ static BOOL create_context(struct wgl_context *context, CGLContextObj share, uns ...@@ -1480,7 +1468,6 @@ static BOOL create_context(struct wgl_context *context, CGLContextObj share, uns
if (pf->backing_store) if (pf->backing_store)
attribs[n++] = kCGLPFABackingStore; attribs[n++] = kCGLPFABackingStore;
#if defined(MAC_OS_X_VERSION_10_7) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
if (core) if (core)
{ {
attribs[n++] = kCGLPFAOpenGLProfile; attribs[n++] = kCGLPFAOpenGLProfile;
...@@ -1493,7 +1480,6 @@ static BOOL create_context(struct wgl_context *context, CGLContextObj share, uns ...@@ -1493,7 +1480,6 @@ static BOOL create_context(struct wgl_context *context, CGLContextObj share, uns
attribs[n++] = (int)kCGLOGLPVersion_3_2_Core; attribs[n++] = (int)kCGLOGLPVersion_3_2_Core;
#endif #endif
} }
#endif
attribs[n] = 0; attribs[n] = 0;
...@@ -1856,12 +1842,8 @@ static CGLPixelFormatObj create_pixel_format_for_renderer(CGLRendererInfoObj ren ...@@ -1856,12 +1842,8 @@ static CGLPixelFormatObj create_pixel_format_for_renderer(CGLRendererInfoObj ren
if (core) if (core)
{ {
#if defined(MAC_OS_X_VERSION_10_7) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
attrs[3] = kCGLPFAOpenGLProfile; attrs[3] = kCGLPFAOpenGLProfile;
attrs[4] = (CGLPixelFormatAttribute)kCGLOGLPVersion_3_2_Core; attrs[4] = (CGLPixelFormatAttribute)kCGLOGLPVersion_3_2_Core;
#else
return NULL;
#endif
} }
if (!get_renderer_property(renderer_info, renderer, kCGLRPRendererID, &renderer_id)) if (!get_renderer_property(renderer_info, renderer, kCGLRPRendererID, &renderer_id))
...@@ -2157,12 +2139,10 @@ static BOOL query_renderer_integer(CGLRendererInfoObj renderer_info, GLint rende ...@@ -2157,12 +2139,10 @@ static BOOL query_renderer_integer(CGLRendererInfoObj renderer_info, GLint rende
} }
case WGL_RENDERER_VIDEO_MEMORY_WINE: case WGL_RENDERER_VIDEO_MEMORY_WINE:
#if defined(MAC_OS_X_VERSION_10_7) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
err = CGLDescribeRenderer(renderer_info, renderer, kCGLRPVideoMemoryMegabytes, (GLint*)value); err = CGLDescribeRenderer(renderer_info, renderer, kCGLRPVideoMemoryMegabytes, (GLint*)value);
if (err != kCGLNoError && err != kCGLBadProperty) if (err != kCGLNoError && err != kCGLBadProperty)
WARN("CGLDescribeRenderer(kCGLRPVideoMemoryMegabytes) failed: %d %s\n", err, CGLErrorString(err)); WARN("CGLDescribeRenderer(kCGLRPVideoMemoryMegabytes) failed: %d %s\n", err, CGLErrorString(err));
if (err != kCGLNoError) if (err != kCGLNoError)
#endif
{ {
if (get_renderer_property(renderer_info, renderer, kCGLRPVideoMemory, (GLint*)value)) if (get_renderer_property(renderer_info, renderer, kCGLRPVideoMemory, (GLint*)value))
*value /= 1024 * 1024; *value /= 1024 * 1024;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment