Bug #1289
closedGTK 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 about 1 month 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 Dean Brown about 1 month ago
- File 1289-gtk5.patch 1289-gtk5.patch added
copy the fix into gtk5
Updated by Marko Lindqvist 24 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 '(')
Updated by Dean Brown 15 days ago
- File 1289FixedCombined.patch 1289FixedCombined.patch added
Replace files 1289-gtk5.patch and 1289.patch with 1289FixedCombined.patch
Updated by Marko Lindqvist 10 days ago
- File 0043-gtk-Fix-saving-and-restoring-city-dlog-size.patch 0043-gtk-Fix-saving-and-restoring-city-dlog-size.patch added
- File 0010-gtk-Fix-saving-and-restoring-city-dlog-size.patch 0010-gtk-Fix-saving-and-restoring-city-dlog-size.patch added
I fixed minor style issue in the main/S3_3 patch (former 1289FixedCombined.patch), and S3_1 patch (former 1289.patch).
We still need a separate patch for S3_2.
Updated by Dean Brown 10 days ago
- File S3_2-gtk-Fix-saving-and-restoring-city-dlog-size.patch S3_2-gtk-Fix-saving-and-restoring-city-dlog-size.patch added
patch for S3_2
Updated by Marko Lindqvist 10 days ago
- Status changed from New to In Review
- Assignee set to Marko Lindqvist
Updated by Marko Lindqvist 5 days ago
- Status changed from In Review to In Progress
Noticed an error on gtk5-client change (main/S3_3 patch) in that it refers to GTK4 y-size macros instead of GTK5 ones. Will send updated patch once I rebase my work branches.
Updated by Marko Lindqvist 3 days ago
- File 0029-gtk-Fix-saving-and-restoring-city-dlog-size.patch 0029-gtk-Fix-saving-and-restoring-city-dlog-size.patch added
Marko Lindqvist wrote in #note-9:
Noticed an error on gtk5-client change (main/S3_3 patch) in that it refers to GTK4 y-size macros instead of GTK5 ones. Will send updated patch once I rebase my work branches.
Fixed
Updated by Marko Lindqvist 3 days ago
- Status changed from In Progress to In Review
Updated by Marko Lindqvist about 21 hours ago
- Status changed from In Review to Closed