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
29 views

Draw an icon on a title bar in XLIB

My purpose is to draw an icon into the title bar of a basic wm i'm trying to create. I already googled, and tried different solutions, but so far none is working (maybe just because of my lack of ...
1
vote
1answer
35 views

Why XServer sends FocusOut notify twice

I write dummy window for software KVM. Idea is when user switches to another machine, previous machine opens dummy window beyond the screen bounds, so emulates focus lost. Windows without focus are ...
0
votes
0answers
23 views

BadMatch error on XCreateWindow for InputOnly window

I am trying to create a window with Xlib like this: XSetWindowAttributes win_attribs; ::memset((void *)&win_attribs, 0, sizeof(win_attribs)); unsigned long win_attribs_mask; win_attribs....
0
votes
0answers
20 views

Sending a button press event for a second pointing device

So I want to make left mouse clicks using another pointing device (that can be created with e.g. xinput create-master mouse) but those clicks shouldn't give focus to windows. This is what I got so ...
0
votes
0answers
23 views

How to correctly set the value of WM_CLASS in the GNOME(GTK) application

Which function to use: GLib.set_prgname (prgname) GLib.set_application_name (application_name) Gtk.Window.set_wmclass (wmclass_name, wmclass_class) (In the documentation - Deprecated since version 3....
0
votes
0answers
26 views

How to resize a current window using Xlib?

I'm trying to resize currently focused window using Xlib. Here's the code: #include <X11/Xlib.h> #include <stdio.h> #include <stdlib.h> Window get_toplevel_parent(Display * display,...
0
votes
0answers
54 views

Foreground colors in Xlib affected in unexpected way by background windows colors when using transparent background color

I am trying to write a program that uses Xlib and has an alpha component so that the transparency can be adjusted. The background colors transparency seems to be working as expected, with alpha, red, ...
4
votes
1answer
129 views

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 ...
0
votes
0answers
25 views

How to show/hide windows by their wm name (_NET_WM_NAME) using libxdo or other x library?

With the xdo command-line tool, you can target a window by its wm name using the -a switch. For example: xdo hide -a Foo Whereas in the xdo library for C, libxdo, you can only target windows by ...
1
vote
0answers
29 views

Open a dock type window with x11 and capture key press

I would like to open a "dock type" window without its title bar with x11 in C and I want to capture a key press (Ctrl-q) to close it. The actual code does not capture the key presses to the active ...
0
votes
0answers
17 views

How to draw FreeType grayscaled glyph bitmap on screen with Xlib?

I'm trying to draw FreeType glyph bitmaps on screen with Xlib. I have managed to draw the monochrome glyph bitmap returned by the following code. FT_Load_Glyph( curFace, glyph_index, FT_LOAD_RENDER | ...
0
votes
1answer
31 views

Can I use _NET_WM_WINDOW_TYPE_DOCK EWHM extension in openbox?

Openbox is stated to be EWMH compliant here. I want to use this compliance layer to implement a decoration-less window, as proposed on this question's best answer. As such, I am trying to build a ...
0
votes
0answers
37 views

Xlib: Shutdown X server cleanly

I'm playing around with Xlib. Want to write a simple window manager for the purpose of education. Is there a function in the Xlib library to close all windows and shutdown the X Server? I found the ...
0
votes
1answer
147 views

Why is if (fork() == 0) { getpid() } and a popen() process returning the same process id?

I want to know why the two process id's match when the the getpid() in the fork() to my knowledge is supposed to be a different process than the one produced by popen(). I was informed that my code ...
0
votes
1answer
46 views

How can I display an xmp image file in a window in xlib? (I'm coding in C)

I am creating Chess in C, and I need to print the board after every move. I have managed to print the board using strings as pieces but I would like to replace the strings with images of actual pieces....
0
votes
1answer
34 views

How to wait an input without stop the program in Xlib

The problem is this, I, am writing a chip 8 emulator in C, and i am using a library that use Xlib, for writing sprites attending input etc, the method that the library have for wait an input is this: ...
0
votes
0answers
18 views

Why does X11 send two events in the case of _NET_ACTIVE_WINDOW changing value?

So I wrote a simple test program to track the value of the _NET_ACTIVE_WINDOW property before I implemented in my main program. Though I noticed a strange behavior, whenever I switch what window is ...
2
votes
0answers
21 views

Why does xlib interfere XNVCtrl calls? [duplicate]

I am practicing with threads in C. My program have to constantly (periodically) poll free GPU memory (and other info), while being able to handle X events. The problem is when I am calling ...
0
votes
0answers
34 views

Xlib. Async XMoveResizeWindow execution

I've got x11 window which is actually a border around another window. My border changes it's color every 0.5 seconds to make flicking effect. The border is bound with another application's window (...
0
votes
0answers
12 views

How to change xlib coordinates origin

I'm implementing x windows system in my own render. The problem is that x window's coordinates start at top-left corner, but my calculations are based on bottom-left corner coordinates origin. So how ...
1
vote
1answer
56 views

Could someone explain this section about events in Xlib?

The section I am confused about is from Volume One: Xlib Programming Manual. Keyboard and pointer events are generated in the smallest window enclosing the pointer (or grabbing the pointer, as ...
0
votes
1answer
44 views

Why doesn't a VNC server provide multiple screen capability?

I have a single Java application that can take advantage of more than one physical monitor described by a Linux X server as separate screens or one logical frame buffer (i.e. TwinView or Xinerama), ...
0
votes
1answer
56 views

XI2. How to ignore events of modifier keys?

I'm trying to fix xneur keyboard switcher. Its author tried to add XI2 support, but broke input in the applications that use only XI2(google chrome for example). And I'm stuck with modifiers ...
0
votes
0answers
47 views

Can't Gtk application show SDL_RenderDrawRect with rectangle?

I have written example in C# of link sdl_renderer shows background color = It is ok. I really don't understand why does it not work if SDL2-CS embeds in GtkSharp3 and it doesn't see any shapes, texts ...
-1
votes
1answer
25 views

Is there a way to connect a process to X window manager?

I am running this process on Linux. This is a server process that does not have direct connection to X Server. The process needs to run an X utility tool ( xinput command). The xinput command is ...
0
votes
1answer
88 views

Detect window focus changes with XCB

I'm writing a program with XCB that needs to detect whenever a window gains or loses focus. So far I have this but it just hangs on the xcb_wait_for_event call, never entering the loop. What am I ...
1
vote
0answers
40 views

How to select output monitor to display?

workdir$ xrandr | grep -i connected DVI-I-1 connected 1920x1080+1920+0 (normal left inverted right x axis y axis) 477mm x 268mm DP-3 connected primary 1920x1080+0+0 (normal left inverted right x axis ...
1
vote
2answers
155 views

how to hide cursor in XCB?

I want to hide system cursor in Xorg I use xcb to write X11-app for Xorg, it will hide cursor in some cases (like "xbanish" or "unclutter"). I've tried use Xfixes: it works fine with xlib, but doesn'...
0
votes
1answer
152 views

Have X11 c program compiled, getting undefined reference errors, what lib(s) are needed?

I am new to c programming on Linux. My objective is to create an efficient program to monitor free space on a mounted partition (parm1) and put an icon in the tray to represent it showing my name (...
0
votes
0answers
32 views

How to ignore error “Xlib: extension ”GLX“ missing on display ”:2“” generated on a VNC machine from Qt UI

Qt UI is throwing the error Xlib: extension "GLX" missing on display ":2" repeatedly. As the UI instance is generated from perl, this breaks the pipe between the UI and perl instance calling it and ...
0
votes
0answers
21 views

xlib How to get the viewport width of chrome browser,

linuxubuntu x11 use xlib How to get the viewport width of chrome browser, not the whole browser Or how to get the size of the browser title including the collection bar I have get the window of ...
0
votes
0answers
37 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
69 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
64 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
31 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
98 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
112 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
201 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
118 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
32 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
12 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
52 views

How do window managers set the background of the root window

I am trying to learn xlib, but I couldnt 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
41 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
27 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
45 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
163 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. ...
2
votes
1answer
92 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
138 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
1answer
35 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 ...
2
votes
0answers
78 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 ...