x11

Keeping X11 window on top of another window

北慕城南 提交于 2020-01-03 17:59:10
问题 I have two x11 windows which need to maintain a certain stacking order between each other, namely one window needs to stay above the other. I don't care about other windows outside the application. Normally, I would use a parent/child for this, but since X11 clips the child window to the parent, I have to fake it. I've tried various methods to keep and/or adjust the window stack to maintain the proper order. However, the WM is ignoring pretty much everything except for XRaiseWindow() which is

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

Opening sockets to the Xserver directly

孤街醉人 提交于 2020-01-02 11:23:24
问题 I'm looking to understand how Linux Desktop Environments work with Xserver. I was reading that most window managers don't open sockets directly, instead they use either Xlib bindings for which ever language the WM is being written or you can use higher level bindings XCB; but i would like to know What are the advantages to opening a socket directly to the Xserver? 回答1: The question should rather be "What are the advantages of using Xlib instead of a graphical toolkit like gtk"? Even to master

Opening sockets to the Xserver directly

送分小仙女□ 提交于 2020-01-02 11:20:17
问题 I'm looking to understand how Linux Desktop Environments work with Xserver. I was reading that most window managers don't open sockets directly, instead they use either Xlib bindings for which ever language the WM is being written or you can use higher level bindings XCB; but i would like to know What are the advantages to opening a socket directly to the Xserver? 回答1: The question should rather be "What are the advantages of using Xlib instead of a graphical toolkit like gtk"? Even to master

unsuccessful use of popen() in C?

坚强是说给别人听的谎言 提交于 2020-01-02 06:42:14
问题 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",

Deploy JavaFX on Ubuntu server without display

丶灬走出姿态 提交于 2020-01-02 04:10:07
问题 I'm developing a JavaFX application using jdk1.7.0_51 on Mac OS X (10.9.1) in Netbeans. I can run it without a problem and after a clean build I can also launch the jar from the dist/ folder. Now I want to deploy this on a 64 bit Ubuntu 13.04 server. I've had a lot of issues doing this but have finally set up the server to have the correct JRE, fonts and libraries. Running the jar resulted in errors going way deeper than my code (going to UnsatisfiedLinks to native libraries where MACOS was

Help: Maximum number of clients reached - Segmentation fault

吃可爱长大的小学妹 提交于 2020-01-01 10:59:24
问题 I want to simulate many key press events. I found a solution by using XTestFakeKeyEvent , but when I simulate more than 210 times my program raises a "Maximum number of clients reached" segmentation fault. I don't known how to solve this problem. My code here: #include <X11/Xlib.h> #include <X11/keysym.h> #include <X11/extensions/XTest.h> #include <stdio.h> #define PRESS_UP 0 #define PRESS_DOWN 1 #define PRESS_LEFT 2 #define PRESS_RIGHT 3 #define PRESS_ENTER 4 #define PRESS_ESC 5 #define

Help: Maximum number of clients reached - Segmentation fault

烈酒焚心 提交于 2020-01-01 10:59:02
问题 I want to simulate many key press events. I found a solution by using XTestFakeKeyEvent , but when I simulate more than 210 times my program raises a "Maximum number of clients reached" segmentation fault. I don't known how to solve this problem. My code here: #include <X11/Xlib.h> #include <X11/keysym.h> #include <X11/extensions/XTest.h> #include <stdio.h> #define PRESS_UP 0 #define PRESS_DOWN 1 #define PRESS_LEFT 2 #define PRESS_RIGHT 3 #define PRESS_ENTER 4 #define PRESS_ESC 5 #define

Excluding some keys from XGrabKeyboard

时间秒杀一切 提交于 2020-01-01 10:52:38
问题 Consider an application where it's desirable to grab the keyboard when focused in order to capture all window manager commands (Alt+F4 and whatnot) for processing. Now, this has the downside that the user has no way of switching to another application or virtual desktop via the keyboard when the keyboard is grabbed. I'd like to have a user-defined whitelist of key combination (say, the key combinations for switching virtual desktops) that are excluded from the grab. I can think of two

Does OpenGL use Xlib to draw windows and render things, or is it the other way around?

杀马特。学长 韩版系。学妹 提交于 2020-01-01 05:36:08
问题 I want to render fonts and lines on a window using either OpenGL or Xlib , but I'd like to know which one is "more fundamental". Using the Xlib interface I can render such things with something like this (which I found here): // gcc x_1.c -o x_1 -lX11 && ./x_1 #include <stdio.h> #include <X11/Xlib.h> // This program draws a red line and some text in a chosen font. Display *display; Window window; XSetWindowAttributes attributes; XGCValues gr_values; XFontStruct *fontinfo; GC gr_context;