From 486e1939b5347d6ead5d1d0dcbc65399a1072ecc Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Mon, 30 Jun 2003 22:26:45 +0000 Subject: Hide only when necessary. Remove gdk_ungrab stuff that doesnt seem to be 2003-07-01 Marco Pesenti Gritti * lib/widgets/ephy-autocompletion-window.c: (ephy_autocompletion_window_finalize_impl), (ephy_autocompletion_window_show), (ephy_autocompletion_window_hide): Hide only when necessary. Remove gdk_ungrab stuff that doesnt seem to be necessary. * lib/widgets/ephy-location-entry.c: (ephy_location_entry_autocompletion_show_alternatives): Reset entry->button when showing autocompletion, the grab get gtk crazy otherwise. --- ChangeLog | 16 ++++++++++++++++ lib/widgets/ephy-autocompletion-window.c | 12 +----------- lib/widgets/ephy-location-entry.c | 7 +++++++ 3 files changed, 24 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index 00dc732ae..247b382d7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,19 @@ +2003-07-01 Marco Pesenti Gritti + + * lib/widgets/ephy-autocompletion-window.c: + (ephy_autocompletion_window_finalize_impl), + (ephy_autocompletion_window_show), + (ephy_autocompletion_window_hide): + + Hide only when necessary. Remove gdk_ungrab stuff + that doesnt seem to be necessary. + + * lib/widgets/ephy-location-entry.c: + (ephy_location_entry_autocompletion_show_alternatives): + + Reset entry->button when showing autocompletion, the grab + get gtk crazy otherwise. + 2003-06-30 Marco Pesenti Gritti * embed/ephy-embed-dialog.c: (ephy_embed_dialog_get_embed): diff --git a/lib/widgets/ephy-autocompletion-window.c b/lib/widgets/ephy-autocompletion-window.c index 0f7a8fc1c..d00cfbb19 100644 --- a/lib/widgets/ephy-autocompletion-window.c +++ b/lib/widgets/ephy-autocompletion-window.c @@ -209,9 +209,6 @@ ephy_autocompletion_window_finalize_impl (GObject *o) g_free (p->selected); g_free (p); - gdk_pointer_ungrab (GDK_CURRENT_TIME); - gdk_keyboard_ungrab (GDK_CURRENT_TIME); - G_OBJECT_CLASS (g_object_class)->finalize (o); } @@ -572,11 +569,6 @@ ephy_autocompletion_window_show (EphyAutocompletionWindow *aw) { gtk_widget_show (p->window); - gdk_pointer_grab (p->parent->window, TRUE, - GDK_POINTER_MOTION_MASK | GDK_BUTTON_PRESS_MASK | - GDK_BUTTON_RELEASE_MASK, - NULL, NULL, GDK_CURRENT_TIME); - gdk_keyboard_grab (p->parent->window, TRUE, GDK_CURRENT_TIME);\ gtk_grab_add (p->window); g_signal_connect (p->window, "button-press-event", @@ -820,12 +812,10 @@ ephy_autocompletion_window_key_press_cb (GtkWidget *widget, void ephy_autocompletion_window_hide (EphyAutocompletionWindow *aw) { - if (aw->priv->window) + if (aw->priv->window && aw->priv->shown) { gtk_widget_hide (aw->priv->window); gtk_grab_remove (aw->priv->window); - gdk_pointer_ungrab (GDK_CURRENT_TIME); - gdk_keyboard_ungrab (GDK_CURRENT_TIME); ephy_autocompletion_window_unselect (aw); g_signal_emit (aw, EphyAutocompletionWindowSignals[EPHY_AUTOCOMPLETION_WINDOW_HIDDEN], 0); } diff --git a/lib/widgets/ephy-location-entry.c b/lib/widgets/ephy-location-entry.c index 8e869e1a5..3ecebe5a2 100644 --- a/lib/widgets/ephy-location-entry.c +++ b/lib/widgets/ephy-location-entry.c @@ -343,6 +343,13 @@ static void ephy_location_entry_autocompletion_show_alternatives (EphyLocationEntry *w) { EphyLocationEntryPrivate *p = w->priv; + + /* Reset it because if we do a grab on click (like when pasting + text in the location entry, the entry will lose the release + event and will not reset it. It's what gtk does for the entry + popup */ + GTK_ENTRY (w)->button = 0; + if (p->autocompletion_window) { ephy_autocompletion_window_show (p->autocompletion_window); -- cgit v1.2.3