Skip to content

Commit

Permalink
zoom-control: use NULL instead of uninitialized variable
Browse files Browse the repository at this point in the history
  • Loading branch information
monsta committed May 16, 2018
1 parent 13fe58e commit 9bf65ee
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/caja-zoom-control.c
Expand Up @@ -140,14 +140,13 @@ static void
zoom_popup_menu (GtkWidget *widget, CajaZoomControl *zoom_control)
{
GtkMenu *menu;
GdkEvent *event;

menu = create_zoom_menu (zoom_control);
gtk_menu_popup_at_widget (menu,
widget,
GDK_GRAVITY_SOUTH_WEST,
GDK_GRAVITY_NORTH_WEST,
(const GdkEvent*) event);
NULL);

gtk_menu_shell_select_first (GTK_MENU_SHELL (menu), FALSE);
}
Expand Down

2 comments on commit 9bf65ee

@raveit65
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, there is a build warning about, still wondering that i missed that.
Thx.

@lukefromdc
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see what happened here: event is not imported into the function, so it cannot be used and NULL is required. In this case the right-click remains responsive and the popup is easily invoked

Please sign in to comment.