Wayland: Clean up data types related to scales

This commit is contained in:
Camilla Löwy 2024-02-08 19:36:27 +01:00
parent 4c283e4a3c
commit 1be7bc546b
3 changed files with 10 additions and 10 deletions

View File

@ -116,7 +116,7 @@ static void outputHandleScale(void* userData,
for (_GLFWwindow* window = _glfw.windowListHead; window; window = window->next)
{
for (int i = 0; i < window->wl.outputScaleCount; i++)
for (size_t i = 0; i < window->wl.outputScaleCount; i++)
{
if (window->wl.outputScales[i].output == monitor->wl.output)
{

View File

@ -340,7 +340,7 @@ typedef struct _GLFWofferWayland
typedef struct _GLFWscaleWayland
{
struct wl_output* output;
int factor;
int32_t factor;
} _GLFWscaleWayland;
// Wayland-specific per-window data
@ -389,10 +389,10 @@ typedef struct _GLFWwindowWayland
// We need to track the monitors the window spans on to calculate the
// optimal scaling factor.
int bufferScale;
int32_t bufferScale;
_GLFWscaleWayland* outputScales;
int outputScaleCount;
int outputScaleSize;
size_t outputScaleCount;
size_t outputScaleSize;
struct zwp_relative_pointer_v1* relativePointer;
struct zwp_locked_pointer_v1* lockedPointer;
@ -586,7 +586,7 @@ typedef struct _GLFWmonitorWayland
int x;
int y;
int scale;
int32_t scale;
} _GLFWmonitorWayland;
// Wayland-specific per-cursor data

View File

@ -312,7 +312,7 @@ static void setContentAreaOpaque(_GLFWwindow* window)
static void resizeFramebuffer(_GLFWwindow* window)
{
int scale = window->wl.bufferScale;
int32_t scale = window->wl.bufferScale;
int scaledWidth = window->wl.width * scale;
int scaledHeight = window->wl.height * scale;
@ -366,9 +366,9 @@ void _glfwUpdateBufferScaleFromOutputsWayland(_GLFWwindow* window)
}
// Get the scale factor from the highest scale monitor.
int maxScale = 1;
int32_t maxScale = 1;
for (int i = 0; i < window->wl.outputScaleCount; i++)
for (size_t i = 0; i < window->wl.outputScaleCount; i++)
maxScale = _glfw_max(window->wl.outputScales[i].factor, maxScale);
// Only change the framebuffer size if the scale changed.
@ -420,7 +420,7 @@ static void surfaceHandleLeave(void* userData,
_GLFWwindow* window = userData;
for (int i = 0; i < window->wl.outputScaleCount; i++)
for (size_t i = 0; i < window->wl.outputScaleCount; i++)
{
if (window->wl.outputScales[i].output == output)
{