x11

Get a Firefox's window id (WId) under X11

主宰稳场 提交于 2019-12-12 03:05:02
问题 I'm trying to find out how to get a Firefox's X11 WId (window id) from within a Firefox addon/extension. Checked out nsIWindowMediator , nsIXULBrowserWindow , nsIXULWindow but haven't found it. I'd rather not go the usual way of (ab)using Xlib to search the window tree for one that matches the attributes of the current window like title, type and so on. 回答1: I think that the only place where you can get it is nsIEmbeddingSiteWindow.siteWindow (its type is GtkWidget* on Linux, it should be

Python: text overlay on top of all windows including fullscreen in Linux

别等时光非礼了梦想. 提交于 2019-12-12 02:28:26
问题 I am trying to write a simple script in python that outputs text on top of all windows and fullscreen apps. The purpose of this script is to output load average and free memory (and other useful stats) in similar fashion that Steam FPS counter works. So far I tried pygame but as far as I can see it can only write into its own window. As I understand I need to write directly to frame buffer? The target OS is Linux with Nvidia card and Xorg, but I would prefer it to be hardware agnostic. Thanks

XMaskEvent not returning

大兔子大兔子 提交于 2019-12-12 01:41:50
问题 I am following this tutorial here: http://www.sbin.org/doc/Xlib/chapt_16.html Here is the image of the tutorial: Here is my code: (it is in another thread from which I called XInitThreads - I know using threads and X is bad, I know I should be on the main thread, but just wondering if possible) var ev = XEvent(); var rez_XMaskEvent = XMaskEvent(cachedXOpenDisplay(), ButtonPressMask | ButtonReleaseMask, ev.address()); console.log('rez_XMaskEvent:', rez_XMaskEvent); console.log('ev:', ev);

XLib windows auto-alignment performance

余生颓废 提交于 2019-12-12 00:42:57
问题 In XLib based application, I need to make the child window to be resized after the parent window. (For example, in order to make the child window to take the whole client area of the parent window) I am processing the ConfigureNotify event of the parent window and resizing the child window when needed. In generally it works properly. But there is a delay between resizing the parent window (for example when the user resizes the window dragging the edge) and the event received by the

Gdk / X11 Screen Capture

二次信任 提交于 2019-12-12 00:20:58
问题 I want to write a program that continuously captures the screen and does some modifications to the image. A complete test program can be found at: https://gist.github.com/blogsh/eb4dd4b96aca468c8bfa However, I ran into some problems. The first experiment I did was using the Gdk root window, create a Cairo context from it and then using it's target as the source for another window, where the contents are painted to: mScreenContext = Gdk::Screen::get_default()->get_root_window()->create_cairo

x11 - how to keep window at fixed position

﹥>﹥吖頭↗ 提交于 2019-12-11 19:58:57
问题 I develop a plugin for Compiz (window manager). A window manager is run by xfce on my test machine. I have two monitors which are set vertically (top 1920x1080+0+0, bottom 1920x1080+0+1080). A bottom monitor is set as a primary monitor. This option (primary monitor) is available for example in nvidia-settings. In my code I can use xlib function XConfigureWindow when I want to set a top left corner of the game window at position [0,0]. This works fine, but when a window is in the fullscreen

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

How to store the data generated by an event in X11?

此生再无相见时 提交于 2019-12-11 14:08:38
问题 I am working on an event-driven project that draws shape on an x-window. Whenever I click a mouse on the screen, new values of x and y are generated. My question is: how can I store the different values of x and y in the code below assuming each time you click a mouse, new values of x and y are generated. int x, y; x = report.xbutton.x; y = report.xbutton.y; if (report.xbutton.button == Button1) { XFillArc(display_ptr, win, gc_red, x - win_height/80, y - win_height/80, win_height/60, win

usr/bin/X11 has too many recursive symbolic link

ぃ、小莉子 提交于 2019-12-11 13:43:10
问题 I just want to know why. I know its known only to linux devs. But why usr/bin/X11 has too many symbolic links. If I type in command cd usr/bin then use 'tab', it shows X11 and it goes on to subdirectory X11 (inside and inside and so on) until say 40th subdir. And when I'm in 40th subdir and go to X11 and tap 'tab' again X11/X11/X11 and so on upto 40th. When I press 'enter' here, I've been redirected to usr/bin itself. What sort of behaviour is this and why? 回答1: The X Window System used to

GLX Vsync event

断了今生、忘了曾经 提交于 2019-12-11 13:30:54
问题 I'm wondering if I could catch the screen vsync event by any file descriptor and [select | poll | epoll]ing it. Normally, if I'm right, glXSwapBuffers() doesn't block the process so I could do something like : int init() { create epollfd; add Xconnection number to it; add some other fd like socket timer tty etc... possibly add a vsync fd like dri/card0 or fb0 or other??? return epollfd; } main() { int run = 1; int epollfd = init(); while(run) { epoll_wait(epollfd, ...) { if(trigedfd = socket)