aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/ephy-gui.c36
-rw-r--r--lib/ephy-gui.h4
-rw-r--r--lib/widgets/ephy-location-entry.c6
3 files changed, 44 insertions, 2 deletions
diff --git a/lib/ephy-gui.c b/lib/ephy-gui.c
index 99e68bc2b..7ed8b36ef 100644
--- a/lib/ephy-gui.c
+++ b/lib/ephy-gui.c
@@ -416,6 +416,42 @@ ephy_gui_help (GtkWindow *parent,
}
}
+void
+ephy_gui_get_current_event (GdkEventType *otype,
+ guint *ostate,
+ guint *obutton)
+{
+ GdkEvent *event;
+ GdkEventType type = GDK_NOTHING;
+ guint state = 0, button = (guint) -1;
+
+ event = gtk_get_current_event ();
+ if (event != NULL)
+ {
+ type = event->type;
+
+ if (type == GDK_KEY_PRESS ||
+ type == GDK_KEY_RELEASE)
+ {
+ state = event->key.state;
+ }
+ else if (type == GDK_BUTTON_PRESS ||
+ type == GDK_BUTTON_RELEASE ||
+ type == GDK_2BUTTON_PRESS ||
+ type == GDK_3BUTTON_PRESS)
+ {
+ button = event->button.button;
+ state = event->button.state;
+ }
+
+ gdk_event_free (event);
+ }
+
+ if (otype) *otype = type;
+ if (ostate) *ostate = state & gtk_accelerator_get_default_mod_mask ();
+ if (obutton) *obutton = button;
+}
+
gboolean
ephy_gui_is_middle_click (void)
{
diff --git a/lib/ephy-gui.h b/lib/ephy-gui.h
index 3dc1eb18d..c46efe746 100644
--- a/lib/ephy-gui.h
+++ b/lib/ephy-gui.h
@@ -61,6 +61,10 @@ void ephy_gui_menu_position_on_panel (GtkMenu *menu,
GtkWindowGroup *ephy_gui_ensure_window_group (GtkWindow *window);
+void ephy_gui_get_current_event (GdkEventType *type,
+ guint *state,
+ guint *button);
+
gboolean ephy_gui_is_middle_click (void);
gboolean ephy_gui_check_location_writable (GtkWidget *parent,
diff --git a/lib/widgets/ephy-location-entry.c b/lib/widgets/ephy-location-entry.c
index a77797a40..f38742d03 100644
--- a/lib/widgets/ephy-location-entry.c
+++ b/lib/widgets/ephy-location-entry.c
@@ -380,7 +380,8 @@ entry_key_press_cb (GtkEntry *entry,
if ((event->keyval == GDK_Return ||
event->keyval == GDK_KP_Enter ||
event->keyval == GDK_ISO_Enter) &&
- state == GDK_CONTROL_MASK)
+ (state == GDK_CONTROL_MASK ||
+ state == (GDK_CONTROL_MASK | GDK_SHIFT_MASK)))
{
gtk_im_context_reset (entry->im_context);
@@ -388,7 +389,8 @@ entry_key_press_cb (GtkEntry *entry,
return TRUE;
}
- else if (event->keyval == GDK_Escape && state == 0)
+
+ if (event->keyval == GDK_Escape && state == 0)
{
ephy_location_entry_reset (lentry);
/* don't return TRUE since we want to cancel the autocompletion popup too */