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.

0
votes
0answers
14 views

`Bad Value` return on call to xcb_input_xi_grab_device

I'm attempting to grab a keyboard with the XCB XInput2 extension. This is to support the use of virtual keyboards in a window manager I'm developing. Here's the relevant code: static const uint32_t ...
0
votes
1answer
13 views

xcb_get_image_reply fails for window on another workspace/desktop

Ubuntu (xfce) provides virtual desktops aka workspaces. I would like to get a screenshot of an application which is placed on another virtual desktop. I successfully create xcb connection and I can ...
0
votes
0answers
22 views

How to change X window Properties

I am using gdm and my goal is to disable user interaction on a specific X window id. I have tried to change many X-win properties like WM_PROTOCOLS, WM_HINTS, _NET_WM_ALLOWED_ACTIONS using xprop. ...
1
vote
1answer
29 views

Global hotkey in Python3 using Gtk and XLib

My application for X System stays in background (and in panel as indicator) and should popup whenever user hits a key, no matter whatever be the active window. Similar to Menu app. Tried the ...
3
votes
4answers
73 views

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 <X11/Xlib.h> #include <...
0
votes
0answers
26 views

Does presence of many polygons on X11 window buffer slow down drawing of other GUI elements?

We are working on a legacy X-Windows/Motif application to show real-time air traffic (flights) and convective weather in the form of polygons. The app is double-buffered, with the back buffer ...
1
vote
0answers
31 views

Xlib - Two issues with call to XMoveResizeWindow

I am new to Xlib (in C) and am having two issues when calling the XMoveResizeWindow function. ex. XMoveResizeWindow(display, window_id, move_x, move_y, resize_x, resize_y); 1) After the call, the ...
0
votes
1answer
26 views

Is xkb a part of xlib standard?

Is xkb a part of xlib standard? Can I use it in my applications, without any problems on all the "xorg-driven" systems?
0
votes
0answers
15 views

Xlib (or gtk). Check if window is resizing or moving

Is it possible to check if specific window (lets say Terminal window) is in resizing or moving state? My application draws border around Terminal window. The border should dynamically adjust to ...
0
votes
1answer
28 views

Is there any standard which defines keycodes and/or keysyms?

I look for some standard which defines some table, which first column contains key (what we see on keyboard (;:ж)(fа)(+=)) and second one contains numeric representation of this key. Does this ...
3
votes
1answer
42 views

XDefaultDepth and XDisplayPlanes – what's the difference?

For XDefaultDepth, the Xlib documentation says: Returns the depth (number of planes) of the default root window for the specified screen.Other depths may also be supported on this screen. For ...
1
vote
0answers
24 views

Xlib (or gtk). C++. Highlight application's window

I've got application for applications sharing (over network). I need to highlight application's window when it is in sharing state. Currently I use GtkWidget to create border around the window to show ...
1
vote
1answer
27 views

Getting segmentation fault when using ctypes on xlib

I am trying to get idle time from xlib screensaver i tried debugging it, and the error starts happening after the line dpy = xlib.XOpenDisplay(os.environ['DISPLAY'].encode('ascii')) Here's my code ...
0
votes
1answer
63 views

How to render Unicode character in TCL/TK using X11 System

I am trying to render a unicode character to draw a scissor mark (✂) in TCL/TK I am using X11 API "void XwcDrawString(Display *display, Drawable d, XFontSet font_set, GC gc, int x, int y, wchar_t *...
0
votes
0answers
30 views

Start and check name of window on virtual X display

I'm writing a test on Ubuntu 18.04. I want to create a virtual display, start a window on it, and check the window name. In three separate shells I'm running: Xvfb :4 -screen 0 1920x1080x24+32 -fbdir ...
0
votes
1answer
36 views

Cannot ungrab keyboard after XGrabKeyboard

I'm developing an app that should freeze all input, both keyboard and mouse, for a period of time. I've tried using XGrabKeyboard, but I cannot revert its effect using XUngrabKeyboard, it does nothing....
0
votes
0answers
22 views

Sending key strokes via Python Xlib on Linux

I'm trying to automate sending key strokes to a web browser on Linux that is displayed on a VNC display. The code generates the following output with a focus error, and does not send any key strokes ...
0
votes
1answer
27 views

XErrorEvent structure field meaning

I'm currently having some issues with Xlib and CEF and I need to investigate the XErrorEvent that is sent to the function registered with XSetErrorHandler. typedef struct { int type; Display ...
0
votes
0answers
24 views

How to create a monochrome rgba window with xlib

I would like to create a monochrome Pixmap in order to create a window with monochrome background color with XLib. According to documentation, the XSetWindowAttributes attr to pass to XCreateWindow ...
0
votes
1answer
41 views

How to XCreateWindow in the background?

I'm looking at improving developer experience when running graphics tests which spawn short-lived windows "like crazy". The windows need to be physically there, as otherwise data readback fails (i.e. ...
0
votes
0answers
40 views

How to host window spawned from another process in own X11 window in C#?

I need to host a window spawned from another process inside of a window I create in order to send commands such as key presses, etc. as well as retrieve information from the process for debug purposes ...
1
vote
1answer
64 views

Get application's icon using Xlib?

I spent for about two days to reach the goal, however I didn't manage to do what I needed. My goal is to get the icon from application's window in my C++ application and save it into wxIcon (or ...
1
vote
1answer
74 views

Xlib. Check if window is overlapped

I need to check (in my C++ application) if application's window is overlapped (partially or completely) by another window. How can I get this info using xlib? I tried get WM_STATE property of the ...
1
vote
0answers
44 views

XLIB How to make a window go fullscreen?

I'm using Xlib to write my own platform library (genius plays, I know), but I can't get fullscreen to work on GNOME based DE. It works on I3 and Xfce but not on GNOME or Unity. Here is what I have so ...
0
votes
0answers
19 views

Is it possible to be notified right before UnmapNotify event in Xlib?

The X server can report UnmapNotify events to clients wanting information about which windows are unmapped. However, it seems that this event is occurred after unmapping actually happen. I want to be ...
3
votes
2answers
106 views

Find out mouse button state via Xlib in Python

I can determine the current mouse pointer position with: from Xlib.display import Display display = Display() qp = display.screen().root.query_pointer() print(qp.root_x, qp.root_y) How do I get the ...
0
votes
1answer
23 views

libXm get display number from widget

I'm using libXm4.0.3. I want to get the display number that the widget is being displayed on from the widget. Going directly to xlib causes a segfault. Xt seems to also segfault. I started using ...
0
votes
2answers
165 views

Problem with Keypress simulation on Linux (Ubuntu 18)

I'm making a hobby project that is basically a bot for a very old flash game, the mouse move and click works fine, but all key presses make the operating system lag/stutter and sometimes stop ...
0
votes
0answers
59 views

XCopyArea fails for X11 bitmap (Pixmap with depth 1)

I want to do texture atlas with Xlib in X11. I Created a pixmap by loading pixel data from an image file which contains all sprites that will be used as texture. I can copy part of texture atlas ...
0
votes
2answers
64 views

XReparentWindow works sporadically

I'm experimenting with XReparentWindow with the end goal to aggregate windows of multiple processes into one "cockpit" simulating process. Experiments with XReparentWindow works sporadically; ...
1
vote
0answers
37 views

Xlib XSendEvent Custom ClientEvent

I'm having problem of sending my program specific event with XSendEvent(). I setup XEvent as follows and send it: XEvent evt; evt.xclient.type = ClientMessage; evt.xclient.serial = 0; evt.xclient....
0
votes
0answers
29 views

How to send unicode emoji character with xlib simulation input?

I tried to send the simulation input using XLib, I managed to send a few characters before. But I failed when I would send emoji characters. What is wrong with my code? And how can I send emoji ...
1
vote
1answer
110 views

Request image from X11 compositing WM in C or C++

I need to request and retrieve an image of a window from the X server or the WM (I believe the WM does the actual compositing). I need to be able to get an image of the window even if it is obscured ...
0
votes
0answers
42 views

Xlib MapRequest events are received only once?

According to Xlib Programming Manual on tronche.com: If the override-redirect of the window is False and if some other client has selected SubstructureRedirectMask on the parent window, then the X ...
0
votes
1answer
40 views

write mouse position to file 100 times a second in python

I want to write the position of the mouse to a file 100 times a second. But it writes to slow I think. It writes at the beginning about 80 a second and goes down to 5 after some time. Is it possible ...
1
vote
0answers
34 views

Compilation error due to ambiguity in definition of Window object in Zbar and Xlib [duplicate]

I have a piece of code that takes a screenshot of a window using XGetImage, converts it into OpenCV Mat object format. There is no problem with that. Now, I have another piece of the code that ...
1
vote
0answers
201 views

ModuleNotFoundError: No module named 'fcntl' with screenshot utility

I am trying to get a screenshot utility to work after porting it from: PyQt4 -> PyQt5 Python 2.7 -> Python 3.7 Ubuntu -> Windows 7 original code new ported code I changed ...
0
votes
1answer
34 views

Automatic focusing if the new window in x11

When I create a new window using x11 and XCreateSimpleWindow, I observe that the keyboard focus automatically goes onto this new window. Is there any method to prevent this auto-focusing ?
0
votes
0answers
64 views

Is there a way to return all Widgets from a parent Window with X11/Xt?

I'm writing an application using X11, Xt, and Motif directly with C. I want to have the ability to list all the children widgets from a parent Window. Is there a way to do this? I found the following ...
0
votes
1answer
22 views

Possibility of making an Overlay window parent of root window

I wanted to know if it is possible to draw a window (like overlay window) or a shape (using cairo) such that, that window is the parent of root window. It seems illogical to think like this, as root ...
0
votes
0answers
44 views

XLib X_ChangeWindowAttributes BadAccess

I'm trying to subscribe for window events from C application by means of Xlib. I access to window through it's id(I know it from other application and I'm sure its valid). But when I call ...
0
votes
2answers
63 views

Pointer to children window/s in x11

How to obtain the pointer to the child window/s form the root window in x11 ? I have used the XGetWindowAttributes(), but that doesn't have any pointer/s to children windows as such. https://tronche....
0
votes
0answers
46 views

How does the event loop work with select in the case of a X11 Window Managers?

I am just taking this example from lwm: https://github.com/jamesfcarter/lwm/blob/9483c2a7d7e2b765b0a329b8f694f8a9110d0918/lwm.c#L195-L205 if (select(max_fd, &readfds, NULL, NULL, NULL) > -1) {...
0
votes
0answers
56 views

Cairo x11 doesn't display anything

I worked with cairo and X11 before, and had a piece of code working perfectly, and now I am developping a new project (supposed to be a karaoke), and I took a piece of the code that was used to ...
2
votes
2answers
80 views

Xlib : Segmentation fault on multithreading

My attempt is to write an Xlib wrapper for the purpose of implementing triple buffering methods. Using which a person needs only compute their display matrix and forward it to the API for displaying. ...
0
votes
1answer
83 views

Module not found, even when I have installed it

I'm trying to use the PyAutoGUI lib, and I get this error ModuleNotFoundError: No module named 'Xlib'. I have already tried sudo apt-get install python-xlib, pip3 install xlib and all the instalation ...
0
votes
0answers
46 views

XSelectInput doesn't react to any key press

I'm trying to create a simple global key logger in Linux using X11/Xlib.h I've seen Global Hotkey with X11/Xlib but that seems to be specific to one hotkey. When I try to call XGrabKey I got X ...
1
vote
0answers
104 views

Xlib ConfigureRequest with custom configuration not working

I am using python and python3-xlib (which is a pure python implementation of the Xlib interface but basically is very similar to the C Xlib). For educational purposes, I am trying to create a simple ...
0
votes
1answer
37 views

XLib Disconnection Callback

I use XLib and XRand to get some information about the connected displays on an embedded system. class Foo { private: Display *_display{}; public: Foo() { _display = XOpenDisplay(":0....
0
votes
1answer
75 views

How does XLockDisplay() work across multiple processes?

I'm dealing with multiple processes that read eachothers's drawables and thus need synchronization. XLockDisplay is supposed to "lock out all other threads" from using the display, but does that apply ...