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.

944 questions
62
votes
3 answers

Xlib and Firefox behavior

I'm trying to create a small window manager (just for fun), but I'm having problems in handling windows created by Firefox (only with that application, other apps works fine) The problem is, after I launch Firefox, and add my decoration, it seems…
Ivan
  • 3,976
  • 2
  • 34
  • 68
51
votes
9 answers

How do I efficiently determine if a polygon is convex, non-convex or complex?

From the man page for XFillPolygon: If shape is Complex, the path may self-intersect. Note that contiguous coincident points in the path are not treated as self-intersection. If shape is Convex, for every pair of points inside the polygon, the…
hhafez
  • 36,343
  • 33
  • 109
  • 143
39
votes
7 answers

Why XGrabKey generates extra focus-out and focus-in events?

Does anyone know an xlib function to trap a keypress event without losing the original focus? How to get rid of it? (or "to use XGrabKey() without generating Grab-style focusout"?) (or "How to get rid of NotifyGrab and NotifyUngrab focus events at…
diyism
  • 10,974
  • 5
  • 44
  • 43
39
votes
2 answers

How do I gracefully exit an X11 event loop?

Almost every tutorial I find tells me to do this for my event loop: XEvent event; while (true) { XNextEvent(display, &event); switch (event.type) { case Expose: printf("Expose\n"); break; …
TheBuzzSaw
  • 8,241
  • 3
  • 34
  • 53
31
votes
3 answers

Global Hotkey with X11/Xlib

My goal is to have a program that sleeps in the background but can be activated by the user via some "hotkey". From digging around the Xlib manual and the Xlib O'reilly manual, I gather that the correct way to to this is with XGrabKey. However my…
cheshirekow
  • 4,487
  • 5
  • 36
  • 45
28
votes
3 answers

How do take a screenshot correctly with xlib?

I am trying to capture an image of the screen for use in screencasting. Thus I need a fast solution, and cannot rely on shell programs such as import or xwd. This is the code I have written so far, but it fails and gives me a junk image, which just…
Lalaland
  • 8,180
  • 3
  • 30
  • 47
27
votes
3 answers

how to quit the blocking of xlib's XNextEvent

Under windows, the GUI thread usually call GetMessage to waiting for message, when another thread use PoseMessage put a message into the queue, then the GUI thread will return GetMessage (quit blocking). Does anyone can tell me, when I use…
Tom Wong
  • 273
  • 1
  • 3
  • 4
25
votes
5 answers

What do I need to do to link with xlib?

I am using GCC, what switches do I need to add to link with Xlib? After searching, all I could find was -lX11, but that gave me ld: library not found for -lX11 I am using a mac (10.6), but I would not like anything that is Mac specific.
Jeffrey Aylesworth
  • 7,630
  • 8
  • 37
  • 56
24
votes
1 answer

Reducing input latency when working with X

I've been reading a few articles about input latency lately: https://danluu.com/term-latency/ https://pavelfatin.com/typing-with-pleasure/ And I've been trying to improve the user experience of my small text editor. I was using SDL to pool input and…
vinnylinux
  • 6,580
  • 11
  • 56
  • 110
19
votes
9 answers

Getting pid and details for topmost window

Does anyone know how to get the PID of the top active window and then how to get the properties of the window using the PID? I mean properties like process name, program name, etc. I'm using Qt under Linux (Ubuntu 9.10).
user247991
  • 209
  • 1
  • 2
  • 4
17
votes
4 answers

How do you exit X11 program without Error

I have a fairly simple "Hello World" in X11 at end of question. But when it exits I get the run time error messages below: $ ./xtest XIO: fatal IO error 11 (Resource temporarily unavailable) on X server ":0" after 9 requests (7 known…
Joe McGrath
  • 1,413
  • 10
  • 25
17
votes
2 answers

Modern ways to write a window manager

I'm trying to write a window manager. (Actually, I have written an OS and a compiler, but that's beside the point.) XLib and xcb aren't exactly nasty, at least not by, say, win32 standards, but they are definitely very old and don't lend themselves…
David Given
  • 12,261
  • 6
  • 63
  • 114
17
votes
2 answers

How do you install Python Xlib with pip?

"Python Xlib" ( http://pypi.python.org/pypi/Python%20Xlib ) is a low level python library for working with xlib. I have installed it on my Ubuntu Linux machine via apt, i.e. sudo aptitude install python-xlib. However is it possible to install it…
Rory
  • 48,706
  • 67
  • 174
  • 234
16
votes
2 answers

How to upload 32 bit image to server-side pixmap

I'm trying to create server-side RGBA pixmap from client side buffer. CreatePixmap & CreateImage work ok for 32 and 24 bit, but XPutImage result in Match Error returned by server X Error of failed request: BadMatch (invalid parameter attributes) …
Andrey Sidorov
  • 22,962
  • 4
  • 58
  • 73
14
votes
4 answers

Listening to keyboard events without trapping them?

I'm writing an command-line application which listens for Control key release events in X Windows and alerts another process when it detects them. Being new to GNU/Linux, I'd prefer avoiding to fumble with GCC and therefore I'm looking for a…
1
2 3
62 63