X11 Cursor Transparent Theme - Why is the X cursor displayed in GTK + windows?

I use the transparent cursor theme trick (see http://obiltschnig.com/2010/08/14/hiding-the-gtkx11-mouse-cursor/ ) to hide the X11 cursor in a full-screen Linux GTK + touchscreen application. I mainly use the WebKit GTK + application, which uses the Xorg server without a window manager in full screen. Now, by hiding the cursor and setting the transparent 1-pixel cursor, the default theme works pretty well (see also: How do you hide the mouse pointer under Linux / X11? ). However, as soon as the cursor is inside a subtitle (for example, a JavaScript warning window or a drop-down list / HTML), the X cursor appears (and disappears again if the cursor moves out of the window). Does anyone know why this is so? And is there a way to completely hide the cursor?

+5
source share
2 answers

"Why is that so?"

The main reason for this behavior is that there is a function XGrabPointer()(see Xlib Programming Guide) that actively captures pointer control and returns GrabSuccessif the capture was successful. Further pointer events are reported only to the capturing client. XGrabPointer()cancels any active capture of this client.

int XGrabPointer(Display *display;
                 Window grab_window;
                 Bool owner_events;
                 unsigned int event_mask;
                 int pointer_mode, keyboard_mode;
                 Window confine_to;
                 Cursor cursor;
                 Time time);

, , . None, , grab_window ; grab_window.

" ?"

, XUnDefineCursor XUnDefineCursor:

XUndefineCursor(Display *display;
                Window w);

XDefineCursor() . , . , undefine , . XUnDefineCursor XDefineCursor, None.

    display=XOpenDisplay(NULL)
    window = DefaultRootWindow(display);
    Cursor invisible_cursor;
    Pixmap no_pixmap;
    XColor black;
    static char nothing[] = { 0, 0, 0, 0, 0, 0, 0, 0 };

    no_pixmap = XCreateBitmapFromData(display, window, nothing, 8, 8);
    invisible_cursor = XCreatePixmapCursor(display,
                                           no_pixmap, no_pixmap,
                                           &black, &black, 0, 0);
    XDefineCursor(display, window, invisible_cursor);

, KDE, , , , .


, unclutter, . , .

unclutter X11 . , . , unclutter.

0: unclutter -idle 0, , .

+2

, . , , .

GTK , , , xsettings . , gnome-settings-manager, , .

XFixesHideCursor(), X- , .

0

All Articles