Skip to content

Commit

Permalink
widget: Emit title-changed and uri-changed only if the value really c…
Browse files Browse the repository at this point in the history
…hanged

https://bugzilla.gnome.org/show_bug.cgi?id=782863
(cherry picked from commit 9bc33bd)
  • Loading branch information
egmontkob authored and Christian Persch committed Oct 30, 2017
1 parent 9bb20ba commit 8de154e
Showing 1 changed file with 29 additions and 16 deletions.
45 changes: 29 additions & 16 deletions src/vte.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10630,51 +10630,64 @@ VteTerminalPrivate::emit_pending_signals()
{
GObject *object = G_OBJECT(m_terminal);
g_object_freeze_notify(object);
gboolean really_changed;

emit_adjustment_changed();

if (m_window_title_changed) {
really_changed = (g_strcmp0(m_window_title, m_window_title_changed) != 0);
g_free (m_window_title);
m_window_title = m_window_title_changed;
m_window_title_changed = NULL;

_vte_debug_print(VTE_DEBUG_SIGNALS,
"Emitting `window-title-changed'.\n");
g_signal_emit(object, signals[SIGNAL_WINDOW_TITLE_CHANGED], 0);
g_object_notify_by_pspec(object, pspecs[PROP_WINDOW_TITLE]);
if (really_changed) {
_vte_debug_print(VTE_DEBUG_SIGNALS,
"Emitting `window-title-changed'.\n");
g_signal_emit(object, signals[SIGNAL_WINDOW_TITLE_CHANGED], 0);
g_object_notify_by_pspec(object, pspecs[PROP_WINDOW_TITLE]);
}
}

if (m_icon_title_changed) {
really_changed = (g_strcmp0(m_icon_title, m_icon_title_changed) != 0);
g_free (m_icon_title);
m_icon_title = m_icon_title_changed;
m_icon_title_changed = NULL;

_vte_debug_print(VTE_DEBUG_SIGNALS,
"Emitting `icon-title-changed'.\n");
g_signal_emit(object, signals[SIGNAL_ICON_TITLE_CHANGED], 0);
g_object_notify_by_pspec(object, pspecs[PROP_ICON_TITLE]);
if (really_changed) {
_vte_debug_print(VTE_DEBUG_SIGNALS,
"Emitting `icon-title-changed'.\n");
g_signal_emit(object, signals[SIGNAL_ICON_TITLE_CHANGED], 0);
g_object_notify_by_pspec(object, pspecs[PROP_ICON_TITLE]);
}
}

if (m_current_directory_uri_changed) {
really_changed = (g_strcmp0(m_current_directory_uri, m_current_directory_uri_changed) != 0);
g_free (m_current_directory_uri);
m_current_directory_uri = m_current_directory_uri_changed;
m_current_directory_uri_changed = NULL;

_vte_debug_print(VTE_DEBUG_SIGNALS,
"Emitting `current-directory-uri-changed'.\n");
g_signal_emit(object, signals[SIGNAL_CURRENT_DIRECTORY_URI_CHANGED], 0);
g_object_notify_by_pspec(object, pspecs[PROP_CURRENT_DIRECTORY_URI]);
if (really_changed) {
_vte_debug_print(VTE_DEBUG_SIGNALS,
"Emitting `current-directory-uri-changed'.\n");
g_signal_emit(object, signals[SIGNAL_CURRENT_DIRECTORY_URI_CHANGED], 0);
g_object_notify_by_pspec(object, pspecs[PROP_CURRENT_DIRECTORY_URI]);
}
}

if (m_current_file_uri_changed) {
really_changed = (g_strcmp0(m_current_file_uri, m_current_file_uri_changed) != 0);
g_free (m_current_file_uri);
m_current_file_uri = m_current_file_uri_changed;
m_current_file_uri_changed = NULL;

_vte_debug_print(VTE_DEBUG_SIGNALS,
"Emitting `current-file-uri-changed'.\n");
g_signal_emit(object, signals[SIGNAL_CURRENT_FILE_URI_CHANGED], 0);
g_object_notify_by_pspec(object, pspecs[PROP_CURRENT_FILE_URI]);
if (really_changed) {
_vte_debug_print(VTE_DEBUG_SIGNALS,
"Emitting `current-file-uri-changed'.\n");
g_signal_emit(object, signals[SIGNAL_CURRENT_FILE_URI_CHANGED], 0);
g_object_notify_by_pspec(object, pspecs[PROP_CURRENT_FILE_URI]);
}
}

/* Flush any pending "inserted" signals. */
Expand Down

0 comments on commit 8de154e

Please sign in to comment.