@@ -25,7 +25,7 @@ static void waylandOutputModeListener(void* data, FF_MAYBE_UNUSED struct wl_outp
2525static void waylandOutputScaleListener (void * data , FF_MAYBE_UNUSED struct wl_output * output , int32_t scale )
2626{
2727 WaylandDisplay * display = data ;
28- display -> scale = scale ;
28+ display -> dpi = 96 * ( uint32_t ) scale ;
2929}
3030
3131static void waylandOutputGeometryListener (void * data ,
@@ -51,7 +51,7 @@ static void handleXdgLogicalSize(void *data, FF_MAYBE_UNUSED struct zxdg_output_
5151 // Seems the values are only useful when ractional scale is enabled
5252 if (width < display -> width )
5353 {
54- display -> scale = (double ) display -> width / width ;
54+ display -> dpi = (uint32_t ) ( display -> width * 96 / width ) ;
5555 }
5656}
5757
@@ -86,7 +86,6 @@ const char* ffWaylandHandleGlobalOutput(WaylandData* wldata, struct wl_registry*
8686
8787 WaylandDisplay display = {
8888 .parent = wldata ,
89- .scale = 1 ,
9089 .transform = WL_OUTPUT_TRANSFORM_NORMAL ,
9190 .type = FF_DISPLAY_TYPE_UNKNOWN ,
9291 .name = ffStrbufCreate (),
@@ -128,8 +127,7 @@ const char* ffWaylandHandleGlobalOutput(WaylandData* wldata, struct wl_registry*
128127 (uint32_t ) display .width ,
129128 (uint32_t ) display .height ,
130129 display .refreshRate / 1000.0 ,
131- (uint32_t ) (display .width / display .scale + .5 ),
132- (uint32_t ) (display .height / display .scale + .5 ),
130+ display .dpi ,
133131 (uint32_t ) display .preferredWidth ,
134132 (uint32_t ) display .preferredHeight ,
135133 display .preferredRefreshRate / 1000.0 ,
0 commit comments