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
7
votes
2 answers

Get current X11 server time

Using Xlib, can we query the current X server time? With that I mean the value that would be returned in the time field of an XEvent if we were to receive an event right now. Preferably without opening any windows.
orlp
  • 112,504
  • 36
  • 218
  • 315
7
votes
2 answers

How to manage my application window with python-xlib?

I would like to find a linux-wide (insofar as it uses X11) way to control the window geometry of my application, which I program using Python. All my researches point to using python-xlib, which happens to be very poorly documented. What I'd like to…
neydroydrec
  • 6,973
  • 9
  • 57
  • 89
7
votes
6 answers

Anyone still program using xlib directly

I am surprised at the lack of response to all the xlib related question I've had on SO, is this because no one uses xlib directly anymore or is this the wrong place to ask these types of questions? Even if no one uses xlib directly, there must still…
hhafez
  • 38,949
  • 39
  • 113
  • 143
7
votes
1 answer

Playing video in Gtk in a window with a menubar

I have created a video player in Gtk3 using Gstreamer in Python3. It works except when I add a GtkMenuBar (place 2). It will then either show a black screen, or fail with an exception. The exception references the XInitThreads, which I am calling…
Aaron Schif
  • 2,421
  • 3
  • 17
  • 29
7
votes
1 answer

XChangeProperty without effect after client exits

I am trying to write a simple program that changes the name of a window with a certain window id. /* See LICENSE file for copyright and license details. */ #include #include #include #include #include…
7
votes
1 answer

Convert from Xlib to xcb

I am currently porting one of my applications from Xlib to libxcb and I am having a bit trouble finding informations on the XInput2 extension I use at some point. Is there an XInput2 implementation in libxcb? If yes, where can I find the…
Nidhoegger
  • 4,973
  • 4
  • 36
  • 81
7
votes
1 answer

Xlib: XGetWindowAttributes always returns 1x1?

I'd like to have width and height of the currently focussed window. The selection of the window works like a charm whereas the height and width are always returning 1. #include #include int main(int argc, char *argv[]) { …
Atmocreations
  • 9,923
  • 15
  • 67
  • 102
7
votes
2 answers

X11: Draw overlay / Remove drawings from overlay

I need to draw a shape directly on screen (a little arrow) in X11, it serves as an overlay. I am searching for about an hour no with no good results. Could anyone provide me a good entry point for what I need? The technologies I can use are cairo,…
Nidhoegger
  • 4,973
  • 4
  • 36
  • 81
7
votes
1 answer

Excluding some keys from XGrabKeyboard

Consider an application where it's desirable to grab the keyboard when focused in order to capture all window manager commands (Alt+F4 and whatnot) for processing. Now, this has the downside that the user has no way of switching to another…
Matti Virkkunen
  • 63,558
  • 9
  • 127
  • 159
7
votes
1 answer

Xtst and usleep

I'm using the Xtst extentsion to type and do stuff using the mouse I have not encoutnered any problems untill I started using xtst to move and click the mouse. for example, here's a set of action: move 359,216 & click …
Adel Ahmed
  • 638
  • 7
  • 24
7
votes
2 answers

sending fake keypress event to a window using xlib

I'm trying to use C and xlib to send a fake keypress event to the window with focus, here's my code: #include #include #define XK_A 0x041 int main() { Display *display = XOpenDisplay(NULL); …
Adel Ahmed
  • 638
  • 7
  • 24
7
votes
6 answers

How would you build a "pixel perfect" GUI on Linux?

I'd like build a GUI where every single pixel is under my control (i.e. not using the standard widgets that something like GTK+ provides). Renoise is a good example of what I'm looking to produce. Is getting down to the Xlib or XCB level the best…
splicer
  • 5,344
  • 4
  • 42
  • 47
7
votes
2 answers

Gtk: get usable area of each monitor (excluding panels)

Using gdk_screen_get_monitor_geometry, I can get the total area in pixels and the relative position of each monitor, even when there are two or more used as a single screen. However, I want to get the usable area (that is, excluding panels) of each…
Chris Camacho
  • 1,164
  • 1
  • 9
  • 31
7
votes
2 answers

How to wait until window is mapped and viewable

What is the proper way to wait until an X11 window is mapped and viewable? Precisely, I want to wait until I can safely call XSetInputFocus() without running into any risks of the X server backfiring with the following error: // X Error of failed…
Andreas
  • 9,245
  • 9
  • 49
  • 97
7
votes
1 answer

How to get an Xlib.display.Window instance by id?

I have found the following code (http://pastebin.com/rNkUj5V8), but I would rather use a direct lookup: import Xlib import Xlib.display def get_window_by_id(winid): mydisplay = Xlib.display.Display() root = mydisplay.screen().root # should…
blueyed
  • 27,102
  • 4
  • 75
  • 71