summaryrefslogtreecommitdiff
path: root/src/nautilus-navigation-window.c
diff options
context:
space:
mode:
authorJohn Harper <jsh@eazel.com>2001-01-04 02:00:05 +0000
committerJohn Harper <jsh@src.gnome.org>2001-01-04 02:00:05 +0000
commit92677ae6f7814d32e23c66a0f3f2435d7de3735b (patch)
tree477e5c2ba1ea37e2b6938f523f7d2a70fe57a6da /src/nautilus-navigation-window.c
parenta23b981c554d6a537332d457c95324644e95c2c1 (diff)
downloadnautilus-92677ae6f7814d32e23c66a0f3f2435d7de3735b.tar.gz
reviewed by: Darin Adler <darin@eazel.com>
2001-01-03 John Harper <jsh@eazel.com> reviewed by: Darin Adler <darin@eazel.com> Work to make clicking on an inactive window not focus it if the click subsequently starts a drag. Fixes bug 1681, and removes fixme bugs 5030, 5032, and 5033 * libnautilus-extensions/nautilus-drag-window.c, libnautilus-extensions/nautilus-drag-window.h (nautilus_drag_window_register): new module, hooks into a GtkWindow to retrofit a focus policy that makes sense with drag and drop sources. When dragging from a window, a button press event that subsequently causes a drag to be started doesn't focus (or raise) the window This uses a sawfish-specific WM_PROTOCOL to handle the `don't raise' part (_SAWFISH_WM_RAISE_WINDOW), but everything else should work with any ICCCM-compliant wm. (The sawfish specific part will have zero effect with other wm's. It currently requires a cvs version of sawfish) * src/nautilus-window.c (nautilus_window_constructed): * src/nautilus-property-browser.c (nautilus_property_browser_initialize): Call nautilus_drag_window_register () on the window, since it may be used as a drag source * libnautilus-extensions/nautilus-gdk-extensions.c, libnautilus-extensions/nautilus-gdk-extensions.h (nautilus_gdk_window_focus, nautilus_gdk_window_set_wm_protocols): new functions
Diffstat (limited to 'src/nautilus-navigation-window.c')
-rw-r--r--src/nautilus-navigation-window.c53
1 files changed, 4 insertions, 49 deletions
diff --git a/src/nautilus-navigation-window.c b/src/nautilus-navigation-window.c
index 39b3ac2df..58e076e0d 100644
--- a/src/nautilus-navigation-window.c
+++ b/src/nautilus-navigation-window.c
@@ -56,6 +56,7 @@
#include <libgnomevfs/gnome-vfs-uri.h>
#include <libgnomevfs/gnome-vfs-utils.h>
#include <libnautilus-extensions/nautilus-bonobo-extensions.h>
+#include <libnautilus-extensions/nautilus-drag-window.h>
#include <libnautilus-extensions/nautilus-file-utilities.h>
#include <libnautilus-extensions/nautilus-gdk-extensions.h>
#include <libnautilus-extensions/nautilus-gdk-pixbuf-extensions.h>
@@ -551,6 +552,9 @@ nautilus_window_constructed (NautilusWindow *window)
/* Set up the sidebar panels. */
update_sidebar_panels_from_preferences (window);
+
+ /* Register that things may be dragged from this window */
+ nautilus_drag_window_register (GTK_WINDOW (window));
}
static void
@@ -697,41 +701,6 @@ nautilus_window_close (NautilusWindow *window)
gtk_widget_destroy (GTK_WIDGET (window));
}
-/* FIXME bugzilla.eazel.com 5030: Why is this filter turned off? */
-#if 0
-#include <gdk/gdkx.h>
-#include <gdk/gdkprivate.h>
-
-static GdkFilterReturn
-nautilus_window_filter (GdkXEvent *xev, GdkEvent *event, gpointer data)
-{
- XEvent *xevent = (XEvent *)xev;
-
- if ((Atom) xevent->xclient.data.l[0] == gdk_wm_delete_window) {
- /* The delete window request specifies a window
- * to delete. We don't actually destroy the
- * window because "it is only a request". (The
- * window might contain vital data that the
- * program does not want destroyed). Instead
- * the event is passed along to the program,
- * which should then destroy the window.
- */
- GDK_NOTE (EVENTS, g_message ("delete window:\t\twindow: %ld", xevent->xclient.window));
-
- event->any.type = GDK_DELETE;
-
- return GDK_FILTER_TRANSLATE;
- } else if ((Atom) xevent->xclient.data.l[0] == gdk_wm_take_focus) {
- /* Check and see if we are in a drag. If not, Focus window and bring to front */
- nautilus_gdk_window_bring_to_front (GTK_WIDGET (data)->window);
-
- return GDK_FILTER_TRANSLATE;
- }
-
- return GDK_FILTER_REMOVE;
-}
-#endif
-
static void
nautilus_window_update_launcher (GdkWindow *window)
{
@@ -762,20 +731,6 @@ nautilus_window_realize (GtkWidget *widget)
/* Create our GdkWindow */
NAUTILUS_CALL_PARENT_CLASS (GTK_WIDGET_CLASS, realize, (widget));
- /* Set window manager hints so click-drag from window to window works */
-
- /* FIXME bugzilla.eazel.com 5032: need to coordinate with sawfish or this line results in
- nautilus windows being unfocusable */
-#if 0
- nautilus_gdk_window_set_wm_hints_input (widget->window, FALSE);
-#endif
-
- /* Add custom message filter to handle WM_TAKE_FOCUS */
- /* FIXME bugzilla.eazel.com 5033: Why is this filter turned off? */
-#if 0
- gdk_add_client_message_filter (gdk_wm_protocols, nautilus_window_filter, widget);
-#endif
-
/* Set the mini icon */
filename = nautilus_pixmap_file ("nautilus-mini-logo.png");
if (filename != NULL) {