Skip to content

Commit

Permalink
Try to fix positioning (bug 12833)
Browse files Browse the repository at this point in the history
  • Loading branch information
f2404 committed Sep 11, 2016
1 parent f20bc74 commit 175a550
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions terminal/terminal-app.c
Expand Up @@ -662,8 +662,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;
Expand Down Expand Up @@ -829,9 +830,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);
}
}
Expand Down

0 comments on commit 175a550

Please sign in to comment.