Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MaskUsedModifiers: remove bits used for XKB group index #901

Merged
merged 1 commit into from
Sep 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion fvwm/bindings.c
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,7 @@ void print_bindings(void)
/* Removes all unused modifiers from in_modifiers */
unsigned int MaskUsedModifiers(unsigned int in_modifiers)
{
return in_modifiers & ~mods_unused;
return in_modifiers & ~mods_unused & ~DEFAULT_XKB_MODS_IGNORED;
}

unsigned int GetUnusedModifiers(void)
Expand Down
10 changes: 10 additions & 0 deletions libs/defaults.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,16 @@
((Button1MotionMask * ((1 << NUMBER_OF_MOUSE_BUTTONS) - 1)))
#define DEFAULT_MODS_UNUSED LockMask

/* Default modifier bits to ignore in XEvent.xkey.state or XEvent.xbutton.state.
* According to section "Xkb State to Core Protocol State Transformation" of the
* "The X Keyboard Extension: Library Specification", the Xkb-aware server
* reports group index in bits 13 and 14, which interferes with FVWM's modifier
* handling as described in https://github.com/fvwmorg/fvwm3/issues/861. */
#ifdef HAVE_X11_XKBLIB_H
#define DEFAULT_XKB_MODS_IGNORED ((1 << 13) | (1 << 14))
#else
#define DEFAULT_XKB_MODS_IGNORED 0
#endif

/*
* These values may be adjusted to fine tune the menu looks.
Expand Down
Loading