x11

In C, how to get the geometry (x, y, width, height) of the active monitor within the screen using X11

夙愿已清 提交于 2019-12-20 07:32:53
问题 All my searches lead to answers about how to get the geometry of the active screen in X11 using C, but that screen may contain many monitors, and there is normally only one screen unless there are many users simultaneously using the same computer. Those answers about getting the screen geometry are out of date because they don't take into account multiple monitors. So, how can I get the geometry (x, y, width, height) of the monitor that has the mouse pointer or active window on it? I would

(Linux) How to run a program of gtk without display environment? Gtk-WARNING **: cannot open display:

走远了吗. 提交于 2019-12-20 06:38:33
问题 I got a program which must run in GTK gui environment. I can only use ssh. This program will run on a server(centos 6) and installed gnome X display. It's no need to see GUI, but after it run finished, i can get the answer. VNC and Remote screen is disable. When i start the program in ssh: Gtk-WARNING **: cannot open display: Is there any ways to salve this problem??? I known it's bad to run a gui program in this situation, but here we only discuss technology... Thank you... 回答1: The ssh

installing X11 on Fedora 16

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-20 04:23:05
问题 I wish to install X11 development libraries. I have Fedora 16 as OS. I found this link that offers source tar fies to X11R7.6. http://www.x.org/releases/X11R7.6/src/ Could you tell the next few steps? thanks in advance 回答1: There is no need to download the headers yourself, you can install them with yum, Fedora's package manager. sudo yum groupinstall "X Software Development" 来源: https://stackoverflow.com/questions/8214592/installing-x11-on-fedora-16

XMoveWindow not Working before XMapWindow

浪子不回头ぞ 提交于 2019-12-20 04:04:37
问题 I have a window, and I'd like to be able to control where it appears. However, calling "XMoveWindow" seems to have no effect before "XMapWindow" is called. The docs don't say anything. Help? 回答1: In XtCreateWindow there are x and y coordinates, so you could specify the location when creating it. Note that the X server doesn't have to know about a window before it is mapped for the first time, thus moving a window which is unmapped may not have any effect. But XtCreateWindow only works for

No error on xcb_grab_key but event loop not catching (Global Hotkey)

女生的网名这么多〃 提交于 2019-12-19 10:15:33
问题 I am trying to set up a global hotkey on Linux. I had initially used x11 ( libX11.so ) however I had to do this from a thread. I tried it but the XPendingEvent and XNextEvent would eventually crash the app. So I switched to xcb ( libxcb.so.1 ). There is no errors, I even check with xcb_request_check however the event loop is not picking anything up. As soon as I start the loop, I get only one event which looks like this: { response_type: 0, pad0: 10, sequence: 2, pad: [620, 2162688, 0, 0, 0,

How to observe changes in connected monitors via Xlib?

风流意气都作罢 提交于 2019-12-19 09:48:21
问题 I'm trying to write a program that would detect external monitors being plugged in and automatically enable and configure them through Xlib. I know that there is XRandr extension that allows this. My question is, how do I enable receiving XRandr events to my application? What event mask should I use? I know that xev app is able to do this. 回答1: Xev's source code: http://cgit.freedesktop.org/xorg/app/xev/tree/ Or: git clone git://anongit.freedesktop.org/xorg/app/xev 回答2: For the second part, I

ld can't find X11 library on OSX Leopard

不羁岁月 提交于 2019-12-19 09:18:16
问题 I have a pretty basic X11 app that I run on Linux that I'm trying to get compiled under OSX 10.5.8. I have X11 and the X11 SDK installed, and modified the makefile as follows: CFLAGS = -L/usr/X11/lib -I/usr/X11/include Everything compiles fine, but the linker can't find the X11 lib. ld: library not found for -lX11 I've looked on google, but the only other people I've found with this problem so far either didn't have the X11 SDK installed or didn't know about the -L flag. Any ideas? 回答1: You

FLTK in MSVC needs x11 headers?

那年仲夏 提交于 2019-12-19 07:48:29
问题 I'm trying to learn how to use FLTK right now (In MSVC 2008). I got all the the libraries compiled correctly, but when I tried to run this program: #include "FL/Fl.H" #include "FL/Fl_Window.H" #include "FL/Fl_Box.H" int main(int argc, char *argv[]) { Fl_Window *window = new Fl_Window(340, 180); Fl_Box *box = new Fl_Box(20, 40, 300, 100, "Hello, World!"); box->box(FL_UP_BOX); box->labelfont(FL_BOLD + FL_ITALIC); box->labelsize(36); box->labeltype(FL_SHADOW_LABEL); window->end(); window->show()

pygtk window with box that ignores all X(mouse)events (passes them through)

会有一股神秘感。 提交于 2019-12-18 17:25:47
问题 I'd like to do the following: Create a fullscreen, always on top pygtk window with a webkit widget displaying some html, but with a box that is completely transparent, so that the windows below are visible. (This seems to be possible: Is it possible to render web content over a clear background using WebKit?) What I'd like is to (sometimes) pass all mouse events that occur in the transparent box down to the windows below my application's window, so that I can interact with them normally. So

Taking screenshot with libx11

江枫思渺然 提交于 2019-12-18 17:12:32
问题 I'm currently trying to take a screenshot using libx11 #include <X11/Xlib.h> #include <X11/Xutil.h> #include <stdio.h> int main(void) { XImage* pic; Display* dpl; unsigned int buffer_size; dpl = XOpenDisplay("127.0.0.1:0.0"); pic = XGetImage(dpl, RootWindow(dpl, DefaultScreen(dpl)), 10, 10, 201, 201, AllPlanes, ZPixmap); } if I compile the code using -lX11 and run it I keep getting a segmentation fault. Any ideas? Thanks in advance! 回答1: The X11 server does not usually listen on TCP/IP