Browse Source

added hidecursor option

git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/slim/trunk@99 7c53e7cc-98ea-0310-8f1f-a0b24da60408
sip 18 years ago
parent
commit
b1fe9d767f
4 changed files with 23 additions and 11 deletions
  1. 5 0
      ChangeLog
  2. 13 11
      app.cpp
  3. 1 0
      cfg.cpp
  4. 4 0
      slim.conf

+ 5 - 0
ChangeLog

@@ -1,3 +1,8 @@
+X.X.X - XXXX.XX.XX
+    * hiding of the cursor is now an option (disabled
+      by default) since some WMs does not re-initialize
+      the root window cursor.
+
 1.2.4 - 2006.01.18
     * Added commands for session start and stop
       (i.e. for session registering)

+ 13 - 11
app.cpp

@@ -291,17 +291,19 @@ int App::GetServerPID() {
 
 // Hide the cursor
 void App::HideCursor() {
-	XColor		    black;
-	char		    cursordata[1];
-	Pixmap		    cursorpixmap;
-	Cursor		    cursor;
-	cursordata[0]=0;
-	cursorpixmap=XCreateBitmapFromData(Dpy,Root,cursordata,1,1);
-	black.red=0;
-	black.green=0;
-	black.blue=0;
-	cursor=XCreatePixmapCursor(Dpy,cursorpixmap,cursorpixmap,&black,&black,0,0);
-	XDefineCursor(Dpy,Root,cursor);
+	if (cfg.getOption("hidecursor") == "true") {
+		XColor		    black;
+		char		    cursordata[1];
+		Pixmap		    cursorpixmap;
+		Cursor		    cursor;
+		cursordata[0]=0;
+		cursorpixmap=XCreateBitmapFromData(Dpy,Root,cursordata,1,1);
+		black.red=0;
+		black.green=0;
+		black.blue=0;
+		cursor=XCreatePixmapCursor(Dpy,cursorpixmap,cursorpixmap,&black,&black,0,0);
+		XDefineCursor(Dpy,Root,cursor);
+	}
 }
 
 void App::Login() {

+ 1 - 0
cfg.cpp

@@ -42,6 +42,7 @@ Cfg::Cfg() {
     options.insert(option("shutdown_msg","The system is halting..."));
     options.insert(option("reboot_msg","The system is rebooting..."));
     options.insert(option("sessions","wmaker,blackbox,icewm"));
+    options.insert(option("hidecursor","false"));
 
     // Theme stuff
     options.insert(option("input_panel_x","50%"));

+ 4 - 0
slim.conf

@@ -12,6 +12,10 @@ console_cmd         /usr/X11R6/bin/xterm -C -fg white -bg black +sb -T "Console
 # Activate numlock when slim starts. Valid values: on|off
 # numlock             on
 
+# Hide the mouse cursor (note: does not work with some WMs).
+# Valid values: true|false
+# hidecursor          false
+
 # This command is executed after a succesful login.
 # you can place the %session and %theme variables
 # to handle launching of specific commands in .xinitrc