xlib

XReparentWindow works sporadically

☆樱花仙子☆ 提交于 2019-12-11 18:17:46
问题 I'm experimenting with XReparentWindow with the end goal to aggregate windows of multiple processes into one "cockpit" simulating process. Experiments with XReparentWindow works sporadically ; sometimes the window is reparented successfully, sometimes not . When unsuccessfully reparented the (not) grabbed window flickers for a second and then proceedes as usual, and the grabber show undefined window content. It is successfull every other time (tempted to brute-force the problem away by always

I want to determine the cause of a sigsegv

谁说我不能喝 提交于 2019-12-11 12:37:41
问题 I'm writing an applicaiton for gentoo linux and redhat linux, one of the funciton always crashes on the redhat machine usleep(100000); Display *display; display = XOpenDisplay(NULL); Window w; int x,y,i; unsigned m; Window root = XDefaultRootWindow(display); XQueryPointer(display,root,&root,&w,&x,&y,&i,&i,&m); XImage *image; sleep(1); image = XGetImage(display,root,0,0,1366,768,AllPlanes,XYPixmap); int pixel = XGetPixel(image,x,y); printf("\\clr(%i,%i,%i){}\n",x,y,pixel); XCloseDisplay

Resize a window to exceed the resolution boundary under X

依然范特西╮ 提交于 2019-12-11 11:00:03
问题 I know users can move a window around and make it partially outside of the resolution boundary under X window system. Is it possible to change the size to achieve the same result either programmatically or manually? Here is my experimental code, but it doesn't work. Window w; int revert_to; XGetInputFocus(m_display, &w, &revert_to); if (w == None) { printf("can't get focused window"); } else { Window top = get_top_window(m_display, w); XWindowAttributes xwa; XGetWindowAttributes(m_display,

Xlib XSendEvent click event do not work inside of some windows on Ubuntu 12.04

末鹿安然 提交于 2019-12-11 10:52:13
问题 i'm trying to send mouse click event using xlib in a ubuntu 12.04, all works when i do the click in the desktop bar icons and works when i do click in the title bar of each window (close, minimize, maximize window) but in some windows doing a click inside do not work, only work in my qt creator window but when i click in, for example, Home folder icon then move the mouse inside the folder, i can't do any click in folders or menu bar, only works in the title bar of the windows. Maybe is a bug

Xlib: window is created in wrong position

核能气质少年 提交于 2019-12-11 07:57:19
问题 I have simple xlib program which creates window. I think it has to show window on the upper-left corner of the screen because I pass 0, 0 to XCreateSimpleWindow function, but it's in upper-middle side. Why ? #include <X11/Xlib.h> #include <stdio.h> #include <stdlib.h> int main(int argc, char* argv[]) { Display* display; int screen_num; Window win; unsigned int display_width,display_height; unsigned int width, height; char *display_name = getenv("DISPLAY"); display = XOpenDisplay(display_name)

Is it possible to programmatically click button of another app in Linux?

落花浮王杯 提交于 2019-12-11 07:18:13
问题 Is it possible to send an event to a particular widget (say a button) in Linux (X window system) I am looking for an equivalent to the following code for Linux (using Xlib) #include <windows.h> int main() { HWND WindowHandle; HWND ButtonHandle; WindowHandle = FindWindow(NULL, "File Download"); ButtonHandle = FindWindowEx(WindowHandle, 0, "Button", "&Open"); SendMessage (ButtonHandle, BM_CLICK, 0 , 0); return 0; } I guess that FindWindow can be simulated by XFetchName, but I have no idea how

Picture format for _NET_WM_ICON

眉间皱痕 提交于 2019-12-11 04:07:18
问题 Environment: Ubuntu 16.04 In my app, I get an application's icon by calling XGetWindowProperty with _NET_WM_ICON atom. unsigned char* data; XGetWindowProperty(..., &data); unsigned long* data1 = (unsigned long*) data; long width = *data1; long height = *(data1 + 1) unsigned char* imageData = (unsigned char*) (data1 + 2); Here are the specs for the returned data: https://specifications.freedesktop.org/wm-spec/wm-spec-1.3.html#idm140130317554480 According to the specs, the returned image must

How to resize a pixmap with XLib?

不想你离开。 提交于 2019-12-11 02:35:37
问题 I'm using a pixmap as a window's backup in order to restore it under expose events. When the window is resized, must I resize the backup pixmap? If so, what is the best way? Create a new pixmap with the new size? 回答1: Yes you are right. If the window is resized to a smaller size you just clip it. If the window is bigger you allocate again to the new size. My advice would also be to look at xcb which replaces xlib at the moment xshm functions for faster performance Xrender/cairo/clutter that

How to open a non-decorated fullscreen window on Ubuntu

拟墨画扇 提交于 2019-12-11 00:54:45
问题 What is the trick to open a non-decorated fullscreen window on Ubuntu? I used to change the _NET_WM_STATE property to _NET_WM_STATE_FULLSCREEN to achieve this but while working fine on KDE it doesn't seem to work on Ubuntu (GNOME; tested with 12.04 LTS). The launcher on the left and the title bar are still there and appear above my non-decorated fullscreen window which is not what I want. When switching to fullscreen mode in Firefox, however, Firefox's fullscreen window covers the complete

How to get Xlib code work in eclipse for C++ ubuntu

半城伤御伤魂 提交于 2019-12-10 23:17:03
问题 I have some code with the following headers for Xlib but don't know what to do to make it work...I can't find these headers. #include <X11/Xlib.h> #include <X11/Xutil.h> #include <X11/Xos.h> #include <X11/Xatom.h> Sorry new to this.. Okay so now I can view the headers in the foldrrs in my eclipse IDE. and i get the following errors.Thee is no problem with the source as friends have run it from the terminal,and i want to do it from eclipse ide: In function main': /home/abbas/workspace/test3