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.
(cherry picked from commit 3bbb41eacc
)
This commit is contained in:
parent
608007673f
commit
1c4284e449
@ -161,6 +161,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
|
||||||
|
|
||||||
|
|
||||||
## Contact
|
## Contact
|
||||||
|
@ -314,6 +314,10 @@ int _glfwPlatformInit(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.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)
|
||||||
{
|
{
|
||||||
@ -430,7 +434,6 @@ int _glfwPlatformInit(void)
|
|||||||
|
|
||||||
_glfwInitTimerPOSIX();
|
_glfwInitTimerPOSIX();
|
||||||
|
|
||||||
_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