aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2003-10-06 21:53:56 +0800
committerChristian Persch <chpe@src.gnome.org>2003-10-06 21:53:56 +0800
commit41070c314feabcd3c8a12d685bfd9c86988ede56 (patch)
treeab1a6c8dcc171dd4b816d5b5411b7e10f495cb29 /src
parent14e3040722bdd3115777a6d4098fea87108a6f87 (diff)
downloadgsoc2013-epiphany-41070c314feabcd3c8a12d685bfd9c86988ede56.tar
gsoc2013-epiphany-41070c314feabcd3c8a12d685bfd9c86988ede56.tar.gz
gsoc2013-epiphany-41070c314feabcd3c8a12d685bfd9c86988ede56.tar.bz2
gsoc2013-epiphany-41070c314feabcd3c8a12d685bfd9c86988ede56.tar.lz
gsoc2013-epiphany-41070c314feabcd3c8a12d685bfd9c86988ede56.tar.xz
gsoc2013-epiphany-41070c314feabcd3c8a12d685bfd9c86988ede56.tar.zst
gsoc2013-epiphany-41070c314feabcd3c8a12d685bfd9c86988ede56.zip
Allow dragging of tabs to a window even when the tabs bar is not shown.
2003-10-06 Christian Persch <chpe@cvs.gnome.org> * src/ephy-notebook.c: (find_notebook_at_pointer), (ephy_notebook_init), (ephy_notebook_finalize): Allow dragging of tabs to a window even when the tabs bar is not shown. Fixes bug #123908.
Diffstat (limited to 'src')
-rw-r--r--src/ephy-notebook.c37
1 files changed, 16 insertions, 21 deletions
diff --git a/src/ephy-notebook.c b/src/ephy-notebook.c
index d9e48d17b..6567d12ed 100644
--- a/src/ephy-notebook.c
+++ b/src/ephy-notebook.c
@@ -78,7 +78,6 @@ static void move_tab_to_another_notebook (EphyNotebook *src,
/* Local variables */
static GdkCursor *cursor = NULL;
-static GList *notebooks = NULL;
static GtkTargetEntry url_drag_types [] =
{
@@ -204,36 +203,36 @@ is_in_notebook_window (EphyNotebook *notebook,
static EphyNotebook *
find_notebook_at_pointer (gint abs_x, gint abs_y)
{
- GList *l;
+ GdkWindow *win_at_pointer, *toplevel_win;
+ gpointer toplevel = NULL;
gint x, y;
- GdkWindow *win_at_pointer = gdk_window_at_pointer (&x, &y);
- GdkWindow *parent_at_pointer = NULL;
+ win_at_pointer = gdk_window_at_pointer (&x, &y);
if (win_at_pointer == NULL)
{
/* We are outside all windows containing a notebook */
return NULL;
}
- gdk_window_get_toplevel (win_at_pointer);
- /* When we are in the notebook event window, win_at_pointer will be
- this event window, and the toplevel window we are interested in
- will be its parent
- */
- parent_at_pointer = gdk_window_get_parent (win_at_pointer);
+ toplevel_win = gdk_window_get_toplevel (win_at_pointer);
+
+ /* get the GtkWidget which owns the toplevel GdkWindow */
+ gdk_window_get_user_data (toplevel_win, &toplevel);
- for (l = notebooks; l != NULL; l = l->next)
+ /* toplevel should be an EphyWindow */
+ if (toplevel != NULL && EPHY_IS_WINDOW (toplevel))
{
- EphyNotebook *nb = EPHY_NOTEBOOK (l->data);
- GdkWindow *win = GTK_WIDGET (nb)->window;
+ EphyNotebook *notebook;
+
+ notebook = EPHY_NOTEBOOK (ephy_window_get_notebook
+ (EPHY_WINDOW (toplevel)));
- win = gdk_window_get_toplevel (win);
- if (((win == win_at_pointer) || (win == parent_at_pointer))
- && is_in_notebook_window (nb, abs_x, abs_y))
+ if (is_in_notebook_window (notebook, abs_x, abs_y))
{
- return nb;
+ return notebook;
}
}
+
return NULL;
}
@@ -735,8 +734,6 @@ ephy_notebook_init (EphyNotebook *notebook)
notebook->priv->opened_tabs = NULL;
notebook->priv->show_tabs = TRUE;
- notebooks = g_list_append (notebooks, notebook);
-
g_signal_connect (notebook, "button-press-event",
(GCallback)button_press_cb, NULL);
g_signal_connect (notebook, "button-release-event",
@@ -766,8 +763,6 @@ ephy_notebook_finalize (GObject *object)
{
EphyNotebook *notebook = EPHY_NOTEBOOK (object);
- notebooks = g_list_remove (notebooks, notebook);
-
eel_gconf_notification_remove (notebook->priv->tabs_vis_notifier_id);
if (notebook->priv->focused_pages)