Reduce difference to GLFW upstream
This commit is contained in:
parent
4f85d4db71
commit
c05cbed5b2
4 changed files with 9 additions and 8 deletions
|
|
@ -354,8 +354,9 @@ void _glfwPollMonitorsNS(void)
|
||||||
void _glfwSetVideoModeNS(_GLFWmonitor* monitor, const GLFWvidmode* desired)
|
void _glfwSetVideoModeNS(_GLFWmonitor* monitor, const GLFWvidmode* desired)
|
||||||
{
|
{
|
||||||
GLFWvidmode current;
|
GLFWvidmode current;
|
||||||
const GLFWvidmode* best = _glfwChooseVideoMode(monitor, desired);
|
|
||||||
_glfwPlatformGetVideoMode(monitor, ¤t);
|
_glfwPlatformGetVideoMode(monitor, ¤t);
|
||||||
|
|
||||||
|
const GLFWvidmode* best = _glfwChooseVideoMode(monitor, desired);
|
||||||
if (_glfwCompareVideoModes(¤t, best) == 0)
|
if (_glfwCompareVideoModes(¤t, best) == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
@ -505,7 +506,6 @@ void _glfwPlatformGetMonitorWorkarea(_GLFWmonitor* monitor,
|
||||||
void _glfwPlatformGetVideoMode(_GLFWmonitor* monitor, GLFWvidmode *mode)
|
void _glfwPlatformGetVideoMode(_GLFWmonitor* monitor, GLFWvidmode *mode)
|
||||||
{
|
{
|
||||||
CVDisplayLinkRef link;
|
CVDisplayLinkRef link;
|
||||||
|
|
||||||
CVDisplayLinkCreateWithCGDisplay(monitor->ns.displayID, &link);
|
CVDisplayLinkCreateWithCGDisplay(monitor->ns.displayID, &link);
|
||||||
|
|
||||||
CGDisplayModeRef native = CGDisplayCopyDisplayMode(monitor->ns.displayID);
|
CGDisplayModeRef native = CGDisplayCopyDisplayMode(monitor->ns.displayID);
|
||||||
|
|
|
||||||
|
|
@ -647,9 +647,9 @@ - (void)windowDidChangeScreen:(NSNotification *)notification
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@end // }}}
|
@end // }}}
|
||||||
|
|
||||||
|
|
||||||
// Content view class for the GLFW window {{{
|
// Content view class for the GLFW window {{{
|
||||||
|
|
||||||
@interface GLFWContentView : NSView <NSTextInputClient>
|
@interface GLFWContentView : NSView <NSTextInputClient>
|
||||||
|
|
@ -1271,7 +1271,7 @@ - (void)doCommandBySelector:(SEL)selector
|
||||||
@end
|
@end
|
||||||
// }}}
|
// }}}
|
||||||
|
|
||||||
// GLFW Window class {{{
|
// GLFW window class {{{
|
||||||
|
|
||||||
@interface GLFWWindow : NSWindow {
|
@interface GLFWWindow : NSWindow {
|
||||||
_GLFWwindow* glfw_window;
|
_GLFWwindow* glfw_window;
|
||||||
|
|
@ -1371,7 +1371,7 @@ static bool createNativeWindow(_GLFWwindow* window,
|
||||||
[window->ns.object setLevel:NSMainMenuWindowLevel + 1];
|
[window->ns.object setLevel:NSMainMenuWindowLevel + 1];
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
[(NSWindow*)window->ns.object center];
|
[(NSWindow*) window->ns.object center];
|
||||||
_glfw.ns.cascadePoint =
|
_glfw.ns.cascadePoint =
|
||||||
NSPointToCGPoint([window->ns.object cascadeTopLeftFromPoint:
|
NSPointToCGPoint([window->ns.object cascadeTopLeftFromPoint:
|
||||||
NSPointFromCGPoint(_glfw.ns.cascadePoint)]);
|
NSPointFromCGPoint(_glfw.ns.cascadePoint)]);
|
||||||
|
|
|
||||||
3
glfw/linux_joystick.c
vendored
3
glfw/linux_joystick.c
vendored
|
|
@ -222,7 +222,8 @@ static bool openJoystickDevice(const char* path)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_GLFWjoystick* js = _glfwAllocJoystick(name, guid, axisCount, buttonCount, hatCount);
|
_GLFWjoystick* js =
|
||||||
|
_glfwAllocJoystick(name, guid, axisCount, buttonCount, hatCount);
|
||||||
if (!js)
|
if (!js)
|
||||||
{
|
{
|
||||||
close(linjs.fd);
|
close(linjs.fd);
|
||||||
|
|
|
||||||
4
glfw/nsgl_context.h
vendored
4
glfw/nsgl_context.h
vendored
|
|
@ -32,8 +32,8 @@
|
||||||
//
|
//
|
||||||
typedef struct _GLFWcontextNSGL
|
typedef struct _GLFWcontextNSGL
|
||||||
{
|
{
|
||||||
id pixelFormat;
|
id pixelFormat;
|
||||||
id object;
|
id object;
|
||||||
|
|
||||||
} _GLFWcontextNSGL;
|
} _GLFWcontextNSGL;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue