Re: [Nautilus-list] drag window focus hack issues



Havoc Pennington writes:
| - when it focuses a window, it sets focus to the 
|   window itself not GTK's magic focus child window. 
|   Not sure what impact this has.

I don't know anything about this..

|
| - when a window is not a registered drag window (e.g. prefs dialog),
|   Nautilus client message filter never calls XSetInputFocus() at all
|   which breaks Metacity.  It works with sawfish/twm/fvwm2 but I
|   do not understand why - WM isn't supposed to set focus here 
|   and Nautilus does not AFAICT.

Sawfish may ignore the input flag in some cases, maybe that's why

This bug can be easily fixed by focusing the window if it doesn't have
a drag data structure associated with it

|
| - it breaks GTK's _NET_WM_PING support.

well, I noticed that someone has added _NET_WM_PING to the list of
protocols, but removed _SAWFISH_WM_RAISE_WINDOW (without removing the
code that actually handles _SAWFISH_WM_RAISE_WINDOW)

It looks like they tried to support _NET_WM_PING, but broke both
protocols in the process..?

I haven't tested it (my nautilus for gnome2 doesn't build currently),
but I think this may fix the bugs. Maybe someone could try it out..?
child subprocess can't exec: No such file or directory
Index: libnautilus-private/nautilus-drag-window.c
===================================================================
RCS file: /cvs/gnome/nautilus/libnautilus-private/nautilus-drag-window.c,v
retrieving revision 1.13
diff -u -p -r1.13 nautilus-drag-window.c
--- libnautilus-private/nautilus-drag-window.c	7 Mar 2002 19:36:01 -0000	1.13
+++ libnautilus-private/nautilus-drag-window.c	27 Mar 2002 06:22:28 -0000
@@ -294,6 +294,9 @@ wm_protocols_filter (GdkXEvent *xev, Gdk
 			 * is received in the near future.
 			 */
 			set_focus_timeout (window);
+		} else {
+			eel_gdk_window_focus (GTK_WIDGET (window)->window,
+					      xevent->xclient.data.l[1]);
 		}
 		return GDK_FILTER_REMOVE;

@@ -309,6 +312,11 @@ wm_protocols_filter (GdkXEvent *xev, Gdk
 		}
 		return GDK_FILTER_REMOVE;
 	}
+	else if ((Atom) xevent->xclient.data.l[0] == gdk_x11_get_xatom_by_name ("_NET_WM_PING"))
+	{
+		xevent->xclient.window = GDK_ROOT_WINDOW ();
+		XSendEvent (GDK_DISPLAY (), GDK_ROOT_WINDOW (), False, SubstructureRedirectMask | SubstructureNotifyMask, xevent);
+	}
 	else {
 		return GDK_FILTER_CONTINUE;
 	}
@@ -335,8 +343,9 @@ nautilus_drag_window_realize (GtkWidget
 	 */
         protocols[0] = gdk_atom_intern ("WM_DELETE_WINDOW", FALSE);
         protocols[1] = gdk_atom_intern ("WM_TAKE_FOCUS", FALSE);
-        protocols[2] = gdk_atom_intern ("_NET_WM_PING", FALSE);
-	eel_gdk_window_set_wm_protocols (widget->window, protocols, 3);
+        protocols[2] = gdk_atom_intern ("_SAWFISH_WM_RAISE_WINDOW", FALSE);
+        protocols[3] = gdk_atom_intern ("_NET_WM_PING", FALSE);
+	eel_gdk_window_set_wm_protocols (widget->window, protocols, 4);
 }

 /* Public entry point */
	John


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]