Bugzilla – Attachment 1264 Details for
Bug 8527
Caps lock/Num lock synchronisation unreliable on GNOME Wayland
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
Minimal example to trigger issue
sync_x11.c (text/x-csrc), 1.12 KB, created by
Adam Halim
on 2025-02-24 16:05:28 CET
(
hide
)
Description:
Minimal example to trigger issue
Filename:
MIME Type:
Creator:
Adam Halim
Created:
2025-02-24 16:05:28 CET
Size:
1.12 KB
patch
obsolete
>#include <X11/Xlib.h> >#include <X11/XKBlib.h> >#include <stdio.h> >#include <stdbool.h> > >void checkLockStates(Display* display) { > XkbStateRec state; > XkbGetState(display, XkbUseCoreKbd, &state); > > bool capsLock = state.locked_mods & LockMask; > bool numLock = state.locked_mods & Mod2Mask; > > printf("Caps Lock: %s\n", (capsLock ? "ON" : "OFF")); > printf("Num Lock: %s\n", (numLock ? "ON" : "OFF")); >} > >int main() { > Display* display = XOpenDisplay(NULL); > if (!display) { > fprintf(stderr, "Unable to open X display\n"); > return 1; > } > > int screen = DefaultScreen(display); > Window rootWindow = RootWindow(display, screen); > > Window window = XCreateSimpleWindow(display, rootWindow, 0, 0, 400, 300, 1, > BlackPixel(display, screen), WhitePixel(display, screen)); > > XSelectInput(display, window, FocusChangeMask); > XMapWindow(display, window); > > XEvent event; > while (true) { > XNextEvent(display, &event); > if (event.type == FocusIn) { > checkLockStates(display); > } > } > XCloseDisplay(display); > return 0; >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 8527
: 1264