Project

General

Profile

Actions

Bug #1289

open

GTK client remember size of the city dlog

Added by Dean Brown 23 days ago. Updated 4 days ago.

Status:
New
Priority:
Normal
Assignee:
-
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

1289.patch (4.38 KB) 1289.patch Dean Brown, 04/11/2025 11:59 PM
1289-gtk5.patch (2.26 KB) 1289-gtk5.patch Dean Brown, 04/16/2025 01:57 AM
Actions

Also available in: Atom PDF