xorg

How does X11 clipboard handle multiple data formats?

懵懂的女人 提交于 2019-12-02 20:07:06
It probably happened to you as well - sometimes when you copy a text from some web page into your rich-text e-mail draft in your favorite webmail client, you dislike the fact that the pasted piece has a different font/size/weight.. it somehow remembers the style (often images, when selected). How is it than that if you paste the same into your favorite text editor like Vim, there's no HTML, just the plain text? It seems that clipboard maintains the selected data in various formats. How can one access data in any one of those formats (programmatically or with some utility)? How does the X11

Qt4: Making fullscreen window impossible to get around (a lock screen)?

南笙酒味 提交于 2019-12-02 07:13:38
问题 My application is an OS lock screen (like GDM's lock screen or KDE's), so I'm trying to make it function like one. I am trying to make my application's window hover above all other windows and disable/intercept all keyboard shortcuts ( ALT-TAB , CTRL-ALT-D , etc.) that would cause it disappear. Is there any way to do this? I'm 100% sure there is, as lock screens with GUIs exist, but I just can't find the place to look... 回答1: I don't know how to do it with Qt, but what you are looking for is

how to define window stacking order?

随声附和 提交于 2019-12-02 06:00:45
问题 I'm trying to write my own window manager. One issue I faced is that I don't understand how to define in which order windows should be displayed. The only means I found is to use xcb_configure_window . But it looks very limited to me: it only allows either to rise the window on top of all, or put it to the very bottom (no notion of layers or something). What a limited functionality :(. What I really would like to do is to define the window order and tell X about it. Or to define multiple

Sending Programmatic Mouse Events to X

若如初见. 提交于 2019-12-02 02:12:01
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. I think you can use XSendEvent . There's some sample code here which uses XQueryPointer to populate most of the event fields. If you just want to move the pointer, use XWarpPointer . You need to be learning Xlib if you want the "raw

how to define window stacking order?

杀马特。学长 韩版系。学妹 提交于 2019-12-02 00:36:48
I'm trying to write my own window manager. One issue I faced is that I don't understand how to define in which order windows should be displayed. The only means I found is to use xcb_configure_window . But it looks very limited to me: it only allows either to rise the window on top of all, or put it to the very bottom (no notion of layers or something). What a limited functionality :(. What I really would like to do is to define the window order and tell X about it. Or to define multiple layers of windows (e.g, normal, above all, below all). So I could rise (or lower) the window with respect

Qt4: Making fullscreen window impossible to get around (a lock screen)?

爷,独闯天下 提交于 2019-12-01 23:19:43
My application is an OS lock screen (like GDM's lock screen or KDE's), so I'm trying to make it function like one. I am trying to make my application's window hover above all other windows and disable/intercept all keyboard shortcuts ( ALT-TAB , CTRL-ALT-D , etc.) that would cause it disappear. Is there any way to do this? I'm 100% sure there is, as lock screens with GUIs exist, but I just can't find the place to look... I don't know how to do it with Qt, but what you are looking for is called grabbing . You can grab the pointer input device as well as the keyboard . Edit: Looking in to the

How to map a X11 KeySym to a Unicode character?

半腔热情 提交于 2019-12-01 18:20:26
This is an exact duplicate of this question ; however the code linked in the accepted answer is nearly 11 years old, and this comment in the code leads to my duplicate question: The keysym -> UTF-8 conversion will hopefully one day be provided by Xlib via XmbLookupString() and should ideally not have to be done in X applications. But we are not there yet. Are we there yet? I'm aware of XwcLookupString , but something like... wchar_t unicode = XKeySymToWideChar( keysym ); ... would be much simpler and logical, and not require updating whenever KeySyms are added or changed. Is there a simple

How to map a X11 KeySym to a Unicode character?

冷暖自知 提交于 2019-12-01 17:49:44
问题 This is an exact duplicate of this question; however the code linked in the accepted answer is nearly 11 years old, and this comment in the code leads to my duplicate question: The keysym -> UTF-8 conversion will hopefully one day be provided by Xlib via XmbLookupString() and should ideally not have to be done in X applications. But we are not there yet. Are we there yet? I'm aware of XwcLookupString , but something like... wchar_t unicode = XKeySymToWideChar( keysym ); ... would be much

Does xlib have an active window event?

a 夏天 提交于 2019-11-30 15:23:55
I am trying to write a program that tracks when the active window changes using Xlib. I am have trouble figuring out the best way to do this. These are my ideas so far: Every second use _NET_ACTIVE_WINDOW to get the active window and if it has changed then running the related code for the event. Get a list of all windows and listen to their focus in event. I would have to figure out how to keep an up to date list of open windows though. Is their an easier/better way? I am new to programming with Xlib. Here's a Python implementation of what @alanc proposed. import Xlib import Xlib.display disp

How to create a callback for “monitor plugged” on an intel graphics?

送分小仙女□ 提交于 2019-11-30 10:26:44
问题 I've got an eeepc with an intel graphics. I'd like to hook a script to the event of a monitor plugged via VGA. How to do that? 回答1: As a crude solution, you may be able to poll on sysfs. On my laptop I have: $ cat /sys/class/drm/card0-LVDS-1/status connected $ cat /sys/class/drm/card0-VGA-1/status disconnected I'm guessing this requires kernel DRM and possibly KMS. To see if you can trigger something automatically, you could run udevadm monitor --property , and watch while you are (dis-