PDA

View Full Version : X11 resoulutions & mouse



10-13-2000, 03:09 PM
hi there,
I know, this is actually a more X11 related question than a gl-one, but I stll think that it could be of interest for many guys doing gl-linux-development.
So here come those questions:

1.) how to change the resulution of X11 ?
2.) how to change the position of the mouse-courser ,
and how to make it invisible?

(actually 3 questions, oops http://www.opengl.org/discussion_boards/ubb/smile.gif
I think the answers to this questions are really useful for everyone.

Regards, abductee

miq
10-13-2000, 05:41 PM
Hi,


Originally posted by abductee:

1.) how to change the resulution of X11 ?
2.) how to change the position of the mouse-courser ,
and how to make it invisible?
[/B]

I have answers to 1.) and 2.1):

1.) At least recent Xfree86 Xservers come with the XF86VidModeExtension which provides functions for changing resolutions. These are covered in the xfree86 api-reference...
With other xservers i have no experience but they perhaps come with similar extensions...

2.1) To move the mouse pointer you can use the function XWarpPointer(display, src_w, dest_w, src_x, src_y, src_width, src_height, dest_x, dest_y).

have fun...

bxe Miq

10-18-2000, 01:58 PM
1st of all thanks miq http://www.opengl.org/discussion_boards/ubb/wink.gif
here's the complete answer:

include the XF86VidModeExtension (as miq told us before)
and then you can use

XF86VidModeGetAllModeLines

to get all availible X-modes
and then you can set one of these modes using

XF86VidModeSwitchToMode

Regards, abductee

P.S. Still no Ideas about hiding the mouse-cursor ?

10-19-2000, 10:03 AM
More answers:
for letting the cursor disappear:
set a PixMapCursor with a "transparent" content.
then use
XDefineCursor(display,window,cursor);
..
and don't forget to restore the old one before You quit
XUndefineCursor(display,window);

so, happy coding everyone http://www.opengl.org/discussion_boards/ubb/wink.gif

Regards, abductee