diff --git a/CMakeLists.txt b/CMakeLists.txt index f4f30293..1a203cce 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.0) -project(GLFW VERSION 3.3.3 LANGUAGES C) +project(GLFW VERSION 3.3.5 LANGUAGES C) set(CMAKE_LEGACY_CYGWIN_WIN32 OFF) diff --git a/README.md b/README.md index 398f31d4..5538a8a7 100644 --- a/README.md +++ b/README.md @@ -118,47 +118,7 @@ information on what to include when reporting a bug. ## Changelog - - Added `GLFW_RESIZE_NWSE_CURSOR`, `GLFW_RESIZE_NESW_CURSOR`, - `GLFW_RESIZE_ALL_CURSOR` and `GLFW_NOT_ALLOWED_CURSOR` cursor shapes (#427) - - Added `GLFW_RESIZE_EW_CURSOR` alias for `GLFW_HRESIZE_CURSOR` (#427) - - Added `GLFW_RESIZE_NS_CURSOR` alias for `GLFW_VRESIZE_CURSOR` (#427) - - Added `GLFW_POINTING_HAND_CURSOR` alias for `GLFW_HAND_CURSOR` (#427) - - Bugfix: Some extension loader headers did not prevent default OpenGL header - inclusion (#1695) - - [Win32] Disabled framebuffer transparency on Windows 7 when DWM windows are - opaque (#1512) - - [Win32] Bugfix: Non-BMP Unicode codepoint input was reported as UTF-16 - - [Win32] Bugfix: Monitor functions could return invalid values after - configuration change (#1761) - - [Win32] Bugfix: Initialization would segfault on Windows 8 (not 8.1) (#1775) - - [Win32] Bugfix: Duplicate size events were not filtered (#1610) - - [Cocoa] Changed `EGLNativeWindowType` from `NSView` to `CALayer` (#1169) - - [Cocoa] Bugfix: Non-BMP Unicode codepoint input was reported as UTF-16 - (#1635) - - [Cocoa] Bugfix: Failing to retrieve the refresh rate of built-in displays - could leak memory - - [Cocoa] Bugfix: Objective-C files were compiled as C with CMake 3.19 (#1787) - - [Cocoa] Bugfix: Duplicate video modes were not filtered out (#1830) - - [Cocoa] Bugfix: Menubar was not clickable on macOS 10.15+ until it lost and - regained focus (#1648,#1802) - - [Cocoa] Bugfix: Monitor name query could segfault on macOS 11 (#1809,#1833) - - [Cocoa] Bugfix: The install name of the installed dylib was relative (#1504) - - [X11] Bugfix: IME input of CJK was broken for "C" locale (#1587,#1636) - - [X11] Bugfix: Xlib errors caused by other parts of the application could be - reported as GLFW errors - - [X11] Bugfix: A handle race condition could cause a `BadWindow` error (#1633) - - [X11] Bugfix: XKB path used keysyms instead of physical locations for - non-printable keys (#1598) - - [X11] Bugfix: Function keys were mapped to `GLFW_KEY_UNKNOWN` for some layout - combinaitons (#1598) - - [X11] Bugfix: Keys pressed simultaneously with others were not always - reported (#1112,#1415,#1472,#1616) - - [Wayland] Bugfix: Repeated keys could be reported with `NULL` window (#1704) - - [Wayland] Bugfix: Retrieving partial framebuffer size would segfault - - [Wayland] Bugfix: Scrolling offsets were inverted compared to other platforms - (#1463) - - [Wayland] Bugfix: Client-Side Decorations were destroyed in the wrong worder - (#1798) +There is nothing here yet. ## Contact diff --git a/include/GLFW/glfw3.h b/include/GLFW/glfw3.h index c9f8246c..3aa63fe0 100644 --- a/include/GLFW/glfw3.h +++ b/include/GLFW/glfw3.h @@ -295,7 +295,7 @@ extern "C" { * API changes. * @ingroup init */ -#define GLFW_VERSION_REVISION 3 +#define GLFW_VERSION_REVISION 5 /*! @} */ /*! @brief One. diff --git a/src/win32_init.c b/src/win32_init.c index a7a6be6a..22c1ba77 100644 --- a/src/win32_init.c +++ b/src/win32_init.c @@ -39,6 +39,10 @@ static const GUID _glfw_GUID_DEVINTERFACE_HID = #if defined(_GLFW_USE_HYBRID_HPG) || defined(_GLFW_USE_OPTIMUS_HPG) +#if defined(_GLFW_BUILD_DLL) + #warning "These symbols must be exported by the executable and have no effect in a DLL" +#endif + // Executables (but not DLLs) exporting this symbol with this value will be // automatically directed to the high-performance GPU on Nvidia Optimus systems // with up-to-date drivers diff --git a/src/win32_window.c b/src/win32_window.c index 64117d79..fec77f83 100644 --- a/src/win32_window.c +++ b/src/win32_window.c @@ -505,7 +505,17 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg, case WM_NCCREATE: { if (_glfwIsWindows10AnniversaryUpdateOrGreaterWin32()) - EnableNonClientDpiScaling(hWnd); + { + const CREATESTRUCTW* cs = (const CREATESTRUCTW*) lParam; + const _GLFWwndconfig* wndconfig = cs->lpCreateParams; + + // On per-monitor DPI aware V1 systems, only enable + // non-client scaling for windows that scale the client area + // We need WM_GETDPISCALEDSIZE from V2 to keep the client + // area static when the non-client area is scaled + if (wndconfig && wndconfig->scaleToMonitor) + EnableNonClientDpiScaling(hWnd); + } break; } @@ -1131,9 +1141,11 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg, const float xscale = HIWORD(wParam) / (float) USER_DEFAULT_SCREEN_DPI; const float yscale = LOWORD(wParam) / (float) USER_DEFAULT_SCREEN_DPI; - // Only apply the suggested size if the OS is new enough to have - // sent a WM_GETDPISCALEDSIZE before this - if (_glfwIsWindows10CreatorsUpdateOrGreaterWin32()) + // Resize windowed mode windows that either permit rescaling or that + // need it to compensate for non-client area scaling + if (!window->monitor && + (window->win32.scaleToMonitor || + _glfwIsWindows10CreatorsUpdateOrGreaterWin32())) { RECT* suggested = (RECT*) lParam; SetWindowPos(window->win32.handle, HWND_TOP, @@ -1248,7 +1260,7 @@ static int createNativeWindow(_GLFWwindow* window, NULL, // No parent window NULL, // No window menu GetModuleHandleW(NULL), - NULL); + (LPVOID) wndconfig); free(wideTitle); diff --git a/src/wl_monitor.c b/src/wl_monitor.c index 48b25b9f..a7b05c60 100644 --- a/src/wl_monitor.c +++ b/src/wl_monitor.c @@ -88,6 +88,14 @@ static void outputHandleDone(void* data, struct wl_output* output) { struct _GLFWmonitor *monitor = data; + if (monitor->widthMM <= 0 || monitor->heightMM <= 0) + { + // If Wayland does not provide a physical size, assume the default 96 DPI + const GLFWvidmode* mode = &monitor->modes[monitor->wl.currentMode]; + monitor->widthMM = (int) (mode->width * 25.4f / 96.f); + monitor->heightMM = (int) (mode->height * 25.4f / 96.f); + } + _glfwInputMonitor(monitor, GLFW_CONNECTED, _GLFW_INSERT_LAST); } diff --git a/src/x11_window.c b/src/x11_window.c index 8e815cf1..bbf9c2c5 100644 --- a/src/x11_window.c +++ b/src/x11_window.c @@ -2500,7 +2500,11 @@ void _glfwPlatformSetWindowMonitor(_GLFWwindow* window, } if (window->monitor) + { + _glfwPlatformSetWindowDecorated(window, window->decorated); + _glfwPlatformSetWindowFloating(window, window->floating); releaseMonitor(window); + } _glfwInputWindowMonitor(window, monitor); updateNormalHints(window, width, height);