mirror of
https://github.com/glfw/glfw.git
synced 2024-11-14 06:23:50 +00:00
Wayland: Stop manually tracking interface versions
This is already tracked by the proxies we care about.
(cherry picked from commit 4cf510511c
)
This commit is contained in:
parent
1de73c0dc5
commit
a29b5f38c6
@ -61,10 +61,9 @@ static void registryHandleGlobal(void* userData,
|
|||||||
{
|
{
|
||||||
if (strcmp(interface, "wl_compositor") == 0)
|
if (strcmp(interface, "wl_compositor") == 0)
|
||||||
{
|
{
|
||||||
_glfw.wl.compositorVersion = _glfw_min(3, version);
|
|
||||||
_glfw.wl.compositor =
|
_glfw.wl.compositor =
|
||||||
wl_registry_bind(registry, name, &wl_compositor_interface,
|
wl_registry_bind(registry, name, &wl_compositor_interface,
|
||||||
_glfw.wl.compositorVersion);
|
_glfw_min(3, version));
|
||||||
}
|
}
|
||||||
else if (strcmp(interface, "wl_subcompositor") == 0)
|
else if (strcmp(interface, "wl_subcompositor") == 0)
|
||||||
{
|
{
|
||||||
@ -84,10 +83,9 @@ static void registryHandleGlobal(void* userData,
|
|||||||
{
|
{
|
||||||
if (!_glfw.wl.seat)
|
if (!_glfw.wl.seat)
|
||||||
{
|
{
|
||||||
_glfw.wl.seatVersion = _glfw_min(4, version);
|
|
||||||
_glfw.wl.seat =
|
_glfw.wl.seat =
|
||||||
wl_registry_bind(registry, name, &wl_seat_interface,
|
wl_registry_bind(registry, name, &wl_seat_interface,
|
||||||
_glfw.wl.seatVersion);
|
_glfw_min(4, version));
|
||||||
_glfwAddSeatListenerWayland(_glfw.wl.seat);
|
_glfwAddSeatListenerWayland(_glfw.wl.seat);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -460,7 +458,7 @@ int _glfwPlatformInit(void)
|
|||||||
_glfwInitTimerPOSIX();
|
_glfwInitTimerPOSIX();
|
||||||
|
|
||||||
#ifdef WL_KEYBOARD_REPEAT_INFO_SINCE_VERSION
|
#ifdef WL_KEYBOARD_REPEAT_INFO_SINCE_VERSION
|
||||||
if (_glfw.wl.seatVersion >= WL_KEYBOARD_REPEAT_INFO_SINCE_VERSION)
|
if (wl_seat_get_version(_glfw.wl.seat) >= WL_KEYBOARD_REPEAT_INFO_SINCE_VERSION)
|
||||||
{
|
{
|
||||||
_glfw.wl.keyRepeatTimerfd =
|
_glfw.wl.keyRepeatTimerfd =
|
||||||
timerfd_create(CLOCK_MONOTONIC, TFD_CLOEXEC | TFD_NONBLOCK);
|
timerfd_create(CLOCK_MONOTONIC, TFD_CLOEXEC | TFD_NONBLOCK);
|
||||||
|
@ -257,9 +257,6 @@ typedef struct _GLFWlibraryWayland
|
|||||||
_GLFWwindow* dragFocus;
|
_GLFWwindow* dragFocus;
|
||||||
uint32_t dragSerial;
|
uint32_t dragSerial;
|
||||||
|
|
||||||
int compositorVersion;
|
|
||||||
int seatVersion;
|
|
||||||
|
|
||||||
struct wl_cursor_theme* cursorTheme;
|
struct wl_cursor_theme* cursorTheme;
|
||||||
struct wl_cursor_theme* cursorThemeHiDPI;
|
struct wl_cursor_theme* cursorThemeHiDPI;
|
||||||
struct wl_surface* cursorSurface;
|
struct wl_surface* cursorSurface;
|
||||||
|
@ -381,8 +381,11 @@ static void resizeWindow(_GLFWwindow* window)
|
|||||||
|
|
||||||
void _glfwUpdateContentScaleWayland(_GLFWwindow* window)
|
void _glfwUpdateContentScaleWayland(_GLFWwindow* window)
|
||||||
{
|
{
|
||||||
if (_glfw.wl.compositorVersion < WL_SURFACE_SET_BUFFER_SCALE_SINCE_VERSION)
|
if (wl_compositor_get_version(_glfw.wl.compositor) <
|
||||||
|
WL_SURFACE_SET_BUFFER_SCALE_SINCE_VERSION)
|
||||||
|
{
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Get the scale factor from the highest scale monitor.
|
// Get the scale factor from the highest scale monitor.
|
||||||
int maxScale = 1;
|
int maxScale = 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user