xlib

Convert from Xlib to xcb

◇◆丶佛笑我妖孽 提交于 2021-02-06 12:43:11
问题 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 documentation. Currently I am having trouble for example with this functions: XIQueryDevice , XISelectEvents . These are mainly the functions I use. Maybe someone can point out the documentation for me or provide me a very small example to get started. 回答1:

How to fix error Xlib.error.DisplayConnectionError: Can't connect to display “:0”: b'No protocol specified\n'

﹥>﹥吖頭↗ 提交于 2021-02-06 10:46:50
问题 I'm making some program with python3 and XLib. On my PC with Ubuntu 14.04 everything works fine but when I try to run my app in my notebook with manualy installed Xorg I get exception: Xlib.error.DisplayConnectionError: Can't connect to display ":0": b'No protocol specified\n' on line: self.__display = Xlib.display.Display() What's going on here? How to fix this that it could work on every Linux? Edit: This does not look like duplicate of X11: run a gnome app as another user. On my both

What event is used for Maximizing/Minimizing?

时间秒杀一切 提交于 2021-02-04 15:51:46
问题 Currently I am in charge of developing a (C++) window class for a little project; the goal is to keep dependencies at a bare minimum. The implementation for Win32/WinAPI works as supposed, however, I am struggling when it comes to Linux/XCB. I am aware, that I am able to check the "_NET_WM_STATE" property, however, the documentation doesn't specify any event, which would occur when the window is being maximized or minimized. The Extended Window Manager Hints specification doesn't seem to

How do you exit X11 program without Error

让人想犯罪 __ 提交于 2020-12-01 02:06:29
问题 I have a fairly simple "Hello World" in X11 at end of question. But when it exits I get the run time error messages below: $ ./xtest XIO: fatal IO error 11 (Resource temporarily unavailable) on X server ":0" after 9 requests (7 known processed) with 0 events remaining. So I tried handling the wmDeleteMessage myself, and I was able to stop the window from closing, so i know I am getting the event correctly. Than I added a XDestroyWindow() to the event handling and I get new errors. X Error of

How do you exit X11 program without Error

给你一囗甜甜゛ 提交于 2020-12-01 02:04:08
问题 I have a fairly simple "Hello World" in X11 at end of question. But when it exits I get the run time error messages below: $ ./xtest XIO: fatal IO error 11 (Resource temporarily unavailable) on X server ":0" after 9 requests (7 known processed) with 0 events remaining. So I tried handling the wmDeleteMessage myself, and I was able to stop the window from closing, so i know I am getting the event correctly. Than I added a XDestroyWindow() to the event handling and I get new errors. X Error of

Python xlib change cursor

时光总嘲笑我的痴心妄想 提交于 2020-05-29 11:08:11
问题 How can I set the cursor for the root window (or any other window) in a python application using Xlib? I have an instance of display and window (the root window). Using the C bindings; I could use XDefineCursor with a cursor I have created with XCreatePixmapCursor. How do I do the same with the python bindings? I want to be able to use a default cursor, or a custom cursor. 回答1: There are two things you want to keep in mind when you need to find the python-xlib equivalent of any libX11

Invert the colors of a region in Xlib

不问归期 提交于 2020-04-30 07:34:50
问题 I want to know if it is possible to invert the colors of a region using Xlib. A region may be a rectangular area defined by two co-ordinates (x1, y1 to x2, y2). Below code is the latest modified version of the script that is used to invert a portion of active window, as per suggestions by JvO import Xlib from Xlib import X, display, Xutil d = display.Display() screen = d.screen() bgsize = 20 act_win = d.get_input_focus().focus wmname = act_win.get_wm_name() wmclass = act_win.get_wm_class() if

How can I check in xlib if window exists?

允我心安 提交于 2020-03-22 09:51:26
问题 I am writing c++ library in Linux using gcc. Program opens web pages in new browser windows with system("firefox https://www.webpage.com"); After that I use xlib to determine identifiers of each opened browser window. Then program raises firefox windows one by one using XRaiseWindow(display, window) in order to make a screenshot of each window and OCR. But if I close browser window manually and try to use XRaiseWindow with the corresponding identifier it generates BadWindow error and