mirror of
https://github.com/gryf/wmaker.git
synced 2026-10-06 09:20:34 +02:00
WPrefs: Fix crash when switching to mouse settings panel
Apparently, there is some exceptional case when the 'Mouse Grab Modifier' list can be empty, in which case the program would crash. This patch makes sure the program will not crash (that's a bad behaviour), but does not solve the empty list case Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
This commit is contained in:
1 parent
ebac6e7c83
commit
5d2fb4ec97
1 file changed
+6
-3
@@ -315,10 +315,13 @@ static void showData(_Panel * panel)
|
||||
}
|
||||
|
||||
if (a < 1) {
|
||||
sscanf(WMGetPopUpButtonItem(panel->grabP, 0), "%s", buffer);
|
||||
WMSetPopUpButtonSelectedItem(panel->grabP, 0);
|
||||
char *previous;
|
||||
|
||||
previous = WMGetPopUpButtonItem(panel->grabP, 0);
|
||||
if (previous != NULL)
|
||||
WMSetPopUpButtonSelectedItem(panel->grabP, 0);
|
||||
wwarning(_("modifier key %s for option ModifierKey was not recognized. Using %s as default"),
|
||||
str, buffer);
|
||||
str, previous?previous:"(empty)");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user