Wayland: Clean up data types related to scales

master
Camilla Löwy ago%!(EXTRA string=1 year)
parent 4c283e4a3c
commit 1be7bc546b
  1. 2
      src/wl_monitor.c
  2. 10
      src/wl_platform.h
  3. 8
      src/wl_window.c

@ -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)
{

@ -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

@ -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)
{

Loading…
Cancel
Save