[Xfce4-commits] [apps/xfce4-terminal] 01/01: Make geometry positioning more precise
noreply at xfce.org
noreply at xfce.org
Mon Sep 12 15:29:43 CEST 2016
This is an automated email from the git hooks/post-receive script.
f2404 pushed a commit to branch master
in repository apps/xfce4-terminal.
commit 93e0123f8b586e07a3fb205cb9c2d1035442d85a
Author: Igor <f2404 at yandex.ru>
Date: Mon Sep 12 16:28:44 2016 +0300
Make geometry positioning more precise
Use gravity when a negative offset is used.
Fixes https://bugzilla.xfce.org/show_bug.cgi?id=12833
---
terminal/terminal-app.c | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/terminal/terminal-app.c b/terminal/terminal-app.c
index 9c77ab3..d0580cc 100644
--- a/terminal/terminal-app.c
+++ b/terminal/terminal-app.c
@@ -664,8 +664,9 @@ terminal_app_open_window (TerminalApp *app,
gboolean reuse_window = FALSE;
GdkDisplay *attr_display;
gint attr_screen_num;
-#if GTK_CHECK_VERSION (3,20,0)
+#if GTK_CHECK_VERSION (3,20,0) && defined (GDK_WINDOWING_X11)
TerminalScreen *active_terminal;
+ GdkGravity gravity = GDK_GRAVITY_NORTH_WEST;
gint mask = NoValue, x, y;
guint width, height;
gint screen_width, screen_height;
@@ -831,9 +832,16 @@ terminal_app_open_window (TerminalApp *app,
screen_height = gdk_screen_get_height (screen);
gtk_window_get_default_size (GTK_WINDOW (window), &window_width, &window_height);
if (mask & XNegative)
- x = screen_width - window_width + x;
+ {
+ x = screen_width - window_width + x;
+ gravity = GDK_GRAVITY_NORTH_EAST;
+ }
if (mask & YNegative)
- y = screen_height - window_height + y;
+ {
+ 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);
}
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list