[Xfce4-commits] [apps/xfce4-terminal] 01/01: Fix negative offsets handling
noreply at xfce.org
noreply at xfce.org
Fri Aug 4 02:52:12 CEST 2017
This is an automated email from the git hooks/post-receive script.
f 2 4 0 4 p u s h e d a c o m m i t t o b r a n c h m a s t e r
in repository apps/xfce4-terminal.
commit 2b543e2bd6bcedc7aa252881803ed27dcec7b59e
Author: Igor <f2404 at yandex.ru>
Date: Thu Aug 3 20:49:50 2017 -0400
Fix negative offsets handling
Can only calculate window size after tabs have been added.
Fixes bug #13753
---
terminal/terminal-app.c | 68 +++++++++++++++++++++++++++----------------------
1 file changed, 37 insertions(+), 31 deletions(-)
diff --git a/terminal/terminal-app.c b/terminal/terminal-app.c
index eac92d0..0eaf9c4 100644
--- a/terminal/terminal-app.c
+++ b/terminal/terminal-app.c
@@ -816,31 +816,47 @@ terminal_app_open_window (TerminalApp *app,
if (mask & YValue)
y = new_y;
}
+#endif
+ }
+
+ /* add the tabs */
+ for (lp = attr->tabs; lp != NULL; lp = lp->next)
+ {
+ terminal = terminal_screen_new ((TerminalTabAttr *) lp->data,
+ width,
+ height);
+ terminal_window_add (TERMINAL_WINDOW (window), terminal);
+ terminal_screen_launch_child (terminal);
+ }
- if ((mask & XValue) || (mask & YValue))
- {
- screen = gtk_window_get_screen (GTK_WINDOW (window));
+ if (!attr->drop_down)
+ {
+ /* move the window to desired position */
+#ifdef GDK_WINDOWING_X11
+ if ((mask & XValue) || (mask & YValue))
+ {
+ screen = gtk_window_get_screen (GTK_WINDOW (window));
#if GTK_CHECK_VERSION (3, 22, 0)
- gdk_window_get_geometry (gdk_screen_get_root_window (screen), NULL, NULL,
- &screen_width, &screen_height);
+ gdk_window_get_geometry (gdk_screen_get_root_window (screen), NULL, NULL,
+ &screen_width, &screen_height);
#else
- screen_width = gdk_screen_get_width (screen);
- screen_height = gdk_screen_get_height (screen);
+ screen_width = gdk_screen_get_width (screen);
+ screen_height = gdk_screen_get_height (screen);
#endif
- gtk_window_get_default_size (GTK_WINDOW (window), &window_width, &window_height);
- if (mask & XNegative)
- {
- x = screen_width - window_width + x;
- gravity = GDK_GRAVITY_NORTH_EAST;
- }
- if (mask & YNegative)
- {
- y = screen_height - window_height + y;
- gravity = (mask & XNegative) ? GDK_GRAVITY_SOUTH_EAST : GDK_GRAVITY_SOUTH_WEST;
- }
- gtk_window_set_gravity (GTK_WINDOW (window), gravity);
- gtk_window_move (GTK_WINDOW (window), x, y);
- }
+ gtk_window_get_size (GTK_WINDOW (window), &window_width, &window_height);
+ if (mask & XNegative)
+ {
+ x = screen_width - window_width + x;
+ gravity = GDK_GRAVITY_NORTH_EAST;
+ }
+ if (mask & YNegative)
+ {
+ y = screen_height - window_height + y;
+ gravity = (mask & XNegative) ? GDK_GRAVITY_SOUTH_EAST : GDK_GRAVITY_SOUTH_WEST;
+ }
+ gtk_window_set_gravity (GTK_WINDOW (window), gravity);
+ gtk_window_move (GTK_WINDOW (window), x, y);
+ }
else if (!(mask & WidthValue) && !(mask & XValue))
#else
if (!gtk_window_parse_geometry (GTK_WINDOW (window), geometry))
@@ -851,16 +867,6 @@ terminal_app_open_window (TerminalApp *app,
g_free (geometry);
}
- /* add the tabs */
- for (lp = attr->tabs; lp != NULL; lp = lp->next)
- {
- terminal = terminal_screen_new ((TerminalTabAttr *) lp->data,
- width,
- height);
- terminal_window_add (TERMINAL_WINDOW (window), terminal);
- terminal_screen_launch_child (terminal);
- }
-
/* show the window */
if (attr->drop_down)
terminal_window_dropdown_toggle (TERMINAL_WINDOW_DROPDOWN (window), attr->startup_id, reuse_window);
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list