mirror of
https://github.com/glfw/glfw.git
synced 2024-11-22 13:04:35 +00:00
Wayland: Fix glfwInit closing stdin on failure
If platform initialization failed before either timer fd member had been set to -1 or a valid fd, termination would close stdin.
This commit is contained in:
parent
0b76e3a6f1
commit
3bbb41eacc
@ -342,6 +342,7 @@ information on what to include when reporting a bug.
|
|||||||
- [Wayland] Bugfix: `glfwSetWindowSize` would resize a full screen window
|
- [Wayland] Bugfix: `glfwSetWindowSize` would resize a full screen window
|
||||||
- [Wayland] Bugfix: A window content scale event would be emitted every time
|
- [Wayland] Bugfix: A window content scale event would be emitted every time
|
||||||
the window resized
|
the window resized
|
||||||
|
- [Wayland] Bugfix: If `glfwInit` failed it would close stdin
|
||||||
- [POSIX] Removed use of deprecated function `gettimeofday`
|
- [POSIX] Removed use of deprecated function `gettimeofday`
|
||||||
- [POSIX] Bugfix: `CLOCK_MONOTONIC` was not correctly tested for or enabled
|
- [POSIX] Bugfix: `CLOCK_MONOTONIC` was not correctly tested for or enabled
|
||||||
- [WGL] Disabled the DWM swap interval hack for Windows 8 and later (#1072)
|
- [WGL] Disabled the DWM swap interval hack for Windows 8 and later (#1072)
|
||||||
|
@ -479,6 +479,10 @@ int _glfwInitWayland(void)
|
|||||||
long cursorSizeLong;
|
long cursorSizeLong;
|
||||||
int cursorSize;
|
int cursorSize;
|
||||||
|
|
||||||
|
// These must be set before any failure checks
|
||||||
|
_glfw.wl.timerfd = -1;
|
||||||
|
_glfw.wl.cursorTimerfd = -1;
|
||||||
|
|
||||||
_glfw.wl.client.display_flush = (PFN_wl_display_flush)
|
_glfw.wl.client.display_flush = (PFN_wl_display_flush)
|
||||||
_glfwPlatformGetModuleSymbol(_glfw.wl.client.handle, "wl_display_flush");
|
_glfwPlatformGetModuleSymbol(_glfw.wl.client.handle, "wl_display_flush");
|
||||||
_glfw.wl.client.display_cancel_read = (PFN_wl_display_cancel_read)
|
_glfw.wl.client.display_cancel_read = (PFN_wl_display_cancel_read)
|
||||||
@ -635,7 +639,6 @@ int _glfwInitWayland(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);
|
||||||
|
|
||||||
_glfw.wl.timerfd = -1;
|
|
||||||
if (_glfw.wl.seatVersion >= 4)
|
if (_glfw.wl.seatVersion >= 4)
|
||||||
_glfw.wl.timerfd = timerfd_create(CLOCK_MONOTONIC, TFD_CLOEXEC | TFD_NONBLOCK);
|
_glfw.wl.timerfd = timerfd_create(CLOCK_MONOTONIC, TFD_CLOEXEC | TFD_NONBLOCK);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user