forked from AuroraMiddleware/gtk
menushell: Don’t dereference before typechecking
This commit is contained in:
parent
aca0422d84
commit
71d7a1b3d0
@ -1196,12 +1196,13 @@ void
|
|||||||
gtk_menu_shell_select_item (GtkMenuShell *menu_shell,
|
gtk_menu_shell_select_item (GtkMenuShell *menu_shell,
|
||||||
GtkWidget *menu_item)
|
GtkWidget *menu_item)
|
||||||
{
|
{
|
||||||
GtkMenuShellPrivate *priv = menu_shell->priv;
|
GtkMenuShellPrivate *priv;
|
||||||
GtkMenuShellClass *class;
|
GtkMenuShellClass *class;
|
||||||
|
|
||||||
g_return_if_fail (GTK_IS_MENU_SHELL (menu_shell));
|
g_return_if_fail (GTK_IS_MENU_SHELL (menu_shell));
|
||||||
g_return_if_fail (GTK_IS_MENU_ITEM (menu_item));
|
g_return_if_fail (GTK_IS_MENU_ITEM (menu_item));
|
||||||
|
|
||||||
|
priv = menu_shell->priv;
|
||||||
class = GTK_MENU_SHELL_GET_CLASS (menu_shell);
|
class = GTK_MENU_SHELL_GET_CLASS (menu_shell);
|
||||||
|
|
||||||
if (class->select_item &&
|
if (class->select_item &&
|
||||||
@ -1263,10 +1264,12 @@ gtk_menu_shell_real_select_item (GtkMenuShell *menu_shell,
|
|||||||
void
|
void
|
||||||
gtk_menu_shell_deselect (GtkMenuShell *menu_shell)
|
gtk_menu_shell_deselect (GtkMenuShell *menu_shell)
|
||||||
{
|
{
|
||||||
GtkMenuShellPrivate *priv = menu_shell->priv;
|
GtkMenuShellPrivate *priv;
|
||||||
|
|
||||||
g_return_if_fail (GTK_IS_MENU_SHELL (menu_shell));
|
g_return_if_fail (GTK_IS_MENU_SHELL (menu_shell));
|
||||||
|
|
||||||
|
priv = menu_shell->priv;
|
||||||
|
|
||||||
if (priv->active_menu_item)
|
if (priv->active_menu_item)
|
||||||
{
|
{
|
||||||
gtk_menu_item_deselect (GTK_MENU_ITEM (priv->active_menu_item));
|
gtk_menu_item_deselect (GTK_MENU_ITEM (priv->active_menu_item));
|
||||||
@ -1793,11 +1796,13 @@ void
|
|||||||
_gtk_menu_shell_set_grab_device (GtkMenuShell *menu_shell,
|
_gtk_menu_shell_set_grab_device (GtkMenuShell *menu_shell,
|
||||||
GdkDevice *device)
|
GdkDevice *device)
|
||||||
{
|
{
|
||||||
GtkMenuShellPrivate *priv = menu_shell->priv;
|
GtkMenuShellPrivate *priv;
|
||||||
|
|
||||||
g_return_if_fail (GTK_IS_MENU_SHELL (menu_shell));
|
g_return_if_fail (GTK_IS_MENU_SHELL (menu_shell));
|
||||||
g_return_if_fail (device == NULL || GDK_IS_DEVICE (device));
|
g_return_if_fail (device == NULL || GDK_IS_DEVICE (device));
|
||||||
|
|
||||||
|
priv = menu_shell->priv;
|
||||||
|
|
||||||
if (!device)
|
if (!device)
|
||||||
priv->grab_pointer = NULL;
|
priv->grab_pointer = NULL;
|
||||||
else if (gdk_device_get_source (device) == GDK_SOURCE_KEYBOARD)
|
else if (gdk_device_get_source (device) == GDK_SOURCE_KEYBOARD)
|
||||||
@ -1869,10 +1874,12 @@ void
|
|||||||
gtk_menu_shell_set_take_focus (GtkMenuShell *menu_shell,
|
gtk_menu_shell_set_take_focus (GtkMenuShell *menu_shell,
|
||||||
gboolean take_focus)
|
gboolean take_focus)
|
||||||
{
|
{
|
||||||
GtkMenuShellPrivate *priv = menu_shell->priv;
|
GtkMenuShellPrivate *priv;
|
||||||
|
|
||||||
g_return_if_fail (GTK_IS_MENU_SHELL (menu_shell));
|
g_return_if_fail (GTK_IS_MENU_SHELL (menu_shell));
|
||||||
|
|
||||||
|
priv = menu_shell->priv;
|
||||||
|
|
||||||
if (priv->take_focus != take_focus)
|
if (priv->take_focus != take_focus)
|
||||||
{
|
{
|
||||||
priv->take_focus = take_focus;
|
priv->take_focus = take_focus;
|
||||||
|
Loading…
Reference in New Issue
Block a user