xlib

Create a click through window for Linux

烈酒焚心 提交于 2019-12-07 12:59:34
问题 I want to make a click through window. A window which I click but the click pass to the window below it. I've found this two solutions for windows: How to make click-through windows PyQt I have a form that can "click through", i.e. direct clicks to the window below. How can I undo my changes after the event? But I want it to work in linux. I study the xlib mechanisms but cannot understand how the window stack works. Actually I can get all the windows with XQueryTree() and found the ones under

x11/xlib with microsoft visual c++

我只是一个虾纸丫 提交于 2019-12-07 12:36:58
问题 I copy-past this code from Wikipedia: http://en.wikipedia.org/wiki/Xlib And I'm getting this error: fatal error C1083: Cannot open include file: 'X11/Xlib.h': No such file or directory I assume it works for c++ even the though the code is c, or at least find the library x11? Been stuck on this problem entire day... anyone have any idea what I'm doing wrong here? 回答1: I'm assuming from your usage of Microsoft visual C++ that you are on a windows platform. Now, from http://en.wikipedia.org/wiki

Disable actions, move, resize, minimize, etc using python-xlib

不羁岁月 提交于 2019-12-06 16:31:33
I'm making a program where I need to lock the position of a window on the screen, one would think the easy way to do this is using _NET_WM_ALLOWED_ACTIONS but apparently didn't work or I don't know how it work xD... I tried to send an event, something like this: def getatom (atom): return self.display.intern_atom(atom) data = [getatom("_NET_WM_ACTION_ABOVE"),getatom("_NET_WM_ACTION_CLOSE"), getatom("_NET_WM_ACTION_BELOW"),getatom("_NET_WM_ACTION_CHANGE_DESKTOP"), getatom("_NET_WM_ACTION_SHADE")] state = getatom("_NET_WM_ALLOWED_ACTIONS") event = Xlib.protocol.event.ClientMessage(window =

Need for XEventsQueued(display, QueuedAfterReading) in XCB

柔情痞子 提交于 2019-12-06 15:48:17
I am migrating some code of CYBOI from Xlib to XCB. CYBOI uses a couple of threads for different communication channels like: serial_port, terminal, socket, x_window_system. However, it uses these threads only for signal/event/data detection; the actual receiving and sending is done in the main thread, in order to avoid any multi-threading conflicts of address space. For the x_window_system channel, I previously detected events in a thread: int n = XEventsQueued(display, QueuedAfterReading); Upon detection of an event, an "interrupt flag" was set. Afterwards, the main thread was reading the

linux C++ XImage RGB <-> BGR?

蓝咒 提交于 2019-12-06 12:40:10
问题 I have a vector containing RGBA (actualy I don't care about the alpha channel) value from a picture, I want to draw this picture with xlib. So I have to use an XImage and to got one I need to use XCreateImage. XCreateImage requires "char *data" so first I need to convert my vector. I don't know if what I'm doing is efficient, but that works : vector<unsigned char> picture; cunsigned char *unsigneddata = &picture[0]; char *data; data = (char*)unsigneddata; so now I can use "data" to draw my

X11 modal dialog

霸气de小男生 提交于 2019-12-06 11:53:35
How can I create a modal dialog in X11 using Xlib? A modal dialog is a a window that stays on top of other windows of the app (like transient windows do) and also refuses to give focus to other windows of the app. In Windows, modality is also signaled by flashing the titlebar of the modal window when trying to steal the focus from it. Thanks. You need to set _NET_WM_STATE property (which is of type "atom list") to include _NET_WM_STATE, see references to _NET_WM_STATE in EWMP spec (also need to set WM_TRANSIENT_FOR correctly) 来源: https://stackoverflow.com/questions/31779316/x11-modal-dialog

freedesktop XEmbed systray client code in C, Xlib

不问归期 提交于 2019-12-06 11:00:28
问题 I've been trying to implement a systray icon using straight C and Xlib, going along with the freedesktop specification [0]. I can't seem to get my Window to embed into my desktop manager's systray[1], while other apps seem to be able to do it. I am not sure how to go forward debugging this, but I've provided minimal sample code below. I haven't been able to find any sample code using straight Xlib and C, and all the suggestions I've seen have been with regard to some framework like Gtk/Qt

How to create OpenGL-enabled window with transparent background using xlib and glx

早过忘川 提交于 2019-12-06 08:54:30
I'd like to create a window with transparent background and then render something onto it using OpenGL. I don't want to use the trick where whatever is behind the window is captured and then painted as a background - I want real transparency (I have composition manager running). I'm not using any GUI library (GTK, QT, ...), just raw xlib and glx. Anyone knows how to do it? Take a look at these patches to Neverball and SDL . They seem to be based on NVidia's driver documentation . I haven't tried it, but it looks as if you just select the correct GLX config ( GLX_RGBA_BIT ), clear your window

In Xlib, How can I animate until an event occurs?

狂风中的少年 提交于 2019-12-06 07:14:39
I've been trying to animate in a C program using Xlib and I wanna do something when an event occurs, otherwise I wanna keep animating. Here's an example code snippet of what I am doing currently: while( 1 ) { // If an event occurs, stop and do whatever is needed. // If no event occurs, skip this if statement. if ( XEventsQueued( display, QueuedAlready ) > 0 ) { XNextEvent( display, &event ) switch ( event.type ) { // Don't do anything case Expose: while ( event.xexpose.count != 0 ) break; // Do something, when a button is pressed case ButtonPress: ... break; // Do something, when a key is

xpath expression in findnodes() returning empty nodelist

落爺英雄遲暮 提交于 2019-12-06 02:47:49
问题 XML: <zoo xmlns="http://www.zoo.com" xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:schemaLocation="http://www.zoo.com employee.xsd"> <area id="1" posizione="nord" nome="scimmie"> <animale> <nome>Gigi</nome> <sesso>Male</sesso> <eta>3</eta> </animale> <animale> <nome>Gigia</nome> <sesso>Female</sesso> <eta>2</eta> </animale> </area> <area id="2" posizione="nord" nome="giraffe"> <animale> <nome>Giro</nome> <sesso>Male</sesso> <eta>6</eta> </animale> <animale> <nome>Gira</nome> <sesso