[Nautilus-list] Patch for Sawfish-workaround



Attached is a small patch for eel that makes sure nautilus2 works better
with old and current versions of sawfish.
More specifically, dialogs created from the desktop, will not end up
behind all other windows, unable to be moved to the front.

I've also tested the behaviour with Metacity and Enlightenment. The patch
did not change any user-visible changes for them.

I added a define, that can turn on or off the workaround. Perhaps
this should be a compile-time option, but I have very little
experience with Makefiles.

Gaute
? patchforeel
? eel/eel-stock-dialogs.bck2
Index: eel/eel-stock-dialogs.c
===================================================================
RCS file: /cvs/gnome/eel/eel/eel-stock-dialogs.c,v
retrieving revision 1.17
diff -r1.17 eel-stock-dialogs.c
35a36,38
> #include <X11/Xatom.h>
> #include <X11/Xlib.h>
> #include <gdk/gdkx.h>
39a43
> #define WORKAROUND_FOR_SAWFISH_TRANSIENT_BUG 1
421a426,432
> 	GdkWindow *parentxwindow;
> 	guchar *data;
> 	gint format;
> 	gulong nitems, bytes_after;
> 	Atom xtype;
> 	Atom foundatom;
> 	Atom desktop_atom;
428a440,466
> 	}
> 
> 	/* If the define is set, we activate the workaround */
> 	if (WORKAROUND_FOR_SAWFISH_TRANSIENT_BUG) {
> 		parentxwindow = (GTK_WIDGET (parent))->window;
> 		desktop_atom = XInternAtom (GDK_DISPLAY (), "_NET_WM_WINDOW_TYPE_DESKTOP", False);
> 			
> 		if (XGetWindowProperty (GDK_DISPLAY (), GDK_WINDOW_XWINDOW (parentxwindow), 
> 				    gdk_x11_get_xatom_by_name ("_NET_WM_WINDOW_TYPE"),
> 				    0, G_MAXLONG, False, XA_ATOM,
> 					&xtype, &format, &nitems, &bytes_after, &data) == Success) {
> 			
> 			if (xtype == XA_ATOM && format == 32 && nitems == 1) {
> 				
> 				foundatom = (Atom) ((long *) data)[0];
> 				
> 				/* Compare the desktop_atom with the one found in the window */
> 				if (foundatom == desktop_atom) {
> 				/* Makes sure the dialog is non-transient, so it can
> 				 * be brought to the top */
> 					
> 					gtk_window_set_transient_for (GTK_WINDOW (dialog), NULL);
> 				}
> 				
> 			}
> 			XFree (data);
> 		}


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