From 35e9e7c3eb029f989523c43ac9ce4b95bdd138c7 Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Mon, 20 Jan 2020 21:51:17 +0100 Subject: [PATCH] app_server: match screen configurations with empty serial number My laptop LCD has no serial number. Because of this check, it would never "exact match" with the previous data stored in the workspace settings. As a result, every time I set a new video mode, a new "screen" would be stored in the settings file, and the old entry would just stay there and never be used again. I currently find myself with about 100K of workspace settings, tracing the history of video mode changes over the last few years. Change-Id: Iea236a6ad09bc8bae9f6df8d63780bbfd4fa5619 Reviewed-on: https://review.haiku-os.org/c/haiku/+/2135 Reviewed-by: waddlesplash --- src/servers/app/ScreenConfigurations.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/servers/app/ScreenConfigurations.cpp b/src/servers/app/ScreenConfigurations.cpp index 643bb169e9..9c2a7628f9 100644 --- a/src/servers/app/ScreenConfigurations.cpp +++ b/src/servers/app/ScreenConfigurations.cpp @@ -76,9 +76,8 @@ ScreenConfigurations::BestFit(int32 id, const monitor_info* info, && !strcasecmp(configuration->info.name, info->name) && configuration->info.product_id == info->product_id) { score += 2; - if (info->serial_number[0] != '\0' - && !strcmp(configuration->info.serial_number, - info->serial_number)) { + if (strcmp(configuration->info.serial_number, + info->serial_number) == 0) { exactMatch = true; score += 2; }