Add logging to wxGTK wxTopLevelWindow size-related functions
This can be helpful when debugging size-related problems and doesn't do any harm as long as the corresponding tracing category is disabled.
This commit is contained in:
parent
08c3d09e51
commit
66cb7089f8
1 changed files with 24 additions and 0 deletions
|
|
@ -50,6 +50,8 @@
|
|||
#include <gdk/gdkwayland.h>
|
||||
#endif
|
||||
|
||||
#define TRACE_TLWSIZE "tlwsize"
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// data
|
||||
// ----------------------------------------------------------------------------
|
||||
|
|
@ -271,6 +273,11 @@ size_allocate(GtkWidget*, GtkAllocation* alloc, wxTopLevelWindowGTK* win)
|
|||
if (win->m_clientWidth != alloc->width ||
|
||||
win->m_clientHeight != alloc->height)
|
||||
{
|
||||
wxLogTrace(TRACE_TLWSIZE, "Size changed for %s (%d, %d) -> (%d, %d)",
|
||||
wxDumpWindow(win),
|
||||
win->m_clientWidth, win->m_clientHeight,
|
||||
alloc->width, alloc->height);
|
||||
|
||||
wxRecursionGuard setInSizeAllocate(g_inSizeAllocate);
|
||||
|
||||
win->m_clientWidth = alloc->width;
|
||||
|
|
@ -1293,6 +1300,9 @@ void wxTopLevelWindowGTK::DoSetSize( int x, int y, int width, int height, int si
|
|||
|
||||
if (m_width != oldSize.x || m_height != oldSize.y)
|
||||
{
|
||||
wxLogTrace(TRACE_TLWSIZE, "Size set for %s (%d, %d) -> (%d, %d)",
|
||||
wxDumpWindow(this), oldSize.x, oldSize.y, m_width, m_height);
|
||||
|
||||
m_deferShowAllowed = true;
|
||||
m_useCachedClientSize = false;
|
||||
|
||||
|
|
@ -1341,6 +1351,9 @@ static gboolean reset_size_request(void* data)
|
|||
|
||||
void wxTopLevelWindowGTK::DoSetClientSize(int width, int height)
|
||||
{
|
||||
wxLogTrace(TRACE_TLWSIZE, "Client size set for %s: (%d, %d)",
|
||||
wxDumpWindow(this), width, height);
|
||||
|
||||
base_type::DoSetClientSize(width, height);
|
||||
|
||||
// Since client size is being explicitly set, don't change it later
|
||||
|
|
@ -1399,6 +1412,9 @@ void wxTopLevelWindowGTK::DoSetSizeHints( int minW, int minH,
|
|||
int maxW, int maxH,
|
||||
int incW, int incH )
|
||||
{
|
||||
wxLogTrace(TRACE_TLWSIZE, "Size hints for %s set to (%d, %d)",
|
||||
wxDumpWindow(this), minW, minH);
|
||||
|
||||
base_type::DoSetSizeHints(minW, minH, maxW, maxH, incW, incH);
|
||||
|
||||
if (!HasFlag(wxRESIZE_BORDER))
|
||||
|
|
@ -1589,6 +1605,9 @@ void wxTopLevelWindowGTK::GTKDoAfterShow()
|
|||
|
||||
void wxTopLevelWindowGTK::GTKUpdateClientSizeIfNecessary()
|
||||
{
|
||||
wxLogTrace(TRACE_TLWSIZE, "GTKUpdateClientSizeIfNecessary() for %s, pending=%d",
|
||||
wxDumpWindow(this), m_pendingFittingClientSizeFlags);
|
||||
|
||||
if ( m_pendingFittingClientSizeFlags )
|
||||
{
|
||||
WXSetInitialFittingClientSize(m_pendingFittingClientSizeFlags);
|
||||
|
|
@ -1599,6 +1618,8 @@ void wxTopLevelWindowGTK::GTKUpdateClientSizeIfNecessary()
|
|||
|
||||
void wxTopLevelWindowGTK::SetMinSize(const wxSize& minSize)
|
||||
{
|
||||
wxLogTrace(TRACE_TLWSIZE, "SetMinSize() for %s", wxDumpWindow(this));
|
||||
|
||||
wxTopLevelWindowBase::SetMinSize(minSize);
|
||||
|
||||
// Explicitly set minimum size should override the pending size, if any.
|
||||
|
|
@ -1608,6 +1629,9 @@ void wxTopLevelWindowGTK::SetMinSize(const wxSize& minSize)
|
|||
void
|
||||
wxTopLevelWindowGTK::WXSetInitialFittingClientSize(int flags, wxSizer* sizer)
|
||||
{
|
||||
wxLogTrace(TRACE_TLWSIZE, "WXSetInitialFittingClientSize(%d) for %s (%s)",
|
||||
flags, wxDumpWindow(this), IsShown() ? "shown" : "hidden");
|
||||
|
||||
// In any case, update the size immediately.
|
||||
wxTopLevelWindowBase::WXSetInitialFittingClientSize(flags, sizer);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue