diff options
author | Christian Persch <chpe@cvs.gnome.org> | 2005-02-01 22:47:33 +0800 |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2005-02-01 22:47:33 +0800 |
commit | 2f4357ef874b11caa38200119264e9826d72d689 (patch) | |
tree | 5b2a93d9af122fd6f3c9dd3fabb460ad96a465d5 | |
parent | 48260d29c265eebcc9f1761a359aa645f852f8ec (diff) | |
download | gsoc2013-epiphany-2f4357ef874b11caa38200119264e9826d72d689.tar gsoc2013-epiphany-2f4357ef874b11caa38200119264e9826d72d689.tar.gz gsoc2013-epiphany-2f4357ef874b11caa38200119264e9826d72d689.tar.bz2 gsoc2013-epiphany-2f4357ef874b11caa38200119264e9826d72d689.tar.lz gsoc2013-epiphany-2f4357ef874b11caa38200119264e9826d72d689.tar.xz gsoc2013-epiphany-2f4357ef874b11caa38200119264e9826d72d689.tar.zst gsoc2013-epiphany-2f4357ef874b11caa38200119264e9826d72d689.zip |
Ungrab the pointer when moving tab between notebooks. Fixes bug #165797.
2005-02-01 Christian Persch <chpe@cvs.gnome.org>
* src/ephy-notebook.c: (motion_notify_cb),
(move_tab_to_another_notebook), (button_release_cb),
(ephy_notebook_finalize):
Ungrab the pointer when moving tab between notebooks.
Fixes bug #165797.
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | src/ephy-notebook.c | 18 |
2 files changed, 23 insertions, 4 deletions
@@ -1,3 +1,12 @@ +2005-02-01 Christian Persch <chpe@cvs.gnome.org> + + * src/ephy-notebook.c: (motion_notify_cb), + (move_tab_to_another_notebook), (button_release_cb), + (ephy_notebook_finalize): + + Ungrab the pointer when moving tab between notebooks. + Fixes bug #165797. + 2005-01-31 Christian Persch <chpe@cvs.gnome.org> * embed/mozilla/mozilla-embed.cpp: diff --git a/src/ephy-notebook.c b/src/ephy-notebook.c index 8f8cdc5d9..58667b9bf 100644 --- a/src/ephy-notebook.c +++ b/src/ephy-notebook.c @@ -77,6 +77,7 @@ static void ephy_notebook_class_init (EphyNotebookClass *klass); static void ephy_notebook_finalize (GObject *object); static void move_tab_to_another_notebook (EphyNotebook *src, EphyNotebook *dest, + GdkEventMotion *event, int dest_position); /* Local variables */ @@ -443,7 +444,7 @@ motion_notify_cb (EphyNotebook *notebook, if (dest != notebook) { move_tab_to_another_notebook (notebook, dest, - page_num); + event, page_num); } else { @@ -458,11 +459,15 @@ motion_notify_cb (EphyNotebook *notebook, static void move_tab_to_another_notebook (EphyNotebook *src, EphyNotebook *dest, + GdkEventMotion *event, int dest_position) { EphyTab *tab; int cur_page; + LOG ("moving tab from notebook %p to notebook %p at %d", + src, dest, dest_position); + /* This is getting tricky, the tab was dragged in a notebook * in another window of the same app, we move the tab * to that new notebook, and let this notebook handle the @@ -475,7 +480,12 @@ move_tab_to_another_notebook (EphyNotebook *src, tab = EPHY_TAB (gtk_notebook_get_nth_page (GTK_NOTEBOOK (src), cur_page)); /* stop drag in origin window */ + /* ungrab the pointer if it's grabbed */ drag_stop (src); + if (gdk_pointer_is_grabbed ()) + { + gdk_pointer_ungrab (event->time); + } gtk_grab_remove (GTK_WIDGET (src)); ephy_notebook_move_tab (src, dest, tab, dest_position); @@ -516,12 +526,14 @@ button_release_cb (EphyNotebook *notebook, /* ungrab the pointer if it's grabbed */ if (gdk_pointer_is_grabbed ()) { - gdk_pointer_ungrab (GDK_CURRENT_TIME); + gdk_pointer_ungrab (event->time); gtk_grab_remove (GTK_WIDGET (notebook)); } } + /* This must be called even if a drag isn't happening */ drag_stop (notebook); + return FALSE; } @@ -730,8 +742,6 @@ ephy_notebook_finalize (GObject *object) } g_object_unref (notebook->priv->title_tips); - LOG ("EphyNotebook finalised %p", object); - G_OBJECT_CLASS (parent_class)->finalize (object); } |