Project

General

Profile

Actions

Bug #1289

closed

GTK client remember size of the city dlog

Added by Dean Brown about 1 month ago. Updated about 21 hours ago.

Status:
Closed
Priority:
Normal
Category:
gtk3.22-client
Target version:
Start date:
04/06/2025
Due date:
% Done:

0%

Estimated time:

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

Actions #1

Updated by Dean Brown about 1 month ago

This patch fixes gtk3.22 and gtk4 client. Tested and works for 3.1, 3.2 branch. Should work for main branch.

Actions #2

Updated by Dean Brown about 1 month ago

copy the fix into gtk5

Actions #3

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 '(')

Actions #4

Updated by Marko Lindqvist 18 days ago

  • Target version set to 3.1.6
Actions #5

Updated by Dean Brown 15 days ago

Replace files 1289-gtk5.patch and 1289.patch with 1289FixedCombined.patch

Updated by Marko Lindqvist 10 days ago

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.

Actions #8

Updated by Marko Lindqvist 10 days ago

  • Status changed from New to In Review
  • Assignee set to Marko Lindqvist
Actions #9

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.

Actions #10

Updated by Marko Lindqvist 3 days ago

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

Actions #11

Updated by Marko Lindqvist 3 days ago

  • Status changed from In Progress to In Review
Actions #12

Updated by Marko Lindqvist about 21 hours ago

  • Status changed from In Review to Closed
Actions

Also available in: Atom PDF