Wayland: Simplify per-window ouput scales tracking

This replaces (one case of) manual management of weak links between
windows and monitors, both objects with complex life times, with
wl_object pointers used as opaque key values.

(cherry picked from commit efa9297a41)
This commit is contained in:
Camilla Löwy
2022-11-08 20:33:29 +01:00
parent 5ac970120a
commit e5d19c9fac
3 changed files with 48 additions and 39 deletions
+11 -5
View File
@@ -169,6 +169,12 @@ typedef struct _GLFWofferWayland
GLFWbool text_uri_list;
} _GLFWofferWayland;
typedef struct _GLFWscaleWayland
{
struct wl_output* output;
int factor;
} _GLFWscaleWayland;
// Wayland-specific per-window data
//
typedef struct _GLFWwindowWayland
@@ -209,10 +215,10 @@ typedef struct _GLFWwindowWayland
// We need to track the monitors the window spans on to calculate the
// optimal scaling factor.
int scale;
_GLFWmonitor** monitors;
int monitorsCount;
int monitorsSize;
int contentScale;
_GLFWscaleWayland* scales;
int scaleCount;
int scaleSize;
struct zwp_relative_pointer_v1* relativePointer;
struct zwp_locked_pointer_v1* lockedPointer;
@@ -346,7 +352,7 @@ typedef struct _GLFWmonitorWayland
int x;
int y;
int scale;
int contentScale;
} _GLFWmonitorWayland;
// Wayland-specific per-cursor data