xorg

How to programmatically prevent linux computer from sleeping or turning on screensaver?

时光怂恿深爱的人放手 提交于 2020-07-17 09:37:48
问题 While developing a small cross-platform game on C++, I got stuck with following issue: when players are playing with a USB gamepad without touching a keyboard or mouse, the computer sleeps automatically while they're playing. In Windows, it can be done easily using SetThreadExecutionState function. In OS X, I think it can be done with UpdateSystemActivity but not tested yet. But the problem is, in Linux there's nothing like a common API between DE's. I've found that in Gnome you can stop the

Draw on top of the screen using xlib

纵然是瞬间 提交于 2020-01-23 07:41:50
问题 I want to draw some primitives on top of all windows on the screen. I've found some code in C and tried to port it to use python's xlib: from Xlib.display import Display from Xlib import X from Xlib import protocol display = Display(':0') root = display.screen().root gc = root.create_gc() root.fill_rectangle(gc, 100, 100, 500, 500) But nothing appears on the screen (however, the root window is assigned: grabbing keyboard after it works). How to do this correctly? 回答1: You can draw on root

Sending Programmatic Mouse Events to X

邮差的信 提交于 2020-01-21 13:58:24
问题 I am somewhat new to X development on Linux. I'm wondering what are best practices (or links to resources) for programmatically sending cursor events. Moving the cursor to a normalized (X,Y), creating right/left mouse clicks, etc. Ideally this would be something in C/C++ . I have played around with the Qt QCursor but I'd like to know the raw way to accomplish this. 回答1: I think you can use XSendEvent. There's some sample code here which uses XQueryPointer to populate most of the event fields.

What does XCloseDisplay return?

廉价感情. 提交于 2020-01-15 20:18:28
问题 I can see from various documentations that XCloseDisplay returns an integer, which I suspect to be an error code. What should I do with this value? Is it an error code? If so how do I handle the error? 回答1: I looked in the source code ( lib/X11/ClDisplay.c ) It says: return 0; So there's nothing you can really do with the return value. 来源: https://stackoverflow.com/questions/23083523/what-does-xclosedisplay-return

What does XCloseDisplay return?

▼魔方 西西 提交于 2020-01-15 20:17:51
问题 I can see from various documentations that XCloseDisplay returns an integer, which I suspect to be an error code. What should I do with this value? Is it an error code? If so how do I handle the error? 回答1: I looked in the source code ( lib/X11/ClDisplay.c ) It says: return 0; So there's nothing you can really do with the return value. 来源: https://stackoverflow.com/questions/23083523/what-does-xclosedisplay-return

What does XCloseDisplay return?

烈酒焚心 提交于 2020-01-15 20:17:49
问题 I can see from various documentations that XCloseDisplay returns an integer, which I suspect to be an error code. What should I do with this value? Is it an error code? If so how do I handle the error? 回答1: I looked in the source code ( lib/X11/ClDisplay.c ) It says: return 0; So there's nothing you can really do with the return value. 来源: https://stackoverflow.com/questions/23083523/what-does-xclosedisplay-return

Scripts launched from udev do not have DISPLAY access anymore?

荒凉一梦 提交于 2019-12-29 05:19:26
问题 I have a script that runs from udev when I plug in my external drive. It always worked. But after upgrading from Linux 3.8/Xorg 1.12/Mint 14 ( Ubuntu 12.10 compatible) to Linux 3.11/Xorg 1.14/Mint 16 ( Ubuntu 13.10 compatible), it doesn't work anymore. The script still runs, but none of the commands that require the display work. I figured that out by quitting the udev daemon and manually run udevd --debug for verbose output (more below). This script used to work in Mint 14/12.10 : export

Second Cursor is not triggering a screen refresh

冷暖自知 提交于 2019-12-24 21:17:57
问题 I previously posted about controlling two separate cursors in two xsessions. (http://stackoverflow.com/questions/13714831/controlling-multiple-pointers-with-xlib-or-xinput-in-ubuntu-linux) That solution worked well. However, a odd thing occurs when I control the cursor. Instead of the cursor moving normally and the screen refreshing to adjust, the cursor is on top of a white box and when I move it the cursor leaves a trail and nothing refreshes. This only happens when I move the newly created

example code for Xorg/X11 record extension fails

夙愿已清 提交于 2019-12-24 11:44:03
问题 I'm compiling a basic example (as much as using bare X could be simple...) using the X11 's RECORD extension on the latest version of Ubuntu, and I'm getting the following error: RECORD extension for local server is version is 1.13 X Error of failed request: XRecordBadContext Major opcode of failed request: 135 (RECORD) Minor opcode of failed request: 5 (XRecordEnableContext) Context in failed request: 0x17 Serial number of failed request: 10 Current serial number in output stream: 10 Any

How to start linux with gui without monitor? [closed]

前提是你 提交于 2019-12-23 02:03:06
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 7 years ago . I met a problem. I had a server which is installed redhat enterprise 5.5. And one Qt program was running on this server. So what I should do is to turn on my server, the server will start automaticly with Gui and that Qt program will start automaticly. I finished all on my desktop. But while I start this server