attributes inheritance fix; apply style to both m_wxwindow and m_widget (patch 984858)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28785 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -103,7 +103,6 @@ void wxControl::PostCreation(const wxSize& size)
|
|||||||
// GetBestSize is called.
|
// GetBestSize is called.
|
||||||
gtk_widget_ensure_style(m_widget);
|
gtk_widget_ensure_style(m_widget);
|
||||||
|
|
||||||
InheritAttributes();
|
|
||||||
ApplyWidgetStyle();
|
ApplyWidgetStyle();
|
||||||
SetInitialBestSize(size);
|
SetInitialBestSize(size);
|
||||||
}
|
}
|
||||||
|
@@ -251,6 +251,16 @@ static bool g_activeFrameLostFocus = FALSE;
|
|||||||
// yet, defer setting the focus to idle time.
|
// yet, defer setting the focus to idle time.
|
||||||
wxWindowGTK *g_delayedFocus = (wxWindowGTK*) NULL;
|
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
|
// 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
|
// 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
|
// OnIdle() call and it is reset to -1: this value means that we shouldn't
|
||||||
@@ -1963,6 +1973,8 @@ static gint gtk_window_focus_in_callback( GtkWidget *widget,
|
|||||||
GdkEvent *WXUNUSED(event),
|
GdkEvent *WXUNUSED(event),
|
||||||
wxWindow *win )
|
wxWindow *win )
|
||||||
{
|
{
|
||||||
|
InFocusHandlerLock flock;
|
||||||
|
|
||||||
DEBUG_MAIN_THREAD
|
DEBUG_MAIN_THREAD
|
||||||
|
|
||||||
if (g_isIdle)
|
if (g_isIdle)
|
||||||
@@ -2057,6 +2069,8 @@ static gint gtk_window_focus_in_callback( GtkWidget *widget,
|
|||||||
static gint gtk_window_focus_out_callback( GtkWidget *widget, GdkEventFocus *gdk_event, wxWindowGTK *win )
|
static gint gtk_window_focus_out_callback( GtkWidget *widget, GdkEventFocus *gdk_event, wxWindowGTK *win )
|
||||||
{
|
{
|
||||||
DEBUG_MAIN_THREAD
|
DEBUG_MAIN_THREAD
|
||||||
|
|
||||||
|
InFocusHandlerLock flock;
|
||||||
|
|
||||||
if (g_isIdle)
|
if (g_isIdle)
|
||||||
wxapp_install_idle_handler();
|
wxapp_install_idle_handler();
|
||||||
@@ -2946,6 +2960,8 @@ void wxWindowGTK::PostCreation()
|
|||||||
(gpointer) this );
|
(gpointer) this );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
InheritAttributes();
|
||||||
|
|
||||||
m_hasVMT = TRUE;
|
m_hasVMT = TRUE;
|
||||||
|
|
||||||
// unless the window was created initially hidden (i.e. Hide() had been
|
// unless the window was created initially hidden (i.e. Hide() had been
|
||||||
@@ -3606,6 +3622,14 @@ void wxWindowGTK::SetFocus()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (gs_inFocusSignalHandler)
|
||||||
|
{
|
||||||
|
wxLogTrace(TRACE_FOCUS,
|
||||||
|
_T("in focus handler, delaying SetFocus(%p)"), this);
|
||||||
|
g_delayedFocus = this;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (m_wxwindow)
|
if (m_wxwindow)
|
||||||
{
|
{
|
||||||
if (!GTK_WIDGET_HAS_FOCUS (m_wxwindow))
|
if (!GTK_WIDGET_HAS_FOCUS (m_wxwindow))
|
||||||
@@ -4233,10 +4257,8 @@ void wxWindowGTK::ApplyWidgetStyle(bool forceStyle)
|
|||||||
void wxWindowGTK::DoApplyWidgetStyle(GtkRcStyle *style)
|
void wxWindowGTK::DoApplyWidgetStyle(GtkRcStyle *style)
|
||||||
{
|
{
|
||||||
if (m_wxwindow)
|
if (m_wxwindow)
|
||||||
// should we also do m_widget in this case?
|
|
||||||
gtk_widget_modify_style(m_wxwindow, style);
|
gtk_widget_modify_style(m_wxwindow, style);
|
||||||
else
|
gtk_widget_modify_style(m_widget, style);
|
||||||
gtk_widget_modify_style(m_widget, style);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -103,7 +103,6 @@ void wxControl::PostCreation(const wxSize& size)
|
|||||||
// GetBestSize is called.
|
// GetBestSize is called.
|
||||||
gtk_widget_ensure_style(m_widget);
|
gtk_widget_ensure_style(m_widget);
|
||||||
|
|
||||||
InheritAttributes();
|
|
||||||
ApplyWidgetStyle();
|
ApplyWidgetStyle();
|
||||||
SetInitialBestSize(size);
|
SetInitialBestSize(size);
|
||||||
}
|
}
|
||||||
|
@@ -251,6 +251,16 @@ static bool g_activeFrameLostFocus = FALSE;
|
|||||||
// yet, defer setting the focus to idle time.
|
// yet, defer setting the focus to idle time.
|
||||||
wxWindowGTK *g_delayedFocus = (wxWindowGTK*) NULL;
|
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
|
// 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
|
// 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
|
// OnIdle() call and it is reset to -1: this value means that we shouldn't
|
||||||
@@ -1963,6 +1973,8 @@ static gint gtk_window_focus_in_callback( GtkWidget *widget,
|
|||||||
GdkEvent *WXUNUSED(event),
|
GdkEvent *WXUNUSED(event),
|
||||||
wxWindow *win )
|
wxWindow *win )
|
||||||
{
|
{
|
||||||
|
InFocusHandlerLock flock;
|
||||||
|
|
||||||
DEBUG_MAIN_THREAD
|
DEBUG_MAIN_THREAD
|
||||||
|
|
||||||
if (g_isIdle)
|
if (g_isIdle)
|
||||||
@@ -2057,6 +2069,8 @@ static gint gtk_window_focus_in_callback( GtkWidget *widget,
|
|||||||
static gint gtk_window_focus_out_callback( GtkWidget *widget, GdkEventFocus *gdk_event, wxWindowGTK *win )
|
static gint gtk_window_focus_out_callback( GtkWidget *widget, GdkEventFocus *gdk_event, wxWindowGTK *win )
|
||||||
{
|
{
|
||||||
DEBUG_MAIN_THREAD
|
DEBUG_MAIN_THREAD
|
||||||
|
|
||||||
|
InFocusHandlerLock flock;
|
||||||
|
|
||||||
if (g_isIdle)
|
if (g_isIdle)
|
||||||
wxapp_install_idle_handler();
|
wxapp_install_idle_handler();
|
||||||
@@ -2946,6 +2960,8 @@ void wxWindowGTK::PostCreation()
|
|||||||
(gpointer) this );
|
(gpointer) this );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
InheritAttributes();
|
||||||
|
|
||||||
m_hasVMT = TRUE;
|
m_hasVMT = TRUE;
|
||||||
|
|
||||||
// unless the window was created initially hidden (i.e. Hide() had been
|
// unless the window was created initially hidden (i.e. Hide() had been
|
||||||
@@ -3606,6 +3622,14 @@ void wxWindowGTK::SetFocus()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (gs_inFocusSignalHandler)
|
||||||
|
{
|
||||||
|
wxLogTrace(TRACE_FOCUS,
|
||||||
|
_T("in focus handler, delaying SetFocus(%p)"), this);
|
||||||
|
g_delayedFocus = this;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (m_wxwindow)
|
if (m_wxwindow)
|
||||||
{
|
{
|
||||||
if (!GTK_WIDGET_HAS_FOCUS (m_wxwindow))
|
if (!GTK_WIDGET_HAS_FOCUS (m_wxwindow))
|
||||||
@@ -4233,10 +4257,8 @@ void wxWindowGTK::ApplyWidgetStyle(bool forceStyle)
|
|||||||
void wxWindowGTK::DoApplyWidgetStyle(GtkRcStyle *style)
|
void wxWindowGTK::DoApplyWidgetStyle(GtkRcStyle *style)
|
||||||
{
|
{
|
||||||
if (m_wxwindow)
|
if (m_wxwindow)
|
||||||
// should we also do m_widget in this case?
|
|
||||||
gtk_widget_modify_style(m_wxwindow, style);
|
gtk_widget_modify_style(m_wxwindow, style);
|
||||||
else
|
gtk_widget_modify_style(m_widget, style);
|
||||||
gtk_widget_modify_style(m_widget, style);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user