Hide mouse cursor in fullscreen view
authorUlrik Svensson <ulrik@kristnet.org>
Mon, 23 Jan 2006 20:53:24 +0000 (20:53 +0000)
committerUlrik Svensson <ulrik@kristnet.org>
Mon, 23 Jan 2006 20:53:24 +0000 (20:53 +0000)
src/packages/kofoto/gkofoto/fullscreenwindow.py

index 5ce72b6..111d405 100644 (file)
@@ -21,6 +21,7 @@ class FullScreenWindow(gtk.Window):
         self.set_keep_above(True)
         self.set_default_size(400, 400)
         self.fullscreen()
+        self.connect_after("map-event", self._hideCursor)
         self._goto()
 
     def destroy(self):
@@ -54,6 +55,23 @@ class FullScreenWindow(gtk.Window):
             self._preload()
             self._image_view.set_image(self.get_image_async_cb)
 
+    def _hideCursor(self, *unused):
+        pix_data = """/* XPM */
+        static char * invisible_xpm[] = {
+        "1 1 1 1",
+        "       c None",
+        " "};"""
+        color = gtk.gdk.Color()
+        pix = gtk.gdk.pixmap_create_from_data(None,
+                                              pix_data,
+                                              1,
+                                              1,
+                                              1,
+                                              color,
+                                              color)
+        invisible_cursor = gtk.gdk.Cursor(pix, pix, color, color, 0, 0)
+        self.window.set_cursor(invisible_cursor)
+
     def _is_valid_index(self, index):
         return index >= 0 and index < len(self._image_versions)