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
5
votes
1 answer

Python: how to switch between workspaces using Xlib?

How do I switch between my window manager's workspaces using Python with Xlib module? This is my most promising attempt: #!/usr/bin/python from Xlib import X, display, error, Xatom, Xutil import Xlib.protocol.event screen =…
Philip
  • 301
  • 2
  • 8
5
votes
0 answers

Change display mode under Linux

I'm trying to grasp programming graphics with Xlib and OpenGL. I can create windows etc., but I stuck at changing display modes. I can list available video modes with Xrandr functions (XRRSizes, XRRRates, XRRGetScreenInfo, XRRConfigSizes), check…
SasQ
  • 14,009
  • 7
  • 43
  • 43
5
votes
1 answer

Get a screenshot of a window that is cover or not visible or minimized with Xcomposite extension for X11

I have the follow starting code to get a screenshot of a X window (the window can be covered, not visibled, or minimized). #include #include #include #include #include…
Pioz
  • 6,051
  • 4
  • 48
  • 67
5
votes
0 answers

Copy-paste of selections with Xlib in X11: XA_TARGETS array of atoms

I've implemented copy-paste of text strings in an Xlib program. When my program owns the current selection, and I paste into xterm, or into a text field in gimp, or into firefox, it works fine: the program I'm pasting into sends a SelectionRequest…
5
votes
1 answer

How to catch X errors?

I tried searching the web, but I must note that finding materials about this aspect of X programming is not really easy. I use X with GLX to create OpenGL contexts. I already know my current graphics card driver only supports up to OpenGL API…
Oragon Efreet
  • 1,114
  • 1
  • 8
  • 25
5
votes
1 answer

python xlib xgrabkey keyrelease events not firing

i want to catch keydown and keyup events with python xlib, but keyup events disappear when some keys are pressed simultaneously. if 2 or more keyes are released simultaneously then there will be 2 or more keypress events, but only 1 keyrelease…
tino
  • 518
  • 5
  • 18
5
votes
2 answers

XSelectInput is not working for ButtonPressEvents,how to do it?

I am writing a simple programmes in C where i want to capture all the mouse and Keyboard events that are taking place. I tried to use "XGrabPointer" but it results in locking the screen and i can not go to other applications. I tried with…
user2314247
  • 71
  • 2
  • 4
5
votes
1 answer

How to draw on an X11 Drawable with Cairo in Haskell

I recently made my first steps in X11 programming in Haskell and now I want to draw texts using Cairo/Pango. I found some C tutorials and it seems as I need to create an Xlib surface using cairo_xlib_surface_create(). There is a Haskell wrapper for…
CAS
  • 51
  • 3
5
votes
1 answer

X11 screenshot of active window fails for GTK windows

this is a sub-project of a much larger research project. I am trying to take screenshots of an active window (browser) every 100ms, which are then to be stored in memory for OpenCV processing. I found from a similar question a solution to taking a…
Ælex
  • 14,432
  • 20
  • 88
  • 129
5
votes
2 answers

How to remove borders of widgets in an x window program using x resource?

I would like to change the ugly default looking of gv's GUI. I used editres to get the x resource tree of gv and tried to remove borders of buttons using the following settings: GV.control.MButton.borderWidth: 0 GV.control.MButton.borderColor:…
Jing
  • 283
  • 1
  • 8
5
votes
1 answer

Move window using PySide and PyKDE4

How should I go about moving a window created with PySide using the window manager? I see that kdeui has the NETRootInfo class with a moveResizeRequest method, which does exactly what I want. The following: from PySide.QtCore import Qt from PyKDE4…
D K
  • 5,530
  • 7
  • 31
  • 45
5
votes
1 answer

XChangeProperty() always fails

I'm learning to use xlib and I'm unable to get XChangeProperty() to work for me. I have a simple program that displays a window successfully. But calls to XChangeProperty() always fail with error code error 1 (BadRequest). Can someone tell me what…
Dhoti Walla
  • 119
  • 3
  • 8
5
votes
1 answer

Do I need to disconnect an xcb_connection_t that I got from XGetXCBConnection?

Here's an example I saw for some GLX code: display = XOpenDisplay(0); // ... xcb_connection_t *connection = XGetXCBConnection(display); // ... XCloseDisplay(display); I noticed that there was no xcb_disconnect in there. Is this correct? Also, is…
Pubby
  • 51,882
  • 13
  • 139
  • 180
5
votes
2 answers

xpath expression in findnodes() returning empty nodelist

XML: Gigi
qwertoyo
  • 1,332
  • 2
  • 15
  • 31
5
votes
1 answer

Transparent window in Xwindow parent

I am trying to create an overlay window above another running application. Let's say firefox. I implemented by using Xcreatewindow win = XCreateWindow( display, *firefoxwindow, 50, 300, 400, 400, 0, …
user753758
  • 75
  • 5