From 91e7f3707491c0730db9950789bbe46a74cb4d0a Mon Sep 17 00:00:00 2001 From: David Maciejak Date: Tue, 21 Mar 2023 21:06:06 +0800 Subject: [PATCH] WPrefs: fix keyboard shortcut sorting order That patch is fixing some Actions entries that are not sorted properly. One is using some upper/lower cases. And the other one, is displaying numbers while alphabetic sorting is not working properly on numbers. For example: Shortcut for window 1 Shortcut for window 10 Shortcut for window 2 ... --- WPrefs.app/KeyboardShortcuts.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/WPrefs.app/KeyboardShortcuts.c b/WPrefs.app/KeyboardShortcuts.c index c4aa7873..225eda04 100644 --- a/WPrefs.app/KeyboardShortcuts.c +++ b/WPrefs.app/KeyboardShortcuts.c @@ -154,7 +154,7 @@ static struct keyOption { /* Misc. */ { "WindowRelaunchKey", N_("Launch new instance of application") }, - { "ScreenSwitchKey", N_("Switch to Next Screen/Monitor") }, + { "ScreenSwitchKey", N_("Switch to next screen/monitor") }, { "RunKey", N_("Run application") }, { "ExitKey", N_("Exit Window Maker") }, { "DockRaiseLowerKey", N_("Raise/Lower Dock") }, @@ -550,7 +550,7 @@ static int cmpKeyOptions(const void *v1, const void *v2) const struct keyOption *opt1 = (struct keyOption *)v1; const struct keyOption *opt2 = (struct keyOption *)v2; - if ((rc = strcmp(opt1->title, opt2->title)) < 0) + if ((rc = strncmp(opt1->title, opt2->title, 20)) < 0) return -1; else if (rc > 0) return 1;