From 71cedc6cfe2fd0c4707946e91abea5cd1ab32fb9 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Sat, 9 Apr 2016 00:53:03 +0100 Subject: [PATCH] wayland: Implement glfwSetWindowMonitor --- src/wl_window.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/wl_window.c b/src/wl_window.c index 033e11e4..c254f41b 100644 --- a/src/wl_window.c +++ b/src/wl_window.c @@ -558,8 +558,19 @@ void _glfwPlatformSetWindowMonitor(_GLFWwindow* window, int width, int height, int refreshRate) { - // TODO - fprintf(stderr, "_glfwPlatformSetWindowMonitor not implemented yet\n"); + if (monitor) + { + wl_shell_surface_set_fullscreen( + window->wl.shell_surface, + WL_SHELL_SURFACE_FULLSCREEN_METHOD_DEFAULT, + refreshRate * 1000, // Convert Hz to mHz. + monitor->wl.output); + } + else + { + wl_shell_surface_set_toplevel(window->wl.shell_surface); + } + _glfwInputWindowMonitorChange(window, monitor); } int _glfwPlatformWindowFocused(_GLFWwindow* window)