Questions tagged [xlib]

Xlib is a library used to communicate with X11 servers. This is the library that widget toolkits like GTK+, Qt, and Motif use to draw their graphics, and it's considered to be low-level.

Xlib is a library used to communicate with X11 servers.

This is the library that widget toolkits like GTK+, Qt, and Motif use to draw their graphics, and it's considered to be low-level. If you're looking for a high-level GUI toolkit, you're better off looking at those toolkits instead of using Xlib directly.

Xlib was first developed in 1985. The newer XCB library is intended to replace Xlib and take over its functions, but currently very few programs use XCB.

1036 questions
4
votes
4 answers

Why does it matter when you draw in XWindows?

I got this XWindows "hello, world" off the net. I have behavior I don't understand in a more complex program, but the simple program here also displays it: #include #include #include #include int…
Scott Franco
  • 481
  • 2
  • 15
4
votes
2 answers

Xlib Fatal IO Error: 11 (resource temporarily unavailable) caused by not using XCloseDisplay()

I'm using X11 and when I run my program the window displays fine, but when I quit the following error is outputted in the console: XIO: fatal IO error 11 (Resource temporarily unavailable) on X server ":0.0" after 58 requests (58 known…
Adam Yaxley
  • 670
  • 1
  • 7
  • 13
4
votes
2 answers

Activating a Window on X11, why do I lose the title bar?

Using the bellow code, I am activating a window on X11. I'm using FindWindow to get the window handle, which works just fine. Then I want to bring the specified window in the foreground. To do this, I use XRaiseWindow. XRaiseWindow(display,…
Stefan Steiger
  • 78,642
  • 66
  • 377
  • 442
4
votes
1 answer

Disable keyboard but keep getting events

I have a touchscreen laptop that folds back enough to become like a tablet. If I put it down on the table, I don't want to be hitting keys accidentally, so I'm working on a script to disable the keyboard when I hit Ctrl-F10 and then re-enable it…
zondo
  • 19,901
  • 8
  • 44
  • 83
4
votes
0 answers

XGetImage is mangled for chrome, firefox, electron, when using XCompositeRedirectWindow

I am attempting to create a thumbnailer (for i3wm on linux) which generates an icon from a screenshot for all the available windows. The aim being to replicate something like how windows uses Alt-Tab to produce a pane of windows to choose from; The…
Tom
  • 3,324
  • 1
  • 31
  • 42
4
votes
2 answers

Picture format for _NET_WM_ICON

Environment: Ubuntu 16.04 In my app, I get an application's icon by calling XGetWindowProperty with _NET_WM_ICON atom. unsigned char* data; XGetWindowProperty(..., &data); unsigned long* data1 = (unsigned long*) data; long width = *data1; long…
Peter
  • 11,260
  • 14
  • 78
  • 155
4
votes
4 answers

Books/resources on learning Xlib ("the Linux Petzold"?)

I have stubbornly decided to learn Xlib programming for Linux GUIs, just for fun & the gained experience. I'm young and have lots of time to read useless stuff. Nobody seems to want people to learn this, though, as everywhere I look, askers are…
user1481860
4
votes
1 answer

XDrawString incorrect encoding

I want to display cyrillic symbols with XDrawString(), but on screen they are shown in wrong encoding. I have installed xfonts-cyrillic in my system (ubuntu 14.04), but still any font from xlsfonts list shows wrong result. My code…
dima.rus
  • 183
  • 1
  • 8
4
votes
1 answer

How to react to mouse wheel in Xlib?

I want to execute code when user will use mouse wheel. I wrote simple example application and it is not working. Why my application is not reacting on mouse wheel? #include #include #include #include…
BPS
  • 1,133
  • 1
  • 17
  • 38
4
votes
1 answer

xinit window always on top _NET_WM_STATE _NET_WM_STATE_ABOVE

I use fedora 14 system. When I use starx startup desktop systems, I created a Xlib program, the code is as follows: Atom wmStateAbove = XInternAtom(display, "_NET_WM_STATE_ABOVE",1); if(wmStateAbove != None) …
cgmst
  • 41
  • 4
4
votes
2 answers

xlib XNextEvent checking if a key is held down

I am using xlib to get keyboard input I want to simulate windows its getAsynckeystate() to check if a button is being pressed I tried using a timer to fix the result but its still broken. the function should always return true if 'z' is held down…
4
votes
1 answer

Portable keycodes in X11?

I want to get mapping-independent key codes, but documentation says that "keycode" in XKeyEvent structure depends on hardware and driver and I can't rely on it. How can I get some portable key codes like VK_* in Windows?
Mad Fish
  • 703
  • 1
  • 8
  • 12
4
votes
1 answer

How to get the character for an XLib key wrt the keyboard layout?

Using XKeycodeToKeysym (in C++) I can get the KeySym for a key-press event. From what I understand this already should respect the keyboard layout. However, when I switch a keyboard layout (between english and hebrew) I get the same KeySym. I…
Yaron Cohen-Tal
  • 2,005
  • 1
  • 15
  • 26
4
votes
1 answer

Get window title with XCB

I am trying to get information about the window in focus. It seems that I get a correct window id from xcb_get_input_focus_reply_t->focus: it stays the same for my Eclipse IDE (56623164) and is another for any other window in focus. However, the…
Matthias
  • 7,432
  • 6
  • 55
  • 88
4
votes
1 answer

Qt + XCompositeRender problem

I want to render the contents of the window in to QWidget ( or QPixmap ) using XComposite and XRender. The Issue I'm facing is that I can't get the picture be rendered in the QWidget. The code below has been written using the following tutorial:…
Vladimir
  • 41
  • 1