mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-23 04:46:55 +03:00
1998-10-23 Federico Mena Quintero <federico@nuclecu.unam.mx>
* 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.
This commit is contained in:
parent
5bcfa822f9
commit
c5dca5a751
@ -1,5 +1,14 @@
|
|||||||
1998-10-23 Federico Mena Quintero <federico@nuclecu.unam.mx>
|
1998-10-23 Federico Mena Quintero <federico@nuclecu.unam.mx>
|
||||||
|
|
||||||
|
* 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
|
* desktop-icon.c (desktop_icon_realize): Doh. We need to
|
||||||
initialize the gnome_win_hints before we set any of the hints.
|
initialize the gnome_win_hints before we set any of the hints.
|
||||||
|
|
||||||
|
@ -64,6 +64,7 @@ desktop_icon_class_init (DesktopIconClass *class)
|
|||||||
static void
|
static void
|
||||||
create_window_shape (DesktopIcon *dicon, int icon_width, int icon_height, int text_width, int text_height)
|
create_window_shape (DesktopIcon *dicon, int icon_width, int icon_height, int text_width, int text_height)
|
||||||
{
|
{
|
||||||
|
GdkImlibImage *im;
|
||||||
GdkBitmap *mask;
|
GdkBitmap *mask;
|
||||||
GdkBitmap *im_mask;
|
GdkBitmap *im_mask;
|
||||||
GdkGC *mgc;
|
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_gc_set_foreground (mgc, &c);
|
||||||
gdk_draw_rectangle (mask, mgc, TRUE, 0, 0, dicon->width, dicon->height);
|
gdk_draw_rectangle (mask, mgc, TRUE, 0, 0, dicon->width, dicon->height);
|
||||||
|
|
||||||
/* Paint the mask of the image */
|
|
||||||
|
|
||||||
c.pixel = 1;
|
c.pixel = 1;
|
||||||
gdk_gc_set_foreground (mgc, &c);
|
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,
|
gdk_draw_pixmap (mask,
|
||||||
mgc,
|
mgc,
|
||||||
im_mask,
|
im_mask,
|
||||||
0, 0,
|
0, 0,
|
||||||
(dicon->width - icon_width) / 2, 0,
|
(dicon->width - icon_width) / 2, 0,
|
||||||
icon_width, icon_height);
|
icon_width, icon_height);
|
||||||
else
|
gdk_imlib_free_bitmap (im_mask);
|
||||||
|
} else
|
||||||
gdk_draw_rectangle (mask, mgc, TRUE,
|
gdk_draw_rectangle (mask, mgc, TRUE,
|
||||||
(dicon->width - icon_width) / 2, 0,
|
(dicon->width - icon_width) / 2, 0,
|
||||||
icon_width, icon_height);
|
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 */
|
/* 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 ();
|
gnome_win_hints_init ();
|
||||||
|
|
||||||
if (gnome_win_hints_wm_exists ()) {
|
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_layer (widget, WIN_LAYER_DESKTOP);
|
||||||
gnome_win_hints_set_hints (widget,
|
gnome_win_hints_set_hints (widget,
|
||||||
(WIN_HINTS_SKIP_FOCUS
|
(WIN_HINTS_SKIP_FOCUS
|
||||||
|
@ -2,7 +2,8 @@
|
|||||||
* Controls the desktop contents
|
* Controls the desktop contents
|
||||||
* (C) 1998 the Free Software Foundation
|
* (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 <config.h>
|
#include <config.h>
|
||||||
#include <gnome.h>
|
#include <gnome.h>
|
||||||
@ -206,7 +207,6 @@ desktop_icon_set_position (desktop_icon_t *di)
|
|||||||
di->x = x;
|
di->x = x;
|
||||||
di->y = y;
|
di->y = y;
|
||||||
|
|
||||||
gdk_window_lower (di->widget->window);
|
|
||||||
gtk_widget_set_uposition (di->widget, x, y);
|
gtk_widget_set_uposition (di->widget, x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1074,9 +1074,6 @@ post_setup_desktop_icon (desktop_icon_t *di, int show)
|
|||||||
#endif
|
#endif
|
||||||
if (show)
|
if (show)
|
||||||
gtk_widget_show (di->widget);
|
gtk_widget_show (di->widget);
|
||||||
|
|
||||||
/* lower the window */
|
|
||||||
gdk_window_lower (di->widget->window);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Pops up the icon properties pages */
|
/* Pops up the icon properties pages */
|
||||||
|
Loading…
Reference in New Issue
Block a user