Opened 5 years ago

Closed 5 years ago

#15549 closed defect (fixed)

wxGTK: dialogs without a best size shrivel

Reported by: dghart Owned by:
Priority: normal Milestone: 3.0.0
Component: wxGTK Version: stable-latest
Keywords: dialog size regression Cc:
Blocked By: Blocking:
Patch: no


One of my dialogs has recently begun to shrink: it initially appears at about the right size, but over half a second it dwindles to a stub. This bisects to r74685, the fix for #14870. The attached patch demonstrates this in the 'minimal' sample's MyFrame::OnAbout.

Setting any non-default minimum size or size hints, even wxSize(0,0), solves the problem. However, as requiring this is a regression affecting code that has worked since wx2.4, it would be good if it could be fixed. If not, it needs to be well documented.

Attachments (1)

minimal.diff download (1.2 KB) - added by dghart 5 years ago.

Download all attachments as: .zip

Change History (7)

Changed 5 years ago by dghart

comment:1 Changed 5 years ago by vadz

  • Resolution set to duplicate
  • Status changed from new to closed

The correct way is to call dlg.SetSizerAndFit() as the initial size of the dialog is simply not defined otherwise. However the dialog does have some reasonable default size under both MSW and OSX with your patch, so I agree that it should also be the case under GTK.

Unfortunately I don't know how to do fix it without re-breaking #14870. It looks like any call to gtk_window_set_geometry_hints() makes the window resizeable. And, in fact, #14870 is still broken because a non-resizeable window still becomes resizeable as soon as its size is set. So I'm going to close this one and reopen the other one because it's one and the same problem actually.

comment:2 Changed 5 years ago by pcor

  • Resolution duplicate deleted
  • Status changed from closed to reopened

This works fine for me on Fedora 19 with XFCE and gtk+-2.24.19. David, what platform does this happen on? Even if it's Ubuntu, I don't see how this is the same problem as #14870.

comment:3 Changed 5 years ago by vadz

FWIW I see this under the same Ubuntu 12.04 system as #14870.

comment:4 Changed 5 years ago by dghart

This was on debian wheezy, kde, gtk 2.24.10. However it also happens on ubuntu 13.04 lxde and (with gritted teeth) unity; and on VBox guests of openSUSE 12.3 (kde) and fedora 19 (gnome).

I was just getting ready to accuse xfce, but I installed that in fedora 19 and the problem still happens :/ Apart from being a VBox guest, a difference is that my fedora hasn't been updated; but nevertheless its gtk is 2.24.19.

comment:5 Changed 5 years ago by pcor

OK, I do see this now. I botched the test code.

comment:6 Changed 5 years ago by PC

  • Resolution set to fixed
  • Status changed from reopened to closed

(In [74942]) Fix default size of un-resizable windows, broken in r74685
see #14870
closes #15549

Note: See TracTickets for help on using tickets.