Bug #1289
openGTK client remember size of the city dlog
0%
Description
Similar to #1287 & #1288, there is already code to do this, but it is not working.
In file client/gui-gtk-3.22/citydlg.c , routine create_city_dialog(), this code -
/* Restore size of the city dialog. */
gtk_window_set_default_size(GTK_WINDOW(pdialog->shell),
GUI_GTK_OPTION(citydlg_xsize),
GUI_GTK_OPTION(citydlg_ysize));
does nothing. Changing the width/height param values or leaving out the call altogether makes no difference to size of the dialog. In the routine city_destroy_callback(), this code -
/* Save size of the city dialog. */
GUI_GTK_OPTION(citydlg_xsize)
= CLIP(GUI_GTK3_22_CITYDLG_MIN_XSIZE,
gtk_widget_get_allocated_width(pdialog->shell),
GUI_GTK3_22_CITYDLG_MAX_XSIZE);
GUI_GTK_OPTION(citydlg_ysize)
= CLIP(GUI_GTK3_22_CITYDLG_MIN_XSIZE,
gtk_widget_get_allocated_height(pdialog->shell),
GUI_GTK3_22_CITYDLG_MAX_XSIZE);
the gtk_widget_get_allocated_xxx() both always return 1. And the CLIP for the height has typos XSIZE should be YSIZE.
Files
Updated by Dean Brown 17 days ago
- File 1289.patch 1289.patch added
This patch fixes gtk3.22 and gtk4 client. Tested and works for 3.1, 3.2 branch. Should work for main branch.
Updated by Marko Lindqvist 4 days ago
- The patch does not apply to S3_2, S3_3, or main branch.
- Please combine gtk5-client change to the same patch/commit
- Follow freeciv style, not gtk-style (no space between function name and '(')