As mentioned in the cgo documentation: As Go doesn't have support for C's union type in the general case, C's union types are represented as a Go byte array with the same length. Another SO question: Golang CGo: converting union field to Go type or a go-nuts mailing list post...
'xset` can be used to set the rate and delay for repeating keypress events for a held-down key: http://www.x.org/archive/current/doc/man/man1/xset.1.xhtml Example here: http://linuxforcynics.com/how-to/set-keyboard-repeat-delay-and-rate...
Chances are that XOpenDisplay() uses some global variable internally that is not thread-safe or shares data between the displays. I don't think it's wise to call XOpenDisplay like that from within a thread; I suggest opening the displays sequentially first, then start the threads with a Display pointer. Or protect...
I didn't find a solution for the XGrabKeyboard problem. The XGrabKey failed for some keys because they were already grabbed by OpenBox. Openbox has some built-in hotkeys that use XGrabKey. Because I use AnyModifier, if any grab has been made that include this key then the grab will fail. For...
You can't share data between two processes this way: Note that this is local to your program; the data is not stored in the server on a property list I'd suggest to use window properties as shared data storage...
You need to make sure window depth is 32 set value of alpha bits for transparent areas make sure you are running composite manager that can handle transparency correctly See my question "How to upload 32bit pixmap to server" as an example of how to set alpha channel value upd:...
That's how override-redirect windows are meant to behave. They are designed for implementing pop-up menus and similar windows which are transient and stay above other windows. If that's not what you want, do not use override-redirect flag. Instead, use WM hints. See here for the full list of hints. You...
Yes ( you can override this if you implement your own composite manager ) Yes, unless window is added to a "save set". Yes ( but again with your own composite manager you can change visual mapping of [content of all windows hierarchy] -> [screen] any way you want...
You shall always check whether functions returned successfully, or not. It is not a Haskell, where all the checking done for you by monad, it is C. As for your particular case, the problem is that the function XOpenDisplay fails and returns null for you. In the next line you're...
I found my error. The problem was that I was using these fonctions before the window was displayed. Display *display = QX11Info::display(); int window = QWidget::winId (); XMoveResizeWindow(display, window, 100, 100, 400, 400); This works if it is used after "show()". Sorry for that....
After a lot of stuggles, finally solved! In GNOME 3, windows have no "iconify/minimize" button. It appears that a window can't be minimized, neither by the user nor from code. When I called XIconifyWindow, the window wasn't minimized. If it had been minimized, I'd have gotten an "UnmapNotify" event, which...
c,linux,window,transparent,xlib
Your code works fine for me: kde: openbox + xcompmgr: Most likely you are not running composite manager. Try to start xcompmgr command Also check _NET_WM_CM_S0 selection owner - it should point to a window created by composite manager. #include <X11/Xlib.h> #include <X11/Xutil.h> #include <stdio.h> int main(int argc, char* argv[])...
Yes it is possible and not complicated #include <gtk/gtk.h> int main(int argc, char **argv) { gtk_init(&argc, &argv); GtkWidget *mainwin; mainwin = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_keep_above ( (GtkWindow *) mainwin, TRUE); gtk_widget_show_all (mainwin); gtk_main (); return 0; } gtk_window_set_keep_above does trick if window manager is cooperative....
"undefined reference to symbol" is a linker error, not a compiler error. If you get this message, the compiler has already finished compiled the file into an object file, but is unable to find the shared library which contains the function to link the object file into an executable. If...
Found it: _NET_WM_STATE_SKIP_TASKBAR, Source: http://standards.freedesktop.org/wm-spec/wm-spec-1.3.html#id2507144
c,x11,xlib,vala,freedesktop.org
There's a library called libxsettings-client that provides a C interface for accessing XSettings. You'd need to port the API to Vala, which looks pretty straight forward given how small it is (<70 lines). It would depend on x11.vapi, which is already included with Vala. Have a look at binding legacy...
I just created my own translation function as you had suggested: switch (hello[i]) { case ' ': XTestFakeKeyEvent(dis, 65, True, 0); XTestFakeKeyEvent(dis, 65, False, 0); as for capital letters, I used a shift key with the regular key: case 'T': XTestFakeKeyEvent(dis, 50, True, 0); XTestFakeKeyEvent(dis, 28, True, 0); XTestFakeKeyEvent(dis, 28,...
linux,x11,xlib,window-managers
Grab the mouse pointer and pass on the events to the destination window.
Using non-rectangular windows is an extension. It's not part of the core protocol. The XShape... functions are provided in libXext. So to answer your question is that it is not possible to do this with only Xlib. There is some documentation for this library....
No, that's why XRender was introduced. Another option is GLX. One more option (slow): transfer previous content to client, blend in your client code and put pixmap back to server.
XDefaultScreen (usually called by the macro DefaultScreen) returns the screen number which is used in most xlib functions where you want to specify a screen e.g. DefaultGC. XDefaultScreenOfDisplay (usually called by the macro DefaultScreenOfDisplay) returns a Screen pointer and is generally used when you want to find out information...
The n.m.' answer is correct. I have found that for this to work reliably, the window should be of type _NET_WM_TYPE_DOCK and you must first map it then move it to position, otherwise the WM may sometimes place it outside of it own strut. – n.m. This is the code...
KeySyms and KeyCodes are semantically different, and there is not a 1-1 relationship between them. A KeyCode is an arbitrary small integer representing a key on the keyboard. (Not a character. A key.) Xlib requires that key codes be in the range [8, 255], but fortunately most keyboards have only...
It seems the members x and y are of an integral type, so the division is done on integers, which simply truncates the fractional part of the result. In other words, 50 / 100, which is 0.5, gets truncated to the 0 you see in your output. In order to...
In Xlib use XTranslateCoordinates to translate the coordinate (0,0) in your viewport window into coordinates of the root window. This also covers the case of a stacking window manager messing with your window position.
Xlib is the traditional client side implementation of the X11 protocol. The modern (replacement for Xlib) client side implementation would be Xcb, however OpenGL/GLX are a bit of a hassle to use with Xcb. X11 has nothing to do with Microsoft Windows. Xlib/Xcb are essentially protocol implementations that turn function...