Added an enable/disable mouse pointer option in case the autodetection
fails.
This commit is contained in:
parent
89c0410ce7
commit
77572d53d4
1 changed files with 20 additions and 8 deletions
28
GUI/gui.cxx
28
GUI/gui.cxx
|
@ -27,6 +27,7 @@
|
|||
#include <string.h>
|
||||
|
||||
#include <Include/general.h>
|
||||
#include <Main/options.hxx>
|
||||
|
||||
#include "gui.h"
|
||||
|
||||
|
@ -132,23 +133,34 @@ puCallback helpSubmenuCb [] = { notCb, notCb, NULL };
|
|||
void guiInit()
|
||||
{
|
||||
fgGENERAL *g;
|
||||
fgOPTIONS *o;
|
||||
char *mesa_win_state;
|
||||
|
||||
g = &general;
|
||||
o = ¤t_options;
|
||||
|
||||
// Initialize PUI
|
||||
puInit();
|
||||
|
||||
// Determine if we need to render the cursor, or if the windowing
|
||||
// system will do it. First test if we are rendering with glide.
|
||||
if ( strstr ( g->glRenderer, "Glide" ) ) {
|
||||
// Test for the MESA_GLX_FX env variable
|
||||
if ( (mesa_win_state = getenv( "MESA_GLX_FX" )) != NULL) {
|
||||
// test if we are fullscreen mesa/glide
|
||||
if ( (mesa_win_state[0] == 'f') || (mesa_win_state[0] == 'F') ) {
|
||||
puShowCursor ();
|
||||
if ( o->mouse_pointer == 0 ) {
|
||||
// no preference specified for mouse pointer, attempt to autodetect...
|
||||
// Determine if we need to render the cursor, or if the windowing
|
||||
// system will do it. First test if we are rendering with glide.
|
||||
if ( strstr ( g->glRenderer, "Glide" ) ) {
|
||||
// Test for the MESA_GLX_FX env variable
|
||||
if ( (mesa_win_state = getenv( "MESA_GLX_FX" )) != NULL) {
|
||||
// test if we are fullscreen mesa/glide
|
||||
if ( (mesa_win_state[0] == 'f') ||
|
||||
(mesa_win_state[0] == 'F') ) {
|
||||
puShowCursor ();
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if ( o->mouse_pointer == 1 ) {
|
||||
// don't show pointer
|
||||
} else if ( o->mouse_pointer == 2 ) {
|
||||
// force showing pointer
|
||||
puShowCursor();
|
||||
}
|
||||
|
||||
// puSetDefaultStyle ( PUSTYLE_SMALL_BEVELLED );
|
||||
|
|
Loading…
Add table
Reference in a new issue