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
6
votes
0 answers

How to start gst-launch on a custom xy position

I'm developing a C++ application on embedded-linux and I need to display video from camera in it. I've used gstreamer to create a window and start the video capture (because it has hardware support on tegra) with command: system("gst-launch -e…
devslo
  • 61
  • 4
6
votes
1 answer

Xlib: Adding a window to the save-set using XAddToChangeSet does not work from Java/JNI

I am getting stuck and don't know where to look further. I have a Java application and one of its functionality is to grab some specific windows (ie third party application windows) and host them within itself (with some extra frames, etc...) The…
6
votes
3 answers

Cannot call XInitThreads

I have written an SFML C++ game, and tried to start using threads, but after a while everything crashes. After searching I found out the fix seems to be to call XInitThreads(); but this does not work somehow. simplified code: #include…
user3554800
  • 73
  • 1
  • 1
  • 5
6
votes
1 answer

Compiling 32bits qt sources on a 64bit Debian environement

I want to build 32 bits applications on my Debian 64 bits environment. So, I'm trying to compile the Qt sources in order to get the 32 bits libraries. I am trying to use the following configure command: ./configure -platform…
JeD
  • 315
  • 3
  • 8
6
votes
3 answers

Anti-aliased text in X11

I'm experimenting with Xlib to gain a deeper understanding of how Linux GUI programs work. I've written a simple program that display "Hello, world" in a window, but it looks rather anachronistic since the text is not anti-aliased. What is the best…
Jay Conrod
  • 28,943
  • 19
  • 98
  • 110
6
votes
1 answer

X11 and fake keyboard / mouse events

I want to know as to how do you detect if a key press event or a mouse pointer event has been generated by an (automation like) application like xdotool. Basically, I am writing an application to check if there is no real mouse or keyboard…
6
votes
2 answers

linux, C++, xft : how to use it?

I try to use Xft, the tutorial, well let them calling that a tutorial... looks like it was written in a north korean camp... I also found this one. So let me try to do a step-by-step : // g++ XftTest.cc -lX11 -lXft `pkg-config --cflags…
The Unholy Metal Machine
  • 1,093
  • 2
  • 17
  • 36
6
votes
1 answer

How to use xlib to listen for screen resolution changes on Linux

I'm writing a little native routine to notify another process that the user has changed the screen resolution. I tried using gtk but it's unstable on non composite window managers and crashes often. I'm looking into xlib and have a sample working…
wheels53
  • 719
  • 1
  • 7
  • 21
6
votes
2 answers

capture mouse with Xlib

I want to write a simple Xlib program changing the mouse behavior (to give an example, invert vertical movement). I have a problem with capturing the events. I would like the code to capture changes in the controllers position (I move mouse upward,…
Jakub M.
  • 32,471
  • 48
  • 110
  • 179
5
votes
1 answer

Xlib: How to check if a window is minimized or not?

How can I check if a window is minimized or not using the C interface of xlib? Edit: Should this code work? int window_is_minimized(Display *display, Window window) { Atom actual_type; int actual_format; unsigned long i, num_items,…
user301649
5
votes
1 answer

How to draw an image from file on window with Xlib

This is my code: int main() { Display *d = XOpenDisplay(0); unsigned int bitmap_width, bitmap_height; int x, y; Pixmap bitmap; if ( d ) { Window w = XCreateWindow(d, DefaultRootWindow(d), 0, 0, 400, …
user725803
  • 227
  • 2
  • 5
  • 12
5
votes
1 answer

Get notifications when active X window changes using Python xlib

I'd like to monitor which window is active on a Linux system running X, and when that active window gets resized or moved. I can monitor the active window (it's held in the _NET_ACTIVE_WINDOW property on the root window, and I can register for…
sil
  • 1,769
  • 1
  • 18
  • 34
5
votes
1 answer

How do I write text to the root window using Python's Xlib?

I'm running a Debian 10 stable x64 system with the dwm window manager, and I'm using Python 3.7.3. From what I can tell from some example code and the draw_text method itself, I should be able to draw text on the root window with code like…
Michael A
  • 4,391
  • 8
  • 34
  • 61
5
votes
3 answers

Does xlib have an active window event?

I am trying to write a program that tracks when the active window changes using Xlib. I am have trouble figuring out the best way to do this. These are my ideas so far: Every second use _NET_ACTIVE_WINDOW to get the active window and if it has…
Jim
  • 51
  • 1
  • 2
5
votes
1 answer

How can I list all open (X11) windows on Gnu/Linux from a Python script?

I'd like to be able to grab a list of all windows that are open on a Linux desktop from a Python script. I suppose this would require working through Xlib or some other x11 or xdisplay library. This would be the Linux equivalent on win32's…
Al Sweigart
  • 11,566
  • 10
  • 64
  • 92