summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorraveit65 <[email protected]>2016-06-26 22:48:05 +0200
committerraveit65 <[email protected]>2016-07-06 17:47:42 +0200
commit32359d81ae57fdde06062ae857933b2c62bea628 (patch)
tree44ed9518a08f4dd08da8ff455d4600c771396dd6
parentd886a6fa7e3c624d4b53e5d3346ab63a34a991bf (diff)
downloadcaja-32359d81ae57fdde06062ae857933b2c62bea628.tar.bz2
caja-32359d81ae57fdde06062ae857933b2c62bea628.tar.xz
notebook: cleanup an old workaround
There should be no need for all these roundtrips here. We can assume if we got an event on the notebook, it will be within a GtkNotebook. taken from: https://git.gnome.org/browse/nautilus/commit/src?id=bbd77ce
-rw-r--r--src/caja-notebook.c66
1 files changed, 0 insertions, 66 deletions
diff --git a/src/caja-notebook.c b/src/caja-notebook.c
index ec2ec714..199e7a2b 100644
--- a/src/caja-notebook.c
+++ b/src/caja-notebook.c
@@ -39,7 +39,6 @@
#include <gtk/gtk.h>
#define AFTER_ALL_TABS -1
-#define NOT_IN_APP_WINDOWS -2
#if GTK_CHECK_VERSION (3, 0, 0)
#define gtk_hbox_new(X,Y) gtk_box_new(GTK_ORIENTATION_HORIZONTAL,Y)
@@ -105,59 +104,6 @@ caja_notebook_class_init (CajaNotebookClass *klass)
CAJA_TYPE_WINDOW_SLOT);
}
-
-/* FIXME remove when gtknotebook's func for this becomes public, bug #.... */
-static CajaNotebook *
-find_notebook_at_pointer (gint abs_x, gint abs_y)
-{
-#if GTK_CHECK_VERSION(3, 0, 0)
- GdkDeviceManager *manager;
- GdkDevice *pointer;
-#endif
- GdkWindow *win_at_pointer, *toplevel_win;
- gpointer toplevel = NULL;
- gint x, y;
-
- /* FIXME multi-head */
-#if GTK_CHECK_VERSION(3, 0, 0)
- manager = gdk_display_get_device_manager (gdk_display_get_default ());
- pointer = gdk_device_manager_get_client_pointer (manager);
- win_at_pointer = gdk_device_get_window_at_position (pointer, &x, &y);
-#else
- win_at_pointer = gdk_window_at_pointer (&x, &y);
-#endif
-
- if (win_at_pointer == NULL)
- {
- /* We are outside all windows containing a notebook */
- return NULL;
- }
-
- 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);
-
- /* toplevel should be an CajaWindow */
- if (toplevel != NULL && CAJA_IS_NAVIGATION_WINDOW (toplevel))
- {
- return CAJA_NOTEBOOK (CAJA_NAVIGATION_WINDOW_PANE (CAJA_WINDOW (toplevel)->details->active_pane)->notebook);
- }
-
- return NULL;
-}
-
-static gboolean
-is_in_notebook_window (CajaNotebook *notebook,
- gint abs_x, gint abs_y)
-{
- CajaNotebook *nb_at_pointer;
-
- nb_at_pointer = find_notebook_at_pointer (abs_x, abs_y);
-
- return nb_at_pointer == notebook;
-}
-
static gint
find_tab_num_at_pos (CajaNotebook *notebook, gint abs_x, gint abs_y)
{
@@ -169,18 +115,6 @@ find_tab_num_at_pos (CajaNotebook *notebook, gint abs_x, gint abs_y)
tab_pos = gtk_notebook_get_tab_pos (GTK_NOTEBOOK (notebook));
- if (gtk_notebook_get_n_pages (nb) == 0)
- {
- return AFTER_ALL_TABS;
- }
-
- /* For some reason unfullscreen + quick click can
- cause a wrong click event to be reported to the tab */
- if (!is_in_notebook_window(notebook, abs_x, abs_y))
- {
- return NOT_IN_APP_WINDOWS;
- }
-
while ((page = gtk_notebook_get_nth_page (nb, page_num)))
{
GtkWidget *tab;