Skip to content
Commits on Source (9)
commit e86822b8b7013f96f3b3d2d86839395492cb1470
Author: Christian Persch <chpe@src.gnome.org>
Date: Thu Apr 13 11:56:32 2023 +0200
widget: Fix compilation
... somehow the last commit was incompletely committer.
Fixes: https://gitlab.gnome.org/GNOME/gnome-terminal/-/issues/7975
(cherry picked from commit a50cfaa7cb76d7486a45869b948cbcb8239d2fba)
src/clipboard-gtk.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
commit a276c1e0af092dac8bc944521d6ea95b83280bc8
Author: Christian Persch <chpe@src.gnome.org>
Date: Tue Apr 11 20:54:44 2023 +0200
widget: Fix setting clipboard with html data
Fixes: https://gitlab.gnome.org/GNOME/gnome-terminal/-/issues/7975
(cherry picked from commit 587873b5cd4cedff259d32e37a37f11562f6dc11)
src/clipboard-gtk.cc | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
commit 3960fee241f39af6aeeff008a07796854e9b51f7
Author: Eric Johnson <yut23@gvljohnsons.com>
Date: Wed Apr 5 19:10:57 2023 +0200
emulation: Fix invalid mouse scroll event on window edge
Fixes: https://gitlab.gnome.org/GNOME/vte/-/issues/2621
(cherry picked from commit 19acc51708d9e75ef2b314aa026467570e0bd8ee)
src/vte.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
commit f6a26324e9f799a96d69a5887c1a8f2761577166
Author: Christian Persch <chpe@src.gnome.org>
Date: Wed Apr 5 19:10:57 2023 +0200
widget: Fix introspection warnings
(cherry picked from commit 0cade2cf3713142e0fc606936066b840fc22287c)
src/vtegtk.cc | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
commit c4e8371fe65fdb3ea4c81c838d8373444e6d3400
Author: Christian Persch <chpe@src.gnome.org>
Date: Wed Apr 5 19:10:57 2023 +0200
widget: Fix cursor blink timeout
Fix s/ms confusion to make the cursor stop blinking correctly.
Fixes: https://gitlab.gnome.org/GNOME/vte/-/issues/2622
(cherry picked from commit 4da9d055f68f5b5dad9946b289a1836bd7c0fe8d)
src/vte.cc | 30 ++++++++++++++++--------------
src/vteinternal.hh | 12 ++++++------
src/widget.cc | 12 ++++++------
3 files changed, 28 insertions(+), 26 deletions(-)
commit 307a7363cbee8a84ed569bc07593721f9f7d10ae
Author: Alexander Shopov <ash@kambanaria.org>
Date: Fri Mar 31 10:11:16 2023 +0000
Update Bulgarian translation
po/bg.po | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
commit 74690487dee2d77a140662606519cb277579c05f
Author: Alexander Shopov <ash@kambanaria.org>
Date: Fri Mar 31 10:08:45 2023 +0000
Update Bulgarian translation
po/bg.po | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
commit 549de1ba5f4fc106692320ed675a9bb5aa17b3b1
Author: Christian Persch <chpe@src.gnome.org>
Date: Sat Mar 18 10:56:15 2023 +0100
build: Post release version bump
meson.build | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
commit 164c0f1eb5165786e0addfe5317cf6de3061ddf9
Author: Christian Persch <chpe@src.gnome.org>
Date: Sat Mar 11 11:19:11 2023 +0100
......@@ -17,7 +17,7 @@
project(
'vte',
['c', 'cpp'],
version: '0.72.0',
version: '0.72.1',
license: ['LGPL-3.0-or-later', 'GPL-3.0-or-later'],
default_options: [
'buildtype=release',
......
# Bulgarian translation of vte po-file.
# Copyright (C) 2002, 2007, 2007, 2010, 2014, 2017 Free Software Foundation, Inc.
# Copyright (C) 2021 Alexander Shopov.
# Copyright (C) 2021, 2023 Alexander Shopov.
# This file is distributed under the same license as the vte package.
# Alexander Shopov <ash@kambanaria.org>, 2002, 2007, 2010, 2014, 2017.
# Alexander Shopov <ash@kambanaria.org>, 2021.
# Alexander Shopov <ash@kambanaria.org>, 2021, 2023.
# Vladimir "Kaladan" Petkov <vpetkov@i-space.org>, 2005.
# Yavor Doganov <yavor@doganov.org>, 2005.
#
......@@ -50,7 +50,7 @@ msgstr "Действието е отменено"
#: src/spawn.cc:190
#, c-format
msgid "Failed to read from child pipe (%s)"
msgstr "Грешка при четене от дъщерния процес (%s)"
msgstr "Неуспешно четене от дъщерен канал (%s)"
#: src/spawn.cc:620
#, c-format
......
......@@ -113,19 +113,22 @@ private:
break;
case ClipboardFormat::HTML: {
auto const type = gtk_selection_data_get_data_type(data);
auto const target = gtk_selection_data_get_target(data);
if (type == gdk_atom_intern_static_string(MIME_TYPE_TEXT_HTML_UTF8)) {
if (target == gdk_atom_intern_static_string(MIME_TYPE_TEXT_HTML_UTF8)) {
// This makes yet another copy of the data... :(
gtk_selection_data_set_text(data, str->data(), str->size());
} else if (type == gdk_atom_intern_static_string(MIME_TYPE_TEXT_HTML_UTF16)) {
gtk_selection_data_set(data,
target,
8,
reinterpret_cast<guchar const*>(str->data()),
str->size());
} else if (target == gdk_atom_intern_static_string(MIME_TYPE_TEXT_HTML_UTF16)) {
auto [html, len] = text_to_utf16_mozilla(*str);
// This makes yet another copy of the data... :(
if (html) {
gtk_selection_data_set(data,
gtk_selection_data_get_target(data),
// or gdk_atom_intern_static_string("text/html"),
target,
16,
reinterpret_cast<guchar const*>(html.get()),
len);
......
......@@ -840,19 +840,20 @@ bool
Terminal::cursor_blink_timer_callback()
{
m_cursor_blink_state = !m_cursor_blink_state;
m_cursor_blink_time += m_cursor_blink_cycle;
m_cursor_blink_time_ms += m_cursor_blink_cycle_ms;
invalidate_cursor_once(true);
/* only disable the blink if the cursor is currently shown.
* else, wait until next time.
*/
if (m_cursor_blink_time / 1000 >= m_cursor_blink_timeout &&
if (m_cursor_blink_time_ms >= m_cursor_blink_timeout_ms &&
m_cursor_blink_state) {
return false;
}
m_cursor_blink_timer.schedule(m_cursor_blink_cycle, vte::glib::Timer::Priority::eLOW);
m_cursor_blink_timer.schedule(m_cursor_blink_cycle_ms,
vte::glib::Timer::Priority::eLOW);
return false;
}
......@@ -4471,8 +4472,9 @@ Terminal::add_cursor_timeout()
if (m_cursor_blink_timer)
return; /* already added */
m_cursor_blink_time = 0;
m_cursor_blink_timer.schedule(m_cursor_blink_cycle, vte::glib::Timer::Priority::eLOW);
m_cursor_blink_time_ms = 0;
m_cursor_blink_timer.schedule(m_cursor_blink_cycle_ms,
vte::glib::Timer::Priority::eLOW);
}
void
......@@ -7901,17 +7903,17 @@ Terminal::widget_unrealize()
void
Terminal::set_blink_settings(bool blink,
int blink_time,
int blink_timeout) noexcept
int blink_time_ms,
int blink_timeout_ms) noexcept
{
m_cursor_blinks = m_cursor_blinks_system = blink;
m_cursor_blink_cycle = std::max(blink_time / 2, VTE_MIN_CURSOR_BLINK_CYCLE);
m_cursor_blink_timeout = std::max(blink_timeout, VTE_MIN_CURSOR_BLINK_TIMEOUT);
m_cursor_blink_cycle_ms = std::max(blink_time_ms / 2, VTE_MIN_CURSOR_BLINK_CYCLE);
m_cursor_blink_timeout_ms = std::max(blink_timeout_ms, VTE_MIN_CURSOR_BLINK_TIMEOUT);
update_cursor_blinks();
/* Misuse gtk-cursor-blink-time for text blinking as well. This might change in the future. */
m_text_blink_cycle = m_cursor_blink_cycle;
m_text_blink_cycle_ms = m_cursor_blink_cycle_ms;
if (m_text_blink_timer) {
/* The current phase might have changed, and an already installed
* timer to blink might fire too late. So remove the timer and
......@@ -9247,7 +9249,7 @@ Terminal::draw(cairo_t* cr,
int allocated_width, allocated_height;
int extra_area_for_cursor;
bool text_blink_enabled_now;
gint64 now = 0;
auto now_ms = int64_t{0};
allocated_width = get_allocated_width();
allocated_height = get_allocated_height();
......@@ -9293,8 +9295,8 @@ Terminal::draw(cairo_t* cr,
m_text_blink_state = true;
text_blink_enabled_now = (unsigned)m_text_blink_mode & (unsigned)(m_has_focus ? TextBlinkMode::eFOCUSED : TextBlinkMode::eUNFOCUSED);
if (text_blink_enabled_now) {
now = g_get_monotonic_time() / 1000;
if (now % (m_text_blink_cycle * 2) >= m_text_blink_cycle)
now_ms = g_get_monotonic_time() / 1000;
if (now_ms % (m_text_blink_cycle_ms * 2) >= m_text_blink_cycle_ms)
m_text_blink_state = false;
}
/* Painting will flip this if it encounters any cell with blink attribute */
......@@ -9345,7 +9347,7 @@ Terminal::draw(cairo_t* cr,
* implicitly by the timer not getting reinstalled anymore (often after a final unnecessary but
* harmless repaint). */
if (G_UNLIKELY (m_text_to_blink && text_blink_enabled_now && !m_text_blink_timer))
m_text_blink_timer.schedule(m_text_blink_cycle - now % m_text_blink_cycle,
m_text_blink_timer.schedule(m_text_blink_cycle_ms - now_ms % m_text_blink_cycle_ms,
vte::glib::Timer::Priority::eLOW);
m_invalidated_all = FALSE;
......@@ -9417,7 +9419,7 @@ Terminal::widget_mouse_scroll(vte::platform::ScrollEvent const& event)
cnt = -cnt;
for (i = 0; i < cnt; i++) {
/* Encode the parameters and send them to the app. */
feed_mouse_event(grid_coords_from_view_coords(m_mouse_last_position),
feed_mouse_event(confined_grid_coords_from_view_coords(m_mouse_last_position),
button,
false /* not drag */,
false /* not release */);
......
......@@ -4362,7 +4362,7 @@ catch (...)
* @start_col: the first column of the range
* @end_row: the last row of the range
* @end_col: the last column of the range
* @length: (optional) (default 0) (out): a pointer to a #gsize to store the string length
* @length: (optional) (out): a pointer to a #gsize to store the string length
*
* Returns the specified range of text in the specified format.
*
......@@ -5779,7 +5779,7 @@ catch (...)
* vte_terminal_get_text_selected_full:
* @terminal: a #VteTerminal
* @format: the #VteFormat to use
* @length: (optional) (default 0) (out): a pointer to a #gsize to store the string length
* @length: (optional) (out): a pointer to a #gsize to store the string length
*
* Gets the currently selected text in the format specified by @format.
*
......
......@@ -462,9 +462,9 @@ public:
bool m_cursor_blink_state{false};
bool m_cursor_blinks{false}; /* whether the cursor is actually blinking */
bool m_cursor_blinks_system{true}; /* gtk-cursor-blink */
gint m_cursor_blink_cycle{1000}; /* gtk-cursor-blink-time / 2 */
int m_cursor_blink_timeout{500}; /* gtk-cursor-blink-timeout */
gint64 m_cursor_blink_time; /* how long the cursor has been blinking yet */
int m_cursor_blink_cycle_ms{1000}; /* gtk-cursor-blink-time / 2 */
int m_cursor_blink_timeout_ms{500}; /* gtk-cursor-blink-timeout */
int64_t m_cursor_blink_time_ms; /* how long the cursor has been blinking yet */
bool m_has_focus{false}; /* is the widget focused */
/* Contents blinking */
......@@ -475,7 +475,7 @@ public:
bool m_text_blink_state{false}; /* whether blinking text should be visible at this very moment */
bool m_text_to_blink{false}; /* drawing signals here if it encounters any cell with blink attribute */
TextBlinkMode m_text_blink_mode{TextBlinkMode::eALWAYS};
gint m_text_blink_cycle; /* gtk-cursor-blink-time / 2 */
int m_text_blink_cycle_ms; /* gtk-cursor-blink-time / 2 */
/* DECSCUSR cursor style (shape and blinking possibly overridden
* via escape sequence) */
......@@ -922,8 +922,8 @@ public:
#endif /* VTE_GTK */
void set_blink_settings(bool blink,
int blink_time,
int blink_timeout) noexcept;
int blink_time_ms,
int blink_timeout_ms) noexcept;
void draw(cairo_t *cr,
cairo_region_t const* region) noexcept;
......
......@@ -1861,15 +1861,15 @@ void
Widget::settings_changed()
{
auto blink = gboolean{};
auto blink_time = int{};
auto blink_timeout = int{};
auto blink_time_ms = int{};
auto blink_timeout_s = int{};
#if VTE_GTK == 4
auto aspect = double{};
#endif
g_object_get(m_settings.get(),
"gtk-cursor-blink", &blink,
"gtk-cursor-blink-time", &blink_time,
"gtk-cursor-blink-timeout", &blink_timeout,
"gtk-cursor-blink-time", &blink_time_ms,
"gtk-cursor-blink-timeout", &blink_timeout_s,
#if VTE_GTK == 4
"gtk-cursor-aspect-ratio", &aspect,
#endif
......@@ -1877,9 +1877,9 @@ Widget::settings_changed()
_vte_debug_print(VTE_DEBUG_MISC,
"Cursor blinking settings: blink=%d time=%d timeout=%d\n",
blink, blink_time, blink_timeout);
blink, blink_time_ms, blink_timeout_s * 1000);
m_terminal->set_blink_settings(blink, blink_time, blink_timeout);
m_terminal->set_blink_settings(blink, blink_time_ms, blink_timeout_s * 1000);
#if VTE_GTK == 4
m_terminal->set_cursor_aspect(aspect);
......