xcb

Detect window focus changes with XCB

无人久伴 提交于 2021-02-19 06:10:14
问题 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 missing here to grab root events? Or am I just going about this totally wrong and there's a better way than listening to the root? #include <stdio.h> #include <stdlib.h> #include <xcb/xcb.h> int main (int argc, char **argv) { xcb_connection_t* conn = xcb_connect(NULL, NULL); if (xcb_connection_has

Detect window focus changes with XCB

吃可爱长大的小学妹 提交于 2021-02-19 06:05:56
问题 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 missing here to grab root events? Or am I just going about this totally wrong and there's a better way than listening to the root? #include <stdio.h> #include <stdlib.h> #include <xcb/xcb.h> int main (int argc, char **argv) { xcb_connection_t* conn = xcb_connect(NULL, NULL); if (xcb_connection_has

On epoll_pwait, POSIX timers and X11 events. Most of X11 events is either delayed or dropped

十年热恋 提交于 2021-02-11 12:39:20
问题 The setup is below. have a X11 connection file descriptor x11_fd set in non-blocking mode. have a signal file descriptor sig_fd set in non-blocking mode. create a POSIX timer with timer_create add all above in epoll set main_loop: n = epoll_pwait(ep_fd, ep_evs, MAXEVENTS, -1, &mask_sigs) if(fd == sig_fd) do set some signal flags if(fd == x11_fd) do X11 events if(fd == timer_fd or timeout) do some small computations end_main_loop X11 events are processed with while((event = xcb_poll_for_event(

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:

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

X11 non-clipped child windows

时光毁灭记忆、已成空白 提交于 2020-01-03 17:31:28
问题 Does X have the notion of non-clipped child windows? The behavior in Windows and OSX for these is: the parent always stays behind its children the children are closed automatically when the parent is closed the children follow the parent when moving If the answer is no, then I can emulate 2 and 3 but how about 1? Thanks, Cosmin. 回答1: The closest thing to overlapped non-clipped child windows in X is the window property WM_TRANSIENT_FOR. This will create a window that: will not appear on the

python app - xcb plugin fail

浪尽此生 提交于 2019-12-24 16:18:12
问题 My setting: Python 2.7 with anaconda Recently I have installed OpenCV 3.0 and when I try to do simple image display or I want to run python samples that come with OpenCV, there is a error message: This application failed to start because it could not find or load the Qt platform plugin "xcb". I have read many comments that I need to attach .so files to my project but I don't think it's the optimal solution since for most people it works out of a box. I have no clue what to do. I'm

XCB equivalent of XkbSetDetectableAutoRepeat

与世无争的帅哥 提交于 2019-12-24 01:43:17
问题 I was running code from a separate thread, so couldn't call any Xlib functions, I can only call XCB. I was wondering what the equivalent for XkbSetDetectableAutoRepeat would be? Thanks 回答1: XCB presents a more direct view of the protocol than Xlib does, so you often have to look at either the protocol specs or Xlib source code to find out what the underlying protocol request is to find an equivalent. In this case, the Detectable Autorepeat section of the XKB extension spec says it uses the

Need for XEventsQueued(display, QueuedAfterReading) in XCB

这一生的挚爱 提交于 2019-12-22 12:46:10
问题 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);

Qt5 install on OSX -qt-xcb

走远了吗. 提交于 2019-12-22 04:45:16
问题 I am stuck with a problem installing Qt5 on OSX. The Qt Requirements for Mac OSX are done - Xcode and command line are installed. Then I followed the steps: # mkdir qt5 # cd qt5 # git clone git://gitorious.org/qt/qtbase.git # cd qt5 # ./configure The test for linking against libxcb and support libraries failed! You might need to install dependency packages, or pass -qt-xcb. Then I also tried # cd qtbase # ./configure -prefix $HOME/development/macosx/qt5 -nomake docs -nomake examples -nomake