X11 ohne Mauszeiger (fwd)

Jan-Benedict Glaw jbglaw at lug-owl.de
Thu Oct 4 14:24:04 CEST 2001


On Thu, 2001-10-04 13:46:39 +0200, Holger Westphal <allanon at hni.uni-paderborn.de>
wrote in message <Pine.SGI.4.10.10110041346180.3250-100000 at spock>:
> Hallo,
> 
> ich starte mit xinit den X11-Server und darauf direkt eine Praesentation.
> Klappt auch wie gewuenscht - nur: der Mauszeiger stoert bei der
> Prasentation.
> Ich habe schon versucht die "passenden" Sektionen in der XF86Config und
> XF86Config-4 "unschaedlich" zu machen, jedoch ohne Erfolg.
> 
> Wie erreiche ich es jetzt, dass der Mauszeiger verschwindet bzw. gar nicht
> erst auftaucht.
> 
> Maus abzeihen vom Rechner plus Neustart hat auch nichts gebracht.

Die Applikation muß dafür sorgen, daß der Maus-Zeiger nicht sichtbar
ist. Ich hab das mal so gelöst:

#define cursor1_width   16
#define cursor1_height  16
        static char cursor1_bits[] = {
                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
        };
        static char cursor1mask_bits[] = {
                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
        };
static int pl_set_cursor_invisible(void) {
        GdkCursor *cursor;
        GdkPixmap *source, *mask;
        GdkColor fg = { 0, 65535, 0, 0 }; /* Red. */
        GdkColor bg = { 0, 0, 0, 65535 }; /* Blue. */

        source = gdk_bitmap_create_from_data (NULL, cursor1_bits,
                        cursor1_width, cursor1_height
        );
        mask = gdk_bitmap_create_from_data (NULL, cursor1mask_bits,
                        cursor1_width, cursor1_height
        );
        cursor = gdk_cursor_new_from_pixmap(source, mask, &fg, &bg, 8, 8);
        gdk_pixmap_unref(source);
        gdk_pixmap_unref(mask);
        gdk_window_set_cursor(pl_window_main->window, cursor);

        return 0;
}

Es gibt bestimmt auch 'nen Weg, den Cursor auf invisible zu setzen,
aber den Weg hab' ich icht gefunden. Dafür hab' ich das Ding dann
mit dem Code-Fragment von da oben (setzt auf gtk auf...) transparent
gemacht.

MfG, JBG

-- 
Jan-Benedict Glaw . jbglaw at lug-owl.de . +49-172-7608481



More information about the Linux mailing list