mirror of
https://gitlab.gnome.org/GNOME/nautilus
synced 2024-10-03 06:25:36 +00:00
92677ae6f7
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
41 lines
1.3 KiB
C
41 lines
1.3 KiB
C
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
|
|
|
|
/*
|
|
* Nautilus
|
|
*
|
|
* Copyright (C) 2001 Eazel, Inc.
|
|
*
|
|
* Nautilus is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU General Public License as
|
|
* published by the Free Software Foundation; either version 2 of the
|
|
* License, or (at your option) any later version.
|
|
*
|
|
* Nautilus is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
* General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program; if not, write to the Free Software
|
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
*
|
|
* Author: John Harper <jsh@eazel.com>
|
|
*
|
|
*/
|
|
|
|
#ifndef NAUTILUS_DRAG_WINDOW_H
|
|
#define NAUTILUS_DRAG_WINDOW_H
|
|
|
|
#include <gtk/gtkwindow.h>
|
|
|
|
/* Call this function before WINDOW has been realized. It will hook
|
|
* into the window so that it automatically supports the correct focus
|
|
* policy when dragging objects from within the window. (This policy is
|
|
* *not* to focus or raise the window when the activating click is used
|
|
* to drag something)
|
|
*/
|
|
|
|
void nautilus_drag_window_register (GtkWindow *window);
|
|
|
|
#endif /* NAUTILUS_DRAG_WINDOW_H */
|