mirror of
https://github.com/glfw/glfw.git
synced 2025-12-21 06:31:58 +00:00
Compare commits
3 Commits
036b57be01
...
f24dc3c85c
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f24dc3c85c | ||
|
|
768e81a0eb | ||
|
|
54ecc8a9f5 |
@ -68,6 +68,7 @@ video tutorials.
|
|||||||
- Jan Ekström
|
- Jan Ekström
|
||||||
- Siavash Eliasi
|
- Siavash Eliasi
|
||||||
- er-azh
|
- er-azh
|
||||||
|
- Jan Hendrik Farr
|
||||||
- Ahmad Fatoum
|
- Ahmad Fatoum
|
||||||
- Nikita Fediuchin
|
- Nikita Fediuchin
|
||||||
- Felipe Ferreira
|
- Felipe Ferreira
|
||||||
|
|||||||
@ -138,6 +138,7 @@ information on what to include when reporting a bug.
|
|||||||
- [Wayland] Bugfix: Retrieved cursor position would be incorrect when hovering over
|
- [Wayland] Bugfix: Retrieved cursor position would be incorrect when hovering over
|
||||||
fallback decorations
|
fallback decorations
|
||||||
- [Wayland] Bugfix: Fallback decorations would report scroll events
|
- [Wayland] Bugfix: Fallback decorations would report scroll events
|
||||||
|
- [Wayland] Bugfix: Keyboard repeat events halted when any key is released (#2568)
|
||||||
- [X11] Bugfix: Running without a WM could trigger an assert (#2593,#2601,#2631)
|
- [X11] Bugfix: Running without a WM could trigger an assert (#2593,#2601,#2631)
|
||||||
- [Null] Added Vulkan 'window' surface creation via `VK_EXT_headless_surface`
|
- [Null] Added Vulkan 'window' surface creation via `VK_EXT_headless_surface`
|
||||||
- [Null] Added EGL context creation on Mesa via `EGL_MESA_platform_surfaceless`
|
- [Null] Added EGL context creation on Mesa via `EGL_MESA_platform_surfaceless`
|
||||||
|
|||||||
@ -1838,10 +1838,11 @@ static void keyboardHandleKey(void* userData,
|
|||||||
|
|
||||||
timer.it_value.tv_sec = _glfw.wl.keyRepeatDelay / 1000;
|
timer.it_value.tv_sec = _glfw.wl.keyRepeatDelay / 1000;
|
||||||
timer.it_value.tv_nsec = (_glfw.wl.keyRepeatDelay % 1000) * 1000000;
|
timer.it_value.tv_nsec = (_glfw.wl.keyRepeatDelay % 1000) * 1000000;
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
timerfd_settime(_glfw.wl.keyRepeatTimerfd, 0, &timer, NULL);
|
timerfd_settime(_glfw.wl.keyRepeatTimerfd, 0, &timer, NULL);
|
||||||
|
}
|
||||||
|
} else if (scancode == _glfw.wl.keyRepeatScancode) {
|
||||||
|
timerfd_settime(_glfw.wl.keyRepeatTimerfd, 0, &timer, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
_glfwInputKey(window, key, scancode, action, _glfw.wl.xkb.modifiers);
|
_glfwInputKey(window, key, scancode, action, _glfw.wl.xkb.modifiers);
|
||||||
|
|
||||||
|
|||||||
@ -2339,6 +2339,9 @@ void _glfwRestoreWindowX11(_GLFWwindow* window)
|
|||||||
|
|
||||||
if (_glfwWindowIconifiedX11(window))
|
if (_glfwWindowIconifiedX11(window))
|
||||||
{
|
{
|
||||||
|
// Some window managers do not unmap iconified windows, and XMapWindow is
|
||||||
|
// then no-op. Explicitly unmap the window to make sure it gets restored.
|
||||||
|
XUnmapWindow(_glfw.x11.display, window->x11.handle);
|
||||||
XMapWindow(_glfw.x11.display, window->x11.handle);
|
XMapWindow(_glfw.x11.display, window->x11.handle);
|
||||||
waitForVisibilityNotify(window);
|
waitForVisibilityNotify(window);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -56,6 +56,8 @@ static void error_callback(int error, const char* description)
|
|||||||
|
|
||||||
static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods)
|
static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods)
|
||||||
{
|
{
|
||||||
|
static GLFWwindow *iconified;
|
||||||
|
|
||||||
printf("%0.2f Key %s\n",
|
printf("%0.2f Key %s\n",
|
||||||
glfwGetTime(),
|
glfwGetTime(),
|
||||||
action == GLFW_PRESS ? "pressed" : "released");
|
action == GLFW_PRESS ? "pressed" : "released");
|
||||||
@ -67,12 +69,15 @@ static void key_callback(GLFWwindow* window, int key, int scancode, int action,
|
|||||||
{
|
{
|
||||||
case GLFW_KEY_I:
|
case GLFW_KEY_I:
|
||||||
glfwIconifyWindow(window);
|
glfwIconifyWindow(window);
|
||||||
|
iconified = window;
|
||||||
break;
|
break;
|
||||||
case GLFW_KEY_M:
|
case GLFW_KEY_M:
|
||||||
glfwMaximizeWindow(window);
|
glfwMaximizeWindow(window);
|
||||||
break;
|
break;
|
||||||
case GLFW_KEY_R:
|
case GLFW_KEY_R:
|
||||||
|
if (iconified) window = iconified;
|
||||||
glfwRestoreWindow(window);
|
glfwRestoreWindow(window);
|
||||||
|
iconified = NULL;
|
||||||
break;
|
break;
|
||||||
case GLFW_KEY_ESCAPE:
|
case GLFW_KEY_ESCAPE:
|
||||||
glfwSetWindowShouldClose(window, GLFW_TRUE);
|
glfwSetWindowShouldClose(window, GLFW_TRUE);
|
||||||
@ -253,9 +258,10 @@ int main(int argc, char** argv)
|
|||||||
if (fullscreen)
|
if (fullscreen)
|
||||||
monitor = glfwGetPrimaryMonitor();
|
monitor = glfwGetPrimaryMonitor();
|
||||||
|
|
||||||
window_count = 1;
|
window_count = 2;
|
||||||
windows = calloc(window_count, sizeof(GLFWwindow*));
|
windows = calloc(window_count, sizeof(GLFWwindow*));
|
||||||
windows[0] = create_window(monitor);
|
windows[0] = create_window(monitor);
|
||||||
|
windows[1] = create_window(monitor);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < window_count; i++)
|
for (i = 0; i < window_count; i++)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user