[client] wayland: improve fractional scaling

avoids the 24.8 quantisation without introducing floating-point
equality/rounding behaviour throughout the Wayland state.

Closes #1257
This commit is contained in:
Geoffrey McRae
2026-05-31 13:15:42 +10:00
parent dba2d23eb2
commit 01b8724cfe
6 changed files with 103 additions and 21 deletions

View File

@@ -48,6 +48,8 @@
#include "wayland-xdg-output-unstable-v1-client-protocol.h"
#include "wayland-xdg-activation-v1-client-protocol.h"
#include "scale.h"
typedef void (*WaylandPollCallback)(uint32_t events, void * opaque);
struct WaylandPoll
@@ -62,7 +64,7 @@ struct WaylandPoll
struct WaylandOutput
{
uint32_t name;
wl_fixed_t scale;
struct WaylandScale scale;
int32_t scaleInt;
int32_t logicalWidth;
int32_t logicalHeight;
@@ -108,7 +110,7 @@ struct WaylandDSState
struct wl_shm * shm;
struct wl_compositor * compositor;
wl_fixed_t scale;
struct WaylandScale scale;
bool fractionalScale;
bool needsResize;
bool configured;
@@ -285,7 +287,7 @@ bool waylandOutputInit(void);
void waylandOutputFree(void);
void waylandOutputBind(uint32_t name, uint32_t version);
void waylandOutputTryUnbind(uint32_t name);
wl_fixed_t waylandOutputGetScale(struct wl_output * output);
struct WaylandScale waylandOutputGetScale(struct wl_output * output);
// poll module
bool waylandPollInit(void);