Wayland: Fix glfwSetWindowSize resizing fs windows

glfwSetWindowSize would change the size of fullscreen mode windows as
if they were windowed mode.

(cherry picked from commit 6857995498)
This commit is contained in:
Camilla Löwy 2022-06-10 14:10:25 +02:00
parent 15050f5711
commit 589385aada
2 changed files with 14 additions and 4 deletions

View File

@ -158,6 +158,7 @@ information on what to include when reporting a bug.
inconsistent state inconsistent state
- [Wayland] Bugfix: Window maximization events were not emitted - [Wayland] Bugfix: Window maximization events were not emitted
- [Wayland] Bugfix: `glfwRestoreWindow` assumed it was always in windowed mode - [Wayland] Bugfix: `glfwRestoreWindow` assumed it was always in windowed mode
- [Wayland] Bugfix: `glfwSetWindowSize` would resize a full screen window
## Contact ## Contact

View File

@ -548,7 +548,9 @@ static void xdgToplevelHandleConfigure(void* userData,
} }
_glfwInputWindowSize(window, width, height); _glfwInputWindowSize(window, width, height);
_glfwPlatformSetWindowSize(window, width, height); window->wl.width = width;
window->wl.height = height;
resizeWindow(window);
_glfwInputWindowDamage(window); _glfwInputWindowDamage(window);
} }
@ -1903,9 +1905,16 @@ void _glfwPlatformGetWindowSize(_GLFWwindow* window, int* width, int* height)
void _glfwPlatformSetWindowSize(_GLFWwindow* window, int width, int height) void _glfwPlatformSetWindowSize(_GLFWwindow* window, int width, int height)
{ {
window->wl.width = width; if (window->monitor)
window->wl.height = height; {
resizeWindow(window); // Video mode setting is not available on Wayland
}
else
{
window->wl.width = width;
window->wl.height = height;
resizeWindow(window);
}
} }
void _glfwPlatformSetWindowSizeLimits(_GLFWwindow* window, void _glfwPlatformSetWindowSizeLimits(_GLFWwindow* window,