x11

X11: How to delay repainting until all events are processed?

家住魔仙堡 提交于 2019-12-02 11:54:27
问题 I'm writing a program that has an X11/Xlib interface, and my event processing loop looks like this: while (XNextEvent(display, &ev) >= 0) { switch (ev.type) { // Process events } } The problem is when the window is resized, I get a bunch of Expose events telling me which parts of the window to redraw. If I redraw them in direct response to the events, the redraw operation lags terribly because it is so slow (after resizing I get to see all the newly invalidated rectangles refresh one by one.)

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

谁说我不能喝 提交于 2019-12-02 10:29:21
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 want the geometry relative to the screen. n.m. You need to use the RandR extension API. Get the source

GLEW_APPLE_GLX Causes Linking Error When Building GLEW

牧云@^-^@ 提交于 2019-12-02 10:07:32
I grepped inside GLEW while trying to solve my other question , concerning missing __glewX* symbols for Mac, and found that they are guarded by GLEW_APPLE_GLX . When I attempt to build GLEW from source with that flag defined, I get undefined symbols (stuff like _glXGetClientString ). Linking against X11 ( -lX11 ) doesn't help. Question: assuming defining GLEW_APPLE_GLX does indeed make sense, how can I fix the build? When building an application that uses the X Server (XQuartz) instead of using CGL, you also need to add -lGL . Ordinarily when building GL software on OS X you use OpenGL

With x11 get window at coordinates

末鹿安然 提交于 2019-12-02 08:05:51
问题 I want to get the top most window that is at position x and y. In Winapi I do this with WindowFromPoint seen here: https://msdn.microsoft.com/en-us/library/ms633558%28v=vs.85%29.aspx Is there any equivalent in x11? I have covered the entire screen with a window and i want to know all the windows that are at the point in z order. 回答1: XQueryTree gives list of window in the stacking order. You would need to query dimensions for every window in the list and stop when your point is within

With x11 get window at coordinates

↘锁芯ラ 提交于 2019-12-02 06:28:47
I want to get the top most window that is at position x and y. In Winapi I do this with WindowFromPoint seen here: https://msdn.microsoft.com/en-us/library/ms633558%28v=vs.85%29.aspx Is there any equivalent in x11? I have covered the entire screen with a window and i want to know all the windows that are at the point in z order. XQueryTree gives list of window in the stacking order. You would need to query dimensions for every window in the list and stop when your point is within rectangle 来源: https://stackoverflow.com/questions/31712876/with-x11-get-window-at-coordinates

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

How to heartbeat X11 screensaver?

寵の児 提交于 2019-12-02 05:55:09
问题 X11 has a screensaver mechanism that can be controlled by xset command. Without having to invoke the external command to disable or heartbeat the screensaver, from inside my X11 application, how can I heartbeat the screensaver mechanism so to prevent it from shutting down the monitor? 回答1: If this on a modern Linux system, the preferred FreeDesktop method is to ping the DBus interface, specifically org.freedesktop.ScreenSaver.SimulateUserActivity() or another part of the exposed interface,

installing X11 on Fedora 16

与世无争的帅哥 提交于 2019-12-02 05:18:52
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 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-02 04:43:46
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? 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 subwindows of your main window; if you want to position a top-level window (either your main app or a popup

X11 Problems when using CImg header in XCode on Mac OSX 10.11.6

我们两清 提交于 2019-12-02 03:56:16
I added X11 to my header search paths, library search paths, and I linked the binary to the X11 library in the build settings and build phases in XCode however I am still getting the errors shown in the picture below. I am 99.999% Sure the problem is X11 because when I disable the display capabilities the warnings aren't there. Any ideas on what I can do next? I think you have your build settings a little incorrect. Here is a very simple program to get you started - you can choose to display PNG, TIFF or JPEG files by using libpng , libtiff or libjpeg which I am assuming you have installed