Consider the following minimal window manager found online. It compiles and runs fine.
#include <X11/Xlib.h>
#include <stdio.h>
#include <stdlib.h>
int main()
{
Display *display;
Window window;
XEvent event;
int s;
/* open connection with the server */
display = XOpenDisplay(NULL);
if (display == NULL)
{
fprintf(stderr, "Cannot open display\n");
exit(1);
}
s = DefaultScreen(display);
/* create window */
window = XCreateSimpleWindow(display, RootWindow(display, s), 10, 10, 200, 200, 1,
BlackPixel(display, s), WhitePixel(display, s));
/* select kind of events we are interested in */
XSelectInput(display, window, KeyPressMask | KeyReleaseMask );
/* map (show) the window */
XMapWindow(display, window);
/* event loop */
while (1)
{
XNextEvent(display, &event);
/* keyboard events */
if (event.type == KeyPress)
{
printf( "KeyPress: %x\n", event.xkey.keycode );
/* exit on ESC key press */
if ( event.xkey.keycode == 0x09 )
break;
}
else if (event.type == KeyRelease)
{
printf( "KeyRelease: %x\n", event.xkey.keycode );
}
}
/* close connection to server */
XCloseDisplay(display);
return 0;
}
In this window manager, I can load a terminal (such as xterm) and the "onboard" on screen keyboard program with ubuntu (server addition, with xinit installed). The onboard on screen keyboard is not sending key input to other windows in this minimal window manager (onboard loads on the bottom region of the screen).
Note that DWM minimalist window manager works as expected (the onboard input gets sent to all other windows). Im unable to find in the DWM source where this kind of thing is considered.
My question is this: How to I make this minialist window manager allow the Onboard on screen keyboard to send input to other windows?