You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In src/keymap.h, the type of the screen member in the xkb_switch_screen_action struct is int8_t. This also matches the type specified in the X Keyboard Extension Protocol Specification for SA_SwitchScreen. However, during the validation step in src/xkbcomp/action.c, in the function HandleSwitchScreen(), all values in the range [-255, +255] are accepted.
Should the validation step instead check that the value is in [-128, +127], in order to fit inside the range of int8_t?
The text was updated successfully, but these errors were encountered:
We try to follow X11 xkbcomp behavior as much as possible, but if it is buggy we may diverge. Here I have not analyzed much the impact, since libxkbcommon does not offer an API to handle this type of action, although we parse and serialize it.
As far as I can tell, the impact would be quite limited on modern systems. This is because there is generally only one screen index (0) available on modern systems that use the X server, with all monitors being combined into one conceptual 'screen'. However, there may be some other configurations I am not aware of, which could be relevant.
For the situation where the parsed screen index exceeds the range, would it make sense to add a log message? This could be a way to notify the user of how the screens are handled without changing the actual behavior of the parser.
In
src/keymap.h
, the type of thescreen
member in thexkb_switch_screen_action
struct isint8_t
. This also matches the type specified in the X Keyboard Extension Protocol Specification for SA_SwitchScreen. However, during the validation step insrc/xkbcomp/action.c
, in the functionHandleSwitchScreen()
, all values in the range [-255, +255] are accepted.Should the validation step instead check that the value is in [-128, +127], in order to fit inside the range of
int8_t
?The text was updated successfully, but these errors were encountered: