Skip to content

Commit

Permalink
Fixed the 0 scale factor issue in the drm platform.
Browse files Browse the repository at this point in the history
Copied the code for fetching the device scale factor from the gtk platform.

(cherry picked from commit 4634896)
  • Loading branch information
Mikael-Eliasson authored and aperezdc committed Feb 26, 2024
1 parent 0ec604c commit 2c8fc7c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions platform/drm/cog-platform-drm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1317,6 +1317,12 @@ key_repeat_source_dispatch (GSource *base, GSourceFunc callback, gpointer user_d
}


static void
cog_drm_platform_shell_device_factor_changed(CogShell *shell, GParamSpec *param_spec, gpointer data)
{
drm_data.device_scale = cog_shell_get_device_scale_factor(shell);
}

static void
clear_glib (void)
{
Expand Down Expand Up @@ -1401,6 +1407,7 @@ cog_drm_platform_setup(CogPlatform *platform, CogShell *shell, const char *param
CogDrmPlatform *self = COG_DRM_PLATFORM(platform);

init_config(COG_DRM_PLATFORM(platform), shell, params);
g_signal_connect(shell, "notify::device-scale-factor", G_CALLBACK(cog_drm_platform_shell_device_factor_changed), NULL);

if (!wpe_loader_init ("libWPEBackend-fdo-1.0.so")) {
g_set_error_literal (error,
Expand Down

0 comments on commit 2c8fc7c

Please sign in to comment.