Skip to content

Commit f476e25

Browse files
committed
Set the gravity of the main and the monitor windows,
so that gtk doesn't over-compensate for the window's border width when saving/restoring its position. git-svn-id: https://svn.code.sf.net/p/vice-emu/code/trunk@45386 379a1393-f5fb-40a0-bcee-ef074d9b53f7
1 parent 11cf9fd commit f476e25

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

vice/src/arch/gtk3/ui.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1788,6 +1788,9 @@ void ui_create_main_window(video_canvas_t *canvas)
17881788
}
17891789

17901790
new_window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
1791+
/* Set the gravity so that gtk doesn't over-compensate for the
1792+
* window's border width when saving/restoring its position. */
1793+
gtk_window_set_gravity(GTK_WINDOW(new_window), GDK_GRAVITY_STATIC);
17911794
/* this needs to be here to make the menus with accelerators work */
17921795
vhk_gtk_init_accelerators(new_window);
17931796

vice/src/arch/gtk3/uimon.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1283,14 +1283,17 @@ static gboolean uimon_window_open_impl(gpointer user_data)
12831283
fixed.window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
12841284
gtk_window_set_title(GTK_WINDOW(fixed.window), "VICE monitor");
12851285

1286-
resources_get_int("MonitorXpos", &xpos);
1287-
resources_get_int("MonitorYpos", &ypos);
1286+
resources_get_int("MonitorXPos", &xpos);
1287+
resources_get_int("MonitorYPos", &ypos);
12881288
if (xpos == INT_MIN || ypos == INT_MIN) {
12891289
/* Only center if we didn't get either a previous position or
12901290
* the position was set via the command line.
12911291
*/
12921292
gtk_window_set_position(GTK_WINDOW(fixed.window), GTK_WIN_POS_CENTER);
12931293
}
1294+
/* Set the gravity so that gtk doesn't over-compensate for the
1295+
* window's border width when saving/restoring its position. */
1296+
gtk_window_set_gravity(GTK_WINDOW(fixed.window), GDK_GRAVITY_STATIC);
12941297
gtk_widget_set_app_paintable(fixed.window, TRUE);
12951298
gtk_window_set_deletable(GTK_WINDOW(fixed.window), TRUE);
12961299

0 commit comments

Comments
 (0)