forked from AuroraMiddleware/gtk
Fix GtkShortcutsWindow crash
GtkShortcutsWindow is among the 'cheating' containers that iterate over indirect children in forall, and this is now triggering an assertion in gtk_container_propagate_draw. For now, just exclude the cheating containers from the assertion. Eventually, this needs a better solution.
This commit is contained in:
parent
5150849a67
commit
c2d4fd6b93
@ -54,6 +54,16 @@
|
|||||||
#include "gtkpopovermenu.h"
|
#include "gtkpopovermenu.h"
|
||||||
#include "gtkshortcutswindow.h"
|
#include "gtkshortcutswindow.h"
|
||||||
|
|
||||||
|
/* A handful of containers inside GTK+ are cheating and widgets
|
||||||
|
* inside internal structure as direct children for the purpose
|
||||||
|
* of forall().
|
||||||
|
*/
|
||||||
|
#define SPECIAL_CONTAINER(x) (GTK_IS_ASSISTANT (x) || \
|
||||||
|
GTK_IS_ACTION_BAR (x) || \
|
||||||
|
GTK_IS_POPOVER_MENU (x) || \
|
||||||
|
GTK_IS_SHORTCUTS_SECTION (x) || \
|
||||||
|
GTK_IS_SHORTCUTS_WINDOW (x))
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SECTION:gtkcontainer
|
* SECTION:gtkcontainer
|
||||||
* @Short_description: Base class for widgets which contain other widgets
|
* @Short_description: Base class for widgets which contain other widgets
|
||||||
@ -661,9 +671,7 @@ gtk_container_buildable_set_child_property (GtkContainer *container,
|
|||||||
GObjectNotifyQueue *nqueue;
|
GObjectNotifyQueue *nqueue;
|
||||||
|
|
||||||
if (_gtk_widget_get_parent (child) != (GtkWidget *)container &&
|
if (_gtk_widget_get_parent (child) != (GtkWidget *)container &&
|
||||||
!GTK_IS_ASSISTANT (container) &&
|
!SPECIAL_CONTAINER (container))
|
||||||
!GTK_IS_ACTION_BAR (container) &&
|
|
||||||
!GTK_IS_POPOVER_MENU (container))
|
|
||||||
{
|
{
|
||||||
/* This can happen with internal children of complex widgets.
|
/* This can happen with internal children of complex widgets.
|
||||||
* Silently ignore the child properties in this case. We explicitly
|
* Silently ignore the child properties in this case. We explicitly
|
||||||
@ -3749,7 +3757,8 @@ gtk_container_propagate_draw (GtkContainer *container,
|
|||||||
g_return_if_fail (GTK_IS_WIDGET (child));
|
g_return_if_fail (GTK_IS_WIDGET (child));
|
||||||
g_return_if_fail (cr != NULL);
|
g_return_if_fail (cr != NULL);
|
||||||
|
|
||||||
g_assert (_gtk_widget_get_parent (child) == GTK_WIDGET (container));
|
g_assert (_gtk_widget_get_parent (child) == GTK_WIDGET (container) ||
|
||||||
|
SPECIAL_CONTAINER (container));
|
||||||
|
|
||||||
if (!gtk_container_should_propagate_draw (container, child, cr))
|
if (!gtk_container_should_propagate_draw (container, child, cr))
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user