diff -Nrup -x '*.orig' -x '*.rej' -x '*.*~' ../SUNWgnome-display-mgr-2.30.4-clean/gdm-2.30.4/data/session-setup.entries gdm-2.30.4/data/session-setup.entries --- ../SUNWgnome-display-mgr-2.30.4-clean/gdm-2.30.4/data/session-setup.entries 2010-08-09 09:51:02.535624440 +0200 +++ gdm-2.30.4/data/session-setup.entries 2010-08-09 09:55:22.681440019 +0200 @@ -422,6 +422,12 @@ 300 + + /desktop/gnome/background/picture_filename + + /usr/share/gdm/bkg.jpg + + /apps/gnome_settings_daemon/keybindings/eject diff -Nrup -x '*.orig' -x '*.rej' -x '*.*~' ../SUNWgnome-display-mgr-2.30.4-clean/gdm-2.30.4/gui/simple-greeter/Makefile.am gdm-2.30.4/gui/simple-greeter/Makefile.am --- ../SUNWgnome-display-mgr-2.30.4-clean/gdm-2.30.4/gui/simple-greeter/Makefile.am 2010-08-09 09:51:02.577658995 +0200 +++ gdm-2.30.4/gui/simple-greeter/Makefile.am 2010-08-09 09:58:18.846315706 +0200 @@ -85,6 +85,8 @@ test_greeter_login_window_SOURCES = \ gdm-user-chooser-widget.c \ gdm-user-chooser-dialog.h \ gdm-user-chooser-dialog.c \ + branding.c \ + branding.h \ $(NULL) test_greeter_login_window_LDADD = \ @@ -134,6 +136,8 @@ test_greeter_panel_SOURCES = \ gdm-sessions.c \ gdm-session-option-widget.h \ gdm-session-option-widget.c \ + branding.c \ + branding.h \ $(NULL) test_greeter_panel_LDADD = \ @@ -327,6 +331,8 @@ gdm_simple_greeter_SOURCES = \ gdm-session-option-widget.c \ gdm-user-chooser-widget.h \ gdm-user-chooser-widget.c \ + branding.c \ + branding.h \ $(NULL) gdm_simple_greeter_LDADD = \ @@ -344,6 +350,10 @@ gdm_simple_greeter_LDADD = \ uidir = $(pkgdatadir) ui_DATA = \ gdm-greeter-login-window.ui \ + box.png \ + logo.png \ + bkg.jpg \ + bottom-panel-image-gdm.png \ $(NULL) EXTRA_DIST = \ diff -Nrup -x '*.orig' -x '*.rej' -x '*.*~' ../SUNWgnome-display-mgr-2.30.4-clean/gdm-2.30.4/gui/simple-greeter/branding.c gdm-2.30.4/gui/simple-greeter/branding.c --- ../SUNWgnome-display-mgr-2.30.4-clean/gdm-2.30.4/gui/simple-greeter/branding.c 1970-01-01 01:00:00.000000000 +0100 +++ gdm-2.30.4/gui/simple-greeter/branding.c 2010-08-09 09:51:46.928239708 +0200 @@ -0,0 +1,824 @@ +#include +#include +#include +#include + +typedef struct +{ + GdkPixbuf *pixbuf; + GSList *scaled; + gboolean stretch; + gint border_left; + gint border_right; + gint border_bottom; + gint border_top; + guint hints[3][3]; +} ConstraintScale; +typedef enum +{ + COMPONENT_NORTH_WEST = 1 << 0, + COMPONENT_NORTH = 1 << 1, + COMPONENT_NORTH_EAST = 1 << 2, + COMPONENT_WEST = 1 << 3, + COMPONENT_CENTER = 1 << 4, + COMPONENT_EAST = 1 << 5, + COMPONENT_SOUTH_EAST = 1 << 6, + COMPONENT_SOUTH = 1 << 7, + COMPONENT_SOUTH_WEST = 1 << 8, + COMPONENT_ALL = 1 << 9 +} ConstraintScaleComponent; + +typedef enum { + THEME_CONSTANT_ROWS = 1 << 0, + THEME_CONSTANT_COLS = 1 << 1, + THEME_MISSING = 1 << 2 +} ThemeRenderHints; + + +static GdkPixbuf * +bilinear_gradient (GdkPixbuf *src, + gint src_x, + gint src_y, + gint width, + gint height) +{ + guint n_channels = gdk_pixbuf_get_n_channels (src); + guint src_rowstride = gdk_pixbuf_get_rowstride (src); + guchar *src_pixels = gdk_pixbuf_get_pixels (src); + guchar *p1, *p2, *p3, *p4; + guint dest_rowstride; + guchar *dest_pixels; + GdkPixbuf *result; + int i, j, k; + + p1 = src_pixels + (src_y - 1) * src_rowstride + (src_x - 1) * n_channels; + p2 = p1 + n_channels; + p3 = src_pixels + src_y * src_rowstride + (src_x - 1) * n_channels; + p4 = p3 + n_channels; + + result = gdk_pixbuf_new (GDK_COLORSPACE_RGB, n_channels == 4, 8, + width, height); + dest_rowstride = gdk_pixbuf_get_rowstride (result); + dest_pixels = gdk_pixbuf_get_pixels (result); + + for (i = 0; i < height; i++) + { + guchar *p = dest_pixels + dest_rowstride *i; + guint v[4]; + gint dv[4]; + + for (k = 0; k < n_channels; k++) + { + guint start = ((height - i) * p1[k] + (1 + i) * p3[k]) / (height + 1); + guint end = ((height - i) * p2[k] + (1 + i) * p4[k]) / (height + 1); + + dv[k] = (((gint)end - (gint)start) << 16) / (width + 1); + v[k] = (start << 16) + dv[k] + 0x8000; + } + + for (j = width; j; j--) + { + for (k = 0; k < n_channels; k++) + { + *(p++) = v[k] >> 16; + v[k] += dv[k]; + } + } + } + + return result; +} + +static GdkPixbuf * +horizontal_gradient (GdkPixbuf *src, + gint src_x, + gint src_y, + gint width, + gint height) +{ + guint n_channels = gdk_pixbuf_get_n_channels (src); + guint src_rowstride = gdk_pixbuf_get_rowstride (src); + guchar *src_pixels = gdk_pixbuf_get_pixels (src); + guint dest_rowstride; + guchar *dest_pixels; + GdkPixbuf *result; + int i, j, k; + + result = gdk_pixbuf_new (GDK_COLORSPACE_RGB, n_channels == 4, 8, + width, height); + dest_rowstride = gdk_pixbuf_get_rowstride (result); + dest_pixels = gdk_pixbuf_get_pixels (result); + + for (i = 0; i < height; i++) + { + guchar *p = dest_pixels + dest_rowstride *i; + guchar *p1 = src_pixels + (src_y + i) * src_rowstride + (src_x - 1) * n_channels; + guchar *p2 = p1 + n_channels; + + guint v[4]; + gint dv[4]; + + for (k = 0; k < n_channels; k++) + { + dv[k] = (((gint)p2[k] - (gint)p1[k]) << 16) / (width + 1); + v[k] = (p1[k] << 16) + dv[k] + 0x8000; + } + + for (j = width; j; j--) + { + for (k = 0; k < n_channels; k++) + { + *(p++) = v[k] >> 16; + v[k] += dv[k]; + } + } + } + + return result; +} + +static GdkPixbuf * +vertical_gradient (GdkPixbuf *src, + gint src_x, + gint src_y, + gint width, + gint height) +{ + guint n_channels = gdk_pixbuf_get_n_channels (src); + guint src_rowstride = gdk_pixbuf_get_rowstride (src); + guchar *src_pixels = gdk_pixbuf_get_pixels (src); + guchar *top_pixels, *bottom_pixels; + guint dest_rowstride; + guchar *dest_pixels; + GdkPixbuf *result; + int i, j; + + top_pixels = src_pixels + (src_y - 1) * src_rowstride + (src_x) * n_channels; + bottom_pixels = top_pixels + src_rowstride; + + result = gdk_pixbuf_new (GDK_COLORSPACE_RGB, n_channels == 4, 8, + width, height); + dest_rowstride = gdk_pixbuf_get_rowstride (result); + dest_pixels = gdk_pixbuf_get_pixels (result); + + for (i = 0; i < height; i++) + { + guchar *p = dest_pixels + dest_rowstride *i; + guchar *p1 = top_pixels; + guchar *p2 = bottom_pixels; + + for (j = width * n_channels; j; j--) + *(p++) = ((height - i) * *(p1++) + (1 + i) * *(p2++)) / (height + 1); + } + + return result; +} + +static GdkPixbuf * +replicate_single (GdkPixbuf *src, + gint src_x, + gint src_y, + gint width, + gint height) +{ + guint n_channels = gdk_pixbuf_get_n_channels (src); + guchar *pixels = (gdk_pixbuf_get_pixels (src) + + src_y * gdk_pixbuf_get_rowstride (src) + + src_x * n_channels); + guchar r = *(pixels++); + guchar g = *(pixels++); + guchar b = *(pixels++); + guint dest_rowstride; + guchar *dest_pixels; + guchar a = 0; + GdkPixbuf *result; + int i, j; + + if (n_channels == 4) + a = *(pixels++); + + result = gdk_pixbuf_new (GDK_COLORSPACE_RGB, n_channels == 4, 8, + width, height); + dest_rowstride = gdk_pixbuf_get_rowstride (result); + dest_pixels = gdk_pixbuf_get_pixels (result); + + for (i = 0; i < height; i++) + { + guchar *p = dest_pixels + dest_rowstride *i; + + for (j = 0; j < width; j++) + { + *(p++) = r; + *(p++) = g; + *(p++) = b; + + if (n_channels == 4) + *(p++) = a; + } + } + + return result; +} + +static GdkPixbuf * +replicate_rows (GdkPixbuf *src, + gint src_x, + gint src_y, + gint width, + gint height) +{ + guint n_channels = gdk_pixbuf_get_n_channels (src); + guint src_rowstride = gdk_pixbuf_get_rowstride (src); + guchar *pixels = (gdk_pixbuf_get_pixels (src) + src_y * src_rowstride + src_x * n_channels); + guchar *dest_pixels; + GdkPixbuf *result; + guint dest_rowstride; + int i; + + result = gdk_pixbuf_new (GDK_COLORSPACE_RGB, n_channels == 4, 8, + width, height); + dest_rowstride = gdk_pixbuf_get_rowstride (result); + dest_pixels = gdk_pixbuf_get_pixels (result); + + for (i = 0; i < height; i++) + memcpy (dest_pixels + dest_rowstride * i, pixels, n_channels * width); + + return result; +} + +static GdkPixbuf * +replicate_cols (GdkPixbuf *src, + gint src_x, + gint src_y, + gint width, + gint height) +{ + guint n_channels = gdk_pixbuf_get_n_channels (src); + guint src_rowstride = gdk_pixbuf_get_rowstride (src); + guchar *pixels = (gdk_pixbuf_get_pixels (src) + src_y * src_rowstride + src_x * n_channels); + guchar *dest_pixels; + GdkPixbuf *result; + guint dest_rowstride; + int i, j; + + result = gdk_pixbuf_new (GDK_COLORSPACE_RGB, n_channels == 4, 8, + width, height); + dest_rowstride = gdk_pixbuf_get_rowstride (result); + dest_pixels = gdk_pixbuf_get_pixels (result); + + for (i = 0; i < height; i++) + { + guchar *p = dest_pixels + dest_rowstride * i; + guchar *q = pixels + src_rowstride * i; + + guchar r = *(q++); + guchar g = *(q++); + guchar b = *(q++); + guchar a = 0; + + if (n_channels == 4) + a = *(q++); + + for (j = 0; j < width; j++) + { + *(p++) = r; + *(p++) = g; + *(p++) = b; + + if (n_channels == 4) + *(p++) = a; + } + } + + return result; +} + +/* Scale the rectangle (src_x, src_y, src_width, src_height) + * onto the rectangle (dest_x, dest_y, dest_width, dest_height) + * of the destination, and render into a pixbuf + */ + +static void +cs_render (GdkPixbuf *src, + guint hints, + GdkPixbuf *scaled, + gint src_x, + gint src_y, + gint src_width, + gint src_height, + gint dest_x, + gint dest_y, + gint dest_width, + gint dest_height) +{ + GdkPixbuf *tmp_pixbuf; + GdkRectangle rect; + int x_offset, y_offset; + gboolean has_alpha = gdk_pixbuf_get_has_alpha (src); + gint src_rowstride = gdk_pixbuf_get_rowstride (src); + gint src_n_channels = gdk_pixbuf_get_n_channels (src); + + if (dest_width <= 0 || dest_height <= 0) + return; + + rect.x = dest_x; + rect.y = dest_y; + rect.width = dest_width; + rect.height = dest_height; + + if (hints & THEME_MISSING) + return; + + if (dest_width == src_width && dest_height == src_height) + { + tmp_pixbuf = g_object_ref (src); + + x_offset = src_x + rect.x - dest_x; + y_offset = src_y + rect.y - dest_y; + } + else if (src_width == 0 && src_height == 0) + { + tmp_pixbuf = bilinear_gradient (src, src_x, src_y, dest_width, dest_height); + + x_offset = rect.x - dest_x; + y_offset = rect.y - dest_y; + } + else if (src_width == 0 && dest_height == src_height) + { + tmp_pixbuf = horizontal_gradient (src, src_x, src_y, dest_width, dest_height); + + x_offset = rect.x - dest_x; + y_offset = rect.y - dest_y; + } + else if (src_height == 0 && dest_width == src_width) + { + tmp_pixbuf = vertical_gradient (src, src_x, src_y, dest_width, dest_height); + + x_offset = rect.x - dest_x; + y_offset = rect.y - dest_y; + } + else if ((hints & THEME_CONSTANT_COLS) && (hints & THEME_CONSTANT_ROWS)) + { + tmp_pixbuf = replicate_single (src, src_x, src_y, dest_width, dest_height); + + x_offset = rect.x - dest_x; + y_offset = rect.y - dest_y; + } + else if (dest_width == src_width && (hints & THEME_CONSTANT_COLS)) + { + tmp_pixbuf = replicate_rows (src, src_x, src_y, dest_width, dest_height); + + x_offset = rect.x - dest_x; + y_offset = rect.y - dest_y; + } + else if (dest_height == src_height && (hints & THEME_CONSTANT_ROWS)) + { + tmp_pixbuf = replicate_cols (src, src_x, src_y, dest_width, dest_height); + + x_offset = rect.x - dest_x; + y_offset = rect.y - dest_y; + } + else + { + double x_scale = (double)dest_width / src_width; + double y_scale = (double)dest_height / src_height; + guchar *pixels; + GdkPixbuf *partial_src; + + pixels = (gdk_pixbuf_get_pixels (src) + + src_y * src_rowstride + + src_x * src_n_channels); + + partial_src = gdk_pixbuf_new_from_data (pixels, GDK_COLORSPACE_RGB, + has_alpha, + 8, src_width, src_height, + src_rowstride, + NULL, NULL); + + tmp_pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, + has_alpha, 8, + rect.width, rect.height); + + gdk_pixbuf_scale (partial_src, tmp_pixbuf, + 0, 0, rect.width, rect.height, + dest_x - rect.x, dest_y - rect.y, + x_scale, y_scale, + GDK_INTERP_BILINEAR); + + gdk_pixbuf_unref (partial_src); + + x_offset = 0; + y_offset = 0; + } + + if (rect.x >= 0 && rect.x + rect.width <= gdk_pixbuf_get_width (scaled) && + rect.y >= 0 && rect.y + rect.height <= gdk_pixbuf_get_height (scaled)) + { + gdk_pixbuf_copy_area (tmp_pixbuf, + x_offset, y_offset, + rect.width, rect.height, + scaled, + rect.x, + rect.y); + } + gdk_pixbuf_unref (tmp_pixbuf); +} + +static guint +compute_hint (GdkPixbuf *pixbuf, + gint x0, + gint x1, + gint y0, + gint y1) +{ + int i, j; + int hints = THEME_CONSTANT_ROWS | THEME_CONSTANT_COLS | THEME_MISSING; + int n_channels = gdk_pixbuf_get_n_channels (pixbuf); + + guchar *data = gdk_pixbuf_get_pixels (pixbuf); + int rowstride = gdk_pixbuf_get_rowstride (pixbuf); + + if (x0 == x1 || y0 == y1) + return 0; + + for (i = y0; i < y1; i++) + { + guchar *p = data + i * rowstride + x0 * n_channels; + guchar r = p[0]; + guchar g = p[1]; + guchar b = p[2]; + guchar a = 0; + + if (n_channels == 4) + a = p[3]; + + for (j = x0; j < x1 ; j++) + { + if (n_channels != 4 || p[3] != 0) + { + hints &= ~THEME_MISSING; + if (!(hints & THEME_CONSTANT_ROWS)) + goto cols; + } + + if (r != *(p++) || + g != *(p++) || + b != *(p++) || + (n_channels != 4 && a != *(p++))) + { + hints &= ~THEME_CONSTANT_ROWS; + if (!(hints & THEME_MISSING)) + goto cols; + } + } + } + + cols: + for (i = y0 + 1; i < y1; i++) + { + guchar *base = data + y0 * rowstride + x0 * n_channels; + guchar *p = data + i * rowstride + x0 * n_channels; + + if (memcmp (p, base, n_channels * (x1 - x0)) != 0) + { + hints &= ~THEME_CONSTANT_COLS; + return hints; + } + } + + return hints; +} + +static void +constraint_scale_compute_hints (ConstraintScale *cs_pb) +{ + int i, j; + gint width = gdk_pixbuf_get_width (cs_pb->pixbuf); + gint height = gdk_pixbuf_get_height (cs_pb->pixbuf); + + if (cs_pb->border_left + cs_pb->border_right > width || + cs_pb->border_top + cs_pb->border_bottom > height) + { + g_warning ("Invalid borders specified"); + if (cs_pb->border_left + cs_pb->border_right > width) + { + cs_pb->border_left = width / 2; + cs_pb->border_right = (width + 1) / 2; + } + if (cs_pb->border_bottom + cs_pb->border_top > height) + { + cs_pb->border_top = height / 2; + cs_pb->border_bottom = (height + 1) / 2; + } + } + + for (i = 0; i < 3; i++) + { + gint y0, y1; + + switch (i) + { + case 0: + y0 = 0; + y1 = cs_pb->border_top; + break; + case 1: + y0 = cs_pb->border_top; + y1 = height - cs_pb->border_bottom; + break; + default: + y0 = height - cs_pb->border_bottom; + y1 = height; + break; + } + + for (j = 0; j < 3; j++) + { + gint x0, x1; + + switch (j) + { + case 0: + x0 = 0; + x1 = cs_pb->border_left; + break; + case 1: + x0 = cs_pb->border_left; + x1 = width - cs_pb->border_right; + break; + default: + x0 = width - cs_pb->border_right; + x1 = width; + break; + } + + cs_pb->hints[i][j] = compute_hint (cs_pb->pixbuf, x0, x1, y0, y1); + } + } + +} + +static GdkPixbuf * +constraint_scale (GdkPixbuf *pixbuf, + gint x, + gint y, + gint width, + gint height, + gint border_left, + gint border_right, + gint border_bottom, + gint border_top) +{ + gint src_x[4], src_y[4], dest_x[4], dest_y[4]; + gint pixbuf_width = gdk_pixbuf_get_width (pixbuf); + gint pixbuf_height = gdk_pixbuf_get_height (pixbuf); + GdkGC *scaled_tmp_gc = NULL; + ConstraintScale *cs_pb = g_new0 (ConstraintScale, 1); + guint component_mask = COMPONENT_ALL; + + cs_pb->pixbuf = pixbuf; + cs_pb->stretch = TRUE; + cs_pb->border_left = border_left; + cs_pb->border_right = border_right; + cs_pb->border_bottom = border_bottom; + cs_pb->border_top = border_top; + constraint_scale_compute_hints (cs_pb); + + if (cs_pb->stretch) + { + gboolean cached = TRUE; + GdkPixbuf *scaled = NULL; + + if (!scaled) + { + scaled = gdk_pixbuf_new (gdk_pixbuf_get_colorspace (cs_pb->pixbuf), + gdk_pixbuf_get_has_alpha (cs_pb->pixbuf), + gdk_pixbuf_get_bits_per_sample (cs_pb->pixbuf), + width, + height); + + gdk_pixbuf_fill (scaled, 0x00000000); + + + src_x[0] = 0; + src_x[1] = cs_pb->border_left; + src_x[2] = pixbuf_width - cs_pb->border_right; + src_x[3] = pixbuf_width; + + src_y[0] = 0; + src_y[1] = cs_pb->border_top; + src_y[2] = pixbuf_height - cs_pb->border_bottom; + src_y[3] = pixbuf_height; + + dest_x[0] = 0; + dest_x[1] = cs_pb->border_left; + dest_x[2] = width - cs_pb->border_right; + dest_x[3] = width; + + dest_y[0] = 0; + dest_y[1] = cs_pb->border_top; + dest_y[2] = height - cs_pb->border_bottom; + dest_y[3] = height; + + + if (component_mask & COMPONENT_ALL) + component_mask = (COMPONENT_ALL - 1) & ~component_mask; + +#define RENDER_COMPONENT(X1,X2,Y1,Y2) \ + cs_render (pixbuf, cs_pb->hints[Y1][X1], \ + scaled, \ + src_x[X1], src_y[Y1], \ + src_x[X2] - src_x[X1], src_y[Y2] - src_y[Y1], \ + dest_x[X1], dest_y[Y1], \ + dest_x[X2] - dest_x[X1], dest_y[Y2] - dest_y[Y1]); + + if (component_mask & COMPONENT_NORTH_WEST) + RENDER_COMPONENT (0, 1, 0, 1); + + if (component_mask & COMPONENT_NORTH) + RENDER_COMPONENT (1, 2, 0, 1); + + if (component_mask & COMPONENT_NORTH_EAST) + RENDER_COMPONENT (2, 3, 0, 1); + + if (component_mask & COMPONENT_WEST) + RENDER_COMPONENT (0, 1, 1, 2); + + if (component_mask & COMPONENT_CENTER) + RENDER_COMPONENT (1, 2, 1, 2); + + if (component_mask & COMPONENT_EAST) + RENDER_COMPONENT (2, 3, 1, 2); + + if (component_mask & COMPONENT_SOUTH_WEST) + RENDER_COMPONENT (0, 1, 2, 3); + + if (component_mask & COMPONENT_SOUTH) + RENDER_COMPONENT (1, 2, 2, 3); + + if (component_mask & COMPONENT_SOUTH_EAST) + RENDER_COMPONENT (2, 3, 2, 3); + } + + return scaled; + } +} + +void set_pseudo_transparent_bg (GtkWidget *window, + GdkPixbuf *overlay, + gint border_left, + gint border_right, + gint border_bottom, + gint border_top) +{ + static GdkPixbuf *bkg = NULL; + static int x = -1; + static int y = -1; + XID *pixmaps; + GdkAtom prop_type; + GdkPixmap *pixmap; + GdkPixbuf *app_bkg, *tmp_bkg; + GdkPixbuf *pixbuf_box; + GdkPixbuf *scaled; + GdkPixmap *bg_pixmap; + int prop_size; + GdkColormap *rcolormap; + int width = 0; + int height = 0; + int new_x = 0; + int new_y = 0; + int count = 0; + gboolean found_rootpmap = FALSE; + GtkWidget *panel = NULL; + GtkStyle *style; + GdkWindow *root; + GdkDisplay *dpy; + GdkAtom pmap_id; + + if (!overlay) + return; + + if (!bkg) + { + root = gdk_screen_get_root_window (gdk_drawable_get_screen (GDK_DRAWABLE(window->window))); + dpy = gdk_drawable_get_display(GDK_DRAWABLE(root)); + pmap_id = gdk_x11_xatom_to_atom_for_display (dpy, gdk_x11_get_xatom_by_name_for_display(dpy, + "_XROOTPMAP_ID")); + while (!found_rootpmap && count <= 10000) /* wait until the prop is set, quick fix, better solution is to monitor */ + { + + gdk_property_get(root, pmap_id, GDK_TARGET_PIXMAP, + 0, INT_MAX - 3, + FALSE, + &prop_type, NULL, &prop_size, + (guchar**)&pixmaps); + + + if ((prop_type == GDK_TARGET_PIXMAP) && + (prop_size >= (int)sizeof(XID) && + (pixmaps != NULL))) + { + pixmap = gdk_pixmap_foreign_new_for_display(dpy, pixmaps[0]); + g_free(pixmaps); + found_rootpmap = TRUE; + } + else + { + /*struct timespec ts; + ts.tv_nsec = 100; + nanosleep (&ts, NULL);*/ + count++; + } + } + + if (!found_rootpmap) + return; + + /* Tell GTK+ that this foreign pixmap shares the + * root window's colormap. */ + rcolormap = gdk_drawable_get_colormap(root); + if (gdk_drawable_get_colormap(pixmap) == NULL) + { + gdk_drawable_set_colormap(pixmap, + rcolormap); + } + + /* Retrieve the pixmap's size. */ + gdk_error_trap_push(); + width = height = -1; + gdk_drawable_get_size(pixmap, &width, &height); + gdk_display_sync(gdk_drawable_get_display(GDK_DRAWABLE(root))); + gdk_error_trap_pop(); + + /* If the pixmap gave us a valid size, retrieve its + * contents. */ + if ((width > 0) && (height > 0)) { + gdk_error_trap_push(); + bkg = gdk_pixbuf_get_from_drawable(NULL, + pixmap, + NULL, + 0, 0, + 0, 0, + width, height); + gdk_display_sync(gdk_drawable_get_display(GDK_DRAWABLE(root))); + gdk_error_trap_pop(); + } + + } + /* get window pos */ + gdk_window_get_origin (window->window, &new_x, &new_y); + + if (new_x == x && new_y == y) /* no change needed */ + return; + + x = new_x; + y = new_y; + + /* y -= 14; */ + + /* position pixbuf according to window pos */ + gdk_window_get_geometry (window->window, NULL, NULL, &width, &height, NULL); + + if (y > gdk_pixbuf_get_height (bkg) - height) + y = gdk_pixbuf_get_height (bkg) - height; + /*return; *//* panel popping up */ + + tmp_bkg = gdk_pixbuf_copy (bkg); + app_bkg = gdk_pixbuf_new_subpixbuf (tmp_bkg, x,y,width, height); + + scaled = constraint_scale (overlay, + x,y, + width, height, + border_left, border_right, border_top, border_bottom); + gdk_pixbuf_composite (scaled, + app_bkg, + 0, + 0, + width, + height, + 0.0, + 0.0, + 1.0, + 1.0, + GDK_INTERP_NEAREST, + 255); + + g_object_unref (scaled); + + if (GDK_IS_PIXBUF(app_bkg)) { + gdk_pixbuf_render_pixmap_and_mask_for_colormap(app_bkg, + gtk_widget_get_colormap (window), + &bg_pixmap, NULL, + 0); + g_object_unref(app_bkg); + g_object_unref(tmp_bkg); + } + + style = gtk_style_copy (window->style); + if (style->bg_pixmap[GTK_STATE_NORMAL]) + g_object_unref (style->bg_pixmap[GTK_STATE_NORMAL]); + style->bg_pixmap[GTK_STATE_NORMAL] = g_object_ref (bg_pixmap); + gtk_widget_set_style (window, style); + g_object_unref (style); +} + diff -Nrup -x '*.orig' -x '*.rej' -x '*.*~' ../SUNWgnome-display-mgr-2.30.4-clean/gdm-2.30.4/gui/simple-greeter/branding.h gdm-2.30.4/gui/simple-greeter/branding.h --- ../SUNWgnome-display-mgr-2.30.4-clean/gdm-2.30.4/gui/simple-greeter/branding.h 1970-01-01 01:00:00.000000000 +0100 +++ gdm-2.30.4/gui/simple-greeter/branding.h 2010-08-09 09:51:46.928416142 +0200 @@ -0,0 +1,14 @@ +#ifndef __BRANDING_H +#define __BRANDING_H + +#include + +void set_pseudo_transparent_bg (GtkWidget *window, + GdkPixbuf *overlay, + gint border_left, + gint border_right, + gint border_bottom, + gint border_top); + + +#endif /* __BRANDING_H */ diff -Nrup -x '*.orig' -x '*.rej' -x '*.*~' ../SUNWgnome-display-mgr-2.30.4-clean/gdm-2.30.4/gui/simple-greeter/gdm-greeter-login-window.c gdm-2.30.4/gui/simple-greeter/gdm-greeter-login-window.c --- ../SUNWgnome-display-mgr-2.30.4-clean/gdm-2.30.4/gui/simple-greeter/gdm-greeter-login-window.c 2010-08-09 09:51:02.556121350 +0200 +++ gdm-2.30.4/gui/simple-greeter/gdm-greeter-login-window.c 2010-08-09 09:55:59.881473541 +0200 @@ -64,6 +64,8 @@ #define PW_ENTRY_SIZE GDM_MAX_PASS #endif +#include "branding.h" + #define CK_NAME "org.freedesktop.ConsoleKit" #define CK_PATH "/org/freedesktop/ConsoleKit" #define CK_INTERFACE "org.freedesktop.ConsoleKit" @@ -1105,6 +1107,7 @@ static const char *known_etc_info_files "debian_version", "mandriva-release", "slackware-version", + "release", NULL }; @@ -1196,6 +1199,7 @@ load_theme (GdmGreeterLoginWindow *login GtkWidget *button; GtkWidget *box; GtkWidget *image; + GdkColor color; GError* error = NULL; gdm_profile_start (NULL); @@ -1222,10 +1226,9 @@ load_theme (GdmGreeterLoginWindow *login g_debug ("GdmGreeterLoginWindow: Got greeter logo '%s'", icon_name ? icon_name : "(null)"); - if (icon_name != NULL) { - gtk_image_set_from_icon_name (GTK_IMAGE (image), - icon_name, - GTK_ICON_SIZE_DIALOG); + if (icon_name != NULL) { + gtk_image_set_from_file (GTK_IMAGE (image), + UIDIR "/" "logo.png"); g_free (icon_name); } } @@ -1399,6 +1402,33 @@ update_banner_message (GdmGreeterLoginWi } } +static GdkPixbuf * +get_overlay_pb () +{ + static GdkPixbuf *pb = NULL; + if (!pb) + pb = gdk_pixbuf_new_from_file(UIDIR "/" "box.png",NULL); + return pb; +} + +static gboolean +configure_function (GtkWidget *widget, + gpointer user_data) +{ + set_pseudo_transparent_bg (widget, get_overlay_pb (), 5, 5,60 ,60); + return FALSE; +} + +static gboolean +map_function (GtkWidget *widget, + GdkEvent *event, + gpointer user_data) +{ + set_pseudo_transparent_bg (widget, get_overlay_pb (), 5, 5,60 ,60); + return FALSE; +} + + static GObject * gdm_greeter_login_window_constructor (GType type, guint n_construct_properties, @@ -1412,10 +1442,17 @@ gdm_greeter_login_window_constructor (GT n_construct_properties, construct_properties)); + g_signal_connect (login_window, "map", G_CALLBACK (map_function), login_window); + g_signal_connect (login_window, "configure_event", G_CALLBACK (configure_function), login_window); + load_theme (login_window); update_banner_message (login_window); + gtk_frame_set_shadow_type(GTK_FRAME (gtk_builder_get_object (login_window->priv->builder, "window-frame")), GTK_SHADOW_NONE); + gtk_widget_realize (GTK_WIDGET (login_window)); + gdk_window_set_back_pixmap (GTK_WIDGET (login_window)->window, NULL, FALSE); + gdm_profile_end (NULL); return G_OBJECT (login_window); diff -Nrup -x '*.orig' -x '*.rej' -x '*.*~' ../SUNWgnome-display-mgr-2.30.4-clean/gdm-2.30.4/gui/simple-greeter/gdm-greeter-panel.c gdm-2.30.4/gui/simple-greeter/gdm-greeter-panel.c --- ../SUNWgnome-display-mgr-2.30.4-clean/gdm-2.30.4/gui/simple-greeter/gdm-greeter-panel.c 2010-06-26 00:09:31.000000000 +0200 +++ gdm-2.30.4/gui/simple-greeter/gdm-greeter-panel.c 2010-08-09 09:51:46.930060693 +0200 @@ -67,6 +67,8 @@ #define KEY_DISABLE_RESTART_BUTTONS "/apps/gdm/simple-greeter/disable_restart_buttons" #define KEY_NOTIFICATION_AREA_PADDING "/apps/notification_area_applet/prefs/padding" +#include "branding.h" + #define GDM_GREETER_PANEL_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GDM_TYPE_GREETER_PANEL, GdmGreeterPanelPrivate)) struct GdmGreeterPanelPrivate @@ -719,6 +721,32 @@ on_shutdown_menu_deactivate (GdmGreeterP FALSE); } +static GdkPixbuf * +get_overlay_pb () +{ +static GdkPixbuf *pb = NULL; + if (!pb) + pb = gdk_pixbuf_new_from_file(UIDIR "/" "bottom-panel-image-gdm.png",NULL); + return pb; +} + +static gboolean +configure_function (GtkWidget *widget, + gpointer user_data) +{ + set_pseudo_transparent_bg (widget, get_overlay_pb (), 0, 0, 5, 0); + return FALSE; +} + +static gboolean +map_function (GtkWidget *widget, + GdkEvent *event, + gpointer user_data) +{ + set_pseudo_transparent_bg (widget, get_overlay_pb (), 0, 0, 5, 0); + return FALSE; +} + static void setup_panel (GdmGreeterPanel *panel) { @@ -863,6 +891,9 @@ setup_panel (GdmGreeterPanel *panel) panel); gdm_profile_end (NULL); + + g_signal_connect (panel, "map", G_CALLBACK (map_function), panel); + g_signal_connect (panel, "configure_event", G_CALLBACK (configure_function), panel); } static GObject *