}
}
if (outbufptr != NULL) {
- /* Emit the signal, passing the string. */
- g_signal_emit_by_name(terminal, signal, outbufptr);
- g_free(outbufptr);
+ /* Emit the signal */
+ if (strcmp(signal, "window_title_changed") == 0) {
+ g_free(terminal->window_title);
+ terminal->window_title = outbufptr;
+ }
+ else if (strcmp (signal, "icon_title_changed") == 0) {
+ g_free (terminal->icon_title);
+ terminal->icon_title = outbufptr;
+ }
+ g_signal_emit_by_name(terminal, signal);
}
}
}
GValueArray *params)
{
vte_sequence_handler_set_title_int(terminal, match, match_quark,
- params, "set_icon_title");
+ params, "icon_title_changed");
}
static void
vte_sequence_handler_set_window_title(VteTerminal *terminal,
GValueArray *params)
{
vte_sequence_handler_set_title_int(terminal, match, match_quark,
- params, "set_window_title");
+ params, "window_title_changed");
}
/* Set both the window and icon titles to the same string. */
GValueArray *params)
{
vte_sequence_handler_set_title_int(terminal, match, match_quark,
- params, "set_icon_title");
+ params, "icon_title_changed");
vte_sequence_handler_set_title_int(terminal, match, match_quark,
- params, "set_window_title");
+ params, "window_title_changed");
}
/* Restrict the scrolling region. */
static gboolean
vte_cell_is_selected(VteTerminal *terminal, long row, long col)
{
- guint scol, ecol, cclass, ccol;
- struct vte_charcell *pcell;
+ guint scol, ecol;
/* If there's nothing selected, it's an easy question to answer. */
g_return_val_if_fail(VTE_IS_TERMINAL(terminal), FALSE);
{
int fore, back, dcol;
long xcenter, ycenter, xright, ybottom;
- long delta;
gboolean drawn, reverse;
XwcTextItem textitem;
Visual *visual;
GC gc;
struct vte_charcell *cell;
- int row, drow, col, dcol, row_stop, col_stop, x_offs = 0, y_offs = 0;
- int fore, back, width, height, ascent, descent, tmp;
+ int row, drow, col, row_stop, col_stop, x_offs = 0, y_offs = 0;
+ int width, height, ascent, descent;
long delta;
- XwcTextItem textitem;
#ifdef HAVE_XFT
XftDraw *ftdraw = NULL;
#endif
NULL,
_vte_marshal_VOID__VOID,
G_TYPE_NONE, 0);
- klass->set_window_title_signal =
- g_signal_new("set_window_title",
+ klass->window_title_changed_signal =
+ g_signal_new("window_title_changed",
G_OBJECT_CLASS_TYPE(klass),
G_SIGNAL_RUN_LAST,
0,
NULL,
NULL,
- _vte_marshal_VOID__STRING,
- G_TYPE_NONE, 1, G_TYPE_STRING);
- klass->set_icon_title_signal =
- g_signal_new("set_icon_title",
+ _vte_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+ klass->icon_title_changed_signal =
+ g_signal_new("icon_title_changed",
G_OBJECT_CLASS_TYPE(klass),
G_SIGNAL_RUN_LAST,
0,
NULL,
NULL,
- _vte_marshal_VOID__STRING,
- G_TYPE_NONE, 1, G_TYPE_STRING);
+ _vte_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
klass->char_size_changed_signal =
g_signal_new("char_size_changed",
G_OBJECT_CLASS_TYPE(klass),
#include "vte.h"
static void
-set_window_title(GtkWidget *widget, const char *title, gpointer win)
+window_title_changed(GtkWidget *widget, gpointer win)
{
GtkWindow *window;
+
g_return_if_fail(VTE_TERMINAL(widget));
g_return_if_fail(GTK_IS_WINDOW(win));
- g_return_if_fail(title != NULL);
+ g_return_if_fail(VTE_TERMINAL (widget)->window_title != NULL);
window = GTK_WINDOW(win);
- gtk_window_set_title(window, title);
+
+ gtk_window_set_title(window, VTE_TERMINAL (widget)->window_title);
}
static void
g_signal_connect_object(G_OBJECT(widget), "char_size_changed",
G_CALLBACK(char_size_changed), window, 0);
- /* Connect to the "set_window_title" signal to set the main window's
- * title. */
- g_signal_connect(G_OBJECT(widget), "set_window_title",
- G_CALLBACK(set_window_title), window);
+ /* Connect to the "window_title_changed" signal to set the main
+ * window's title. */
+ g_signal_connect(G_OBJECT(widget), "window_title_changed",
+ G_CALLBACK(window_title_changed), window);
/* Connect to the "eof" signal to quit when the session ends. */
g_signal_connect(G_OBJECT(widget), "eof",