FAQ Database Discussion Community


How to restore a window with Xlib?

linux,unix,x11,gnome,xlib
I've managed to iconify a window using XIconifyWindow, but haven't managed to later restore it. I tried the following: XMapRaised (display, window); And: XMapWindow (display, window); And: XClientMessageEvent ev; std::memset (&ev, 0, sizeof ev); ev.type = ClientMessage; ev.window = window; ev.message_type = XInternAtom(display, "WM_CHANGE_STATE", False); ev.format = 32; ev.data.l[0] =...

Xlib fails (Segmentation fault) even with each connection per thread

multithreading,x11,xlib
So far as I know about X11 with Xlib, is that with multi threading a programmer has 2 choices call early enough XInitThreads or use new connection (XOpenDisplay) per thread. Suppose i don't like first the first method with XInitThreads() call. Why does second fail? #include <X11/Xlib.h> #include <thread> void...

Function XOpenDisplay with and without parameter

c,linux,xlib
I have little issue with XOpenDisplay function. In school I can run program and it works good when using XOpenDisplay("ip:0"), but on my local machine in home when I run program (changed ip on current) got "Segmentation fault (core dumped)", but with empy string XOpenDisplay("") it works fine. I need...

Why is XKeysymToKeycode() making all of my keys lowercase?

c,x11,xlib
I'm currently having a problem with Xlib where whenever I call XKeysymToKeycode() and pass in an uppercase KeySym, it returns a lowercase KeyCode. Google doesn't really seem to have an answer to this question, or too much documentation at all on the functions I'm using, for that matter. Here's the...

Windows Gui and OpenGL relationship

user-interface,opengl,xlib
I have been studying lately OpenGL in university and searched on my own about Windows GUI programming in c++ like Qt. I even went deeper and found XLib for Windows GUI. But I still don't get the big picture. I understand that Qt is build on-top of XLib. And to...

xlib, remove delay when holding down a key

x11,xlib
I've just created a simple demo in opengl that involves movement and rotation of the camera. The problem is in the controls. There is a delay between the first time and second time that the keypress is registered when I am holding down the key. After that there is no...

linux x11 window manager - blocking mouse events

linux,x11,xlib,window-managers
Let's assume that a few windows are visible - I need to implement mechanism which will block events for a selected windows, for example when user click a button in window_nr1 and window_nr2 nothing happens but when a user click a button in window_nr3 event is processed. Compositing window manager...

CGO converting Xlib XEvent struct to byte array?

c,go,xlib,cgo
I am creating a simple window manager (code based of the c code in tinywm) in Golang. To use Xlib, I am using cgo, so my header is: // #cgo LDFLAGS: -lX11 // #include <X11/Xlib.h> And I have a variable declaration, like: event := C.XEvent{} And then, I use this...