diff options
author | ZenWalker <[email protected]> | 2017-08-10 01:10:56 +0200 |
---|---|---|
committer | ZenWalker <[email protected]> | 2017-08-10 01:10:56 +0200 |
commit | 5c6f10892aed32bf7c450962119f65c470898d6d (patch) | |
tree | a7040c54c36def26d3b110fe05fefd0f69291f23 | |
parent | 67e749f9a2612677c5d6c60c888387eb44d4f47c (diff) | |
download | mate-terminal-5c6f10892aed32bf7c450962119f65c470898d6d.tar.bz2 mate-terminal-5c6f10892aed32bf7c450962119f65c470898d6d.tar.xz |
avoid deprecated gdk_screen_get_width/height
-rw-r--r-- | src/terminal-window.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/terminal-window.c b/src/terminal-window.c index 96beb2a..292eea8 100644 --- a/src/terminal-window.c +++ b/src/terminal-window.c @@ -2776,6 +2776,7 @@ terminal_window_update_size_set_geometry (TerminalWindow *window, unsigned int force_grid_width = 0, force_grid_height = 0; int grid_width, grid_height; gint pixel_width, pixel_height; + gint sc_width, sc_height; GdkWindow *gdk_window; GdkGravity pos_gravity; @@ -2851,14 +2852,16 @@ terminal_window_update_size_set_geometry (TerminalWindow *window, if ((geom_result & YValue) == 0) force_pos_y = 0; + gdk_window_get_geometry (gdk_screen_get_root_window (gtk_widget_get_screen (app)), + NULL, NULL, &sc_width, &sc_height); + if (pos_gravity == GDK_GRAVITY_SOUTH_EAST || pos_gravity == GDK_GRAVITY_NORTH_EAST) - force_pos_x = gdk_screen_get_width (gtk_widget_get_screen (app)) - - pixel_width + force_pos_x; + force_pos_x = sc_width - pixel_width + force_pos_x; + if (pos_gravity == GDK_GRAVITY_SOUTH_WEST || pos_gravity == GDK_GRAVITY_SOUTH_EAST) - force_pos_y = gdk_screen_get_height (gtk_widget_get_screen (app)) - - pixel_height + force_pos_y; + force_pos_y = sc_height - pixel_height + force_pos_y; /* we don't let you put a window offscreen; maybe some people would * prefer to be able to, but it's kind of a bogus thing to do. |