// GetBestSize is called.
gtk_widget_ensure_style(m_widget);
- InheritAttributes();
ApplyWidgetStyle();
SetInitialBestSize(size);
}
// yet, defer setting the focus to idle time.
wxWindowGTK *g_delayedFocus = (wxWindowGTK*) NULL;
+// When GTK+ focus_in/out signal is being processed, we shouldn't do
+// any focus changes
+static bool gs_inFocusSignalHandler = false;
+
+struct InFocusHandlerLock
+{
+ InFocusHandlerLock() { gs_inFocusSignalHandler = true; }
+ ~InFocusHandlerLock() { gs_inFocusSignalHandler = false; }
+};
+
// if we detect that the app has got/lost the focus, we set this variable to
// either TRUE or FALSE and an activate event will be sent during the next
// OnIdle() call and it is reset to -1: this value means that we shouldn't
GdkEvent *WXUNUSED(event),
wxWindow *win )
{
+ InFocusHandlerLock flock;
+
DEBUG_MAIN_THREAD
if (g_isIdle)
static gint gtk_window_focus_out_callback( GtkWidget *widget, GdkEventFocus *gdk_event, wxWindowGTK *win )
{
DEBUG_MAIN_THREAD
+
+ InFocusHandlerLock flock;
if (g_isIdle)
wxapp_install_idle_handler();
(gpointer) this );
}
+ InheritAttributes();
+
m_hasVMT = TRUE;
// unless the window was created initially hidden (i.e. Hide() had been
return;
}
+ if (gs_inFocusSignalHandler)
+ {
+ wxLogTrace(TRACE_FOCUS,
+ _T("in focus handler, delaying SetFocus(%p)"), this);
+ g_delayedFocus = this;
+ return;
+ }
+
if (m_wxwindow)
{
if (!GTK_WIDGET_HAS_FOCUS (m_wxwindow))
void wxWindowGTK::DoApplyWidgetStyle(GtkRcStyle *style)
{
if (m_wxwindow)
- // should we also do m_widget in this case?
gtk_widget_modify_style(m_wxwindow, style);
- else
- gtk_widget_modify_style(m_widget, style);
+ gtk_widget_modify_style(m_widget, style);
}
// GetBestSize is called.
gtk_widget_ensure_style(m_widget);
- InheritAttributes();
ApplyWidgetStyle();
SetInitialBestSize(size);
}
// yet, defer setting the focus to idle time.
wxWindowGTK *g_delayedFocus = (wxWindowGTK*) NULL;
+// When GTK+ focus_in/out signal is being processed, we shouldn't do
+// any focus changes
+static bool gs_inFocusSignalHandler = false;
+
+struct InFocusHandlerLock
+{
+ InFocusHandlerLock() { gs_inFocusSignalHandler = true; }
+ ~InFocusHandlerLock() { gs_inFocusSignalHandler = false; }
+};
+
// if we detect that the app has got/lost the focus, we set this variable to
// either TRUE or FALSE and an activate event will be sent during the next
// OnIdle() call and it is reset to -1: this value means that we shouldn't
GdkEvent *WXUNUSED(event),
wxWindow *win )
{
+ InFocusHandlerLock flock;
+
DEBUG_MAIN_THREAD
if (g_isIdle)
static gint gtk_window_focus_out_callback( GtkWidget *widget, GdkEventFocus *gdk_event, wxWindowGTK *win )
{
DEBUG_MAIN_THREAD
+
+ InFocusHandlerLock flock;
if (g_isIdle)
wxapp_install_idle_handler();
(gpointer) this );
}
+ InheritAttributes();
+
m_hasVMT = TRUE;
// unless the window was created initially hidden (i.e. Hide() had been
return;
}
+ if (gs_inFocusSignalHandler)
+ {
+ wxLogTrace(TRACE_FOCUS,
+ _T("in focus handler, delaying SetFocus(%p)"), this);
+ g_delayedFocus = this;
+ return;
+ }
+
if (m_wxwindow)
{
if (!GTK_WIDGET_HAS_FOCUS (m_wxwindow))
void wxWindowGTK::DoApplyWidgetStyle(GtkRcStyle *style)
{
if (m_wxwindow)
- // should we also do m_widget in this case?
gtk_widget_modify_style(m_wxwindow, style);
- else
- gtk_widget_modify_style(m_widget, style);
+ gtk_widget_modify_style(m_widget, style);
}