x11

Cannot get QWindow::fromWinId to work properly

被刻印的时光 ゝ 提交于 2021-02-19 06:20:28
问题 My Qt 5.9 program (on X11 Linux) launches other applications, using QProcess . I would like to have control over windows these applications spawn, so I obtain their winId value and use QWindow::fromWinId to get a QWindow instance. The problem is these instances are invalid and do not represent the window they are supposed to. If I check the winId values using xwininfo , the correct information is returned, so I know they are good. What am I doing wrong? Edit: An example won't help much, but

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

Using an X11 Window with GTK

半世苍凉 提交于 2021-02-10 06:31:11
问题 My C application uses X11 calls to create and manage a window. I only want to use GTK3 for menus. I create a window using Window wnd = XCreateWindow(...); Now I want to use GTK to add menus to wnd . GTK APIs such as gtk_container_add(GTK_CONTAINER(gtk_wnd), vbox) want a GtkWindow, which I do not have. How do I accomplish this? Ideally I'd like to get a X11 handle to work with GTK, potentially via a conversion. Alternatively, I'd also settle for getting the current window via some GTK API. 来源:

The way to detect the current mouse cursor type from bash or python

走远了吗. 提交于 2021-02-09 08:20:47
问题 I know that I can get the current location of the mouse cursor by executing "xdotool getmouselocation". I would like to detect the current mouse cursor type such as pointer, beam, or hand cursor from bash terminal or python code. Would this be possible? Thank you. June 回答1: You can use xdotool to continuously click where the link would be until the program notices the window title changes. When the window title changes, that means the link has been clicked, and the new page is loading.

The way to detect the current mouse cursor type from bash or python

旧街凉风 提交于 2021-02-09 08:18:26
问题 I know that I can get the current location of the mouse cursor by executing "xdotool getmouselocation". I would like to detect the current mouse cursor type such as pointer, beam, or hand cursor from bash terminal or python code. Would this be possible? Thank you. June 回答1: You can use xdotool to continuously click where the link would be until the program notices the window title changes. When the window title changes, that means the link has been clicked, and the new page is loading.

The way to detect the current mouse cursor type from bash or python

梦想与她 提交于 2021-02-09 08:18:15
问题 I know that I can get the current location of the mouse cursor by executing "xdotool getmouselocation". I would like to detect the current mouse cursor type such as pointer, beam, or hand cursor from bash terminal or python code. Would this be possible? Thank you. June 回答1: You can use xdotool to continuously click where the link would be until the program notices the window title changes. When the window title changes, that means the link has been clicked, and the new page is loading.

The way to detect the current mouse cursor type from bash or python

痞子三分冷 提交于 2021-02-09 08:17:27
问题 I know that I can get the current location of the mouse cursor by executing "xdotool getmouselocation". I would like to detect the current mouse cursor type such as pointer, beam, or hand cursor from bash terminal or python code. Would this be possible? Thank you. June 回答1: You can use xdotool to continuously click where the link would be until the program notices the window title changes. When the window title changes, that means the link has been clicked, and the new page is loading.

Using Python GTK GUI front end with C++ backend

一笑奈何 提交于 2021-02-09 07:00:23
问题 I have some C++ code and am now building a GUI for an application. In the past I've used python and pygtk for GUI programming and occasionally link to some C++ code to do some heavy lifting. I would like to continue that trend but have one question on how to do it in this case. Part of the C++ code gets images from a camera and I would like to display those images on the GUI. I've used libvlc in the past and could pass the xid from a DrawingArea to vlc to draw the video on. I would like to do

Using Python GTK GUI front end with C++ backend

穿精又带淫゛_ 提交于 2021-02-09 06:58:41
问题 I have some C++ code and am now building a GUI for an application. In the past I've used python and pygtk for GUI programming and occasionally link to some C++ code to do some heavy lifting. I would like to continue that trend but have one question on how to do it in this case. Part of the C++ code gets images from a camera and I would like to display those images on the GUI. I've used libvlc in the past and could pass the xid from a DrawingArea to vlc to draw the video on. I would like to do