From: Julian Smart Date: Thu, 14 Feb 2008 11:08:49 +0000 (+0000) Subject: Cut down on unnecessary update events X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/df707c27b3837ef17a0ede057e900638555525ce Cut down on unnecessary update events git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@51784 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index bd245f6925..ed85afa137 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -2665,7 +2665,7 @@ void wxWindowGTK::OnInternalIdle() } } - if (wxUpdateUIEvent::CanUpdate(this) && IsShown()) + if (wxUpdateUIEvent::CanUpdate(this) && IsShownOnScreen()) UpdateWindowUI(wxUPDATE_UI_FROMIDLE); } diff --git a/src/gtk1/window.cpp b/src/gtk1/window.cpp index a2e39a0d66..82fbdedf02 100644 --- a/src/gtk1/window.cpp +++ b/src/gtk1/window.cpp @@ -2968,7 +2968,7 @@ void wxWindowGTK::OnInternalIdle() } } - if (wxUpdateUIEvent::CanUpdate(this) && IsShown()) + if (wxUpdateUIEvent::CanUpdate(this) && IsShownOnScreen()) UpdateWindowUI(wxUPDATE_UI_FROMIDLE); } diff --git a/src/mac/carbon/window.cpp b/src/mac/carbon/window.cpp index abf913ca76..e6ac15ee79 100644 --- a/src/mac/carbon/window.cpp +++ b/src/mac/carbon/window.cpp @@ -2502,7 +2502,7 @@ void wxWindowMac::OnInternalIdle() { // This calls the UI-update mechanism (querying windows for // menu/toolbar/control state information) - if (wxUpdateUIEvent::CanUpdate(this) && IsShown()) + if (wxUpdateUIEvent::CanUpdate(this) && IsShownOnScreen()) UpdateWindowUI(wxUPDATE_UI_FROMIDLE); } diff --git a/src/motif/window.cpp b/src/motif/window.cpp index 211dc3bf35..17634160d4 100644 --- a/src/motif/window.cpp +++ b/src/motif/window.cpp @@ -1657,7 +1657,7 @@ void wxWindow::OnInternalIdle() { // This calls the UI-update mechanism (querying windows for // menu/toolbar/control state information) - if (wxUpdateUIEvent::CanUpdate(this) && IsShown()) + if (wxUpdateUIEvent::CanUpdate(this) && IsShownOnScreen()) UpdateWindowUI(wxUPDATE_UI_FROMIDLE); } diff --git a/src/msw/window.cpp b/src/msw/window.cpp index 0306420dec..06e820fe43 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -1570,7 +1570,7 @@ void wxWindowMSW::OnInternalIdle() } #endif // !HAVE_TRACKMOUSEEVENT - if (wxUpdateUIEvent::CanUpdate(this) && IsShown()) + if (wxUpdateUIEvent::CanUpdate(this) && IsShownOnScreen()) UpdateWindowUI(wxUPDATE_UI_FROMIDLE); } diff --git a/src/x11/window.cpp b/src/x11/window.cpp index 0c69ed36f6..b437ef79f6 100644 --- a/src/x11/window.cpp +++ b/src/x11/window.cpp @@ -1317,7 +1317,7 @@ void wxWindowX11::OnInternalIdle() // This calls the UI-update mechanism (querying windows for // menu/toolbar/control state information) - if (wxUpdateUIEvent::CanUpdate((wxWindow*) this) && IsShown()) + if (wxUpdateUIEvent::CanUpdate((wxWindow*) this) && IsShownOnScreen()) UpdateWindowUI(wxUPDATE_UI_FROMIDLE); // Set the input focus if couldn't do it before