mirror of
https://github.com/brl/mutter.git
synced 2024-12-25 20:32:16 +00:00
Replace using sscanf() to parse mode strings with new helper
This fixes issues when the locale uses characters other than `.` in floating point numbers. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2902>
This commit is contained in:
parent
2fd9834d94
commit
86b5d9d809
@ -159,12 +159,10 @@ append_monitor (MetaMonitorManager *manager,
|
||||
for (i = 0; specs[i]; ++i)
|
||||
{
|
||||
int width, height;
|
||||
float refresh_rate = 60.0;
|
||||
float refresh_rate;
|
||||
|
||||
if (sscanf (specs[i], "%dx%d@%f",
|
||||
&width, &height, &refresh_rate) == 3 ||
|
||||
sscanf (specs[i], "%dx%d",
|
||||
&width, &height) == 2)
|
||||
if (meta_parse_monitor_mode (specs[i], &width, &height, &refresh_rate,
|
||||
60.0))
|
||||
{
|
||||
CrtcModeSpec *spec;
|
||||
|
||||
|
@ -533,12 +533,9 @@ add_virtual_monitor_cb (const char *option_name,
|
||||
{
|
||||
MetaContextMain *context_main = user_data;
|
||||
int width, height;
|
||||
float refresh_rate = 60.0;
|
||||
float refresh_rate;
|
||||
|
||||
if (sscanf (value, "%dx%d@%f",
|
||||
&width, &height, &refresh_rate) == 3 ||
|
||||
sscanf (value, "%dx%d",
|
||||
&width, &height) == 2)
|
||||
if (meta_parse_monitor_mode (value, &width, &height, &refresh_rate, 60.0))
|
||||
{
|
||||
g_autofree char *serial = NULL;
|
||||
MetaVirtualMonitorInfo *virtual_monitor;
|
||||
|
Loading…
Reference in New Issue
Block a user