mirror of
https://github.com/glfw/glfw.git
synced 2026-01-11 23:33:16 +01:00
Wayland: Add support for fractional scaling
This adds basic support for fractional-scale-v1. Note that this introduces a potential discrepancy between window and monitor content scales.
This commit is contained in:
@@ -46,6 +46,7 @@
|
||||
#include "viewporter-client-protocol.h"
|
||||
#include "relative-pointer-unstable-v1-client-protocol.h"
|
||||
#include "pointer-constraints-unstable-v1-client-protocol.h"
|
||||
#include "fractional-scale-v1-client-protocol.h"
|
||||
#include "xdg-activation-v1-client-protocol.h"
|
||||
#include "idle-inhibit-unstable-v1-client-protocol.h"
|
||||
|
||||
@@ -78,6 +79,10 @@
|
||||
#include "pointer-constraints-unstable-v1-client-protocol-code.h"
|
||||
#undef types
|
||||
|
||||
#define types _glfw_fractional_scale_types
|
||||
#include "fractional-scale-v1-client-protocol-code.h"
|
||||
#undef types
|
||||
|
||||
#define types _glfw_xdg_activation_types
|
||||
#include "xdg-activation-v1-client-protocol-code.h"
|
||||
#undef types
|
||||
@@ -189,6 +194,13 @@ static void registryHandleGlobal(void* userData,
|
||||
&xdg_activation_v1_interface,
|
||||
1);
|
||||
}
|
||||
else if (strcmp(interface, "wp_fractional_scale_manager_v1") == 0)
|
||||
{
|
||||
_glfw.wl.fractionalScaleManager =
|
||||
wl_registry_bind(registry, name,
|
||||
&wp_fractional_scale_manager_v1_interface,
|
||||
1);
|
||||
}
|
||||
}
|
||||
|
||||
static void registryHandleGlobalRemove(void* userData,
|
||||
@@ -969,6 +981,8 @@ void _glfwTerminateWayland(void)
|
||||
zwp_idle_inhibit_manager_v1_destroy(_glfw.wl.idleInhibitManager);
|
||||
if (_glfw.wl.activationManager)
|
||||
xdg_activation_v1_destroy(_glfw.wl.activationManager);
|
||||
if (_glfw.wl.fractionalScaleManager)
|
||||
wp_fractional_scale_manager_v1_destroy(_glfw.wl.fractionalScaleManager);
|
||||
if (_glfw.wl.registry)
|
||||
wl_registry_destroy(_glfw.wl.registry);
|
||||
if (_glfw.wl.display)
|
||||
|
||||
Reference in New Issue
Block a user