[gnome-terminal] Remove even_if_mapped parameter to terminal_window_set_size()
- From: Owen Taylor <otaylor src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-terminal] Remove even_if_mapped parameter to terminal_window_set_size()
- Date: Mon, 11 Oct 2010 19:53:40 +0000 (UTC)
commit 1ab1fe12fe075f5b84b7c20944b327c64ef38310
Author: Owen W. Taylor <otaylor fishsoup net>
Date: Sat Oct 9 23:05:12 2010 -0400
Remove even_if_mapped parameter to terminal_window_set_size()
The even_if_mapped parameter to terminal_window_set_size() and
terminal_window_set_size_force_grid() doesn't have any useful
role any more. The original reason it was added is lost to
history, but it may had a residual role of making sure that
the the size set by terminal_window_set_size() didn't override
a default size set by gtk_window_parse_geometry(). With the
better handling of geometry from bug 592435, this is no longer
necessary.
https://bugzilla.gnome.org/show_bug.cgi?id=631799
src/terminal-screen.c | 2 +-
src/terminal-window.c | 30 ++++++++++--------------------
src/terminal-window.h | 4 +---
3 files changed, 12 insertions(+), 24 deletions(-)
---
diff --git a/src/terminal-screen.c b/src/terminal-screen.c
index 1dc479c..bcd22cc 100644
--- a/src/terminal-screen.c
+++ b/src/terminal-screen.c
@@ -1164,7 +1164,7 @@ terminal_screen_change_font (TerminalScreen *screen)
terminal_screen_set_font (screen);
window = terminal_screen_get_window (screen);
- terminal_window_set_size (window, screen, TRUE);
+ terminal_window_set_size (window, screen);
}
static void
diff --git a/src/terminal-window.c b/src/terminal-window.c
index 546b6be..036e795 100644
--- a/src/terminal-window.c
+++ b/src/terminal-window.c
@@ -904,7 +904,7 @@ terminal_size_to_cb (GtkAction *action,
vte_terminal_set_size (VTE_TERMINAL (priv->active_screen), width, height);
- terminal_window_set_size_force_grid (window, priv->active_screen, TRUE, -1, -1);
+ terminal_window_set_size_force_grid (window, priv->active_screen, -1, -1);
}
static void
@@ -1097,7 +1097,7 @@ screen_resize_window_cb (TerminalScreen *screen,
if (screen != priv->active_screen)
return;
- terminal_window_set_size_force_grid (window, screen, TRUE, -1, -1); //grid_width, grid_height);
+ terminal_window_set_size_force_grid (window, screen, -1, -1); //grid_width, grid_height);
}
static void
@@ -2298,7 +2298,7 @@ terminal_window_show (GtkWidget *widget)
{
/* At this point, we have our GdkScreen, and hence the right
* font size, so we can go ahead and size the window. */
- terminal_window_set_size (window, priv->active_screen, FALSE);
+ terminal_window_set_size (window, priv->active_screen);
}
GTK_WIDGET_CLASS (terminal_window_parent_class)->show (widget);
@@ -2566,7 +2566,7 @@ terminal_window_set_menubar_visible (TerminalWindow *window,
"[window %p] setting size after toggling menubar visibility\n",
window);
- terminal_window_set_size (window, priv->active_screen, TRUE);
+ terminal_window_set_size (window, priv->active_screen);
}
}
@@ -2590,16 +2590,14 @@ terminal_window_get_notebook (TerminalWindow *window)
void
terminal_window_set_size (TerminalWindow *window,
- TerminalScreen *screen,
- gboolean even_if_mapped)
+ TerminalScreen *screen)
{
- terminal_window_set_size_force_grid (window, screen, even_if_mapped, -1, -1);
+ terminal_window_set_size_force_grid (window, screen, -1, -1);
}
void
terminal_window_set_size_force_grid (TerminalWindow *window,
TerminalScreen *screen,
- gboolean even_if_mapped,
int force_grid_width,
int force_grid_height)
{
@@ -2624,10 +2622,7 @@ terminal_window_set_size_force_grid (TerminalWindow *window,
grid_height = force_grid_height;
#if GTK_CHECK_VERSION (2, 91, 0)
- if (even_if_mapped && gtk_widget_get_mapped (app))
- gtk_window_resize_to_geometry (GTK_WINDOW (app), grid_width, grid_height);
- else
- gtk_window_set_default_geometry (GTK_WINDOW (app), grid_width, grid_height);
+ gtk_window_resize_to_geometry (GTK_WINDOW (app), grid_width, grid_height);
#else
{
/* Owen's hack from gnome-terminal */
@@ -2681,12 +2676,7 @@ terminal_window_set_size_force_grid (TerminalWindow *window,
window,
grid_width, grid_height, force_grid_width, force_grid_height, w, h);
- if (even_if_mapped && gtk_widget_get_mapped (app)) {
- gtk_window_resize (GTK_WINDOW (app), w, h);
- }
- else {
- gtk_window_set_default_size (GTK_WINDOW (app), w, h);
- }
+ gtk_window_resize (GTK_WINDOW (app), w, h);
}
#endif
}
@@ -2858,7 +2848,7 @@ notebook_page_selected_callback (GtkWidget *notebook,
_terminal_debug_print (TERMINAL_DEBUG_GEOMETRY,
"[window %p] setting size after flipping notebook pages\n",
window);
- terminal_window_set_size (window, screen, TRUE);
+ terminal_window_set_size (window, screen);
terminal_window_update_tabs_menu_sensitivity (window);
terminal_window_update_encoding_menu_active_encoding (window);
@@ -2997,7 +2987,7 @@ notebook_page_removed_callback (GtkWidget *notebook,
pages = gtk_notebook_get_n_pages (GTK_NOTEBOOK (notebook));
if (pages == 1)
{
- terminal_window_set_size (window, priv->active_screen, TRUE);
+ terminal_window_set_size (window, priv->active_screen);
}
else if (pages == 0)
{
diff --git a/src/terminal-window.h b/src/terminal-window.h
index 030b57a..006982f 100644
--- a/src/terminal-window.h
+++ b/src/terminal-window.h
@@ -88,11 +88,9 @@ gboolean terminal_window_parse_geometry (TerminalWindow *window,
void terminal_window_update_geometry (TerminalWindow *window);
void terminal_window_set_size (TerminalWindow *window,
- TerminalScreen *screen,
- gboolean even_if_mapped);
+ TerminalScreen *screen);
void terminal_window_set_size_force_grid (TerminalWindow *window,
TerminalScreen *screen,
- gboolean even_if_mapped,
int force_grid_width,
int force_grid_height);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]