]> git.saurik.com Git - wxWidgets.git/commitdiff
Optimized update events by only sending them to visible windows
authorJulian Smart <julian@anthemion.co.uk>
Fri, 21 Sep 2007 10:51:31 +0000 (10:51 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Fri, 21 Sep 2007 10:51:31 +0000 (10:51 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@48854 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/dfb/window.cpp
src/gtk/window.cpp
src/gtk1/window.cpp
src/mgl/window.cpp
src/motif/window.cpp
src/msw/window.cpp
src/x11/window.cpp

index 40e8fddbee47a6ccea4edbdede180d841f41ce11..2470e530ba6d6bd99c3fa50c28255766b7a16d31 100644 (file)
@@ -1076,7 +1076,7 @@ void wxWindowDFB::HandleKeyEvent(const wxDFBWindowEvent& event_)
 
 void wxWindowDFB::OnInternalIdle()
 {
-    if (wxUpdateUIEvent::CanUpdate(this))
+    if (wxUpdateUIEvent::CanUpdate(this) && IsShown())
         UpdateWindowUI(wxUPDATE_UI_FROMIDLE);
 }
 
index fed52353e4409d319d633cfcb57d9269f2db4173..7f1927726824df3089f8b30bd7c0836bd22333e4 100644 (file)
@@ -2839,7 +2839,7 @@ void wxWindowGTK::OnInternalIdle()
         }
     }
 
-    if (wxUpdateUIEvent::CanUpdate(this))
+    if (wxUpdateUIEvent::CanUpdate(this) && IsShown())
         UpdateWindowUI(wxUPDATE_UI_FROMIDLE);
 }
 
index d74a0e0e3fae2d1290eb6b0741de7c328f7e94fb..3b6b76436fc3831096f7db7d46f2e07932051fe7 100644 (file)
@@ -1583,7 +1583,7 @@ static gint gtk_window_button_press_callback( GtkWidget *widget,
     }
 
     g_lastMouseEvent = (GdkEvent*) gdk_event;
-    
+
     wxMouseEvent event( event_type );
     InitMouseEvent( win, event, gdk_event );
 
@@ -1686,7 +1686,7 @@ static gint gtk_window_button_release_callback( GtkWidget *widget,
     }
 
     g_lastMouseEvent = (GdkEvent*) gdk_event;
-    
+
     wxMouseEvent event( event_type );
     InitMouseEvent( win, event, gdk_event );
 
@@ -2958,7 +2958,7 @@ void wxWindowGTK::OnInternalIdle()
         }
     }
 
-    if (wxUpdateUIEvent::CanUpdate(this))
+    if (wxUpdateUIEvent::CanUpdate(this) && IsShown())
         UpdateWindowUI(wxUPDATE_UI_FROMIDLE);
 }
 
index 85f2abeee3d5417af7718dcfcae3321ec0e0cf1b..caa7490178dc9b7e7acb45a9cae060d6c3f4f834 100644 (file)
@@ -1225,6 +1225,6 @@ wxWindow* wxFindWindowAtPoint(const wxPoint& pt)
 
 void wxWindowMGL::OnInternalIdle()
 {
-    if (wxUpdateUIEvent::CanUpdate(this))
+    if (wxUpdateUIEvent::CanUpdate(this) && IsShown())
         UpdateWindowUI(wxUPDATE_UI_FROMIDLE);
 }
index efc13e52739d446f4e9778ee4206bea3ead9f1a5..d21948303970187067c9404e35d1dfd3ea3ac995 100644 (file)
@@ -1172,7 +1172,7 @@ void wxWindow::DoGetSize(int *x, int *y) const
                        XmNwidth, &xx,
                        XmNheight, &yy,
                        NULL );
-    if(x) *x = widget ? xx : -1; 
+    if(x) *x = widget ? xx : -1;
     if(y) *y = widget ? yy : -1;
 }
 
@@ -1654,7 +1654,7 @@ void wxWindow::OnInternalIdle()
 {
     // This calls the UI-update mechanism (querying windows for
     // menu/toolbar/control state information)
-    if (wxUpdateUIEvent::CanUpdate(this))
+    if (wxUpdateUIEvent::CanUpdate(this) && IsShown())
         UpdateWindowUI(wxUPDATE_UI_FROMIDLE);
 }
 
@@ -2624,14 +2624,14 @@ void wxGetTextExtent(const wxWindow* window, const wxString& str,
     {
         XRectangle ink, logical;
         WXFontSet fset = (WXFontSet) args[0].value;
-    
+
         XmbTextExtents( (XFontSet)fset, str.c_str(), str.length(),
                         &ink, &logical);
 
         if( width ) *width = logical.width;
         if( height ) *height = logical.height;
-        if( ascent ) *ascent = -logical.y;    
-        if( descent ) *descent = logical.height + logical.y;    
+        if( ascent ) *ascent = -logical.y;
+        if( descent ) *descent = logical.height + logical.y;
     }
     else
     {
@@ -2670,14 +2670,14 @@ void wxGetTextExtent(const wxWindow* window, const wxString& str,
     if (type == XmFONT_IS_FONTSET)
     {
         XRectangle ink, logical;
-    
+
         XmbTextExtents( (XFontSet)thing, str.c_str(), str.length(),
                         &ink, &logical);
 
         if( width ) *width = logical.width;
         if( height ) *height = logical.height;
-        if( ascent ) *ascent = -logical.y;    
-        if( descent ) *descent = logical.height + logical.y;    
+        if( ascent ) *ascent = -logical.y;
+        if( descent ) *descent = logical.height + logical.y;
     }
     else
     {
index c41f9b1e61a582d350ca2ac2862acfe91b17b828..1a119e8191b65f7b1568d92d8291fcfcfdc32bbd 100644 (file)
@@ -1442,7 +1442,7 @@ void wxWindowMSW::OnInternalIdle()
     }
 #endif // !HAVE_TRACKMOUSEEVENT
 
-    if (wxUpdateUIEvent::CanUpdate(this))
+    if (wxUpdateUIEvent::CanUpdate(this) && IsShown())
         UpdateWindowUI(wxUPDATE_UI_FROMIDLE);
 }
 
index cdcd39a1b0b4e2f6096da662bca833e137476d27..dbd6b97cff2dc9d22a5c4a4263a306fdf2f9aed6 100644 (file)
@@ -1312,7 +1312,7 @@ void wxWindowX11::OnInternalIdle()
 
     // This calls the UI-update mechanism (querying windows for
     // menu/toolbar/control state information)
-    if (wxUpdateUIEvent::CanUpdate((wxWindow*) this))
+    if (wxUpdateUIEvent::CanUpdate((wxWindow*) this) && IsShown())
         UpdateWindowUI(wxUPDATE_UI_FROMIDLE);
 
     // Set the input focus if couldn't do it before