Skip to content

Commit

Permalink
wayland: Scale-to-display mode requires both viewports and xdg-output…
Browse files Browse the repository at this point in the history
… for proper functionality
  • Loading branch information
Kontrabant committed Feb 10, 2025
1 parent b63d3af commit c032586
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/video/wayland/SDL_waylandvideo.c
Original file line number Diff line number Diff line change
Expand Up @@ -1366,10 +1366,16 @@ bool Wayland_VideoInit(SDL_VideoDevice *_this)
// First roundtrip to receive all registry objects.
WAYLAND_wl_display_roundtrip(data->display);

// Require viewports for display scaling.
if (data->scale_to_display_enabled && !data->viewporter) {
SDL_LogError(SDL_LOG_CATEGORY_VIDEO, "wayland: Display scaling requires the missing 'wp_viewporter' protocol: disabling");
data->scale_to_display_enabled = false;
// Require viewports and xdg-output for display scaling.
if (data->scale_to_display_enabled) {
if (!data->viewporter) {
SDL_LogError(SDL_LOG_CATEGORY_VIDEO, "wayland: Display scaling requires the missing 'wp_viewporter' protocol: disabling");
data->scale_to_display_enabled = false;
}
if (!data->xdg_output_manager) {
SDL_LogError(SDL_LOG_CATEGORY_VIDEO, "wayland: Display scaling requires the missing 'zxdg_output_manager_v1' protocol: disabling");
data->scale_to_display_enabled = false;
}
}

// Now that we have all the protocols, load libdecor if applicable
Expand Down

0 comments on commit c032586

Please sign in to comment.