I manage to create a window using XCB and another one using GTKMM. The problem is: I cant spawn both at the same time.
When I open the X11 display with “xcb_connect” I can’t spawn the GTK window after using “gtk_display_get_default”.
But if I comment the “xcb_connect” I can spawn the GTK window. The same happens commenting “gtk_display_get_default”… I then can spawn the XCB window.
But again, if I use both display-opening functions, one of the windows will not appear… I’ve been searching the docs for answers but no luck so far. Am I doing something wrong?
Thanks in advance and apologies for any grammatical mistakes.
Hello, that is a good question. Fortunately it seems this is not a GTK or XCB problem. The join function in C++ will block the calling thread until the target thread returns. Try spawning both threads first, and then joining them:
I also was able to run the code when running the program from the terminal; the two windows spawn normally.
The problem arrives then starting the program from a TTY, like a standalone window manager. I do “startx”, with with “exec test” in my .xinitrc and then just one of the windows appear.
You must either remove those lines, or finish implementing the window manager. And since you are not checking the error, this will silently fail if another window manager is already running.