]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/window.cpp
More comments about non-native GTH widgets.
[wxWidgets.git] / src / gtk / window.cpp
index 00d1a6c61765f0dcffb96b04e343669edd7a3be7..a6544f8fe63403a26db675e6b9ffe1201b11759c 100644 (file)
@@ -219,8 +219,6 @@ extern bool       g_blockEventsOnDrag;
 extern bool       g_blockEventsOnScroll;
 extern wxCursor   g_globalCursor;
 
-static GdkGC *g_eraseGC = NULL;
-
 // mouse capture state: the window which has it and if the mouse is currently
 // inside it
 static wxWindowGTK  *g_captureWindow = (wxWindowGTK*) NULL;
@@ -1122,10 +1120,6 @@ gtk_window_key_press_callback( GtkWidget *widget,
         }
     }
 
-
-
-
-
     // win is a control: tab can be propagated up
     if ( !ret &&
          ((gdk_event->keyval == GDK_Tab) || (gdk_event->keyval == GDK_ISO_Left_Tab)) &&
@@ -1150,13 +1144,7 @@ gtk_window_key_press_callback( GtkWidget *widget,
         ret = win->GetParent()->GetEventHandler()->ProcessEvent( new_event );
     }
 
-    if (ret)
-    {
-        g_signal_stop_emission_by_name (widget, "key_press_event");
-        return TRUE;
-    }
-
-    return FALSE;
+    return ret;
 }
 }
 
@@ -1257,11 +1245,7 @@ gtk_window_key_release_callback( GtkWidget *widget,
         return FALSE;
     }
 
-    if ( !win->GetEventHandler()->ProcessEvent( event ) )
-        return FALSE;
-
-    g_signal_stop_emission_by_name (widget, "key_release_event");
-    return TRUE;
+    return win->GetEventHandler()->ProcessEvent(event);
 }
 }
 
@@ -1613,7 +1597,6 @@ gtk_window_button_press_callback( GtkWidget *widget,
 
     if (win->GetEventHandler()->ProcessEvent( event ))
     {
-        g_signal_stop_emission_by_name (widget, "button_press_event");
         return TRUE;
     }
 
@@ -1684,13 +1667,7 @@ gtk_window_button_release_callback( GtkWidget *widget,
     event.SetEventObject( win );
     event.SetId( win->GetId() );
 
-    if (win->GetEventHandler()->ProcessEvent( event ))
-    {
-        g_signal_stop_emission_by_name (widget, "button_release_event");
-        return TRUE;
-    }
-
-    return FALSE;
+    return win->GetEventHandler()->ProcessEvent(event);
 }
 
 //-----------------------------------------------------------------------------
@@ -1756,13 +1733,7 @@ gtk_window_motion_notify_callback( GtkWidget *widget,
         }
     }
 
-    if (win->GetEventHandler()->ProcessEvent( event ))
-    {
-        g_signal_stop_emission_by_name (widget, "motion_notify_event");
-        return TRUE;
-    }
-
-    return FALSE;
+    return win->GetEventHandler()->ProcessEvent(event);
 }
 
 //-----------------------------------------------------------------------------
@@ -1977,13 +1948,7 @@ gtk_window_enter_callback( GtkWidget *widget,
         }
     }
 
-    if (win->GetEventHandler()->ProcessEvent( event ))
-    {
-       g_signal_stop_emission_by_name (widget, "enter_notify_event");
-       return TRUE;
-    }
-
-    return FALSE;
+    return win->GetEventHandler()->ProcessEvent(event);
 }
 
 //-----------------------------------------------------------------------------
@@ -2022,13 +1987,7 @@ gtk_window_leave_callback( GtkWidget *widget,
     event.m_x = x + pt.x;
     event.m_y = y + pt.y;
 
-    if (win->GetEventHandler()->ProcessEvent( event ))
-    {
-        g_signal_stop_emission_by_name (widget, "leave_notify_event");
-        return TRUE;
-    }
-
-    return FALSE;
+    return win->GetEventHandler()->ProcessEvent(event);
 }
 
 //-----------------------------------------------------------------------------
@@ -2942,9 +2901,6 @@ void wxWindowGTK::OnInternalIdle()
         m_needsStyleChange = false;
     }
     
-    // Update invalidated regions.
-    GtkUpdate();
-
     wxCursor cursor = m_cursor;
     if (g_globalCursor.Ok()) cursor = g_globalCursor;
 
@@ -3604,7 +3560,14 @@ void wxWindowGTK::GTKUpdateCursor()
             const size_t count = windowsThis.size();
             for ( size_t n = 0; n < count; n++ )
             {
-                gdk_window_set_cursor(windowsThis[n], cursor.GetCursor());
+                GdkWindow *win = windowsThis[n];
+                if ( !win )
+                {
+                    wxFAIL_MSG(_T("NULL window returned by GTKGetWindow()?"));
+                    continue;
+                }
+
+                gdk_window_set_cursor(win, cursor.GetCursor());
             }
         }
     }
@@ -4354,32 +4317,3 @@ void wxRemoveGrab(wxWindow* window)
     gtk_grab_remove( (GtkWidget*) window->GetHandle() );
 }
 
-// ----------------------------------------------------------------------------
-// wxWinModule
-// ----------------------------------------------------------------------------
-
-class wxWinModule : public wxModule
-{
-public:
-    bool OnInit();
-    void OnExit();
-
-private:
-    DECLARE_DYNAMIC_CLASS(wxWinModule)
-};
-
-IMPLEMENT_DYNAMIC_CLASS(wxWinModule, wxModule)
-
-bool wxWinModule::OnInit()
-{
-    // g_eraseGC = gdk_gc_new( gdk_get_default_root_window() );
-    // gdk_gc_set_fill( g_eraseGC, GDK_SOLID );
-
-    return true;
-}
-
-void wxWinModule::OnExit()
-{
-    if (g_eraseGC)
-        g_object_unref (g_eraseGC);
-}