From 49be360eab0ae2f70bcf2b0bdcc336efa16978bd Mon Sep 17 00:00:00 2001 From: Paul Cornett Date: Thu, 3 Nov 2016 09:38:39 -0700 Subject: [PATCH] Avoid assert dialog in ClientToScreen()/ScreenToClient(), it's just too annoying (cherry picked from commit e3f117c4f3f7820acc3ba6ef9bdb8370106f1f0d) --- src/gtk/window.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index 96789defe2..1d3c55f1f9 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -3201,7 +3201,11 @@ void wxWindowGTK::DoClientToScreen( int *x, int *y ) const return; } - wxCHECK_RET(source, "ClientToScreen failed on unrealized window"); + if (source == NULL) + { + wxLogDebug("ClientToScreen cannot work when toplevel window is not shown"); + return; + } int org_x = 0; int org_y = 0; @@ -3271,7 +3275,11 @@ void wxWindowGTK::DoScreenToClient( int *x, int *y ) const return; } - wxCHECK_RET(source, "ScreenToClient failed on unrealized window"); + if (source == NULL) + { + wxLogDebug("ScreenToClient cannot work when toplevel window is not shown"); + return; + } int org_x = 0; int org_y = 0;