2009/9/2 Lucio Chiappetti <lu...@lambrate.inaf.it>: > Not strictly an fvwm question, but there are surely lot of X competent > persons on this mailing list, so please forgive (and eventually redirect me > to more appropriate places). > > Is there a way to define (or emulate via another x application ?) an X > cursor which (will run in a fvwm session and) : > > - is rather large (say an ellipse surrounding a word in a typical size > font) > > - is semi-transparent (say the outline of an ellipse but let shine > through what is behind the interior) > > - can be forced to override any cursor defined by other applications > > My purpose is to present in a videoconf a PDF document and a set of web > pages, and being able to highlight parts of it moving the mouse (like a > laser pointer in a local presentation). The typical cursors are not that > visible after all.
You probably have best luck overriding XDefineCursor for the application using LD_PRELOAD. For a simple implementation using fvwm, and not caring about if other courses change as well you could do as follows: 1. draw a png-image with an alpha channel for use as your cursor. 2. Add "CursorStyle DEFAULT your_image.png X_hotspot Y_hotspot" (probably good to have in the center of your circle) to your fvwm configuration. 3. Create a small C-file with contents similar to this: nocursor.c: #include <X11/Xlib.h> int XDefineCursor (Display* display, Window w, Cursor cursor) { return Success; } 4. complie this file as a shared library: gcc -fPIC -shared -o nocursor.so nocursor.c 5. start the application you don't want to be able to set its own cursor with LD_PRELOAD set to the absolute path to nocursor.so compiled above. The result of that will be that your shared function will override any call to XDefineCursor made by the program. (Not that this won't work if the program takes special measures to bind to the X-libraries dynamically at runtime (SDL does that) in which case you would have to overrride some other function in order to be able to intercept the define cursor calls. /Viktor