Dominique Leuenberger 2016-07-28 21:45:18 +00:00 committed by Git OBS Bridge
commit c9360d11b1
5 changed files with 507 additions and 0 deletions

View File

@ -0,0 +1,39 @@
From 69e82e354de26cd7e6957b95740c724ed1c31c10 Mon Sep 17 00:00:00 2001
From: Andreas Henriksson <andreas@fatal.se>
Date: Mon, 25 Jul 2016 19:38:18 +0200
Subject: notebook: avoid crash on tab DND
See "gtk_notebook_detach_tab" API documentation. Using it instead
of gtk_container_remove avoids an assertion crash in gtk+ when
dragging and dropping a tab between terminal windows.
See also original bug report at
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=825818
https://bugzilla.gnome.org/show_bug.cgi?id=769161
(cherry picked from commit 85b448f7c9e219e82d4d8abafe405d73349c08c1)
---
src/terminal-notebook.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/terminal-notebook.c b/src/terminal-notebook.c
index 9d488fc..b054676 100644
--- a/src/terminal-notebook.c
+++ b/src/terminal-notebook.c
@@ -152,8 +152,13 @@ terminal_notebook_remove_screen (TerminalMdiContainer *container,
update_tab_visibility (notebook, -1);
screen_container = terminal_screen_container_get_from_screen (screen);
+#if GTK_CHECK_VERSION(3, 16, 0)
+ gtk_notebook_detach_tab (GTK_NOTEBOOK (notebook),
+ GTK_WIDGET (screen_container));
+#else
gtk_container_remove (GTK_CONTAINER (notebook),
GTK_WIDGET (screen_container));
+#endif
}
static TerminalScreen *
--
cgit v0.12

View File

@ -0,0 +1,40 @@
From 2a10e0ed7d6210b0522ffc2faf8483c64f1d183d Mon Sep 17 00:00:00 2001
From: Egmont Koblinger <egmont@gmail.com>
Date: Fri, 22 Jul 2016 16:42:14 +0200
Subject: profile: editor: Properly initialize the first palette color
https://bugzilla.gnome.org/show_bug.cgi?id=768850
(cherry picked from commit 6447aded26416e49bf5fdce8a8fd13c16c0ebb44)
---
src/profile-editor.c | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)
diff --git a/src/profile-editor.c b/src/profile-editor.c
index ff26df6..82cc7a9 100644
--- a/src/profile-editor.c
+++ b/src/profile-editor.c
@@ -405,18 +405,13 @@ profile_palette_notify_colorpickers_cb (GSettings *profile,
for (i = 0; i < n_colors; i++)
{
char name[32];
- GdkRGBA old_color;
g_snprintf (name, sizeof (name), "palette-colorpicker-%" G_GSIZE_FORMAT, i + 1);
w = (GtkWidget *) gtk_builder_get_object (builder, name);
- gtk_color_chooser_get_rgba (GTK_COLOR_CHOOSER (w), &old_color);
- if (!rgba_equal (&old_color, &colors[i]))
- {
- g_signal_handlers_block_by_func (w, G_CALLBACK (palette_color_notify_cb), profile);
- gtk_color_chooser_set_rgba (GTK_COLOR_CHOOSER (w), &colors[i]);
- g_signal_handlers_unblock_by_func (w, G_CALLBACK (palette_color_notify_cb), profile);
- }
+ g_signal_handlers_block_by_func (w, G_CALLBACK (palette_color_notify_cb), profile);
+ gtk_color_chooser_set_rgba (GTK_COLOR_CHOOSER (w), &colors[i]);
+ g_signal_handlers_unblock_by_func (w, G_CALLBACK (palette_color_notify_cb), profile);
}
}
--
cgit v0.12

View File

@ -0,0 +1,375 @@
From 82be23534eb5f0394b3e6c40992ad36d37dfea6d Mon Sep 17 00:00:00 2001
From: Sorokin Alexei <sor.alexei@meowr.ru>
Date: Mon, 7 Mar 2016 21:45:46 +0000
Subject: [PATCH 1/2] Fix chunked resize and --geometry option
Was caused by https://git.gnome.org/browse/gtk+/commit/?id=08974a1
https://bugzilla.gnome.org/show_bug.cgi?id=760944
---
src/terminal-options.c | 4 ----
src/terminal-window.c | 19 +++++++++++++------
2 files changed, 13 insertions(+), 10 deletions(-)
diff --git a/src/terminal-options.c b/src/terminal-options.c
index cc51cf6..723ecfe 100644
--- a/src/terminal-options.c
+++ b/src/terminal-options.c
@@ -583,10 +583,6 @@ option_geometry_callback (const gchar *option_name,
{
TerminalOptions *options = data;
- /* See https://bugzilla.gnome.org/show_bug.cgi?id=760944 */
- if (gtk_check_version (3, 19, 5) == NULL)
- return unsupported_option_callback (option_name, value, data, error);
-
if (options->initial_windows)
{
InitialWindow *iw;
diff --git a/src/terminal-window.c b/src/terminal-window.c
index 80e54b0..1e60697 100644
--- a/src/terminal-window.c
+++ b/src/terminal-window.c
@@ -3571,8 +3571,9 @@ terminal_window_update_geometry (TerminalWindow *window)
GtkWidget *widget;
GdkGeometry hints;
GtkBorder padding;
- int char_width;
- int char_height;
+ GtkRequisition toplevel_request, widget_request;
+ int base_width, base_height;
+ int char_width, char_height;
if (priv->active_screen == NULL)
return;
@@ -3596,8 +3597,14 @@ terminal_window_update_geometry (TerminalWindow *window)
padding.top + padding.bottom != priv->old_base_height ||
widget != (GtkWidget*) priv->old_geometry_widget)
{
- hints.base_width = padding.left + padding.right;
- hints.base_height = padding.top + padding.bottom;
+ gtk_widget_get_preferred_size (GTK_WIDGET (window), NULL, &toplevel_request);
+ gtk_widget_get_preferred_size (widget, NULL, &widget_request);
+
+ base_width = toplevel_request.width - widget_request.width;
+ base_height = toplevel_request.height - widget_request.height;
+
+ hints.base_width = base_width + padding.left + padding.right;
+ hints.base_height = base_height + padding.top + padding.bottom;
#define MIN_WIDTH_CHARS 4
#define MIN_HEIGHT_CHARS 1
@@ -3605,12 +3612,12 @@ terminal_window_update_geometry (TerminalWindow *window)
hints.width_inc = char_width;
hints.height_inc = char_height;
- /* min size is min size of just the geometry widget, remember. */
+ /* min size is min size of the whole window, remember. */
hints.min_width = hints.base_width + hints.width_inc * MIN_WIDTH_CHARS;
hints.min_height = hints.base_height + hints.height_inc * MIN_HEIGHT_CHARS;
gtk_window_set_geometry_hints (GTK_WINDOW (window),
- widget,
+ NULL,
&hints,
GDK_HINT_RESIZE_INC |
GDK_HINT_MIN_SIZE |
--
2.8.1
From e517e6944d27f4975083eac1efbdad6687524f56 Mon Sep 17 00:00:00 2001
From: Simon McVittie <smcv@debian.org>
Date: Mon, 6 Jun 2016 09:40:32 +0100
Subject: [PATCH 2/2] Replace no-op gtk_window_resize_to_geometry by
calculating new size
Together with the previous commit, this fixes a regression in
GNOME 3.20: anything that would alter the Terminal size, for example
a font size change or the 80x24, 80x43 etc. menu items, did nothing.
Signed-off-by: Simon McVittie <smcv@debian.org>
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=760944
---
src/terminal-window.c | 168 +++++++++++++++++++++++++++++++++++++++++---------
1 file changed, 140 insertions(+), 28 deletions(-)
diff --git a/src/terminal-window.c b/src/terminal-window.c
index 1e60697..82b1b10 100644
--- a/src/terminal-window.c
+++ b/src/terminal-window.c
@@ -72,11 +72,30 @@ struct _TerminalWindowPrivate
GtkWidget *menubar;
TerminalMdiContainer *mdi_container;
+ GtkWidget *main_vbox;
TerminalScreen *active_screen;
+
+ /* Size of a character cell in pixels */
int old_char_width;
int old_char_height;
- int old_base_width;
- int old_base_height;
+
+ /* Width and height added to the actual terminal grid by "chrome" inside
+ * what was traditionally the X11 window: menu bar, title bar,
+ * style-provided padding. This must be included when resizing the window
+ * and also included in geometry hints. */
+ int old_chrome_width;
+ int old_chrome_height;
+
+ /* Width and height added to the window by client-side decorations.
+ * This must be included in geometry hints but must not be included when
+ * resizing the window. */
+ int old_csd_width;
+ int old_csd_height;
+
+ /* Width and height of the padding around the geometry widget. */
+ int old_padding_width;
+ int old_padding_height;
+
void *old_geometry_widget; /* only used for pointer value as it may be freed */
GtkWidget *confirm_close_dialog;
@@ -88,6 +107,8 @@ struct _TerminalWindowPrivate
guint disposed : 1;
guint present_on_insert : 1;
+ guint realized : 1;
+
/* Workaround until gtk+ bug #535557 is fixed */
guint icon_title_set : 1;
};
@@ -2287,6 +2308,12 @@ terminal_window_realize (GtkWidget *widget)
/* Need to do this now since this requires the window to be realized */
if (priv->active_screen != NULL)
sync_screen_icon_title (priv->active_screen, NULL, window);
+
+ /* Now that we've been realized, we should know precisely how large the
+ * client-side decorations are going to be. Recalculate the geometry hints,
+ * export them to the windowing system, and resize the window accordingly. */
+ priv->realized = TRUE;
+ terminal_window_update_size (window);
}
static gboolean
@@ -2621,7 +2648,6 @@ terminal_window_init (TerminalWindow *window)
GtkActionGroup *action_group;
GtkAction *action;
GtkUIManager *manager;
- GtkWidget *main_vbox;
GError *error;
GtkWindowGroup *window_group;
GtkAccelGroup *accel_group;
@@ -2651,7 +2677,7 @@ terminal_window_init (TerminalWindow *window)
priv->active_screen = NULL;
- main_vbox = gtk_bin_get_child (GTK_BIN (window));
+ priv->main_vbox = gtk_bin_get_child (GTK_BIN (window));
priv->mdi_container = TERMINAL_MDI_CONTAINER (terminal_notebook_new ());
@@ -2686,13 +2712,19 @@ terminal_window_init (TerminalWindow *window)
g_signal_connect (priv->mdi_container, "create-window",
G_CALLBACK (handle_tab_droped_on_desktop), window);
- gtk_box_pack_end (GTK_BOX (main_vbox), GTK_WIDGET (priv->mdi_container), TRUE, TRUE, 0);
+ gtk_box_pack_end (GTK_BOX (priv->main_vbox), GTK_WIDGET (priv->mdi_container), TRUE, TRUE, 0);
gtk_widget_show (GTK_WIDGET (priv->mdi_container));
priv->old_char_width = -1;
priv->old_char_height = -1;
- priv->old_base_width = -1;
- priv->old_base_height = -1;
+
+ priv->old_chrome_width = -1;
+ priv->old_chrome_height = -1;
+ priv->old_csd_width = -1;
+ priv->old_csd_height = -1;
+ priv->old_padding_width = -1;
+ priv->old_padding_height = -1;
+
priv->old_geometry_widget = NULL;
/* GAction setup */
@@ -2753,7 +2785,7 @@ terminal_window_init (TerminalWindow *window)
#endif
priv->menubar = gtk_ui_manager_get_widget (manager, "/menubar");
- gtk_box_pack_start (GTK_BOX (main_vbox),
+ gtk_box_pack_start (GTK_BOX (priv->main_vbox),
priv->menubar,
FALSE, FALSE, 0);
@@ -3209,13 +3241,41 @@ terminal_window_update_size (TerminalWindow *window)
{
TerminalWindowPrivate *priv = window->priv;
int grid_width, grid_height;
+ int pixel_width, pixel_height;
+ GdkWindow *gdk_window;
+
+ gdk_window = gtk_widget_get_window (GTK_WIDGET (window));
+
+ if (gdk_window != NULL &&
+ (gdk_window_get_state (gdk_window) &
+ (GDK_WINDOW_STATE_MAXIMIZED | GDK_WINDOW_STATE_TILED)))
+ {
+ /* 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;
+ }
/* be sure our geometry is up-to-date */
terminal_window_update_geometry (window);
terminal_screen_get_size (priv->active_screen, &grid_width, &grid_height);
+ _terminal_debug_print (TERMINAL_DEBUG_GEOMETRY,
+ "[window %p] size is %dx%d cells of %dx%d px\n",
+ window, grid_width, grid_height,
+ priv->old_char_width, priv->old_char_height);
+
+ /* the "old" struct members were updated by update_geometry */
+ pixel_width = priv->old_chrome_width + grid_width * priv->old_char_width;
+ pixel_height = priv->old_chrome_height + grid_height * priv->old_char_height;
+ _terminal_debug_print (TERMINAL_DEBUG_GEOMETRY,
+ "[window %p] %dx%d + %dx%d = %dx%d\n",
+ window, grid_width * priv->old_char_width,
+ grid_height * priv->old_char_height,
+ priv->old_chrome_width, priv->old_chrome_height,
+ pixel_width, pixel_height);
- gtk_window_resize_to_geometry (GTK_WINDOW (window), grid_width, grid_height);
+ gtk_window_resize (GTK_WINDOW (window), pixel_width, pixel_height);
}
void
@@ -3571,9 +3631,11 @@ terminal_window_update_geometry (TerminalWindow *window)
GtkWidget *widget;
GdkGeometry hints;
GtkBorder padding;
- GtkRequisition toplevel_request, widget_request;
- int base_width, base_height;
+ GtkRequisition toplevel_request, vbox_request, widget_request;
+ int grid_width, grid_height;
int char_width, char_height;
+ int chrome_width, chrome_height;
+ int csd_width, csd_height;
if (priv->active_screen == NULL)
return;
@@ -3586,25 +3648,68 @@ terminal_window_update_geometry (TerminalWindow *window)
* window, but that doesn't make too much sense.
*/
terminal_screen_get_cell_size (priv->active_screen, &char_width, &char_height);
-
+
+ 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,
+ char_width * grid_width, char_height * grid_height);
+
gtk_style_context_get_padding(gtk_widget_get_style_context(widget),
gtk_widget_get_state_flags(widget),
&padding);
- if (char_width != priv->old_char_width ||
+ _terminal_debug_print (TERMINAL_DEBUG_GEOMETRY, "padding = %dx%d px\n",
+ padding.left + padding.right,
+ padding.top + padding.bottom);
+
+ gtk_widget_get_preferred_size (priv->main_vbox, NULL, &vbox_request);
+ _terminal_debug_print (TERMINAL_DEBUG_GEOMETRY, "content area requests %dx%d px\n",
+ vbox_request.width, vbox_request.height);
+
+ gtk_widget_get_preferred_size (GTK_WIDGET (window), NULL, &toplevel_request);
+ _terminal_debug_print (TERMINAL_DEBUG_GEOMETRY, "window requests %dx%d px\n",
+ toplevel_request.width, toplevel_request.height);
+
+ chrome_width = vbox_request.width - (char_width * grid_width);
+ chrome_height = vbox_request.height - (char_height * grid_height);
+ _terminal_debug_print (TERMINAL_DEBUG_GEOMETRY, "chrome: %dx%d px\n",
+ chrome_width, chrome_height);
+
+ csd_width = toplevel_request.width - vbox_request.width;
+ csd_height = toplevel_request.height - vbox_request.height;
+ _terminal_debug_print (TERMINAL_DEBUG_GEOMETRY, "CSDs: %dx%d px%s\n",
+ csd_width, csd_height,
+ priv->realized ? "" : " (just a guess)");
+
+ gtk_widget_get_preferred_size (widget, NULL, &widget_request);
+ _terminal_debug_print (TERMINAL_DEBUG_GEOMETRY, "terminal widget requests %dx%d px\n",
+ widget_request.width, widget_request.height);
+
+ if (!priv->realized)
+ {
+ /* Don't actually set the geometry hints until we have been realized,
+ * because we don't know precisely how large the client-side decorations
+ * are going to be. We also avoid setting priv->old_csd_width or
+ * priv->old_csd_height, so that next time through this function we'll
+ * definitely recalculate the hints.
+ *
+ * Similarly, the size request doesn't seem to include the padding
+ * until we've been redrawn at least once. Don't resize the window
+ * until we've done that. */
+ _terminal_debug_print (TERMINAL_DEBUG_GEOMETRY, "not realized yet\n");
+ }
+ else if (char_width != priv->old_char_width ||
char_height != priv->old_char_height ||
- padding.left + padding.right != priv->old_base_width ||
- padding.top + padding.bottom != priv->old_base_height ||
+ padding.left + padding.right != priv->old_padding_width ||
+ padding.top + padding.bottom != priv->old_padding_height ||
+ chrome_width != priv->old_chrome_width ||
+ chrome_height != priv->old_chrome_height ||
+ csd_width != priv->old_csd_width ||
+ csd_height != priv->old_csd_height ||
widget != (GtkWidget*) priv->old_geometry_widget)
{
- gtk_widget_get_preferred_size (GTK_WIDGET (window), NULL, &toplevel_request);
- gtk_widget_get_preferred_size (widget, NULL, &widget_request);
-
- base_width = toplevel_request.width - widget_request.width;
- base_height = toplevel_request.height - widget_request.height;
-
- hints.base_width = base_width + padding.left + padding.right;
- hints.base_height = base_height + padding.top + padding.bottom;
+ hints.base_width = chrome_width + csd_width;
+ hints.base_height = chrome_height + csd_height;
#define MIN_WIDTH_CHARS 4
#define MIN_HEIGHT_CHARS 1
@@ -3632,11 +3737,9 @@ terminal_window_update_geometry (TerminalWindow *window)
hints.min_height,
hints.width_inc,
hints.height_inc);
-
- priv->old_char_width = hints.width_inc;
- priv->old_char_height = hints.height_inc;
- priv->old_base_width = hints.base_width;
- priv->old_base_height = hints.base_height;
+
+ priv->old_csd_width = csd_width;
+ priv->old_csd_height = csd_height;
priv->old_geometry_widget = widget;
}
else
@@ -3645,6 +3748,15 @@ terminal_window_update_geometry (TerminalWindow *window)
"[window %p] hints: increment unchanged, not setting\n",
window);
}
+
+ /* We need these for the size calculation in terminal_window_update_size()
+ * (at least under GTK >= 3.19), so we set them unconditionally. */
+ priv->old_char_width = char_width;
+ priv->old_char_height = char_height;
+ priv->old_chrome_width = chrome_width;
+ priv->old_chrome_height = chrome_height;
+ priv->old_padding_width = padding.left + padding.right;
+ priv->old_padding_height = padding.top + padding.bottom;
}
static void
--
2.8.1

View File

@ -1,3 +1,23 @@
-------------------------------------------------------------------
Mon Jul 25 22:19:39 UTC 2016 - zaitor@opensuse.org
- Add gnome-terminal-notebook-avoid-crash-on-tab-DND.patch and
gnome-terminal-profile-editor-initialize-palette.patch: Two
cherrypicked bugfix commits from upstream stable branch
(bgo#768850, bgo#769161, boo#980474).
-------------------------------------------------------------------
Thu Jul 21 18:07:36 CEST 2016 - fcrozat@suse.com
- Update gnome-terminal-resize-fix.patch with latest revision of
the patches, still not accepted upstream (bgo#760944 bsc#987859).
-------------------------------------------------------------------
Tue May 24 10:53:39 UTC 2016 - zaitor@opensuse.org
- Add gnome-terminal-resize-fix.patch: Fix resizing of
gnome-terminal, patches from upstream bug (bgo#760944).
-------------------------------------------------------------------
Tue May 24 10:52:39 UTC 2016 - mgorse@suse.com
@ -15,6 +35,11 @@ Thu May 19 14:06:49 UTC 2016 - zaitor@opensuse.org
autreconf call: no longer needed since the patch needing it in
the past is already dropped.
-------------------------------------------------------------------
Tue May 17 20:49:17 UTC 2016 - mgorse@suse.com
- Update to GNOME 3.20.2 Fate#318572
-------------------------------------------------------------------
Thu May 12 17:09:20 UTC 2016 - zaitor@opensuse.org
@ -27,6 +52,15 @@ Thu May 12 17:09:20 UTC 2016 - zaitor@opensuse.org
+ Fix GSettings default value translations.
+ Updated translations.
-------------------------------------------------------------------
Thu Apr 14 21:40:36 UTC 2016 - mgorse@suse.com
- Update to GNOME 3.20 Fate#318572
- Drop 0001-build-Add-cleanup-functions.patch,
0001-all-Do-not-use-s-format-with-g_variant_get.patch,
0001-profile-Fix-dummy-settings-patch.patch,
0001-utils-Fix-double-free-in-error-path.patch: fixed upstream.
-------------------------------------------------------------------
Tue Apr 12 10:55:55 UTC 2016 - zaitor@opensuse.org
@ -388,6 +422,16 @@ Thu May 1 09:02:35 UTC 2014 - zaitor@opensuse.org
+ Updated documentations.
+ Updated translations.
-------------------------------------------------------------------
Thu Apr 10 17:54:48 UTC 2014 - mgorse@suse.com
- Add
0001-build-Add-cleanup-functions.patch,
0001-all-Do-not-use-s-format-with-g_variant_get.patch,
0001-profile-Fix-dummy-settings-patch.patch,
0001-utils-Fix-double-free-in-error-path.patch: fixes for crashes
from upstream (bgo#708198, bgo#724264).
-------------------------------------------------------------------
Mon Mar 24 15:39:20 UTC 2014 - dimstar@opensuse.org

View File

@ -24,6 +24,12 @@ License: GPL-3.0+ and LGPL-2.1+
Group: System/X11/Terminals
Url: http://www.gnome.org
Source: http://download.gnome.org/sources/gnome-terminal/3.20/%{name}-%{version}.tar.xz
# PATCH-FIX-UPSTREAM gnome-terminal-resize-fix.patch bgo#760944 zaitor@opensuse.org -- Fix resizing of gnome-terminal, patches from upstream bug.
Patch0: gnome-terminal-resize-fix.patch
# PATCH-FIX-UPSTREAM gnome-terminal-profile-editor-initialize-palette.patch bgo#768850 zaitor@opensuse.org -- profile: editor: Properly initialize the first palette color
Patch1: gnome-terminal-profile-editor-initialize-palette.patch
# PATCH-FIX-UPSTREAM gnome-terminal-notebook-avoid-crash-on-tab-DND.patch bgo#769161 zaitor@opensuse.org -- notebook: avoid crash on tab DND
Patch2: gnome-terminal-notebook-avoid-crash-on-tab-DND.patch
BuildRequires: fdupes
# Needed for search provider. It should not be needed in my opionion, we have to take this up with upstream, or just provide search provider interface definition file as source.
BuildRequires: gnome-shell
@ -81,6 +87,9 @@ arbitrary folders.
%lang_package
%prep
%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p1
translation-update-upstream
%build