[Xfce4-commits] <xfce4-terminal:master> Rename $TERM to emulation.
Nick Schermer
noreply at xfce.org
Mon Dec 31 13:02:02 CET 2012
Updating branch refs/heads/master
to e4842bc7c48db97f9d6d381dfb0439221146fe03 (commit)
from ff74401cc1b01eb1033ec9464abfc82bd7d34460 (commit)
commit e4842bc7c48db97f9d6d381dfb0439221146fe03
Author: Nick Schermer <nick at xfce.org>
Date: Mon Dec 31 13:01:27 2012 +0100
Rename $TERM to emulation.
To avoid confusion and migration problems for people
abusing $TERM.
terminal/terminal-preferences-dialog.c | 4 ++--
terminal/terminal-preferences.c | 10 +++++-----
terminal/terminal-preferences.glade | 6 +++---
terminal/terminal-screen.c | 21 ++++++++++-----------
terminal/terminal-util.c | 4 ++++
5 files changed, 24 insertions(+), 21 deletions(-)
diff --git a/terminal/terminal-preferences-dialog.c b/terminal/terminal-preferences-dialog.c
index b4fff81..fb02548 100644
--- a/terminal/terminal-preferences-dialog.c
+++ b/terminal/terminal-preferences-dialog.c
@@ -211,7 +211,7 @@ error:
/* other properties */
BIND_PROPERTIES ("font-name", "font-name");
BIND_PROPERTIES ("title-initial", "text");
- BIND_PROPERTIES ("term", "text");
+ BIND_PROPERTIES ("emulation", "text");
BIND_PROPERTIES ("word-chars", "text");
BIND_PROPERTIES ("scrolling-lines", "value");
BIND_PROPERTIES ("tab-activity-timeout", "value");
@@ -632,7 +632,7 @@ terminal_preferences_dialog_reset_compat (GtkWidget *button,
{
GParamSpec *spec;
GValue value = { 0, };
- const gchar *properties[] = { "binding-backspace", "binding-delete", "term" };
+ const gchar *properties[] = { "binding-backspace", "binding-delete", "emulation" };
guint i;
for (i = 0; i < G_N_ELEMENTS (properties); i++)
diff --git a/terminal/terminal-preferences.c b/terminal/terminal-preferences.c
index 0f08c9b..e3e3340 100644
--- a/terminal/terminal-preferences.c
+++ b/terminal/terminal-preferences.c
@@ -100,7 +100,7 @@ enum
PROP_SHORTCUTS_NO_MNEMONICS,
PROP_TITLE_INITIAL,
PROP_TITLE_MODE,
- PROP_TERM,
+ PROP_EMULATION,
PROP_WORD_CHARS,
PROP_TAB_ACTIVITY_COLOR,
PROP_TAB_ACTIVITY_TIMEOUT,
@@ -892,12 +892,12 @@ terminal_preferences_class_init (TerminalPreferencesClass *klass)
G_PARAM_READWRITE| G_PARAM_STATIC_STRINGS);
/**
- * TerminalPreferences:term:
+ * TerminalPreferences:emulation:
**/
- preferences_props[PROP_TERM] =
- g_param_spec_string ("term",
+ preferences_props[PROP_EMULATION] =
+ g_param_spec_string ("emulation",
NULL,
- "Term",
+ "Emulation",
"xterm",
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
diff --git a/terminal/terminal-preferences.glade b/terminal/terminal-preferences.glade
index ffcef44..f41cdc4 100644
--- a/terminal/terminal-preferences.glade
+++ b/terminal/terminal-preferences.glade
@@ -2385,9 +2385,9 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
- <property name="label" translatable="yes">$TERM s_etting:</property>
+ <property name="label" translatable="yes">Emulation s_etting:</property>
<property name="use_underline">True</property>
- <property name="mnemonic_widget">term</property>
+ <property name="mnemonic_widget">emulation</property>
</object>
<packing>
<property name="top_attach">3</property>
@@ -2457,7 +2457,7 @@
</packing>
</child>
<child>
- <object class="GtkEntry" id="term">
+ <object class="GtkEntry" id="emulation">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char">•</property>
diff --git a/terminal/terminal-screen.c b/terminal/terminal-screen.c
index 283487b..9f03b21 100644
--- a/terminal/terminal-screen.c
+++ b/terminal/terminal-screen.c
@@ -124,7 +124,7 @@ static void terminal_screen_update_encoding (TerminalScreen
static void terminal_screen_update_colors (TerminalScreen *screen);
static void terminal_screen_update_font (TerminalScreen *screen);
static void terminal_screen_update_misc_bell (TerminalScreen *screen);
-static void terminal_screen_update_term (TerminalScreen *screen);
+static void terminal_screen_update_emulation (TerminalScreen *screen);
static void terminal_screen_update_misc_cursor_blinks (TerminalScreen *screen);
static void terminal_screen_update_misc_cursor_shape (TerminalScreen *screen);
static void terminal_screen_update_misc_mouse_autohide (TerminalScreen *screen);
@@ -298,7 +298,7 @@ terminal_screen_init (TerminalScreen *screen)
terminal_screen_update_encoding (screen);
terminal_screen_update_font (screen);
terminal_screen_update_misc_bell (screen);
- terminal_screen_update_term (screen);
+ terminal_screen_update_emulation (screen);
terminal_screen_update_misc_cursor_blinks (screen);
terminal_screen_update_misc_cursor_shape (screen);
terminal_screen_update_misc_mouse_autohide (screen);
@@ -491,8 +491,8 @@ terminal_screen_preferences_changed (TerminalPreferences *preferences,
terminal_screen_update_font (screen);
else if (strcmp ("misc-bell", name) == 0)
terminal_screen_update_misc_bell (screen);
- else if (strcmp ("term", name) == 0)
- terminal_screen_update_term (screen);
+ else if (strcmp ("emulation", name) == 0)
+ terminal_screen_update_emulation (screen);
else if (strcmp ("misc-cursor-blinks", name) == 0)
terminal_screen_update_misc_cursor_blinks (screen);
else if (strcmp ("misc-cursor-shape", name) == 0)
@@ -719,7 +719,6 @@ terminal_screen_get_child_environment (TerminalScreen *screen)
if (strcmp (*p, "COLUMNS") == 0
|| strcmp (*p, "LINES") == 0
|| strcmp (*p, "WINDOWID") == 0
- || strcmp (*p, "TERM") == 0
|| strcmp (*p, "GNOME_DESKTOP_ICON") == 0
|| strcmp (*p, "COLORTERM") == 0
|| strcmp (*p, "DISPLAY") == 0)
@@ -1015,13 +1014,13 @@ terminal_screen_update_misc_bell (TerminalScreen *screen)
static void
-terminal_screen_update_term (TerminalScreen *screen)
+terminal_screen_update_emulation (TerminalScreen *screen)
{
- gchar *term;
- g_object_get (G_OBJECT (screen->preferences), "term", &term, NULL);
- if (g_strcmp0 (term, vte_terminal_get_emulation (VTE_TERMINAL (screen->terminal))) != 0)
- vte_terminal_set_emulation (VTE_TERMINAL (screen->terminal), term);
- g_free (term);
+ gchar *emulation;
+ g_object_get (G_OBJECT (screen->preferences), "emulation", &emulation, NULL);
+ if (g_strcmp0 (emulation, vte_terminal_get_emulation (VTE_TERMINAL (screen->terminal))) != 0)
+ vte_terminal_set_emulation (VTE_TERMINAL (screen->terminal), emulation);
+ g_free (emulation);
}
diff --git a/terminal/terminal-util.c b/terminal/terminal-util.c
index ab76910..8419d56 100644
--- a/terminal/terminal-util.c
+++ b/terminal/terminal-util.c
@@ -116,6 +116,10 @@ terminal_util_activate_window (GtkWindow *window)
terminal_return_if_fail (GTK_IS_WINDOW (window));
terminal_return_if_fail (gtk_widget_get_realized (GTK_WIDGET (window)));
+ /* leave if the window is already active */
+ if (gtk_window_is_active (window))
+ return;
+
/* we need a slightly custom version of the call through Gtk+ to
* properly focus the panel when a plugin calls
* xfce_panel_plugin_focus_widget() */
More information about the Xfce4-commits
mailing list