desktop icon mess patch



When a user shows the nautilus desktop for the first time, currently the
home and trash icons get stacked on each other in the top left corner. 

The core issue behind this is a problem with size-allocation of
BonoboPlug/Socket, which means the desktop is realized at 60x60, and
then later re-realized at the correct size. This has caused lots of
issues in the history of Nautilus, and the desktop code is sprinkled
with workarounds for this problem. Apparently the new desktop icon code
introduces another issue, where the in-memory objects are "loaded"
before the desktop has been realized at the right size so they get laid
out in 60x60 pixels.

Here is a patch I just put in the RH packages to work around this. Its
hacky, but this is a nasty problem. Should this go into 2.4?

Index: src/file-manager/fm-desktop-icon-view.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/file-manager/fm-desktop-icon-view.c,v
retrieving revision 1.208
diff -u -p -r1.208 fm-desktop-icon-view.c
--- src/file-manager/fm-desktop-icon-view.c	7 Jul 2003 11:05:05 -0000	1.208
+++ src/file-manager/fm-desktop-icon-view.c	4 Sep 2003 14:36:40 -0000
@@ -335,10 +335,20 @@ static void
 realized_callback (GtkWidget *widget, FMDesktopIconView *desktop_icon_view)
 {
 	GdkWindow *root_window;
+	GdkScreen *screen;
+	GtkAllocation allocation;
 
 	g_return_if_fail (desktop_icon_view->details->root_window == NULL);
 
-	root_window = gdk_screen_get_root_window (gtk_widget_get_screen (widget));
+	screen = gtk_widget_get_screen (widget);
+	allocation.x = 0;
+	allocation.y = 0;
+	allocation.width = gdk_screen_get_width (screen);
+	allocation.height = gdk_screen_get_height (screen);
+	gtk_widget_size_allocate (GTK_WIDGET(get_icon_container(desktop_icon_view)),
+				  &allocation);
+	
+	root_window = gdk_screen_get_root_window (screen);
 
 	desktop_icon_view->details->root_window = root_window;
 



=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Alexander Larsson                                            Red Hat, Inc 
                   alexl redhat com    alla lysator liu se 
He's a scrappy vegetarian vagrant who hangs with the wrong crowd. She's a 
disco-crazy hypochondriac lawyer who believes she is the reincarnation of an 
ancient Egyptian queen. They fight crime! 




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