]> git.mdlowis.com Git - proto/labwc.git/commitdiff
Implement fractional-scale-v1 protocol
authorConsus <consus@ftml.net>
Sat, 2 Dec 2023 14:53:12 +0000 (17:53 +0300)
committerConsolatis <35009135+Consolatis@users.noreply.github.com>
Sun, 3 Dec 2023 22:04:35 +0000 (23:04 +0100)
This protocol allows Wayland clients to properly scale on outputs with
fractional scale factor.

Tested with foot and transmission-qt (Qt6).

src/server.c

index bd21d775cb5b471f9d7ca74d57e8e96c1ddca580..e3c5f7e32bb60a311902282230b50a902cb72899 100644 (file)
@@ -5,6 +5,7 @@
 #include <sys/wait.h>
 #include <wlr/types/wlr_data_control_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_input_inhibitor.h>
 #include <wlr/types/wlr_presentation_time.h>
@@ -31,6 +32,7 @@
 #include "xwayland.h"
 
 #define LAB_WLR_COMPOSITOR_VERSION (5)
+#define LAB_WLR_FRACTIONAL_SCALE_V1_VERSION 1
 
 static struct wlr_compositor *compositor;
 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_viewporter_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);