Implement fractional-scale-v1 protocol

This protocol allows Wayland clients to properly scale on outputs with
fractional scale factor.

Tested with foot and transmission-qt (Qt6).
This commit is contained in:
Consus 2023-12-02 17:53:12 +03:00 committed by Consolatis
parent bf326cc8f1
commit e36c065c7b

View file

@ -5,6 +5,7 @@
#include <sys/wait.h> #include <sys/wait.h>
#include <wlr/types/wlr_data_control_v1.h> #include <wlr/types/wlr_data_control_v1.h>
#include <wlr/types/wlr_export_dmabuf_v1.h> #include <wlr/types/wlr_export_dmabuf_v1.h>
#include <wlr/types/wlr_fractional_scale_v1.h>
#include <wlr/types/wlr_gamma_control_v1.h> #include <wlr/types/wlr_gamma_control_v1.h>
#include <wlr/types/wlr_input_inhibitor.h> #include <wlr/types/wlr_input_inhibitor.h>
#include <wlr/types/wlr_presentation_time.h> #include <wlr/types/wlr_presentation_time.h>
@ -31,6 +32,7 @@
#include "xwayland.h" #include "xwayland.h"
#define LAB_WLR_COMPOSITOR_VERSION (5) #define LAB_WLR_COMPOSITOR_VERSION (5)
#define LAB_WLR_FRACTIONAL_SCALE_V1_VERSION 1
static struct wlr_compositor *compositor; static struct wlr_compositor *compositor;
static struct wl_event_source *sighup_source; static struct wl_event_source *sighup_source;
@ -377,6 +379,8 @@ server_init(struct server *server)
wlr_data_control_manager_v1_create(server->wl_display); wlr_data_control_manager_v1_create(server->wl_display);
wlr_viewporter_create(server->wl_display); wlr_viewporter_create(server->wl_display);
wlr_single_pixel_buffer_manager_v1_create(server->wl_display); wlr_single_pixel_buffer_manager_v1_create(server->wl_display);
wlr_fractional_scale_manager_v1_create(server->wl_display,
LAB_WLR_FRACTIONAL_SCALE_V1_VERSION);
idle_manager_create(server->wl_display, server->seat.seat); idle_manager_create(server->wl_display, server->seat.seat);