ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
April 17th, 2024 | 14:30-16:00 SGT (UTC+8) | Online

Wireshark-dev: Re: [Wireshark-dev] [Wireshark-commits] rev 48445: /trunk/ui/gtk/ /trunk/ui/gtk/

From: Gerald Combs <gerald@xxxxxxxxxxxxx>
Date: Thu, 21 Mar 2013 11:42:34 -0700
On 3/20/13 6:33 PM, Bill Meier wrote:
> On 3/20/2013 6:41 PM, gerald@xxxxxxxxxxxxx wrote:
>> http://anonsvn.wireshark.org/viewvc/viewvc.cgi?view=rev&revision=48445
>>
>> User: gerald
>> Date: 2013/03/20 03:41 PM
>>
> 
> 
> Gerald:
> 
> There recently was an issue in capture_if_dlg.c where the use of
> gtk_window_get_size() and gtk_window_resize() seemed not to work well on
> some platforms.
> 
> In the end, what seemed to work well was to use
> get_widget_get_preferred_size() and then gtk_window_set_default_size().
> 
> See https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8468 for all the
> gory details.
> 
> The patch attached to the bug replaced the use of get_size/resize with
> get_preferred_size/set_default_size.
> 
> (Note that gtk_widget_get_preferred_size is defined as
> gtk_widget_size_request for GTK2 which means that the 3rd arg to
> gtk_widget_get_preferred_size() is always set to NULL).
> 
> #define gtk_widget_get_preferred_size(x,y,z) \
> gtk_widget_size_request(x,y)

Thanks for pointing that out! I switched to window_get_geometry() +
gtk_window_set_default_size() in r48459. gtk_widget_get_preferred_size()
returns what appears to be the minimum size for the top-level window on
my machine.