summaryrefslogtreecommitdiffstats
path: root/chrome/browser/gtk
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/gtk')
-rw-r--r--chrome/browser/gtk/menu_gtk.cc7
-rw-r--r--chrome/browser/gtk/menu_gtk.h5
2 files changed, 7 insertions, 5 deletions
diff --git a/chrome/browser/gtk/menu_gtk.cc b/chrome/browser/gtk/menu_gtk.cc
index dac60ab..2a804cb 100644
--- a/chrome/browser/gtk/menu_gtk.cc
+++ b/chrome/browser/gtk/menu_gtk.cc
@@ -69,13 +69,12 @@ void MenuGtk::Popup(GtkWidget* widget, gint button_type, guint32 timestamp) {
button_type, timestamp);
}
-void MenuGtk::PopupAsContext() {
+void MenuGtk::PopupAsContext(guint32 event_time) {
gtk_container_foreach(GTK_CONTAINER(menu_.get()), SetMenuItemInfo, this);
- // TODO(estade): |button| value of 0 (6th argument) is not strictly true,
+ // TODO(estade): |button| value of 3 (6th argument) is not strictly true,
// but does it matter?
- gtk_menu_popup(GTK_MENU(menu_.get()), NULL, NULL, NULL, NULL, 0,
- gtk_get_current_event_time());
+ gtk_menu_popup(GTK_MENU(menu_.get()), NULL, NULL, NULL, NULL, 3, event_time);
}
void MenuGtk::BuildMenuIn(GtkWidget* menu,
diff --git a/chrome/browser/gtk/menu_gtk.h b/chrome/browser/gtk/menu_gtk.h
index f9060e1..0506ff3 100644
--- a/chrome/browser/gtk/menu_gtk.h
+++ b/chrome/browser/gtk/menu_gtk.h
@@ -55,7 +55,10 @@ class MenuGtk {
void Popup(GtkWidget* widget, GdkEvent* event);
// Displays the menu as a context menu, i.e. at the current cursor location.
- void PopupAsContext();
+ // |event_time| is the time of the event that triggered the menu's display.
+ // In the future we may need to modify this to act differently based on the
+ // triggering event (e.g. right mouse click, context menu key, etc.).
+ void PopupAsContext(guint32 event_time);
private:
// A recursive function that transforms a MenuCreateMaterial tree into a set