aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCody Russell <crussell@canonical.com>2010-07-08 10:30:50 -0500
committerCody Russell <crussell@canonical.com>2010-07-08 10:30:50 -0500
commitb3f4350763f249283464d96364ee1adf5bd6ce6a (patch)
tree63c37c24e086293e043af0dc479aea64bcb40eee
parent5fa7b66f3411fe6eaf54335348534f396b2058a4 (diff)
parent440588987f43f3a3cce6bd05bd031ecf89ef817b (diff)
downloadayatana-ido-b3f4350763f249283464d96364ee1adf5bd6ce6a.tar.gz
ayatana-ido-b3f4350763f249283464d96364ee1adf5bd6ce6a.tar.bz2
ayatana-ido-b3f4350763f249283464d96364ee1adf5bd6ce6a.zip
Merge up with trunk.
-rw-r--r--configure.ac2
-rw-r--r--src/idoentrymenuitem.c48
2 files changed, 34 insertions, 16 deletions
diff --git a/configure.ac b/configure.ac
index 19749af..ee565f1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3,7 +3,7 @@
#
m4_define([ido_major_version], [0])
m4_define([ido_minor_version], [1])
-m4_define([ido_micro_version], [5])
+m4_define([ido_micro_version], [6])
m4_define([ido_api_version],
[ido_major_version.ido_minor_version])
diff --git a/src/idoentrymenuitem.c b/src/idoentrymenuitem.c
index 8e7ab5c..7227201 100644
--- a/src/idoentrymenuitem.c
+++ b/src/idoentrymenuitem.c
@@ -35,8 +35,8 @@ static gboolean ido_entry_menu_item_key_press (GtkWidget *widget,
gpointer data);
static gboolean ido_entry_menu_item_button_press (GtkWidget *widget,
GdkEventButton *event);
-static void ido_entry_menu_item_send_focus_change (GtkWidget *widget,
- gboolean in);
+static void ido_entry_menu_item_send_focus_change (GtkWidget *widget,
+ gboolean in);
static void entry_realized_cb (GtkWidget *widget,
IdoEntryMenuItem *item);
static void entry_move_focus_cb (GtkWidget *widget,
@@ -113,13 +113,6 @@ ido_entry_menu_item_init (IdoEntryMenuItem *item)
}
static gboolean
-ido_entry_menu_item_button_release (GtkWidget *widget,
- GdkEventButton *event)
-{
- return TRUE;
-}
-
-static gboolean
is_key_press_valid (IdoEntryMenuItem *item,
gint key)
{
@@ -147,9 +140,21 @@ ido_entry_menu_item_key_press (GtkWidget *widget,
if (menuitem->priv->selected &&
is_key_press_valid (menuitem, event->keyval))
{
- gtk_widget_event (menuitem->priv->entry,
+ GtkWidget *entry = menuitem->priv->entry;
+
+ gtk_widget_event (entry,
((GdkEvent *)(void*)(event)));
+ if (entry->window != NULL)
+ {
+ gdk_window_raise (entry->window);
+ }
+
+ if (!gtk_widget_has_focus (entry))
+ {
+ gtk_widget_grab_focus (entry);
+ }
+
/* We've handled the event, but if the key was GDK_Return
* we still want to forward the event up to the menu shell
* to ensure that the menuitem receives the activate signal.
@@ -193,12 +198,10 @@ static gboolean
ido_entry_menu_item_button_press (GtkWidget *widget,
GdkEventButton *event)
{
- if (event->button == GDK_BUTTON_PRESS)
- {
- GtkWidget *entry;
-
- entry = IDO_ENTRY_MENU_ITEM (widget)->priv->entry;
+ GtkWidget *entry = IDO_ENTRY_MENU_ITEM (widget)->priv->entry;
+ if (event->button == 1)
+ {
if (entry->window != NULL)
{
gdk_window_raise (entry->window);
@@ -209,12 +212,27 @@ ido_entry_menu_item_button_press (GtkWidget *widget,
gtk_widget_grab_focus (entry);
}
+ gtk_widget_event (entry,
+ ((GdkEvent *)(void*)(event)));
+
return TRUE;
}
return FALSE;
}
+static gboolean
+ido_entry_menu_item_button_release (GtkWidget *widget,
+ GdkEventButton *event)
+{
+ GtkWidget *entry = IDO_ENTRY_MENU_ITEM (widget)->priv->entry;
+
+ gtk_widget_event (entry,
+ ((GdkEvent *)(void*)(event)));
+
+ return TRUE;
+}
+
static void
ido_entry_menu_item_select (GtkItem *item)
{