From c5dca5a7515a940f4734f24ce622c82ece253b99 Mon Sep 17 00:00:00 2001 From: Miguel de Icaza Date: Mon, 26 Oct 1998 23:19:37 +0000 Subject: [PATCH] 1998-10-23 Federico Mena Quintero * gdesktop.c (desktop_icon_set_position): Do not lower the window. The gnome-compliant wm will know what to do with windows on the Desktop layer. (post_setup_desktop_icon): Likewise. * desktop-icon.c (create_window_shape): Fetch the mask of the image "by hand", as we cannot rely on the canvas item having created it yet. * desktop-icon.c (desktop_icon_realize): Doh. We need to initialize the gnome_win_hints before we set any of the hints. --- gnome/ChangeLog | 9 +++++++++ gnome/gdesktop-icon.c | 22 +++++++++++++--------- gnome/gdesktop.c | 7 ++----- 3 files changed, 24 insertions(+), 14 deletions(-) diff --git a/gnome/ChangeLog b/gnome/ChangeLog index 0e3eefea7..e61f1c073 100644 --- a/gnome/ChangeLog +++ b/gnome/ChangeLog @@ -1,5 +1,14 @@ 1998-10-23 Federico Mena Quintero + * gdesktop.c (desktop_icon_set_position): Do not lower the + window. The gnome-compliant wm will know what to do with windows + on the Desktop layer. + (post_setup_desktop_icon): Likewise. + + * desktop-icon.c (create_window_shape): Fetch the mask of the + image "by hand", as we cannot rely on the canvas item having + created it yet. + * desktop-icon.c (desktop_icon_realize): Doh. We need to initialize the gnome_win_hints before we set any of the hints. diff --git a/gnome/gdesktop-icon.c b/gnome/gdesktop-icon.c index 747a9cf83..3df95013d 100644 --- a/gnome/gdesktop-icon.c +++ b/gnome/gdesktop-icon.c @@ -64,6 +64,7 @@ desktop_icon_class_init (DesktopIconClass *class) static void create_window_shape (DesktopIcon *dicon, int icon_width, int icon_height, int text_width, int text_height) { + GdkImlibImage *im; GdkBitmap *mask; GdkBitmap *im_mask; GdkGC *mgc; @@ -78,21 +79,24 @@ create_window_shape (DesktopIcon *dicon, int icon_width, int icon_height, int te gdk_gc_set_foreground (mgc, &c); gdk_draw_rectangle (mask, mgc, TRUE, 0, 0, dicon->width, dicon->height); - /* Paint the mask of the image */ - c.pixel = 1; gdk_gc_set_foreground (mgc, &c); - - im_mask = GNOME_CANVAS_IMAGE (dicon->icon)->mask; - if (im_mask) + /* Paint the mask of the image */ + + im = GNOME_CANVAS_IMAGE (dicon->icon)->im; + gdk_imlib_render (im, im->rgb_width, im->rgb_height); + im_mask = gdk_imlib_move_mask (im); + + if (im_mask) { gdk_draw_pixmap (mask, mgc, im_mask, 0, 0, (dicon->width - icon_width) / 2, 0, icon_width, icon_height); - else + gdk_imlib_free_bitmap (im_mask); + } else gdk_draw_rectangle (mask, mgc, TRUE, (dicon->width - icon_width) / 2, 0, icon_width, icon_height); @@ -210,12 +214,12 @@ desktop_icon_realize (GtkWidget *widget) /* Set the window decorations to none and hints to the appropriate combination */ + gdk_window_set_decorations (widget->window, 0); + gdk_window_set_functions (widget->window, 0); + gnome_win_hints_init (); if (gnome_win_hints_wm_exists ()) { - gdk_window_set_decorations (widget->window, 0); - gdk_window_set_functions (widget->window, 0); - gnome_win_hints_set_layer (widget, WIN_LAYER_DESKTOP); gnome_win_hints_set_hints (widget, (WIN_HINTS_SKIP_FOCUS diff --git a/gnome/gdesktop.c b/gnome/gdesktop.c index 88dca42dc..c20c21d50 100644 --- a/gnome/gdesktop.c +++ b/gnome/gdesktop.c @@ -2,7 +2,8 @@ * Controls the desktop contents * (C) 1998 the Free Software Foundation * - * Author: Miguel de Icaza (miguel@gnu.org) + * Authors: Miguel de Icaza (miguel@gnu.org) + * Federico Mena (federico@nuclecu.unam.mx) */ #include #include @@ -206,7 +207,6 @@ desktop_icon_set_position (desktop_icon_t *di) di->x = x; di->y = y; - gdk_window_lower (di->widget->window); gtk_widget_set_uposition (di->widget, x, y); } @@ -1074,9 +1074,6 @@ post_setup_desktop_icon (desktop_icon_t *di, int show) #endif if (show) gtk_widget_show (di->widget); - - /* lower the window */ - gdk_window_lower (di->widget->window); } /* Pops up the icon properties pages */