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.

Filter by
Sorted by
Tagged with
0
votes
0answers
20 views

cairo_fill optimization with Xlib

I'm trying to learn C++ by making a little abstract system visualization program. It's based around the Delaunator C++ library (https://github.com/delfrrr/delaunator-cpp). It generates a random ...
0
votes
0answers
62 views

Python3/Gtk3: unable to get the XDS protocol (full) working

I've wrote a simple program that should let archive managers such as Engrampa and Xarchiver to unpack in the destination folder any archive. Here is the sample code: import gi gi.require_version('Gtk'...
0
votes
0answers
39 views

Parsing a keystroke record using input_event structure return strange key codes

Given: A machine running Debian 10 and using the french keyboard mapping. A dump of keystrokes correspoding to "azerty" obtained using: sudo cat /dev/input/by-id/usb-Logitech_USB_Keyboard-event-kbd &...
0
votes
0answers
28 views

Why does compton interfere xlib calls?

In application I am currently writing, there are a few xlib calls aimed to unfocus previously selected window and focus the new one. XSetWindowBorder(display, c->window, c->bfc.pixel); ...
1
vote
1answer
68 views

Xlib. Redraw (refill) flickering shaped window after resize

I have class which implements flickering border (it changes it's color every 0.5 seconds). Everything works fine until the border is resized. When I resize border only part of the border continues to ...
1
vote
0answers
47 views

Set 'foreground' window using Xlib in C# Mono

I have a winforms application that I'm running on Linux (specifically Raspbian Stretch) using Mono. At one point, I create a Process to run a python script which creates an external window. I need to ...
4
votes
1answer
159 views

Draw border (frame) using xlib

Is it possible to draw transparent window without title bar, close button, responses on mouse buttons using xlib. So just border with specific color and width? Something like this orange rectangle ...
0
votes
1answer
44 views

Clearing X11 window with desktop background pixels, and putting XImage with transparent pixels on it?

I am trying to make an application which will graphically repeat the mouse pointer, so I can ultimately make a mouse trail program, for Ubuntu 18.04 - and it seems, the way to do it is via X11/Xlib - ...
0
votes
0answers
16 views

Screen recording with Xlib triggers an assertion

I am currently trying to record the screen of an X11 display using Xlib. I have written a simple piece of code to measure the performance of the capture. (I have removed the timing and error-checking ...
1
vote
0answers
11 views

Is it possible to use GDK or GTK to pull user generated content from an active firefox window? (Similair to FIndWIndow on Windows)

I am working on a bit of a hobby project while trying to better understand the windowing system in Linux. I want to create a program that will constantly print the contents of the active textbox in a ...
0
votes
0answers
25 views

How do window managers set the background of the root window

I am trying to learn xlib, but I couldn’t find any function that lets me set the background of the root window. How do window managers, or tools like feh, manage the desktop wallpaper? I have tried ...
0
votes
2answers
29 views

Where is Xlib's Colormap defined?

I am porting some linux program to my embedded system. Problem is that program uses Xlib to draw an output image. I've found online definitions of used structures and functions wich helps me to port ...
0
votes
0answers
22 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
24 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
40 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
43 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
84 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
27 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
40 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
33 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
20 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
29 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 ...
2
votes
1answer
46 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
27 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
32 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
80 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
43 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
40 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
28 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
46 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
31 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
57 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
45 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
74 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
90 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
58 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
22 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
117 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
27 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
188 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
77 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
76 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
45 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
133 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
46 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
45 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
274 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
36 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 ?