mirror of
https://github.com/glfw/glfw.git
synced 2024-11-26 06:14:35 +00:00
parent
08e5a17063
commit
1adfbde4d7
@ -1038,8 +1038,6 @@ int _glfwPlatformInit(void)
|
|||||||
char *cursorSizeEnd;
|
char *cursorSizeEnd;
|
||||||
long cursorSizeLong;
|
long cursorSizeLong;
|
||||||
int cursorSize;
|
int cursorSize;
|
||||||
int i;
|
|
||||||
_GLFWmonitor* monitor;
|
|
||||||
|
|
||||||
_glfw.wl.cursor.handle = _glfw_dlopen("libwayland-cursor.so.0");
|
_glfw.wl.cursor.handle = _glfw_dlopen("libwayland-cursor.so.0");
|
||||||
if (!_glfw.wl.cursor.handle)
|
if (!_glfw.wl.cursor.handle)
|
||||||
@ -1148,17 +1146,6 @@ int _glfwPlatformInit(void)
|
|||||||
// Sync so we got all initial output events
|
// Sync so we got all initial output events
|
||||||
wl_display_roundtrip(_glfw.wl.display);
|
wl_display_roundtrip(_glfw.wl.display);
|
||||||
|
|
||||||
for (i = 0; i < _glfw.monitorCount; ++i)
|
|
||||||
{
|
|
||||||
monitor = _glfw.monitors[i];
|
|
||||||
if (monitor->widthMM <= 0 || monitor->heightMM <= 0)
|
|
||||||
{
|
|
||||||
// If Wayland does not provide a physical size, assume the default 96 DPI
|
|
||||||
monitor->widthMM = (int) (monitor->modes[monitor->wl.currentMode].width * 25.4f / 96.f);
|
|
||||||
monitor->heightMM = (int) (monitor->modes[monitor->wl.currentMode].height * 25.4f / 96.f);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
_glfwInitTimerPOSIX();
|
_glfwInitTimerPOSIX();
|
||||||
|
|
||||||
_glfw.wl.timerfd = -1;
|
_glfw.wl.timerfd = -1;
|
||||||
|
@ -81,7 +81,16 @@ static void outputHandleMode(void* data,
|
|||||||
monitor->modes[monitor->modeCount - 1] = mode;
|
monitor->modes[monitor->modeCount - 1] = mode;
|
||||||
|
|
||||||
if (flags & WL_OUTPUT_MODE_CURRENT)
|
if (flags & WL_OUTPUT_MODE_CURRENT)
|
||||||
|
{
|
||||||
monitor->wl.currentMode = monitor->modeCount - 1;
|
monitor->wl.currentMode = monitor->modeCount - 1;
|
||||||
|
|
||||||
|
if (monitor->widthMM <= 0 || monitor->heightMM <= 0)
|
||||||
|
{
|
||||||
|
// If Wayland does not provide a physical size, assume the default 96 DPI
|
||||||
|
monitor->widthMM = (int) (width * 25.4f / 96.f);
|
||||||
|
monitor->heightMM = (int) (height * 25.4f / 96.f);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void outputHandleDone(void* data, struct wl_output* output)
|
static void outputHandleDone(void* data, struct wl_output* output)
|
||||||
|
Loading…
Reference in New Issue
Block a user