mirror of
https://github.com/glfw/glfw.git
synced 2025-12-20 14:11:55 +00:00
Compare commits
3 Commits
8d7af8ed29
...
e56ca0c75c
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e56ca0c75c | ||
|
|
feb2a6b728 | ||
|
|
54ecc8a9f5 |
@ -132,6 +132,7 @@ information on what to include when reporting a bug.
|
|||||||
- [Wayland] Bugfix: `glfwInit` would segfault on compositor with no seat (#2517)
|
- [Wayland] Bugfix: `glfwInit` would segfault on compositor with no seat (#2517)
|
||||||
- [Wayland] Bugfix: A drag entering a non-GLFW surface could cause a segfault
|
- [Wayland] Bugfix: A drag entering a non-GLFW surface could cause a segfault
|
||||||
- [Wayland] Bugfix: Ignore key repeat events when no window has keyboard focus (#2727)
|
- [Wayland] Bugfix: Ignore key repeat events when no window has keyboard focus (#2727)
|
||||||
|
- [Wayland] Bugfix: Reset key repeat timer when window destroyed (#2741,#2727)
|
||||||
- [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`
|
||||||
|
|||||||
@ -2187,7 +2187,12 @@ void _glfwDestroyWindowWayland(_GLFWwindow* window)
|
|||||||
_glfw.wl.pointerFocus = NULL;
|
_glfw.wl.pointerFocus = NULL;
|
||||||
|
|
||||||
if (window == _glfw.wl.keyboardFocus)
|
if (window == _glfw.wl.keyboardFocus)
|
||||||
|
{
|
||||||
|
struct itimerspec timer = {0};
|
||||||
|
timerfd_settime(_glfw.wl.keyRepeatTimerfd, 0, &timer, NULL);
|
||||||
|
|
||||||
_glfw.wl.keyboardFocus = NULL;
|
_glfw.wl.keyboardFocus = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
if (window->wl.fractionalScale)
|
if (window->wl.fractionalScale)
|
||||||
wp_fractional_scale_v1_destroy(window->wl.fractionalScale);
|
wp_fractional_scale_v1_destroy(window->wl.fractionalScale);
|
||||||
|
|||||||
@ -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