gnome-terminal r2936 - trunk/src
- From: chpe svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-terminal r2936 - trunk/src
- Date: Fri, 27 Jun 2008 19:05:51 +0000 (UTC)
Author: chpe
Date: Fri Jun 27 19:05:51 2008
New Revision: 2936
URL: http://svn.gnome.org/viewvc/gnome-terminal?rev=2936&view=rev
Log:
Remove the cursor blink override code, and just use the cursor blinking setting from vte (added in bug #510903) on vte >= 0.16.15.
Modified:
trunk/src/terminal-profile.c
trunk/src/terminal-profile.h
trunk/src/terminal-screen.c
Modified: trunk/src/terminal-profile.c
==============================================================================
--- trunk/src/terminal-profile.c (original)
+++ trunk/src/terminal-profile.c Fri Jun 27 19:05:51 2008
@@ -27,6 +27,7 @@
#include <gconf/gconf-client.h>
#include <libgnome/gnome-program.h>
+#include "terminal-screen.h"
#include "terminal-intl.h"
#include "terminal-profile.h"
#include "terminal-app.h"
@@ -128,7 +129,6 @@
#define DEFAULT_BACKGROUND_IMAGE (NULL)
#define DEFAULT_BACKGROUND_TYPE (TERMINAL_BACKGROUND_SOLID)
#define DEFAULT_BACKSPACE_BINDING (VTE_ERASE_ASCII_DELETE)
-#define DEFAULT_CURSOR_BLINK_MODE (TERMINAL_CURSOR_BLINK_SYSTEM)
#define DEFAULT_CUSTOM_COMMAND ("")
#define DEFAULT_DEFAULT_SHOW_MENUBAR (TRUE)
#define DEFAULT_DELETE_BINDING (VTE_ERASE_DELETE_SEQUENCE)
@@ -155,6 +155,10 @@
#define DEFAULT_VISIBLE_NAME (N_("Unnamed"))
#define DEFAULT_WORD_CHARS ("-A-Za-z0-9,./?%&#:_")
+#if VTE_CHECK_VERSION (0, 16, 15)
+#define DEFAULT_CURSOR_BLINK_MODE (VTE_CURSOR_BLINK_SYSTEM)
+#endif
+
struct _TerminalProfilePrivate
{
GValueArray *properties;
@@ -1288,7 +1292,9 @@
TERMINAL_PROFILE_PROPERTY_ENUM (BACKGROUND_TYPE, TERMINAL_TYPE_BACKGROUND_TYPE, DEFAULT_BACKGROUND_TYPE, KEY_BACKGROUND_TYPE);
TERMINAL_PROFILE_PROPERTY_ENUM (BACKSPACE_BINDING, vte_terminal_erase_binding_get_type (), DEFAULT_BACKSPACE_BINDING, KEY_BACKSPACE_BINDING);
- TERMINAL_PROFILE_PROPERTY_ENUM (CURSOR_BLINK_MODE, TERMINAL_TYPE_CURSOR_BLINK_MODE, DEFAULT_CURSOR_BLINK_MODE, KEY_CURSOR_BLINK_MODE);
+#if VTE_CHECK_VERSION (0, 16, 15)
+ TERMINAL_PROFILE_PROPERTY_ENUM (CURSOR_BLINK_MODE, VTE_TYPE_TERMINAL_CURSOR_BLINK_MODE, DEFAULT_CURSOR_BLINK_MODE, KEY_CURSOR_BLINK_MODE);
+#endif
TERMINAL_PROFILE_PROPERTY_ENUM (DELETE_BINDING, vte_terminal_erase_binding_get_type (), DEFAULT_DELETE_BINDING, KEY_DELETE_BINDING);
TERMINAL_PROFILE_PROPERTY_ENUM (EXIT_ACTION, TERMINAL_TYPE_EXIT_ACTION, DEFAULT_EXIT_ACTION, KEY_EXIT_ACTION);
TERMINAL_PROFILE_PROPERTY_ENUM (SCROLLBAR_POSITION, TERMINAL_TYPE_SCROLLBAR_POSITION, DEFAULT_SCROLLBAR_POSITION, KEY_SCROLLBAR_POSITION);
Modified: trunk/src/terminal-profile.h
==============================================================================
--- trunk/src/terminal-profile.h (original)
+++ trunk/src/terminal-profile.h Fri Jun 27 19:05:51 2008
@@ -56,13 +56,6 @@
TERMINAL_BACKGROUND_TRANSPARENT
} TerminalBackgroundType;
-typedef enum
-{
- TERMINAL_CURSOR_BLINK_SYSTEM,
- TERMINAL_CURSOR_BLINK_ON,
- TERMINAL_CURSOR_BLINK_OFF
-} TerminalCursorBlinkMode;
-
#define TERMINAL_PALETTE_SIZE 16
#define TERMINAL_PALETTE_TANGO 0
Modified: trunk/src/terminal-screen.c
==============================================================================
--- trunk/src/terminal-screen.c (original)
+++ trunk/src/terminal-screen.c Fri Jun 27 19:05:51 2008
@@ -251,29 +251,17 @@
vte_terminal_set_background_image (terminal, NULL);
}
-static void
-terminal_screen_update_cursor_blink (TerminalScreen *screen,
- GtkSettings *settings)
-{
- TerminalScreenPrivate *priv = screen->priv;
- TerminalCursorBlinkMode mode;
- gboolean blink;
-
- mode = terminal_profile_get_property_enum (priv->profile, TERMINAL_PROFILE_CURSOR_BLINK_MODE);
- if (mode == TERMINAL_CURSOR_BLINK_SYSTEM)
- g_object_get (settings, "gtk-cursor-blink", &blink, NULL);
- else
- blink = (mode == TERMINAL_CURSOR_BLINK_ON);
-
- vte_terminal_set_cursor_blinks (VTE_TERMINAL (screen), blink);
-}
+#if !VTE_CHECK_VERSION (0, 16, 15)
static void
terminal_screen_sync_settings (GtkSettings *settings,
GParamSpec *pspec,
TerminalScreen *screen)
{
- terminal_screen_update_cursor_blink (screen, settings);
+ gboolean blink;
+
+ g_object_get (settings, "gtk-cursor-blink", &blink, NULL);
+ vte_terminal_set_cursor_blinks (VTE_TERMINAL (screen), blink);
}
static void
@@ -304,6 +292,8 @@
G_CALLBACK (terminal_screen_sync_settings), widget);
}
+#endif /* VTE < 0.16.15 */
+
static void
terminal_screen_realize (GtkWidget *widget)
{
@@ -555,7 +545,9 @@
object_class->get_property = terminal_screen_get_property;
object_class->set_property = terminal_screen_set_property;
+#if !VTE_CHECK_VERSION (0, 16, 15)
widget_class->screen_changed = terminal_screen_screen_changed;
+#endif
widget_class->realize = terminal_screen_realize;
widget_class->style_set = terminal_screen_style_set;
widget_class->drag_data_received = terminal_screen_drag_data_received;
@@ -933,8 +925,11 @@
vte_terminal_set_allow_bold (vte_terminal,
terminal_profile_get_property_boolean (profile, TERMINAL_PROFILE_ALLOW_BOLD));
+#if VTE_CHECK_VERSION (0, 16, 15)
if (!prop_name || prop_name == I_(TERMINAL_PROFILE_CURSOR_BLINK_MODE))
- terminal_screen_update_cursor_blink (screen, gtk_widget_get_settings (GTK_WIDGET (screen)));
+ vte_terminal_set_cursor_blink_mode (vte_terminal,
+ terminal_profile_get_property_enum (priv->profile, TERMINAL_PROFILE_CURSOR_BLINK_MODE));
+#endif
#if !VTE_CHECK_VERSION (0, 16, 15)
/* For bug 535552 */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]