Skip to content

Commit

Permalink
Set the gravity of the main and the monitor windows,
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Rhialto committed Dec 3, 2024
1 parent 11cf9fd commit f476e25
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 3 additions & 0 deletions vice/src/arch/gtk3/ui.c
Original file line number Diff line number Diff line change
Expand Up @@ -1788,6 +1788,9 @@ void ui_create_main_window(video_canvas_t *canvas)
}

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

Expand Down
7 changes: 5 additions & 2 deletions vice/src/arch/gtk3/uimon.c
Original file line number Diff line number Diff line change
Expand Up @@ -1283,14 +1283,17 @@ static gboolean uimon_window_open_impl(gpointer user_data)
fixed.window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_title(GTK_WINDOW(fixed.window), "VICE monitor");

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

Expand Down

0 comments on commit f476e25

Please sign in to comment.