[vte] emulation: Remove support for window control sequences
- From: Christian Persch <chpe src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vte] emulation: Remove support for window control sequences
- Date: Sun, 24 Nov 2019 18:15:49 +0000 (UTC)
commit 26bc760d0944232e2d18640b294edf058c9a936c
Author: Christian Persch <chpe src gnome org>
Date: Sun Nov 24 19:15:34 2019 +0100
emulation: Remove support for window control sequences
Remove support for raising/lowering, iconify/deiconify and maximise/restore,
and to move the window.
Remove support for refresh. Vte tracks which areas need to be repainted; so
there is *never* a need for the application to tell vte to repaint everything.
https://gitlab.gnome.org/GNOME/vte/issues/128
src/vte.cc | 3 ++
src/vtegtk.cc | 32 +++++++++++----
src/vteinternal.hh | 12 ++----
src/vteseq.cc | 115 ++++-------------------------------------------------
4 files changed, 37 insertions(+), 125 deletions(-)
---
diff --git a/src/vte.cc b/src/vte.cc
index 48ac2205..78181688 100644
--- a/src/vte.cc
+++ b/src/vte.cc
@@ -10045,6 +10045,9 @@ Terminal::reset(bool clear_tabstops,
/* Cause everything to be redrawn (or cleared). */
invalidate_all();
+ /* Reset XTerm window controls */
+ m_xterm_wm_iconified = false;
+
g_object_thaw_notify(object);
}
diff --git a/src/vtegtk.cc b/src/vtegtk.cc
index a20a0e75..06116306 100644
--- a/src/vtegtk.cc
+++ b/src/vtegtk.cc
@@ -1054,7 +1054,9 @@ vte_terminal_class_init(VteTerminalClass *klass)
* VteTerminal::deiconify-window:
* @vteterminal: the object which received the signal
*
- * Emitted at the child application's request.
+ * Never emitted.
+ *
+ * Deprecated: 0.60
*/
signals[SIGNAL_DEICONIFY_WINDOW] =
g_signal_new(I_("deiconify-window"),
@@ -1073,7 +1075,9 @@ vte_terminal_class_init(VteTerminalClass *klass)
* VteTerminal::iconify-window:
* @vteterminal: the object which received the signal
*
- * Emitted at the child application's request.
+ * Never emitted.
+ *
+ * Deprecated: 0.60
*/
signals[SIGNAL_ICONIFY_WINDOW] =
g_signal_new(I_("iconify-window"),
@@ -1092,7 +1096,9 @@ vte_terminal_class_init(VteTerminalClass *klass)
* VteTerminal::raise-window:
* @vteterminal: the object which received the signal
*
- * Emitted at the child application's request.
+ * Never emitted.
+ *
+ * Deprecated: 0.60
*/
signals[SIGNAL_RAISE_WINDOW] =
g_signal_new(I_("raise-window"),
@@ -1111,7 +1117,9 @@ vte_terminal_class_init(VteTerminalClass *klass)
* VteTerminal::lower-window:
* @vteterminal: the object which received the signal
*
- * Emitted at the child application's request.
+ * Never emitted.
+ *
+ * Deprecated: 0.60
*/
signals[SIGNAL_LOWER_WINDOW] =
g_signal_new(I_("lower-window"),
@@ -1130,7 +1138,9 @@ vte_terminal_class_init(VteTerminalClass *klass)
* VteTerminal::refresh-window:
* @vteterminal: the object which received the signal
*
- * Emitted at the child application's request.
+ * Never emitted.
+ *
+ * Deprecated: 0.60
*/
signals[SIGNAL_REFRESH_WINDOW] =
g_signal_new(I_("refresh-window"),
@@ -1149,7 +1159,9 @@ vte_terminal_class_init(VteTerminalClass *klass)
* VteTerminal::restore-window:
* @vteterminal: the object which received the signal
*
- * Emitted at the child application's request.
+ * Never emitted.
+ *
+ * Deprecated: 0.60
*/
signals[SIGNAL_RESTORE_WINDOW] =
g_signal_new(I_("restore-window"),
@@ -1168,7 +1180,9 @@ vte_terminal_class_init(VteTerminalClass *klass)
* VteTerminal::maximize-window:
* @vteterminal: the object which received the signal
*
- * Emitted at the child application's request.
+ * Never emitted.
+ *
+ * Deprecated: 0.60
*/
signals[SIGNAL_MAXIMIZE_WINDOW] =
g_signal_new(I_("maximize-window"),
@@ -1210,7 +1224,9 @@ vte_terminal_class_init(VteTerminalClass *klass)
* @x: the terminal's desired location, X coordinate
* @y: the terminal's desired location, Y coordinate
*
- * Emitted at the child application's request.
+ * Never emitted.
+ *
+ * Deprecated: 0.60
*/
signals[SIGNAL_MOVE_WINDOW] =
g_signal_new(I_("move-window"),
diff --git a/src/vteinternal.hh b/src/vteinternal.hh
index 2d580f12..dc30b111 100644
--- a/src/vteinternal.hh
+++ b/src/vteinternal.hh
@@ -1126,15 +1126,9 @@ public:
void emit_increase_font_size();
void emit_decrease_font_size();
void emit_bell();
- void emit_deiconify_window();
- void emit_iconify_window();
- void emit_raise_window();
- void emit_lower_window();
- void emit_maximize_window();
- void emit_refresh_window();
- void emit_restore_window();
- void emit_move_window(guint x,
- guint y);
+
+ bool m_xterm_wm_iconified{false};
+
void emit_resize_window(guint columns,
guint rows);
void emit_copy_clipboard();
diff --git a/src/vteseq.cc b/src/vteseq.cc
index 65831ba3..3159c46a 100644
--- a/src/vteseq.cc
+++ b/src/vteseq.cc
@@ -206,71 +206,6 @@ Terminal::emit_bell()
g_signal_emit(m_terminal, signals[SIGNAL_BELL], 0);
}
-/* Emit a "deiconify-window" signal. */
-void
-Terminal::emit_deiconify_window()
-{
- _vte_debug_print(VTE_DEBUG_SIGNALS, "Emitting `deiconify-window'.\n");
- g_signal_emit(m_terminal, signals[SIGNAL_DEICONIFY_WINDOW], 0);
-}
-
-/* Emit a "iconify-window" signal. */
-void
-Terminal::emit_iconify_window()
-{
- _vte_debug_print(VTE_DEBUG_SIGNALS, "Emitting `iconify-window'.\n");
- g_signal_emit(m_terminal, signals[SIGNAL_ICONIFY_WINDOW], 0);
-}
-
-/* Emit a "raise-window" signal. */
-void
-Terminal::emit_raise_window()
-{
- _vte_debug_print(VTE_DEBUG_SIGNALS, "Emitting `raise-window'.\n");
- g_signal_emit(m_terminal, signals[SIGNAL_RAISE_WINDOW], 0);
-}
-
-/* Emit a "lower-window" signal. */
-void
-Terminal::emit_lower_window()
-{
- _vte_debug_print(VTE_DEBUG_SIGNALS, "Emitting `lower-window'.\n");
- g_signal_emit(m_terminal, signals[SIGNAL_LOWER_WINDOW], 0);
-}
-
-/* Emit a "maximize-window" signal. */
-void
-Terminal::emit_maximize_window()
-{
- _vte_debug_print(VTE_DEBUG_SIGNALS, "Emitting `maximize-window'.\n");
- g_signal_emit(m_terminal, signals[SIGNAL_MAXIMIZE_WINDOW], 0);
-}
-
-/* Emit a "refresh-window" signal. */
-void
-Terminal::emit_refresh_window()
-{
- _vte_debug_print(VTE_DEBUG_SIGNALS, "Emitting `refresh-window'.\n");
- g_signal_emit(m_terminal, signals[SIGNAL_REFRESH_WINDOW], 0);
-}
-
-/* Emit a "restore-window" signal. */
-void
-Terminal::emit_restore_window()
-{
- _vte_debug_print(VTE_DEBUG_SIGNALS, "Emitting `restore-window'.\n");
- g_signal_emit(m_terminal, signals[SIGNAL_RESTORE_WINDOW], 0);
-}
-
-/* Emit a "move-window" signal. (Pixels.) */
-void
-Terminal::emit_move_window(guint x,
- guint y)
-{
- _vte_debug_print(VTE_DEBUG_SIGNALS, "Emitting `move-window'.\n");
- g_signal_emit(m_terminal, signals[SIGNAL_MOVE_WINDOW], 0, x, y);
-}
-
/* Emit a "resize-window" signal. (Grid size.) */
void
Terminal::emit_resize_window(guint columns,
@@ -8649,24 +8584,16 @@ Terminal::XTERM_WM(vte::parser::Sequence const& seq)
break;
case VTE_XTERM_WM_RESTORE_WINDOW:
- _vte_debug_print(VTE_DEBUG_EMULATION, "Deiconifying window.\n");
- emit_deiconify_window();
+ m_xterm_wm_iconified = false;
break;
case VTE_XTERM_WM_MINIMIZE_WINDOW:
- _vte_debug_print(VTE_DEBUG_EMULATION, "Iconifying window.\n");
- emit_iconify_window();
+ m_xterm_wm_iconified = true;
break;
- case VTE_XTERM_WM_SET_WINDOW_POSITION: {
- int pos_x = seq.collect1(1, 0);
- int pos_y = seq.collect1(2, 0);
-
- _vte_debug_print(VTE_DEBUG_EMULATION,
- "Moving window to %d,%d.\n", pos_x, pos_y);
- emit_move_window(pos_x, pos_y);
+ case VTE_XTERM_WM_SET_WINDOW_POSITION:
+ /* No-op */
break;
- }
case VTE_XTERM_WM_SET_WINDOW_SIZE_PIXELS: {
int width, height;
@@ -8683,19 +8610,12 @@ Terminal::XTERM_WM(vte::parser::Sequence const& seq)
}
case VTE_XTERM_WM_RAISE_WINDOW:
- _vte_debug_print(VTE_DEBUG_EMULATION, "Raising window.\n");
- emit_raise_window();
break;
case VTE_XTERM_WM_LOWER_WINDOW:
- _vte_debug_print(VTE_DEBUG_EMULATION, "Lowering window.\n");
- emit_lower_window();
break;
case VTE_XTERM_WM_REFRESH_WINDOW:
- _vte_debug_print(VTE_DEBUG_EMULATION, "Refreshing window.\n");
- invalidate_all();
- emit_refresh_window();
break;
case VTE_XTERM_WM_SET_WINDOW_SIZE_CELLS: {
@@ -8716,13 +8636,9 @@ Terminal::XTERM_WM(vte::parser::Sequence const& seq)
case -1: /* default */
case 0:
/* Restore */
- _vte_debug_print(VTE_DEBUG_EMULATION, "Restoring window.\n");
- emit_restore_window();
break;
case 1:
/* Maximise */
- _vte_debug_print(VTE_DEBUG_EMULATION, "Maximizing window.\n");
- emit_maximize_window();
break;
case 2:
/* Maximise Vertically */
@@ -8739,39 +8655,22 @@ Terminal::XTERM_WM(vte::parser::Sequence const& seq)
break;
case VTE_XTERM_WM_GET_WINDOW_STATE:
- /* If we're unmapped, then we're iconified. */
- _vte_debug_print(VTE_DEBUG_EMULATION,
- "Reporting window state %siconified.\n",
- gtk_widget_get_mapped(m_widget) ? "non-" : "");
-
- reply(seq, VTE_REPLY_XTERM_WM,
- {gtk_widget_get_mapped(m_widget) ? 1 : 2});
+ reply(seq, VTE_REPLY_XTERM_WM, {m_xterm_wm_iconified ? 2 : 1});
break;
- case VTE_XTERM_WM_GET_WINDOW_POSITION: {
- /* Send window location, in pixels. Reply with fixed origin. */
+ case VTE_XTERM_WM_GET_WINDOW_POSITION:
+ /* Reply with fixed origin. */
reply(seq, VTE_REPLY_XTERM_WM, {3, 0, 0});
break;
- }
case VTE_XTERM_WM_GET_WINDOW_SIZE_PIXELS: {
- /* Send window size, in pixels. */
int width = m_row_count * m_cell_height;
int height = m_column_count * m_cell_width;
- _vte_debug_print(VTE_DEBUG_EMULATION,
- "Reporting window size (%dx%d)\n",
- width, height);
-
reply(seq, VTE_REPLY_XTERM_WM, {4, height, width});
break;
}
case VTE_XTERM_WM_GET_WINDOW_SIZE_CELLS:
- /* Send widget size, in cells. */
- _vte_debug_print(VTE_DEBUG_EMULATION,
- "Reporting widget size %ldx%ld\n",
- m_row_count, m_column_count);
-
reply(seq, VTE_REPLY_XTERM_WM,
{8, (int)m_row_count, (int)m_column_count});
break;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]