+void wxTopLevelWindowGTK::RequestUserAttention(int flags)
+{
+ bool new_hint_value = false;
+
+ // FIXME: This is a workaround to focus handling problem
+ // If RequestUserAttention is called for example right after a wxSleep, OnInternalIdle hasn't
+ // yet been processed, and the internal focus system is not up to date yet.
+ // wxYieldIfNeeded ensures the processing of it, but can have unwanted side effects - MR
+ ::wxYieldIfNeeded();
+
+ /*BCI:
+ if(m_urgency_hint >= 0)
+ gtk_timeout_remove(m_urgency_hint);
+ */
+ int urgency_hint = GPOINTER_TO_INT( gtk_object_get_data( GTK_OBJECT(m_widget), "m_urgency_hint") );
+ if(urgency_hint >= 0)
+ gtk_timeout_remove(urgency_hint);
+ //BCI: END
+
+ //BCI: m_urgency_hint = -2;
+ gtk_object_set_data( GTK_OBJECT(m_widget), "m_urgency_hint", GINT_TO_POINTER(-2));
+
+ if( GTK_WIDGET_REALIZED(m_widget) && !IsActive() )
+ {
+ new_hint_value = true;
+
+ if (flags & wxUSER_ATTENTION_INFO)
+ {
+ //BCI: m_urgency_hint = gtk_timeout_add(5000, (GtkFunction)gtk_frame_urgency_timer_callback, this);
+ gtk_object_set_data( GTK_OBJECT(m_widget), "m_urgency_hint",
+ GINT_TO_POINTER( gtk_timeout_add(5000,
+ (GtkFunction)gtk_frame_urgency_timer_callback,
+ m_widget) ) );
+ } else {
+ //BCI: m_urgency_hint = -1;
+ gtk_object_set_data( GTK_OBJECT(m_widget), "m_urgency_hint", GINT_TO_POINTER(-1) );
+ }
+ }
+
+#if defined(__WXGTK20__) && GTK_CHECK_VERSION(2,7,0)
+ if(!gtk_check_version(2,7,0))
+ gtk_window_set_urgency_hint(GTK_WINDOW( m_widget ), new_hint_value);
+ else
+#endif
+ wxgtk_window_set_urgency_hint(GTK_WINDOW( m_widget ), new_hint_value);
+}