x11

QWidget / X11: Prevent window from beeing activated/focussed by mouse clicks

一个人想着一个人 提交于 2019-12-05 17:08:24
I would like to develop a system-wide onscreen keyboard in Qt/QML. Injecting key-events via xlib works fine. My problem now: If a keyboard-button is clicked, the window with the selected input field will lose the focus. In consequence, the key event will not be delivered to the previously selected input field. So does anybody know how to prevent a QWidget from beeing activated/focussed by mouse-clicks? Every hint is welcome and a code examples would be great! Thank you very much in advance, Frime 来源: https://stackoverflow.com/questions/29097363/qwidget-x11-prevent-window-from-beeing-activated

Can anyone explain the way the “Khronos stack” of technologies fits together?

一个人想着一个人 提交于 2019-12-05 16:15:31
I've been researching OpenGL, OpenGL-ES, etc...Can anyone explain to me, from the bottom up, how this all fits together? For instance, framebuffer -> ?? -> Window Manager -> OpenGL ? (That shows you where I'm at with this, sadly.) Or in the case of a workstation...video card -> DRI -> X -> WM -> ???? I've only recently started working on C++ stuff on personal projects...I've mainly worked on "business software" type stuff in the past...any help would be greatly appreciated! There are certain Khronos technologies that are intended to work together, but most are completely independent. EGL is

Register hotkey with only modifiers in Linux

僤鯓⒐⒋嵵緔 提交于 2019-12-05 16:02:55
I'm using this sample to set hotkey in my program in Linux X11 graphic system. The problem is i don't understand how to set hotkey combinations like Ctrl + Alt and Ctrl + Shift , i.e. without any key, only modifers. I'm trying like this: KeyCode key = XKeysymToKeycode(display, 0); //no key code XGrabKey(display, key, ControlMask | ShiftMask, grabWin, true, GrabModeAsync, GrabModeAsync); But it's not working. However, it is working like this (kind of): KeyCode key = XKeysymToKeycode(display, XK_Alt_L); //Alt key XGrabKey(display, key, ControlMask, grabWin, true, GrabModeAsync, GrabModeAsync); I

How to view GUI apps from inside a docker container

99封情书 提交于 2019-12-05 15:47:20
When I try to run a GUI, like xclock for example I get the error: Error: Can't open display: I'm trying to use Docker to run a ROS container, and I need to see the GUI applications that run inside of it. I did this once just using a Vagrant VM and was able to use X11 to get it done. So far I've tried putting way #1 and #2 into a docker file based on the info here: http://wiki.ros.org/docker/Tutorials/GUI Then I tried copying most of the dockerfile here: https://hub.docker.com/r/mjenz/ros-indigo-gui/~/dockerfile/ Here's my current docker file: # Set the base image to use to ros:kinetic FROM ros

Why python Wnck window.activate(int(time.time()))

对着背影说爱祢 提交于 2019-12-05 15:35:27
This to me is VERY strange. Could someone please explain why the activate() function should want a timestamp? Wouldn't 99.9% of the time be NOW or ASAP or "At your earliest convenience"? And furthermore, if you try w.activate(0) you get this warning: Wnck-WARNING: Received a timestamp of 0; window activation may not function properly Every forum thread that I have read about this warning ends with no answer. But they all seem to indicate that the code does not work properly unless you actually put in the timestamp. And if you put in the (0), things don't work, and you get the warning. However,

C++ - change the cursor in an X Window

点点圈 提交于 2019-12-05 15:12:33
I thought this would be easy to find, but a google search has been very unhelpful. Is there a simple api to change the mouse cursor in your X window? (I know in windows you can just call "SetCursor") #include <X11/cursorfont.h> /* ... */ Cursor c; c = XCreateFontCursor(dpy, XC_xterm); XDefineCursor(dpy, w, c); Where dpy is your display, w is your window and XC_xterm is a constant defining the shape of your cursor. Here's a list of available cursor shape , along with images. Looks like the equivalent of a SetCursor call is XDefineCursor . You can get a Cursor id by calling XCreateFontCursor and

unsuccessful use of popen() in C?

女生的网名这么多〃 提交于 2019-12-05 14:02:37
I can run the following command xwd -root | xwdtopnm | pnmtojpeg > screen.jpg in a terminal under linux and it will produce a screenshot of my current screen. I try to do the following with the code: #include <stdio.h> #include <stdlib.h> int main() { FILE *fpipe; char *command="xwd -root | xwdtopnm | pnmtojpeg"; char line[256]; if ( !(fpipe = (FILE*)popen(command,"r")) ) { // If fpipe is NULL perror("Problems with pipe"); exit(1); } while ( fgets( line, sizeof line, fpipe)) { //printf("%s", line); puts(line); } pclose(fpipe); } then I compile and run the program ./popen > screen.jpg but the

An error ['\+' is an unrecognized escape in character string starting “\+” while creating a R package

怎甘沉沦 提交于 2019-12-05 13:25:14
问题 I tried to create a package using some functions and scripts I created (using X11 on a Mac). While R CMD check was doing its work, it encountered a problem as follows: temp = trim(unlist(strsplit(lp.add(ranefterms[[i]]), + "\+"))) Error: '\+' is an unrecognized escape in character string starting "\+" The oddest thing, however, is that my function actually does NOT have "\ +". Instead, it has "\ \ +" (see below). So I don't know why "\ \ +" is recognized as "\ +". for(i in 1:n) temp = trim

How to use shm pixmap with xcb?

五迷三道 提交于 2019-12-05 11:10:48
I try to learn how to use shared memory pixmaps in the xcb library. Did any of you have experience with this and want to share example codes and/or information? This would be very helpful. Thanks After some research I found out how to use shared memory pixmaps in xcb. Here is my testcode: #include <stdlib.h> #include <stdio.h> #include <sys/ipc.h> #include <sys/shm.h> #include <xcb/xcb.h> #include <xcb/shm.h> #include <xcb/xcb_image.h> #define WID 512 #define HEI 512 int main(){ xcb_connection_t* connection; xcb_window_t window; xcb_screen_t* screen; xcb_gcontext_t gcontext; xcb_generic_event

Sending X11 click event doesn't work with some windows

心不动则不痛 提交于 2019-12-05 10:32:46
The following snippet of code works most of the time, except in certain windows. For instance, under the latest Ubuntu it does not work for selecting folders in the file explorer. It seems to work just about everywhere else, but this gap is significant. I suspect it has to do with how I am using XQueryPointer, but I've tried nearly every example I can find. If I use the computer's mouse instead, it work's fine. FYI: I've already tried the answers to these questions: Sending Programmatic events Capuring Mouse Input but they don't work any different... Here's the code: #include <string.h>