xlib

Qt/X11: How to make a QWidget override-redirect / calling XChangeWindowAttributes() with QWidget

非 Y 不嫁゛ 提交于 2019-12-10 20:45:49
问题 Does anybody has an example how to make a QWidget instance (as toplevel window) override-redirect with the X11 library? the following code doesn't work: QWidget* widget = new QWidget(); XSetWindowAttributes attr; attr.override_redirect = true; XChangeWindowAttributes(display, widget->winId(), CWOverrideRedirect, &attr); widget->show(); Does anybody has an idea? The bigger toplevel-problem i try to solve is the following: QWidget / X11: Prevent window from beeing activated/focussed by mouse

Cannot call XInitThreads

时间秒杀一切 提交于 2019-12-10 20:44:28
问题 I have written an SFML C++ game, and tried to start using threads, but after a while everything crashes. After searching I found out the fix seems to be to call XInitThreads(); but this does not work somehow. simplified code: #include <X11/Xlib.h> int main() { XInitThreads(); //other stuff return 1337; } The error message I get when i try to compile is "undefined reference to symbol 'XInitThreads'. Could it be that the header file is working but there is no file where that method is

Xlib ARGB Window Icon

丶灬走出姿态 提交于 2019-12-10 20:33:01
问题 I have a ARGB image data. I wish to set my window icon to this data. After searching for hours I am still at the start with nothing at hand. I know that I need to create a pixmap for image data and (may be) another pixmap for mask and use hints to hint the window manager about this. However, I do not know how to setup 32bit ARGB or 24bit RGB + 8bit alpha image. A sample would really be nice. 回答1: If 32 bit depth visual is available (check xdpyinfo) then code from my question should work for

XLib Lock Mouse position (Mouse wrap)

拜拜、爱过 提交于 2019-12-10 19:43:50
问题 I am trying to create a a mouse wrap within X11 for openGL games/content. The approach I was trying to take is to hide the cursor (which I can do just fine), lock the mouse position in the center of the window and then use the mouse delta positions to detect movement. I cannot find any way however to lock the mouse position other then to keep moving it back to the center every frame. In windows this can be done with ClipCursor() and in OSX mouse wrap can be done using

Xlib XGetWindowProperty Zero items returned

≡放荡痞女 提交于 2019-12-10 18:49:09
问题 I have problems reading some XWindow ICCCM Properties. The problem actually is when i try to read _NET_WM_STATUS property. The function i'm using is: int get_property_value(Display* display, Window window,char *propname, long max_length, unsigned long *nitems_return, unsigned char **prop_return){ int result; Atom property; Atom actual_type_return; int actual_format_return; unsigned long bytes_after_return; unsigned char* prop_to_return; unsigned long n_items; printf("-----GET_PROPERTY_VALUE--

Xlib: XGetWindowAttributes always returns 1x1?

随声附和 提交于 2019-12-10 17:11:39
问题 I'd like to have width and height of the currently focussed window. The selection of the window works like a charm whereas the height and width are always returning 1. #include <X11/Xlib.h> #include <stdio.h> int main(int argc, char *argv[]) { Display *display; Window focus; XWindowAttributes attr; int revert; display = XOpenDisplay(NULL); XGetInputFocus(display, &focus, &revert); XGetWindowAttributes(display, focus, &attr); printf("[0x%x] %d x %d\n", (unsigned)focus, attr.width, attr.height)

Xlib: Closing window always causes fatal IO error?

孤者浪人 提交于 2019-12-10 13:15:39
问题 I'm not sure why this happens, but any window I create using Xlib in C++ gives outputs an error to the terminal when I try to close is using the X button. I can close it programmatically with no errors, it's just the X button that does it. The error is the following: XIO: fatal IO error 11 (Resource temporarily unavailable) on X server ":0" after 483 requests (483 known processed) with 0 events remaining. The number of requests is different every time, but there's always 0 events remaining.

Transparent window in Xwindow parent

戏子无情 提交于 2019-12-10 09:29:22
问题 I am trying to create an overlay window above another running application. Let's say firefox. I implemented by using Xcreatewindow win = XCreateWindow( display, *firefoxwindow, 50, 300, 400, 400, 0, visualinfo.depth, InputOutput, visualinfo.visual, CWColormap|CWEventMask|CWBackPixmap|CWBorderPixel, &attr ) ; I searched *firefoxwindow by using XQueryTree() and then followed this code https://gist.github.com/903479 The result is the transparent window when I use the XRoot as parent. But, when I

How do we simulate a mouse click with Xlib / C?

点点圈 提交于 2019-12-10 03:12:33
问题 I want to find C / Xorg code to 'enter' a left mouse button click. I'd expect a single line of code but the only things I've found written in C are about two dozen lines long and they don't work anyway :( It seems it can be done in Windows, but I'm in Linux. The reason for the question is that I've written a utility that lets me move my mouse pointer between several screens using the keyboard. The only problem is that if I move to a location where window abc used to be but another window xyz

How to properly configure xstartup file for TightVNC with Ubuntu VPS GNOME environment

ぐ巨炮叔叔 提交于 2019-12-09 12:39:58
问题 I'd like to access my Ubuntu 16.10 VPS (Contabo) with using a GNOME environment with VNC, however I am still facing some issues that I couldn't solve so far. To install and configure the software I ran the following commands: sudo apt-get install ubuntu-gnome-desktop sudo apt-get install tightvncserver xtightvncviewer tightvnc-java sudo locale-gen de_DE.UTF-8 sudo apt-get install xfonts-75dpi sudo apt-get install xfonts-100dpi sudo apt-get install gnome-panel sudo apt-get install metacity