X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7e4501ee3cc88ee8dd2b75e2964118e2897ec4a2..cb78397f149e1e94c624b450db62bc540203081f:/src/gtk1/window.cpp diff --git a/src/gtk1/window.cpp b/src/gtk1/window.cpp index 30fae11783..4294a2a249 100644 --- a/src/gtk1/window.cpp +++ b/src/gtk1/window.cpp @@ -775,6 +775,7 @@ static int gtk_window_expose_callback( GtkWidget *widget, } */ +#ifndef __WXUNIVERSAL__ GtkPizza *pizza = GTK_PIZZA (widget); if (win->GetThemeEnabled()) @@ -794,6 +795,7 @@ static int gtk_window_expose_callback( GtkWidget *widget, (char *)"base", 0, 0, -1, -1); } +#endif win->GetUpdateRegion().Union( gdk_event->area.x, gdk_event->area.y, @@ -801,6 +803,7 @@ static int gtk_window_expose_callback( GtkWidget *widget, gdk_event->area.height ); // Actual redrawing takes place in idle time. + win->Update(); return TRUE; } @@ -865,6 +868,7 @@ static void gtk_window_draw_callback( GtkWidget *widget, } */ +#ifndef __WXUNIVERSAL__ GtkPizza *pizza = GTK_PIZZA (widget); if (win->GetThemeEnabled()) @@ -892,10 +896,13 @@ static void gtk_window_draw_callback( GtkWidget *widget, gdk_window_clear_area( pizza->bin_window, rect->x, rect->y, rect->width, rect->height); } +#endif win->GetUpdateRegion().Union( rect->x, rect->y, rect->width, rect->height ); // Actual redrawing takes place in idle time. + + win->Update(); #ifndef __WXUNIVERSAL__ // Redraw child widgets @@ -1205,20 +1212,15 @@ static gint gtk_window_button_press_callback( GtkWidget *widget, GdkEventButton if (!win->IsOwnGtkWindow( gdk_event->window )) return FALSE; - if (win->m_wxwindow) + if (win->m_wxwindow && (g_focusWindow != win) && win->AcceptsFocus()) { - if (GTK_WIDGET_CAN_FOCUS(win->m_wxwindow) && !GTK_WIDGET_HAS_FOCUS (win->m_wxwindow) ) - { - gtk_widget_grab_focus (win->m_wxwindow); - + gtk_widget_grab_focus( win->m_wxwindow ); /* - wxPrintf( wxT("GrabFocus from ") ); - if (win->GetClassInfo() && win->GetClassInfo()->GetClassName()) - wxPrintf( win->GetClassInfo()->GetClassName() ); - wxPrintf( wxT(".\n") ); + wxPrintf( wxT("GrabFocus from ") ); + if (win->GetClassInfo() && win->GetClassInfo()->GetClassName()) + wxPrintf( win->GetClassInfo()->GetClassName() ); + wxPrintf( wxT(".\n") ); */ - - } } wxEventType event_type = wxEVT_NULL; @@ -1640,11 +1642,8 @@ static gint gtk_window_focus_in_callback( GtkWidget *widget, g_focusWindowLast = g_focusWindow = win; -#if 1 - wxPrintf( "OnSetFocus from " ); - if (win->GetClassInfo() && win->GetClassInfo()->GetClassName()) - wxPrintf( win->GetClassInfo()->GetClassName() ); - wxPrintf( ".\n" ); +#if 0 + wxLogDebug( wxT("OnSetFocus from %s\n"), win->GetName().c_str() ); #endif // notify the parent keeping track of focus for the kbd navigation @@ -1703,9 +1702,7 @@ static gint gtk_window_focus_in_callback( GtkWidget *widget, // "focus_out_event" //----------------------------------------------------------------------------- -static GtkWidget *gs_widgetLastFocus = NULL; - -static gint gtk_window_focus_out_callback( GtkWidget *widget, GdkEvent *WXUNUSED(event), wxWindowGTK *win ) +static gint gtk_window_focus_out_callback( GtkWidget *widget, GdkEventFocus *gdk_event, wxWindowGTK *win ) { DEBUG_MAIN_THREAD @@ -1715,17 +1712,9 @@ static gint gtk_window_focus_out_callback( GtkWidget *widget, GdkEvent *WXUNUSED if (!win->m_hasVMT) return FALSE; if (g_blockEventsOnDrag) return FALSE; - // VZ: this is really weird but GTK+ seems to call us from inside - // gtk_widget_grab_focus(), i.e. it first sends "focus_out" signal to - // this widget and then "focus_in". This is totally unexpected and - // completely breaks wxUniv code so ignore this dummy event (we can't - // be losing focus if we're about to acquire it!) - if ( widget == gs_widgetLastFocus ) - { - gs_widgetLastFocus = NULL; - - return FALSE; - } +#if 0 + wxLogDebug( wxT("OnKillFocus from %s"), win->GetName().c_str() ); +#endif if ( !g_activeFrameLostFocus && g_activeFrame ) { @@ -1751,13 +1740,6 @@ static gint gtk_window_focus_out_callback( GtkWidget *widget, GdkEvent *WXUNUSED g_focusWindow = (wxWindowGTK *)NULL; -#if 0 - wxPrintf( "OnKillFocus from " ); - if (win->GetClassInfo() && win->GetClassInfo()->GetClassName()) - wxPrintf( win->GetClassInfo()->GetClassName() ); - wxPrintf( ".\n" ); -#endif - #ifdef HAVE_XIM if (win->m_ic) gdk_im_end(); @@ -3174,8 +3156,6 @@ void wxWindowGTK::SetFocus() { if (!GTK_WIDGET_HAS_FOCUS (m_wxwindow)) { - // see comment in gtk_window_focus_out_callback() - gs_widgetLastFocus = m_wxwindow; gtk_widget_grab_focus (m_wxwindow); } } @@ -3194,14 +3174,6 @@ void wxWindowGTK::SetFocus() // ? } } - -#if 0 - wxPrintf( "SetFocus finished in " ); - if (GetClassInfo() && GetClassInfo()->GetClassName()) - wxPrintf( GetClassInfo()->GetClassName() ); - wxPrintf( ".\n" ); -#endif - } bool wxWindowGTK::AcceptsFocus() const @@ -3388,7 +3360,7 @@ void wxWindowGTK::GtkSendPaintEvents() m_clipPaintRegion = TRUE; - if (!m_clearRegion.IsEmpty()) + // if (!m_clearRegion.IsEmpty()) // always send an erase event { wxWindowDC dc( (wxWindow*)this ); dc.SetClippingRegion( m_clearRegion );