summaryrefslogtreecommitdiff
path: root/src/ui/menu.c
diff options
context:
space:
mode:
authorDenis Gorodnichev <[email protected]>2014-07-24 10:37:41 +0400
committerinfirit <[email protected]>2014-11-25 18:06:24 +0100
commitb25395fab6fe9ee38bc0cd359941d0a825d88451 (patch)
treee7b6720a543a00495fae1dd1423d652056bedb03 /src/ui/menu.c
parentb8d8e52f0effbf76ff909f88932098d4daf4336e (diff)
downloadmarco-b25395fab6fe9ee38bc0cd359941d0a825d88451.tar.bz2
marco-b25395fab6fe9ee38bc0cd359941d0a825d88451.tar.xz
merge metacity(gtk3) changes
merge metacity(gtk3) changes fix warnings clean up unused variables replace UNUSED_VARIABLE by G_GNUC_UNUSED
Diffstat (limited to 'src/ui/menu.c')
-rw-r--r--src/ui/menu.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/ui/menu.c b/src/ui/menu.c
index 41abc441..1dfc7140 100644
--- a/src/ui/menu.c
+++ b/src/ui/menu.c
@@ -106,7 +106,11 @@ static void popup_position_func(GtkMenu* menu, gint* x, gint* y, gboolean* push_
pos = user_data;
+#if GTK_CHECK_VERSION (3, 0, 0)
+ gtk_widget_get_preferred_size (GTK_WIDGET (menu), &req, NULL);
+#else
gtk_widget_size_request(GTK_WIDGET(menu), &req);
+#endif
*x = pos->x;
*y = pos->y;
@@ -148,7 +152,7 @@ static void activate_cb(GtkWidget* menuitem, gpointer data)
md = data;
- meta_frames_notify_menu_hide(md->menu->frames);
+ meta_frames_notify_menu_hide (md->menu->frames);
(*md->menu->func)(
md->menu,
@@ -159,7 +163,7 @@ static void activate_cb(GtkWidget* menuitem, gpointer data)
GPOINTER_TO_INT(g_object_get_data(G_OBJECT(menuitem), "workspace")),
md->menu->data);
- /* menu may now be freed */
+ /* menu may now be freed */
}
/*
@@ -389,7 +393,7 @@ meta_window_menu_new (MetaFrames *frames,
meta_verbose ("Creating %d-workspace menu current space %lu\n",
n_workspaces, active_workspace);
- GdkWindow* window = gtk_widget_get_window(GTK_WIDGET(frames));
+ GdkWindow* window = gtk_widget_get_window (GTK_WIDGET (frames));
display = GDK_WINDOW_XDISPLAY (window);
@@ -497,9 +501,10 @@ meta_window_menu_new (MetaFrames *frames,
}
}
- g_signal_connect (menu->menu, "selection_done", G_CALLBACK(menu_closed), menu);
+ g_signal_connect (menu->menu, "selection_done",
+ G_CALLBACK (menu_closed), menu);
- return menu;
+ return menu;
}
void meta_window_menu_popup(MetaWindowMenu* menu, int root_x, int root_y, int button, guint32 timestamp)