]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/window.cpp
added wxNativeContainerWindow and implemented it for wxMSW and wxGTK
[wxWidgets.git] / src / gtk / window.cpp
index 7e637c83b076ba1a89f5c960d55e7bde34be9352..28d8173c4c83f4cada4871fdc00ff5cc27a78eae 100644 (file)
@@ -36,7 +36,7 @@
 #include <ctype.h>
 
 #include "wx/gtk/private.h"
-#include "wx/gtk/win_gtk.h"
+#include "wx/gtk/private/win_gtk.h"
 #include <gdk/gdkkeysyms.h>
 #include <gdk/gdkx.h>
 
@@ -187,11 +187,6 @@ static bool g_captureWindowHasMouse = false;
 
 wxWindowGTK  *g_focusWindow = (wxWindowGTK*) NULL;
 
-// the last window which had the focus - this is normally never NULL (except
-// if we never had focus at all) as even when g_focusWindow is NULL it still
-// keeps its previous value
-wxWindowGTK *g_focusWindowLast = (wxWindowGTK*) NULL;
-
 // If a window get the focus set but has not been realized
 // yet, defer setting the focus to idle time.
 wxWindowGTK *g_delayedFocus = (wxWindowGTK*) NULL;
@@ -235,9 +230,7 @@ gdk_window_warp_pointer (GdkWindow      *window,
 //-----------------------------------------------------------------------------
 
 // returns the child of win which currently has focus or NULL if not found
-//
-// Note: can't be static, needed by textctrl.cpp.
-wxWindow *wxFindFocusedChild(wxWindowGTK *win)
+static wxWindow *wxFindFocusedChild(wxWindowGTK *win)
 {
     wxWindow *winFocus = wxWindowGTK::FindFocus();
     if ( !winFocus )
@@ -1622,7 +1615,6 @@ gtk_window_focus_in_callback( GtkWidget * WXUNUSED(widget),
     if (win->m_imData)
         gtk_im_context_focus_in(win->m_imData->context);
 
-    g_focusWindowLast =
     g_focusWindow = win;
 
     wxLogTrace(TRACE_FOCUS,
@@ -2671,7 +2663,7 @@ void wxWindowGTK::OnInternalIdle()
         }
     }
 
-    if (wxUpdateUIEvent::CanUpdate(this) && IsShown())
+    if (wxUpdateUIEvent::CanUpdate(this) && IsShownOnScreen())
         UpdateWindowUI(wxUPDATE_UI_FROMIDLE);
 }
 
@@ -4211,3 +4203,33 @@ GdkWindow* wxWindowGTK::GTKGetDrawingWindow() const
         window = m_wxwindow->window;
     return window;
 }
+
+// ----------------------------------------------------------------------------
+// freeze/thaw
+// ----------------------------------------------------------------------------
+
+void wxWindowGTK::GTKFreezeWidget(GtkWidget *w)
+{
+    if ( w && !GTK_WIDGET_NO_WINDOW(w) )
+        gdk_window_freeze_updates(w->window);
+}
+
+void wxWindowGTK::GTKThawWidget(GtkWidget *w)
+{
+    if ( w && !GTK_WIDGET_NO_WINDOW(w) )
+        gdk_window_thaw_updates(w->window);
+}
+
+void wxWindowGTK::DoFreeze()
+{
+    GTKFreezeWidget(m_widget);
+    if ( m_wxwindow && m_widget != m_wxwindow )
+        GTKFreezeWidget(m_wxwindow);
+}
+
+void wxWindowGTK::DoThaw()
+{
+    GTKThawWidget(m_widget);
+    if ( m_wxwindow && m_widget != m_wxwindow )
+        GTKThawWidget(m_wxwindow);
+}