]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/window.cpp
gsocket update. Fix for EMX broke VA.
[wxWidgets.git] / src / gtk / window.cpp
index 769973db09f18af322b94945c1903f87135f5e61..80384e2535660c2486459e7522ccbb82cec4c055 100644 (file)
 #include <gtk/gtk.h>
 #include <gdk/gdkprivate.h>
 #include <gdk/gdkkeysyms.h>
-#include <wx/gtk/win_gtk.h>
-
 #include <gdk/gdkx.h>
 
+#include <gtk/gtk.h>
+#include <gtk/gtkprivate.h>
+
+#include "wx/gtk/win_gtk.h"
+
 //-----------------------------------------------------------------------------
 // documentation on internals
 //-----------------------------------------------------------------------------
@@ -270,7 +273,7 @@ gdk_window_warp_pointer (GdkWindow      *window,
   GdkWindowPrivate *priv;
 
   if (!window)
-    window = (GdkWindow*) &gdk_root_parent;
+    window = GDK_ROOT_PARENT();
 
   priv = (GdkWindowPrivate*) window;
 
@@ -500,7 +503,7 @@ static long map_to_unmodified_wx_keysym( KeySym keysym )
         case GDK_F12:           key_code = WXK_F12;         break;
         default:
         {
-            if (keysym <= 0xFF)
+            if ((keysym & 0xF000) == 0)
             {
                 guint upper = gdk_keyval_to_upper( (guint)keysym );
                 keysym = (upper != 0 ? upper : keysym ); /* to be MSW compatible */
@@ -599,7 +602,7 @@ static long map_to_wx_keysym( KeySym keysym )
         case GDK_F12:           key_code = WXK_F12;         break;
         default:
         {
-            if (keysym <= 0xFF)
+            if ((keysym & 0xF000) == 0)
             {
                 key_code = (guint)keysym;
             }
@@ -621,7 +624,7 @@ static int gtk_window_expose_callback( GtkWidget *widget, GdkEventExpose *gdk_ev
         wxapp_install_idle_handler();
         
 /*
-    if (win->GetName() == wxT("htmlWindow"))
+    if (win->GetName() == wxT("panel"))
     {
         wxPrintf( wxT("OnExpose from ") );
         if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
@@ -721,7 +724,7 @@ static void gtk_window_draw_callback( GtkWidget *widget, GdkRectangle *rect, wxW
         wxapp_install_idle_handler();
         
 /*
-    if (win->GetName() == wxT("htmlWindow"))
+    if (win->GetName() == wxT("panel"))
     {
         wxPrintf( wxT("OnDraw from ") );
         if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
@@ -737,6 +740,7 @@ static void gtk_window_draw_callback( GtkWidget *widget, GdkRectangle *rect, wxW
         
     if (!win->m_queuedFullRedraw)
     {
+    
         if (!(GTK_WIDGET_APP_PAINTABLE (widget)) &&
              (pizza->clear_on_draw))
         {
@@ -790,6 +794,7 @@ static gint gtk_window_key_press_callback( GtkWidget *widget, GdkEventKey *gdk_e
     if (!win->m_hasVMT) return FALSE;
     if (g_blockEventsOnDrag) return FALSE;
 
+
 /*
     wxString tmp;
     tmp += (char)gdk_event->keyval;
@@ -1726,6 +1731,7 @@ static gint gtk_scrollbar_button_press_callback( GtkRange *widget,
     if (g_isIdle)
         wxapp_install_idle_handler();
 
+
     g_blockEventsOnScroll = TRUE;
     win->m_isScrolling = (gdk_event->window == widget->slider);
 
@@ -1751,7 +1757,7 @@ static gint gtk_scrollbar_button_release_callback( GtkRange *widget,
 
     if (win->m_isScrolling)
     {
-        wxEventType command = wxEVT_SCROLL_THUMBRELEASE;
+        wxEventType command = wxEVT_SCROLLWIN_THUMBRELEASE;
         int value = -1;
         int dir = -1;
 
@@ -2570,8 +2576,14 @@ void wxWindow::OnInternalIdle()
            the actual size of window, in which case all expose events that resulted
            from resizing the window have been sent (and discarded) and we can
            now do our full redraw and switch on expose event handling again. */
-           
-        if ((m_width == m_widget->allocation.width) && (m_height == m_widget->allocation.height))
+        
+        bool child_already_resized = FALSE;
+        if (m_isFrame)
+            child_already_resized = gtk_pizza_child_resized( GTK_PIZZA(m_wxwindow->parent), m_wxwindow );
+        else
+            child_already_resized = gtk_pizza_child_resized( GTK_PIZZA(m_widget->parent), m_widget );
+        
+        if (child_already_resized)
         {
             m_queuedFullRedraw = FALSE;
             m_updateRegion.Clear();
@@ -3029,6 +3041,8 @@ void wxWindow::Refresh( bool eraseBackground, const wxRect *rect )
             gtk_pizza_set_clear( pizza, old_clear );
 */
             GdkEventExpose gdk_event;
+            gdk_event.type = GDK_EXPOSE;
+            gdk_event.window = GTK_PIZZA(m_wxwindow)->bin_window;
             gdk_event.count = 0;
             gdk_event.area.x = 0;
             gdk_event.area.y = 0;
@@ -3063,6 +3077,8 @@ void wxWindow::Refresh( bool eraseBackground, const wxRect *rect )
             gtk_pizza_set_clear( pizza, old_clear );
 */
             GdkEventExpose gdk_event;
+            gdk_event.type = GDK_EXPOSE;
+            gdk_event.window = GTK_PIZZA(m_wxwindow)->bin_window;
             gdk_event.count = 0;
             gdk_event.area.x = rect->x;
             gdk_event.area.y = rect->y;
@@ -3406,6 +3422,10 @@ void wxWindow::CaptureMouse()
 
     if (!window) return;
 
+    wxCursor* cursor = & m_cursor;
+    if (!cursor->Ok())
+        cursor = wxSTANDARD_CURSOR;
+
     gdk_pointer_grab( window, FALSE,
                       (GdkEventMask)
                          (GDK_BUTTON_PRESS_MASK |
@@ -3413,7 +3433,7 @@ void wxWindow::CaptureMouse()
                           GDK_POINTER_MOTION_HINT_MASK |
                           GDK_POINTER_MOTION_MASK),
                       (GdkWindow *) NULL,
-                      m_cursor.GetCursor(),
+                      cursor->GetCursor(),
                       (guint32)GDK_CURRENT_TIME );
     g_captureWindow = this;
 }