static int errno_stack[PLY_ERRNO_STACK_SIZE];
static int errno_stack_position = 0;
+static int overridden_device_scale = 0;
+
bool
ply_open_unidirectional_pipe (int *sender_fd,
int *receiver_fd)
return (pid_t) ppid;
}
+void
+ply_set_device_scale (int device_scale)
+{
+ overridden_device_scale = device_scale;
+ ply_trace ("Device scale is set to %d", device_scale);
+}
+
/* The minimum resolution at which we turn on a device-scale of 2 */
#define HIDPI_LIMIT 192
#define HIDPI_MIN_HEIGHT 1200
if ((force_device_scale = getenv ("PLYMOUTH_FORCE_SCALE")))
return strtoul (force_device_scale, NULL, 0);
+ if (overridden_device_scale != 0)
+ return overridden_device_scale;
+
if (height < HIDPI_MIN_HEIGHT)
return 1;
char *ply_get_process_command_line (pid_t pid);
pid_t ply_get_process_parent_pid (pid_t pid);
+void ply_set_device_scale (int device_scale);
+
int ply_get_device_scale (uint32_t width,
uint32_t height,
uint32_t width_mm,
{
ply_key_file_t *key_file = NULL;
bool settings_loaded = false;
+ const char *scale_string;
const char *splash_string;
ply_trace ("Trying to load %s", path);
}
}
+ scale_string = ply_key_file_get_value (key_file, "Daemon", "DeviceScale");
+
+ if (scale_string != NULL) {
+ ply_set_device_scale (strtoul (scale_string, NULL, 0));
+ }
+
settings_loaded = true;
out:
ply_key_file_free (key_file);