This commit is contained in:
rongyouli 2023-08-29 18:27:24 +08:00 committed by cckylin-cibot
parent 2b2ac02731
commit 192ba41027
4 changed files with 808 additions and 1 deletions

24
debian/changelog vendored
View File

@ -1,3 +1,27 @@
mate-terminal (1.24.0-ok4.1) yangtze; urgency=medium
* BUG号:#I5JPQD点击菜单栏后最小化菜单栏并未消失窗口拖动后也有此问题
* 任务号:无
* 其他改动说明:无
* 其他改动影响域:无
-- rongyouli <rongyouli@kylinos.cn> Tue, 29 Aug 2023 18:24:04 +0800
mate-terminal (1.24.0-ok4) yangtze; urgency=medium
* BUG号:131248 【wayland】【终端】fn+f11进行全屏后再次fn+f11取消全屏不能恢复原来大小;
* 任务号:无
* 其他改动说明:无
* 其他改动影响域:无
-- rongyouli <rongyouli@kylinos.cn> Thu, 29 Jun 2023 16:40:03 +0800
mate-terminal (1.24.0-ok3) yangtze; urgency=medium
* update version info
-- luzhiping <luzhiping@kylinos.cn> Mon, 22 Aug 2022 14:07:12 +0800
mate-terminal (1.24.0-ok2~0627) yangtze; urgency=medium
* BUG号

2
debian/control vendored
View File

@ -1,7 +1,7 @@
Source: mate-terminal
Section: x11
Priority: optional
Maintainer: Debian+Ubuntu MATE Packaging Team <debian-mate@lists.debian.org>
Maintainer: Openkylin Developers <packaging@lists.openkylin.top>
Uploaders: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>,
Stefano Karapetsas <stefano@karapetsas.com>,
Mike Gabriel <sunweaver@debian.org>,

782
debian/patches/0003-I5JPQD.patch vendored Normal file
View File

@ -0,0 +1,782 @@
From: rongyouli <rongyouli>
Date: Tue, 29 Aug 2023 18:27:24 +0800
Subject: I5JPQD
---
src/profile-editor.c | 67 ++++++++++++++++++-
src/terminal-app.c | 10 +++
src/terminal-encoding.c | 2 +-
src/terminal-screen.c | 19 +++---
src/terminal-window.c | 169 +++++++++++++++++++++++++-----------------------
src/terminal.c | 99 ++++------------------------
src/terminal.xml | 2 +-
7 files changed, 186 insertions(+), 182 deletions(-)
diff --git a/src/profile-editor.c b/src/profile-editor.c
index e0d54b2..bd1a981 100644
--- a/src/profile-editor.c
+++ b/src/profile-editor.c
@@ -534,7 +534,7 @@ init_color_scheme_menu (GtkWidget *widget)
GtkCellRenderer *renderer;
GtkTreeIter iter;
GtkListStore *store;
- int i;
+ gsize i;
store = gtk_list_store_new (1, G_TYPE_STRING);
for (i = 0; i < G_N_ELEMENTS (color_schemes); ++i)
@@ -654,6 +654,64 @@ terminal_profile_editor_focus_widget (GtkWidget *editor,
gtk_widget_grab_focus (widget);
}
+static gboolean
+on_profile_editor_notebook_scroll_event (GtkWidget *widget,
+ GdkEventScroll *event)
+{
+ GtkNotebook *notebook = GTK_NOTEBOOK (widget);
+ GtkWidget *child, *event_widget, *action_widget;
+
+ child = gtk_notebook_get_nth_page (notebook, gtk_notebook_get_current_page (notebook));
+ if (child == NULL)
+ return FALSE;
+
+ event_widget = gtk_get_event_widget ((GdkEvent*) event);
+
+ /* Ignore scroll events from the content of the page */
+ if (event_widget == NULL || event_widget == child || gtk_widget_is_ancestor (event_widget, child))
+ return FALSE;
+
+ /* And also from the action widgets */
+ action_widget = gtk_notebook_get_action_widget (notebook, GTK_PACK_START);
+ if (event_widget == action_widget || (action_widget != NULL && gtk_widget_is_ancestor (event_widget, action_widget)))
+ return FALSE;
+
+ action_widget = gtk_notebook_get_action_widget (notebook, GTK_PACK_END);
+ if (event_widget == action_widget || (action_widget != NULL && gtk_widget_is_ancestor (event_widget, action_widget)))
+ return FALSE;
+
+ switch (event->direction) {
+ case GDK_SCROLL_RIGHT:
+ case GDK_SCROLL_DOWN:
+ gtk_notebook_next_page (notebook);
+ break;
+ case GDK_SCROLL_LEFT:
+ case GDK_SCROLL_UP:
+ gtk_notebook_prev_page (notebook);
+ break;
+ case GDK_SCROLL_SMOOTH:
+ switch (gtk_notebook_get_tab_pos (notebook)) {
+ case GTK_POS_LEFT:
+ case GTK_POS_RIGHT:
+ if (event->delta_y > 0)
+ gtk_notebook_next_page (notebook);
+ else if (event->delta_y < 0)
+ gtk_notebook_prev_page (notebook);
+ break;
+ case GTK_POS_TOP:
+ case GTK_POS_BOTTOM:
+ if (event->delta_x > 0)
+ gtk_notebook_next_page (notebook);
+ else if (event->delta_x < 0)
+ gtk_notebook_prev_page (notebook);
+ break;
+ }
+ break;
+ }
+
+ return TRUE;
+}
+
/**
* terminal_profile_edit:
* @profile: a #TerminalProfile
@@ -849,6 +907,13 @@ terminal_profile_edit (TerminalProfile *profile,
terminal_profile_editor_focus_widget (editor, widget_name);
+ w = GTK_WIDGET (gtk_builder_get_object (builder, "profile-editor-notebook"));
+ gtk_widget_add_events (w, GDK_SCROLL_MASK);
+ g_signal_connect (w,
+ "scroll-event",
+ G_CALLBACK (on_profile_editor_notebook_scroll_event),
+ NULL);
+
gtk_window_set_transient_for (GTK_WINDOW (editor),
GTK_WINDOW (transient_parent));
gtk_window_present (GTK_WINDOW (editor));
diff --git a/src/terminal-app.c b/src/terminal-app.c
index 3a7ce5f..db9fbf4 100644
--- a/src/terminal-app.c
+++ b/src/terminal-app.c
@@ -41,8 +41,10 @@
#include <stdlib.h>
#include <time.h>
+#ifdef HAVE_SMCLIENT
#include "eggsmclient.h"
#include "eggdesktopfile.h"
+#endif /* HAVE_SMCLIENT */
#define FALLBACK_PROFILE_ID "default"
@@ -1376,6 +1378,7 @@ terminal_app_manage_profiles (TerminalApp *app,
gtk_window_present (GTK_WINDOW (app->manage_profiles_dialog));
}
+#ifdef HAVE_SMCLIENT
static void
terminal_app_save_state_cb (EggSMClient *client,
GKeyFile *key_file,
@@ -1390,6 +1393,7 @@ terminal_app_client_quit_cb (EggSMClient *client,
{
g_signal_emit (app, signals[QUIT], 0);
}
+#endif /* HAVE_SMCLIENT */
/* Class implementation */
@@ -1470,6 +1474,7 @@ terminal_app_init (TerminalApp *app)
terminal_accels_init ();
+#ifdef HAVE_SMCLIENT
EggSMClient *sm_client;
char *desktop_file;
@@ -1485,6 +1490,7 @@ terminal_app_init (TerminalApp *app)
G_CALLBACK (terminal_app_save_state_cb), app);
g_signal_connect (sm_client, "quit",
G_CALLBACK (terminal_app_client_quit_cb), app);
+#endif /* HAVE_SMCLIENT */
}
static void
@@ -1492,11 +1498,13 @@ terminal_app_finalize (GObject *object)
{
TerminalApp *app = TERMINAL_APP (object);
+#ifdef HAVE_SMCLIENT
EggSMClient *sm_client;
sm_client = egg_sm_client_get ();
g_signal_handlers_disconnect_matched (sm_client, G_SIGNAL_MATCH_DATA,
0, 0, NULL, NULL, app);
+#endif /* HAVE_SMCLIENT */
g_signal_handlers_disconnect_by_func (settings_global,
G_CALLBACK(terminal_app_profile_list_notify_cb),
@@ -1741,6 +1749,7 @@ terminal_app_handle_options (TerminalApp *app,
/* fall-through on success */
}
+#ifdef HAVE_SMCLIENT
EggSMClient *sm_client;
sm_client = egg_sm_client_get ();
@@ -1754,6 +1763,7 @@ terminal_app_handle_options (TerminalApp *app,
!terminal_options_merge_config (options, key_file, SOURCE_SESSION, error))
return FALSE;
}
+#endif /* HAVE_SMCLIENT */
/* Make sure we open at least one window */
terminal_options_ensure_window (options);
diff --git a/src/terminal-encoding.c b/src/terminal-encoding.c
index d0ebac2..ae7bab9 100644
--- a/src/terminal-encoding.c
+++ b/src/terminal-encoding.c
@@ -248,7 +248,7 @@ terminal_encoding_is_valid (TerminalEncoding *encoding)
" input \"%s\"\n",
ascii_sample);
_terminal_debug_print (TERMINAL_DEBUG_ENCODINGS,
- " output \"%s\" bytes read %u written %u\n",
+ " output \"%s\" bytes read %" G_GSIZE_FORMAT " written %" G_GSIZE_FORMAT "\n",
converted ? converted : "(null)", bytes_read, bytes_written);
if (error)
_terminal_debug_print (TERMINAL_DEBUG_ENCODINGS,
diff --git a/src/terminal-screen.c b/src/terminal-screen.c
index 2f2156c..01bec75 100644
--- a/src/terminal-screen.c
+++ b/src/terminal-screen.c
@@ -1167,6 +1167,7 @@ terminal_screen_set_font (TerminalScreen *screen)
TerminalScreenPrivate *priv = screen->priv;
TerminalProfile *profile;
PangoFontDescription *desc;
+ int size;
profile = priv->profile;
@@ -1176,14 +1177,11 @@ terminal_screen_set_font (TerminalScreen *screen)
g_object_get (profile, TERMINAL_PROFILE_FONT, &desc, NULL);
g_assert (desc);
+ size = pango_font_description_get_size (desc);
if (pango_font_description_get_size_is_absolute (desc))
- pango_font_description_set_absolute_size (desc,
- priv->font_scale *
- pango_font_description_get_size (desc));
+ pango_font_description_set_absolute_size (desc, priv->font_scale * size);
else
- pango_font_description_set_size (desc,
- priv->font_scale *
- pango_font_description_get_size (desc));
+ pango_font_description_set_size (desc, (int)(priv->font_scale * size));
vte_terminal_set_font (VTE_TERMINAL (screen), desc);
@@ -1445,7 +1443,11 @@ get_child_environment (TerminalScreen *screen,
g_hash_table_replace (env_table, g_strdup ("TERM"), g_strdup ("xterm-256color")); /* FIXME configurable later? */
/* FIXME: moving the tab between windows, or the window between displays will make the next two invalid... */
- g_hash_table_replace (env_table, g_strdup ("WINDOWID"), g_strdup_printf ("%ld", GDK_WINDOW_XID (gtk_widget_get_window (window))));
+#ifdef GDK_WINDOWING_X11
+ if (GDK_IS_X11_DISPLAY (display)) {
+ g_hash_table_replace (env_table, g_strdup ("WINDOWID"), g_strdup_printf ("%ld", GDK_WINDOW_XID (gtk_widget_get_window (window))));
+ }
+#endif
g_hash_table_replace (env_table, g_strdup ("DISPLAY"), g_strdup (gdk_display_get_name (display)));
g_settings_schema_source_list_schemas (g_settings_schema_source_get_default (), TRUE, &list_schemas, NULL);
@@ -1532,8 +1534,6 @@ static void handle_error_child (TerminalScreen *screen,
info_bar, FALSE, FALSE, 0);
gtk_info_bar_set_default_response (GTK_INFO_BAR (info_bar), GTK_RESPONSE_CANCEL);
gtk_widget_show (info_bar);
-
- g_error_free (err);
}
static void term_spawn_callback (GtkWidget *terminal,
@@ -1546,7 +1546,6 @@ static void term_spawn_callback (GtkWidget *terminal,
if (error)
{
handle_error_child (screen, error);
- g_error_free (error);
}
else
{
diff --git a/src/terminal-window.c b/src/terminal-window.c
index 35a7b56..788de07 100644
--- a/src/terminal-window.c
+++ b/src/terminal-window.c
@@ -45,7 +45,9 @@
#endif
static gboolean detach_tab = FALSE;
-
+gboolean _is_fullscreen = FALSE;
+gboolean goback = FALSE;
+TerminalScreen *_screen;
struct _TerminalWindowPrivate
{
GtkActionGroup *action_group;
@@ -1401,6 +1403,9 @@ popup_leave_fullscreen_callback (GtkAction *action,
TerminalWindow *window)
{
gtk_window_unfullscreen (GTK_WINDOW (window));
+ //terminal_window_update_size (window, window->priv->active_screen, TRUE);
+ //_is_fullscreen = FALSE;
+
}
static void
@@ -1477,9 +1482,6 @@ popup_clipboard_targets_received_cb (GtkClipboard *clipboard,
GtkAction *action;
gboolean can_paste, can_paste_uris, show_link, show_email_link, show_call_link, show_input_method_menu;
int n_pages;
- GdkEvent *event;
- GdkSeat *seat;
- GdkDevice *device;
if (!gtk_widget_get_realized (GTK_WIDGET (screen)))
{
@@ -1552,17 +1554,13 @@ popup_clipboard_targets_received_cb (GtkClipboard *clipboard,
if (!gtk_menu_get_attach_widget (GTK_MENU (popup_menu)))
gtk_menu_attach_to_widget (GTK_MENU (popup_menu),GTK_WIDGET (screen),NULL);
- event = gtk_get_current_event ();
-
- seat = gdk_display_get_default_seat (gdk_display_get_default());
-
- device = gdk_seat_get_pointer (seat);
-
- gdk_event_set_device (event, device);
-
- gtk_menu_popup_at_pointer (GTK_MENU (popup_menu), (const GdkEvent*) event);
-
- gdk_event_free (event);
+ gtk_menu_popup (GTK_MENU (popup_menu),
+ NULL, NULL,
+ NULL, NULL,
+ info->button,
+ info->timestamp);
+ gtk_style_context_add_class(gtk_widget_get_style_context (popup_menu),
+ GTK_STYLE_CLASS_CONTEXT_MENU);
}
static void
@@ -1750,6 +1748,13 @@ terminal_window_map_event (GtkWidget *widget,
return FALSE;
}
+void
+terminal_window_refresh_resizable (TerminalWindow *window) {
+ sleep(1);
+ _is_fullscreen = FALSE;
+ terminal_window_update_size(window, window->priv->active_screen, TRUE);
+ return;
+}
static gboolean
terminal_window_state_event (GtkWidget *widget,
@@ -1766,7 +1771,12 @@ terminal_window_state_event (GtkWidget *widget,
gboolean is_fullscreen;
is_fullscreen = (event->new_window_state & GDK_WINDOW_STATE_FULLSCREEN) != 0;
-
+ if (!is_fullscreen) {
+ if(!g_thread_supported())
+ g_thread_init(NULL);
+ gdk_threads_init();
+ g_thread_new("update_geometry", (GThreadFunc)terminal_window_refresh_resizable, window);
+ }
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
action = gtk_action_group_get_action (priv->action_group, "ViewFullscreen");
gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), is_fullscreen);
@@ -2805,15 +2815,16 @@ terminal_window_update_size_set_geometry (TerminalWindow *window,
if (gdk_window != NULL &&
(gdk_window_get_state (gdk_window) &
- (GDK_WINDOW_STATE_MAXIMIZED | GDK_WINDOW_STATE_TILED)))
+ (GDK_WINDOW_STATE_MAXIMIZED | GDK_WINDOW_STATE_TILED | GDK_WINDOW_STATE_FULLSCREEN)))
{
/* Don't adjust the size of maximized or tiled (snapped, half-maximized)
* windows: if we do, there will be ugly gaps of up to 1 character cell
* around otherwise tiled windows. */
- return result;
+ return result;
}
/* be sure our geometry is up-to-date */
+
terminal_window_update_geometry (window);
if (GTK_IS_WIDGET (screen))
@@ -3218,7 +3229,7 @@ notebook_page_added_callback (GtkWidget *notebook,
priv->present_on_insert = FALSE;
}
pages = gtk_notebook_get_n_pages (GTK_NOTEBOOK (notebook));
- if (pages == 2) terminal_window_update_size (window, priv->active_screen, TRUE);
+ if (pages != 1) terminal_window_update_size (window, priv->active_screen, TRUE);
}
static void
@@ -3375,7 +3386,7 @@ terminal_window_update_geometry (TerminalWindow *window)
int chrome_width, chrome_height;
if (priv->active_screen == NULL)
- return;
+ return;
widget = GTK_WIDGET (priv->active_screen);
@@ -3384,8 +3395,12 @@ terminal_window_update_geometry (TerminalWindow *window)
* get some kind of union of all hints from all terms in the
* window, but that doesn't make too much sense.
*/
- terminal_screen_get_cell_size (priv->active_screen, &char_width, &char_height);
-
+ if (!_is_fullscreen)
+ terminal_screen_get_cell_size (priv->active_screen, &char_width, &char_height);
+ else {
+ char_width = 1;
+ char_height = 1;
+ }
terminal_screen_get_size (priv->active_screen, &grid_width, &grid_height);
_terminal_debug_print (TERMINAL_DEBUG_GEOMETRY, "%dx%d cells of %dx%d px = %dx%d px\n",
grid_width, grid_height, char_width, char_height,
@@ -3424,12 +3439,11 @@ terminal_window_update_geometry (TerminalWindow *window)
chrome_height != priv->old_chrome_height ||
widget != GTK_WIDGET (priv->old_geometry_widget))
{
- hints.base_width = chrome_width;
- hints.base_height = chrome_height;
-
#define MIN_WIDTH_CHARS 4
#define MIN_HEIGHT_CHARS 1
+ hints.base_width = chrome_width;
+ hints.base_height = chrome_height;
hints.width_inc = char_width;
hints.height_inc = char_height;
@@ -3566,6 +3580,7 @@ static gboolean
confirm_close_window_or_tab (TerminalWindow *window,
TerminalScreen *screen)
{
+ GtkBuilder *builder;
TerminalWindowPrivate *priv = window->priv;
GtkWidget *dialog;
gboolean do_confirm;
@@ -3615,30 +3630,34 @@ confirm_close_window_or_tab (TerminalWindow *window,
if (has_processes)
{
if (n_tabs > 1)
- confirm_msg = _("There are still processes running in some terminals in this window. "
+ confirm_msg = _("There are still processes running in some terminals in this window.\n"
"Closing the window will kill all of them.");
else
- confirm_msg = _("There is still a process running in this terminal. "
+ confirm_msg = _("There is still a process running in this terminal.\n"
"Closing the terminal will kill it.");
} else if (n_tabs > 1)
confirm_msg = _("There are multiple tabs open in this window.");
else
return FALSE;
- dialog = priv->confirm_close_dialog =
- gtk_message_dialog_new (GTK_WINDOW (window),
- GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_MESSAGE_WARNING,
- GTK_BUTTONS_CANCEL,
- "%s", n_tabs > 1 ? _("Close this window?") : _("Close this terminal?"));
-
- gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
- "%s", confirm_msg);
-
- gtk_window_set_title (GTK_WINDOW (dialog), "");
-
- gtk_dialog_add_button (GTK_DIALOG (dialog), n_tabs > 1 ? _("C_lose Window") : _("C_lose Terminal"), GTK_RESPONSE_ACCEPT);
- gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_ACCEPT);
+ // dialog = priv->confirm_close_dialog =
+ // gtk_message_dialog_new (GTK_WINDOW (window),
+ // GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
+ // GTK_MESSAGE_WARNING,
+ // GTK_BUTTONS_CANCEL,
+ // "%s", n_tabs > 1 ? _("Close this window?") : _("Close this terminal?"));
+
+ builder = gtk_builder_new_from_resource (TERMINAL_RESOURCES_PATH_PREFIX G_DIR_SEPARATOR_S "ui/confirm-close-dialog.ui");
+ priv->confirm_close_dialog = dialog = GTK_WIDGET (gtk_builder_get_object (builder, "confirm_close_dialog"));
+ if (n_tabs > 1) {
+ gtk_label_set_text (GTK_LABEL (gtk_builder_get_object (builder, "question_text")), _("Close this window?"));
+ gtk_button_set_label (GTK_BUTTON (gtk_builder_get_object (builder, "button_close")), _("C_lose Window"));
+ } else {
+ gtk_label_set_text (GTK_LABEL (gtk_builder_get_object (builder, "question_text")), _("Close this terminal?"));
+ gtk_button_set_label (GTK_BUTTON (gtk_builder_get_object (builder, "button_close")), _("C_lose Terminal"));
+ }
+ gtk_label_set_text (GTK_LABEL (gtk_builder_get_object (builder, "description_text")), confirm_msg);
+ g_object_unref (builder);
g_object_set_data (G_OBJECT (dialog), "close-screen", screen);
@@ -3647,6 +3666,8 @@ confirm_close_window_or_tab (TerminalWindow *window,
g_signal_connect (dialog, "response",
G_CALLBACK (confirm_close_response_cb), window);
+ gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (window));
+ gtk_window_set_title (GTK_WINDOW (dialog), "");
gtk_window_present (GTK_WINDOW (dialog));
return TRUE;
@@ -3940,10 +3961,14 @@ view_fullscreen_toggled_callback (GtkToggleAction *action,
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
toggle_action_check = gtk_toggle_action_get_active (action);
G_GNUC_END_IGNORE_DEPRECATIONS;
- if (toggle_action_check)
+ if (toggle_action_check) {
+ _is_fullscreen = TRUE;
+ terminal_window_update_size (window, window->priv->active_screen, TRUE);
gtk_window_fullscreen (GTK_WINDOW (window));
- else
+ _screen = window->priv->active_screen;
+ } else {
gtk_window_unfullscreen (GTK_WINDOW (window));
+ }
}
static const double zoom_factors[] =
@@ -4230,53 +4255,29 @@ static void
terminal_set_title_callback (GtkAction *action,
TerminalWindow *window)
{
+ GtkBuilder *builder;
TerminalWindowPrivate *priv = window->priv;
- GtkWidget *dialog, *message_area, *hbox, *label, *entry;
+ GtkWidget *dialog, *entry;
if (priv->active_screen == NULL)
return;
- /* FIXME: hook the screen up so this dialogue closes if the terminal screen closes */
+ builder = gtk_builder_new_from_resource (TERMINAL_RESOURCES_PATH_PREFIX G_DIR_SEPARATOR_S "ui/set-title-dialog.ui");
+ dialog = GTK_WIDGET (gtk_builder_get_object (builder, "dialog"));
+ entry = GTK_WIDGET (gtk_builder_get_object (builder, "title_entry"));
+ g_object_unref (builder);
- dialog = gtk_message_dialog_new (GTK_WINDOW (window),
- GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_MESSAGE_OTHER,
- GTK_BUTTONS_OK_CANCEL,
- "%s", "");
-
- gtk_window_set_title (GTK_WINDOW (dialog), _("Set Title"));
- gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
- gtk_window_set_role (GTK_WINDOW (dialog), "mate-terminal-change-title");
- gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK);
- /* Alternative button order was set automatically by GtkMessageDialog */
+ gtk_widget_grab_focus (entry);
+ gtk_entry_set_text (GTK_ENTRY (entry), terminal_screen_get_raw_title (priv->active_screen));
+ gtk_editable_select_region (GTK_EDITABLE (entry), 0, -1);
+ g_object_set_data (G_OBJECT (dialog), "title-entry", entry);
g_signal_connect (dialog, "response",
G_CALLBACK (terminal_set_title_dialog_response_cb), priv->active_screen);
g_signal_connect (dialog, "delete-event",
G_CALLBACK (terminal_util_dialog_response_on_delete), NULL);
- message_area = gtk_message_dialog_get_message_area (GTK_MESSAGE_DIALOG (dialog));
- gtk_container_foreach (GTK_CONTAINER (message_area), (GtkCallback) gtk_widget_hide, NULL);
-
- hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
- gtk_box_pack_start (GTK_BOX (message_area), hbox, FALSE, FALSE, 0);
-
- label = gtk_label_new_with_mnemonic (_("_Title:"));
- gtk_label_set_xalign (GTK_LABEL (label), 0.0);
- gtk_label_set_yalign (GTK_LABEL (label), 0.5);
- gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
-
- entry = gtk_entry_new ();
- gtk_entry_set_width_chars (GTK_ENTRY (entry), 32);
- gtk_entry_set_activates_default (GTK_ENTRY (entry), TRUE);
- gtk_label_set_mnemonic_widget (GTK_LABEL (label), entry);
- gtk_box_pack_start (GTK_BOX (hbox), entry, TRUE, TRUE, 0);
- gtk_widget_show_all (hbox);
-
- gtk_widget_grab_focus (entry);
- gtk_entry_set_text (GTK_ENTRY (entry), terminal_screen_get_raw_title (priv->active_screen));
- gtk_editable_select_region (GTK_EDITABLE (entry), 0, -1);
- g_object_set_data (G_OBJECT (dialog), "title-entry", entry);
+ gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (window));
gtk_window_present (GTK_WINDOW (dialog));
}
@@ -4391,6 +4392,7 @@ tabs_detach_tab_callback (GtkAction *action,
terminal_window_move_screen (window, new_window, screen, -1);
/* FIXME: this seems wrong if tabs are shown in the window */
+
terminal_window_update_size (new_window, screen, FALSE);
gtk_window_present_with_time (GTK_WINDOW (new_window), gtk_get_current_event_time ());
@@ -4416,6 +4418,7 @@ help_about_callback (GtkAction *action,
GKeyFile *key_file;
GError *error = NULL;
char **authors, **contributors, **artists, **documenters, **array_strv;
+ gchar *comments = NULL;
gsize data_len, n_authors = 0, n_contributors = 0, n_artists = 0, n_documenters = 0 , i;
GPtrArray *array;
@@ -4462,6 +4465,9 @@ help_about_callback (GtkAction *action,
licence_text = terminal_util_get_licence_text ();
+ comments = g_strdup_printf (_("MATE Terminal is a terminal emulator for the MATE Desktop Environment.\nPowered by Virtual TErminal %d.%d.%d"),
+ vte_get_major_version (), vte_get_minor_version (), vte_get_micro_version ());
+
gtk_show_about_dialog (GTK_WINDOW (window),
"program-name", _("MATE Terminal"),
"version", VERSION,
@@ -4471,8 +4477,8 @@ help_about_callback (GtkAction *action,
"Copyright \xc2\xa9 2006 Guilherme de S. Pastore\n"
"Copyright \xc2\xa9 20072010 Christian Persch\n"
"Copyright \xc2\xa9 2011 Perberos\n"
- "Copyright \xc2\xa9 2012-2020 MATE developers"),
- "comments", _("A terminal emulator for the MATE desktop"),
+ "Copyright \xc2\xa9 2012-2021 MATE developers"),
+ "comments", comments,
"authors", array_strv,
"artists", artists,
"documenters", documenters,
@@ -4480,9 +4486,10 @@ help_about_callback (GtkAction *action,
"wrap-license", TRUE,
"translator-credits", _("translator-credits"),
"logo-icon-name", MATE_TERMINAL_ICON_NAME,
- "website", "https://mate-desktop.org",
+ "website", PACKAGE_URL,
NULL);
+ g_free (comments);
g_strfreev (array_strv);
g_strfreev (artists);
g_strfreev (documenters);
diff --git a/src/terminal.c b/src/terminal.c
index 1cd29b3..dceb937 100644
--- a/src/terminal.c
+++ b/src/terminal.c
@@ -34,7 +34,9 @@
#include <gdk/gdk.h>
#include <gdk/gdkx.h>
+#ifdef HAVE_SMCLIENT
#include "eggsmclient.h"
+#endif /* HAVE_SMCLIENT */
#include "terminal-accels.h"
#include "terminal-app.h"
@@ -406,79 +408,6 @@ name_lost_cb (GDBusConnection *connection,
gtk_main_quit ();
}
-/* Settings storage works as follows:
- * /apps/mate-terminal/global/
- * /apps/mate-terminal/profiles/Foo/
- *
- * It's somewhat tricky to manage the profiles/ dir since we need to track
- * the list of profiles, but GSettings doesn't have a concept of notifying that
- * a directory has appeared or disappeared.
- *
- * Session state is stored entirely in the RestartCommand command line.
- *
- * The number one rule: all stored information is EITHER per-session,
- * per-profile, or set from a command line option. THERE CAN BE NO
- * OVERLAP. The UI and implementation totally break if you overlap
- * these categories. See mate-terminal 1.x for why.
- *
- * Don't use this code as an example of how to use GSettings - it's hugely
- * overcomplicated due to the profiles stuff. Most apps should not
- * have to do scary things of this nature, and should not have
- * a profiles feature.
- *
- */
-
-/* Copied from libcaja/caja-program-choosing.c; Needed in case
- * we have no DESKTOP_STARTUP_ID (with its accompanying timestamp).
- */
-static Time
-slowly_and_stupidly_obtain_timestamp (Display *xdisplay)
-{
- Window xwindow;
- XEvent event;
-
- {
- XSetWindowAttributes attrs;
- Atom atom_name;
- Atom atom_type;
- const char *name;
-
- attrs.override_redirect = True;
- attrs.event_mask = PropertyChangeMask | StructureNotifyMask;
-
- xwindow =
- XCreateWindow (xdisplay,
- RootWindow (xdisplay, 0),
- -100, -100, 1, 1,
- 0,
- CopyFromParent,
- CopyFromParent,
- (Visual *)CopyFromParent,
- CWOverrideRedirect | CWEventMask,
- &attrs);
-
- atom_name = XInternAtom (xdisplay, "WM_NAME", TRUE);
- g_assert (atom_name != None);
- atom_type = XInternAtom (xdisplay, "STRING", TRUE);
- g_assert (atom_type != None);
-
- name = "Fake Window";
- XChangeProperty (xdisplay,
- xwindow, atom_name,
- atom_type,
- 8, PropModeReplace, (unsigned char *)name, strlen (name));
- }
-
- XWindowEvent (xdisplay,
- xwindow,
- PropertyChangeMask,
- &event);
-
- XDestroyWindow(xdisplay, xwindow);
-
- return event.xproperty.time;
-}
-
static char *
get_factory_name_for_display (const char *display_name)
{
@@ -529,8 +458,7 @@ main (int argc, char **argv)
int i;
char **argv_copy;
int argc_copy;
- const char *startup_id, *display_name, *home_dir;
- GdkDisplay *display;
+ const char *startup_id, *home_dir;
TerminalOptions *options;
GError *error = NULL;
char *working_directory;
@@ -555,8 +483,6 @@ main (int argc, char **argv)
working_directory = g_get_current_dir ();
- gdk_set_allowed_backends ("x11");
-
/* Now change directory to $HOME so we don't prevent unmounting, e.g. if the
* factory is started by caja-open-terminal. See bug #565328.
* On failure back to /.
@@ -574,8 +500,10 @@ main (int argc, char **argv)
FALSE,
&argc, &argv,
&error,
+#ifdef HAVE_SMCLIENT
gtk_get_option_group (TRUE),
egg_sm_client_get_option_group (),
+#endif /* HAVE_SMCLIENT */
NULL);
g_free (working_directory);
@@ -596,20 +524,15 @@ main (int argc, char **argv)
g_unsetenv ("GIO_LAUNCHED_DESKTOP_FILE_PID");
g_unsetenv ("GIO_LAUNCHED_DESKTOP_FILE");
- display = gdk_display_get_default ();
- display_name = gdk_display_get_name (display);
- options->display_name = g_strdup (display_name);
-
if (options->startup_id == NULL)
{
- /* Create a fake one containing a timestamp that we can use */
- Time timestamp;
-
- timestamp = slowly_and_stupidly_obtain_timestamp (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()));
-
- options->startup_id = g_strdup_printf ("_TIME%lu", timestamp);
+ options->startup_id = g_strdup_printf ("_TIME%lu", g_get_monotonic_time () / 1000);
}
+ gdk_init (&argc, &argv);
+ const char *display_name = gdk_display_get_name (gdk_display_get_default ());
+ options->display_name = g_strdup (display_name);
+
if (options->use_factory)
{
OwnData *data;
@@ -644,7 +567,7 @@ main (int argc, char **argv)
}
else
{
-
+ gtk_init(&argc, &argv);
terminal_app_handle_options (terminal_app_get (), options, TRUE /* allow resume */, &error);
terminal_options_free (options);
diff --git a/src/terminal.xml b/src/terminal.xml
index 263dce4..ae82948 100644
--- a/src/terminal.xml
+++ b/src/terminal.xml
@@ -25,7 +25,7 @@
</menu>
<menu action="View">
<menuitem action="ViewMenubar" />
- <menuitem action="ViewFullscreen" />
+ <menuitem action = "ViewFullscreen" />
<separator />
<menuitem action="ViewZoomIn" />
<menuitem action="ViewZoomOut" />

View File

@ -1,2 +1,3 @@
0001_fix-url-highlighting.patch
0002_fix-searching.patch
0003-I5JPQD.patch