[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Cursor fonts ..............



*-Phillip Neumann <filsin@interaccess.cl>
|
| Why does the cursor changes its look when, i.e, changing from the root window (X-like cursor) to a application (arow cursor)? Does the app say X to change the cf (cursor font) from X to arrow and then when going back to the root window it says X to change it again?

Yes. Every window can have its own cursor. Remember that eg. scrollbars
are windows of their own, as are the wm frames.

| Inside the file /usr/X11R6/include/X11/cursorfont.h are lines like this:
| 
| #define XC_X_cursor 0
| #define XC_arrow 2
| 
| So i imagine the `application' says "ok, X, now you will change the cf from 0 to 2" and then X see cursorfont.h and think "yeah, i will change the cf to `arrow'", then X thinks again "acording to /usr/X11R6/lib/fonts/misc/cursor.pcf.gz i will draw this arrow"...
| 
| Is this true? cf works like this?

Almost. What happens is that when the application creates a window, it
also says "I like that cute little XC_arrow. I hereby declare that
XC_arrow will be the cursor when the pointer is inside me!". When the
program is compiled, XC_arrow is simply replaced with 2. Then X gets
the message and thinks "That window wants cursor 2. Then I will
use cursor number 2 in the cursor font when it has the pointer."

| i guess not, becouse changing ```#define XC_X_cursor 0''' to ```#define XC_arrow 0''' dont change the X-cursor to an arrow... so how does it work?

This does not really happen dynamically. The name->number mapping is
fixed at compile time.

| I want to know this becouase i would like to change the default cursors to other ones... 

You could always try to hack the font itself...

| I have done xsetroot -cursor hi hi  , where hi is a file drawed  with bitmap, but this only change the root's cf (`X').

Yup. Changing the applications cursor isn't trivial. Changing the
cf is one possibility. If you are an (aspiring) C hacker you can do
this in the wm.

Well written apps may have resources to change the cursors.

| (btw, i can only draw black points... how do i draw whites ones? or better color ones?)

If you use 'bitmap', right mouse button clears pixels. Unfortunately,
I don't think it is possible to use coloured cursors. I'd love to
be proved wrong, though.

| i have try to see the cf's, but `xfontsel -fn cursor.pcf' cannot open it...

xfd -fn cursor

| How do i change the cursor for writing thinks (the default one) to a pen for example?

Dunno. There are probably some font editing programs in
Debian somewhere...

-- 
The only way tcsh "rocks" is when the rocks are attached to its feet
in the deepest part of a very deep lake.             (Linus Torvalds)
olet@ifi.uio.no   [-: .elOle. :-]   olet@debian.org


Reply to: