summaryrefslogtreecommitdiff
path: root/gtk/window-decorator/gdk.c
diff options
context:
space:
mode:
Diffstat (limited to 'gtk/window-decorator/gdk.c')
-rw-r--r--gtk/window-decorator/gdk.c39
1 files changed, 29 insertions, 10 deletions
diff --git a/gtk/window-decorator/gdk.c b/gtk/window-decorator/gdk.c
index fe7d63a..77ead1e 100644
--- a/gtk/window-decorator/gdk.c
+++ b/gtk/window-decorator/gdk.c
@@ -1,7 +1,28 @@
+/*
+ * Copyright © 2006 Novell, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ * Author: David Reveman <davidr@novell.com>
+ */
+
#include "gtk-window-decorator.h"
GdkPixmap *
-pixmap_new_from_pixbuf (GdkPixbuf *pixbuf, int depth)
+pixmap_new_from_pixbuf (GdkPixbuf *pixbuf, GtkWidget *parent)
{
GdkPixmap *pixmap;
guint width, height;
@@ -10,7 +31,7 @@ pixmap_new_from_pixbuf (GdkPixbuf *pixbuf, int depth)
width = gdk_pixbuf_get_width (pixbuf);
height = gdk_pixbuf_get_height (pixbuf);
- pixmap = create_pixmap (width, height, depth);
+ pixmap = create_pixmap (width, height, parent);
if (!pixmap)
return NULL;
@@ -71,17 +92,15 @@ get_format_for_drawable (decor_t *d, GdkDrawable *drawable)
}
GdkPixmap *
-create_pixmap (int w,
- int h,
- int depth)
+create_pixmap (int w,
+ int h,
+ GtkWidget *parent_style_window)
{
- GtkWidget *widget;
GdkWindow *window;
if (w == 0 || h == 0)
abort ();
- widget = (depth > 24) ? style_window_rgba : style_window_rgb;
- window = gtk_widget_get_window (widget);
- return gdk_pixmap_new (GDK_DRAWABLE (window), w, h, depth);
-} \ No newline at end of file
+ window = gtk_widget_get_window (parent_style_window);
+ return gdk_pixmap_new (GDK_DRAWABLE (window), w, h, -1 /* CopyFromParent */);
+}