[Terminal] Add mouse autohide property
authorIra W. Snyder <devel@irasnyder.com>
Mon, 14 Jan 2008 06:50:34 +0000 (22:50 -0800)
committerIra W. Snyder <devel@irasnyder.com>
Mon, 14 Jan 2008 06:50:34 +0000 (22:50 -0800)
This adds the capability to set the mouse to automatically hide itself when
typing into the terminal.

tilda-terminal.c
tilda-terminal.h

index 2619495..841b2a3 100644 (file)
@@ -127,6 +127,7 @@ enum tilda_terminal_properties {
        TILDA_TERMINAL_AUDIBLE_BELL,
        TILDA_TERMINAL_VISIBLE_BELL,
        TILDA_TERMINAL_DOUBLE_BUFFERED,
+       TILDA_TERMINAL_MOUSE_AUTOHIDE,
 };
 
 static void
@@ -295,6 +296,12 @@ tilda_terminal_set_property (GObject      *object,
                        g_print ("terminal double buffered: %d\n", self->double_buffered);
                        break;
 
+               case TILDA_TERMINAL_MOUSE_AUTOHIDE:
+                       self->mouse_autohide = g_value_get_boolean (value);
+                       vte_terminal_set_mouse_autohide (VTE_TERMINAL(self->vte_term), self->mouse_autohide);
+                       g_print ("terminal mouse autohide: %d\n", self->mouse_autohide);
+                       break;
+
                default:
                        /* We don't have this property... */
                        G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
@@ -404,6 +411,10 @@ tilda_terminal_get_property (GObject    *object,
                        g_value_set_boolean (value, self->double_buffered);
                        break;
 
+               case TILDA_TERMINAL_MOUSE_AUTOHIDE:
+                       g_value_set_boolean (value, self->mouse_autohide);
+                       break;
+
                default:
                        /* We don't have this property... */
                        G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
@@ -738,6 +749,13 @@ tilda_terminal_class_init (gpointer g_class,
        g_object_class_install_property (gobject_class,
                                                                         TILDA_TERMINAL_DOUBLE_BUFFERED,
                                                                         pspec);
+
+       pspec = g_param_spec_boolean ("mouse-autohide",
+                                                                 NULL, NULL, FALSE, G_PARAM_READWRITE);
+
+       g_object_class_install_property (gobject_class,
+                                                                        TILDA_TERMINAL_MOUSE_AUTOHIDE,
+                                                                        pspec);
 }
 
 GType
index d451ada..5bf4e06 100644 (file)
@@ -66,6 +66,7 @@ struct _TildaTerminal {
        gboolean audible_bell;
        gboolean visible_bell;
        gboolean double_buffered;
+       gboolean mouse_autohide;
 };
 
 struct _TildaTerminalClass {