Commit ab30a02e authored by Owen Taylor's avatar Owen Taylor Committed by Owen Taylor

- Show selection correctly when starting selection with arrows

Sun Mar  8 15:53:33 1998  Owen Taylor  <owt1@cornell.edu>

	* gtk/gtktext.c:

	- Show selection correctly when starting selection with arrows

	- Display pixmap background only when not editable

	- Redraw focus area more carefully to prevent flashing (and
	  make style of drawing consistent with Entry)

	* gtk/gtktreeitem.c: ref colormaps for pixmap by colormap
	  storage.

	* gtk/gtkrc.c: Store a separate style for each RcStyle for
	  each colormap, so we can handle background pixmaps
	  correctly, which need to be per-colormap. (Leaks
	  colormaps...)

	  Parse text color style entries correctly.

	* gtk/testgtk.c: insert text without fg color
	  gtk/testgtkrc: move "*" after rest, so the other class styles
	                 take effect

        * gdk/gdkwindow.c gdk/gdk.c gdk/gdkprivate.h: Send DND events
	  safely, in case drop window disappears. (Performance hit
	  because XSync()'s are necessary)

	* gdk/gdk.h gdk/gdkpixmap.c: Added
	  gdk_pixmap_colormap_create_from_xpm[_d] to allow creating
	  pixmaps from xpm's before you have a GdkWindow.
parent 85f13649
Sun Mar 8 15:53:33 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtktext.c:
- Show selection correctly when starting selection with arrows
- Display pixmap background only when not editable
- Redraw focus area more carefully to prevent flashing (and
make style of drawing consistent with Entry)
* gtk/gtktreeitem.c: ref colormaps for pixmap by colormap
storage.
* gtk/gtkrc.c: Store a separate style for each RcStyle for
each colormap, so we can handle background pixmaps
correctly, which need to be per-colormap. (Leaks
colormaps...)
Parse text color style entries correctly.
* gtk/testgtk.c: insert text without fg color
gtk/testgtkrc: move "*" after rest, so the other class styles
take effect
* gdk/gdkwindow.c gdk/gdk.c gdk/gdkprivate.h: Send DND events
safely, in case drop window disappears. (Performance hit
because XSync()'s are necessary)
* gdk/gdk.h gdk/gdkpixmap.c: Added
gdk_pixmap_colormap_create_from_xpm[_d] to allow creating
pixmaps from xpm's before you have a GdkWindow.
Sun Mar 8 12:33:38 PST 1998 Jay Painter <jpaint@serv.net>
* gtk/gtkclist.c: the GList clist->selection now contains row indexes
......
Sun Mar 8 15:53:33 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtktext.c:
- Show selection correctly when starting selection with arrows
- Display pixmap background only when not editable
- Redraw focus area more carefully to prevent flashing (and
make style of drawing consistent with Entry)
* gtk/gtktreeitem.c: ref colormaps for pixmap by colormap
storage.
* gtk/gtkrc.c: Store a separate style for each RcStyle for
each colormap, so we can handle background pixmaps
correctly, which need to be per-colormap. (Leaks
colormaps...)
Parse text color style entries correctly.
* gtk/testgtk.c: insert text without fg color
gtk/testgtkrc: move "*" after rest, so the other class styles
take effect
* gdk/gdkwindow.c gdk/gdk.c gdk/gdkprivate.h: Send DND events
safely, in case drop window disappears. (Performance hit
because XSync()'s are necessary)
* gdk/gdk.h gdk/gdkpixmap.c: Added
gdk_pixmap_colormap_create_from_xpm[_d] to allow creating
pixmaps from xpm's before you have a GdkWindow.
Sun Mar 8 12:33:38 PST 1998 Jay Painter <jpaint@serv.net>
* gtk/gtkclist.c: the GList clist->selection now contains row indexes
......
Sun Mar 8 15:53:33 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtktext.c:
- Show selection correctly when starting selection with arrows
- Display pixmap background only when not editable
- Redraw focus area more carefully to prevent flashing (and
make style of drawing consistent with Entry)
* gtk/gtktreeitem.c: ref colormaps for pixmap by colormap
storage.
* gtk/gtkrc.c: Store a separate style for each RcStyle for
each colormap, so we can handle background pixmaps
correctly, which need to be per-colormap. (Leaks
colormaps...)
Parse text color style entries correctly.
* gtk/testgtk.c: insert text without fg color
gtk/testgtkrc: move "*" after rest, so the other class styles
take effect
* gdk/gdkwindow.c gdk/gdk.c gdk/gdkprivate.h: Send DND events
safely, in case drop window disappears. (Performance hit
because XSync()'s are necessary)
* gdk/gdk.h gdk/gdkpixmap.c: Added
gdk_pixmap_colormap_create_from_xpm[_d] to allow creating
pixmaps from xpm's before you have a GdkWindow.
Sun Mar 8 12:33:38 PST 1998 Jay Painter <jpaint@serv.net>
* gtk/gtkclist.c: the GList clist->selection now contains row indexes
......
Sun Mar 8 15:53:33 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtktext.c:
- Show selection correctly when starting selection with arrows
- Display pixmap background only when not editable
- Redraw focus area more carefully to prevent flashing (and
make style of drawing consistent with Entry)
* gtk/gtktreeitem.c: ref colormaps for pixmap by colormap
storage.
* gtk/gtkrc.c: Store a separate style for each RcStyle for
each colormap, so we can handle background pixmaps
correctly, which need to be per-colormap. (Leaks
colormaps...)
Parse text color style entries correctly.
* gtk/testgtk.c: insert text without fg color
gtk/testgtkrc: move "*" after rest, so the other class styles
take effect
* gdk/gdkwindow.c gdk/gdk.c gdk/gdkprivate.h: Send DND events
safely, in case drop window disappears. (Performance hit
because XSync()'s are necessary)
* gdk/gdk.h gdk/gdkpixmap.c: Added
gdk_pixmap_colormap_create_from_xpm[_d] to allow creating
pixmaps from xpm's before you have a GdkWindow.
Sun Mar 8 12:33:38 PST 1998 Jay Painter <jpaint@serv.net>
* gtk/gtkclist.c: the GList clist->selection now contains row indexes
......
Sun Mar 8 15:53:33 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtktext.c:
- Show selection correctly when starting selection with arrows
- Display pixmap background only when not editable
- Redraw focus area more carefully to prevent flashing (and
make style of drawing consistent with Entry)
* gtk/gtktreeitem.c: ref colormaps for pixmap by colormap
storage.
* gtk/gtkrc.c: Store a separate style for each RcStyle for
each colormap, so we can handle background pixmaps
correctly, which need to be per-colormap. (Leaks
colormaps...)
Parse text color style entries correctly.
* gtk/testgtk.c: insert text without fg color
gtk/testgtkrc: move "*" after rest, so the other class styles
take effect
* gdk/gdkwindow.c gdk/gdk.c gdk/gdkprivate.h: Send DND events
safely, in case drop window disappears. (Performance hit
because XSync()'s are necessary)
* gdk/gdk.h gdk/gdkpixmap.c: Added
gdk_pixmap_colormap_create_from_xpm[_d] to allow creating
pixmaps from xpm's before you have a GdkWindow.
Sun Mar 8 12:33:38 PST 1998 Jay Painter <jpaint@serv.net>
* gtk/gtkclist.c: the GList clist->selection now contains row indexes
......
Sun Mar 8 15:53:33 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtktext.c:
- Show selection correctly when starting selection with arrows
- Display pixmap background only when not editable
- Redraw focus area more carefully to prevent flashing (and
make style of drawing consistent with Entry)
* gtk/gtktreeitem.c: ref colormaps for pixmap by colormap
storage.
* gtk/gtkrc.c: Store a separate style for each RcStyle for
each colormap, so we can handle background pixmaps
correctly, which need to be per-colormap. (Leaks
colormaps...)
Parse text color style entries correctly.
* gtk/testgtk.c: insert text without fg color
gtk/testgtkrc: move "*" after rest, so the other class styles
take effect
* gdk/gdkwindow.c gdk/gdk.c gdk/gdkprivate.h: Send DND events
safely, in case drop window disappears. (Performance hit
because XSync()'s are necessary)
* gdk/gdk.h gdk/gdkpixmap.c: Added
gdk_pixmap_colormap_create_from_xpm[_d] to allow creating
pixmaps from xpm's before you have a GdkWindow.
Sun Mar 8 12:33:38 PST 1998 Jay Painter <jpaint@serv.net>
* gtk/gtkclist.c: the GList clist->selection now contains row indexes
......
Sun Mar 8 15:53:33 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtktext.c:
- Show selection correctly when starting selection with arrows
- Display pixmap background only when not editable
- Redraw focus area more carefully to prevent flashing (and
make style of drawing consistent with Entry)
* gtk/gtktreeitem.c: ref colormaps for pixmap by colormap
storage.
* gtk/gtkrc.c: Store a separate style for each RcStyle for
each colormap, so we can handle background pixmaps
correctly, which need to be per-colormap. (Leaks
colormaps...)
Parse text color style entries correctly.
* gtk/testgtk.c: insert text without fg color
gtk/testgtkrc: move "*" after rest, so the other class styles
take effect
* gdk/gdkwindow.c gdk/gdk.c gdk/gdkprivate.h: Send DND events
safely, in case drop window disappears. (Performance hit
because XSync()'s are necessary)
* gdk/gdk.h gdk/gdkpixmap.c: Added
gdk_pixmap_colormap_create_from_xpm[_d] to allow creating
pixmaps from xpm's before you have a GdkWindow.
Sun Mar 8 12:33:38 PST 1998 Jay Painter <jpaint@serv.net>
* gtk/gtkclist.c: the GList clist->selection now contains row indexes
......
......@@ -88,6 +88,9 @@ Additions:
* Change gtk_widget_propagate_default_style() mechanism to
void gtk_rc_string_export (const gchar *rc_additions,
gboolean override_rc_styles);
* Configure events for windows that no longer exist fail in
XTranslateCoordinates
TODO AFTER GTK 1.0
------------------
......@@ -220,6 +223,11 @@ TODO AFTER GTK 1.0
- Disable pasting compound text
- When showing background pixmap (not editable) actually set
the background pixmap as the windows bg pixmap, to improve
appearance on exposes. But this would require using another
window to get the origins.
? Allow moving the separator for paned widgets by dragging
it directly instead of using the handle.
......@@ -243,3 +251,7 @@ TODO AFTER GTK 1.0
gtk_widget_dnd_data_set (should be guchar * with a copy?
shouldn't be there at all...)
??? GtkDrawingarea.draw_data
* gtk_rc_add_[name/class]_style are broken for bg pixmaps, because
styles are broken for bg pixmaps, and RC styles only hack around
that.
\ No newline at end of file
......@@ -2714,8 +2714,10 @@ gdk_event_translate (GdkEvent *event,
replyev.xclient.data.l[2] = replyev.xclient.data.l[3] = 0;
replyev.xclient.data.l[4] = reptype;
XSendEvent (gdk_display, replyev.xclient.window,
False, NoEventMask, &replyev);
if (!gdk_send_xevent (replyev.xclient.window, False,
NoEventMask, &replyev))
GDK_NOTE (DND, g_print("Sending XdeRequest to %#lx failed\n",
replyev.xclient.window));
event->any.type = GDK_DROP_ENTER;
event->any.window = window;
......@@ -3176,7 +3178,9 @@ gdk_dnd_drag_enter (Window dest)
}
else
sev.xclient.data.l[3] = sev.xclient.data.l[4] = None;
XSendEvent (gdk_display, dest, False, NoEventMask, &sev);
if (!gdk_send_xevent (dest, False, NoEventMask, &sev))
GDK_NOTE (DND, g_print("Sending XdeEnter to %#lx failed\n",
dest));
}
}
......@@ -3731,7 +3735,9 @@ gdk_dnd_drag_leave (Window dest)
{
wp = (GdkWindowPrivate *) gdk_dnd.drag_startwindows[i];
sev.xclient.data.l[0] = wp->xwindow;
XSendEvent(gdk_display, dest, False, NoEventMask, &sev);
if (!gdk_send_xevent (dest, False, NoEventMask, &sev))
GDK_NOTE (DND, g_print("Sending XdeLeave to %#lx failed\n",
dest));
wp->dnd_drag_accepted = 0;
}
}
......@@ -3990,7 +3996,9 @@ gdk_event_send_clientmessage_toall(GdkEvent *event)
for(i = 0; i < ret_nchildren; i++) {
curwin = gdk_get_client_window(gdk_display, ret_children[i]);
sev.xclient.window = curwin;
XSendEvent(gdk_display, curwin, False, NoEventMask, &sev);
if (!gdk_send_xevent (curwin, False, NoEventMask, &sev))
GDK_NOTE (MISC, g_print("Sending client message %ld to %#lx failed\n",
event->client.message_type, curwin));
}
XFree(ret_children);
......@@ -4001,3 +4009,19 @@ gdk_get_display(void)
{
return (gchar *)XDisplayName (gdk_display_name);
}
gint
gdk_send_xevent (Window window, gboolean propagate, glong event_mask,
XEvent *event_send)
{
Status result;
gdk_error_code = 0;
gdk_error_warnings = 0;
result = XSendEvent (gdk_display, window, propagate, event_mask, event_send);
XSync (gdk_display, False);
gdk_error_warnings = 1;
return result && (gdk_error_code != -1);
}
......@@ -382,10 +382,22 @@ GdkPixmap* gdk_pixmap_create_from_xpm (GdkWindow *window,
GdkBitmap **mask,
GdkColor *transparent_color,
const gchar *filename);
GdkPixmap* gdk_pixmap_colormap_create_from_xpm
(GdkWindow *window,
GdkColormap *colormap,
GdkBitmap **mask,
GdkColor *transparent_color,
const gchar *filename);
GdkPixmap* gdk_pixmap_create_from_xpm_d (GdkWindow *window,
GdkBitmap **mask,
GdkColor *transparent_color,
gchar **data);
GdkPixmap* gdk_pixmap_colormap_create_from_xpm_d
(GdkWindow *window,
GdkColormap *colormap,
GdkBitmap **mask,
GdkColor *transparent_color,
gchar **data);
GdkPixmap *gdk_pixmap_ref (GdkPixmap *pixmap);
void gdk_pixmap_unref (GdkPixmap *pixmap);
......
......@@ -351,15 +351,15 @@ gdk_pixmap_extract_color (gchar *buffer)
GdkPixmap*
gdk_pixmap_create_from_xpm (GdkWindow *window,
GdkBitmap **mask,
GdkColor *transparent_color,
const gchar *filename)
gdk_pixmap_colormap_create_from_xpm (GdkWindow *window,
GdkColormap *colormap,
GdkBitmap **mask,
GdkColor *transparent_color,
const gchar *filename)
{
FILE *infile = NULL;
GdkPixmap *pixmap = NULL;
GdkImage *image = NULL;
GdkColormap *colormap;
GdkVisual *visual;
GdkGC *gc;
GdkColor tmp_color;
......@@ -369,7 +369,19 @@ gdk_pixmap_create_from_xpm (GdkWindow *window,
_GdkPixmapColor *colors = NULL, *color = NULL;
gulong index;
g_return_val_if_fail (window != NULL, NULL);
if ((window == NULL) && (colormap == NULL))
g_warning ("Creating pixmap from xpm with NULL window and colormap");
if (window == NULL)
window = (GdkWindow *)&gdk_root_parent;
if (colormap == NULL)
{
colormap = gdk_window_get_colormap (window);
visual = gdk_window_get_visual (window);
}
else
visual = ((GdkColormapPrivate *)colormap)->visual;
infile = fopen (filename, "rb");
if (infile != NULL)
......@@ -386,9 +398,6 @@ gdk_pixmap_create_from_xpm (GdkWindow *window,
colors = g_new(_GdkPixmapColor, num_cols);
colormap = gdk_window_get_colormap (window);
visual = gdk_window_get_visual (window);
if (transparent_color == NULL)
{
gdk_color_white (colormap, &tmp_color);
......@@ -514,14 +523,25 @@ gdk_pixmap_create_from_xpm (GdkWindow *window,
}
GdkPixmap*
gdk_pixmap_create_from_xpm_d (GdkWindow *window,
GdkBitmap **mask,
GdkColor *transparent_color,
gchar **data)
gdk_pixmap_create_from_xpm (GdkWindow *window,
GdkBitmap **mask,
GdkColor *transparent_color,
const gchar *filename)
{
return gdk_pixmap_colormap_create_from_xpm (window, NULL, mask,
transparent_color, filename);
}
GdkPixmap*
gdk_pixmap_colormap_create_from_xpm_d (GdkWindow *window,
GdkColormap *colormap,
GdkBitmap **mask,
GdkColor *transparent_color,
gchar **data)
{
GdkPixmap *pixmap = NULL;
GdkImage *image = NULL;
GdkColormap *colormap;
GdkVisual *visual;
GdkGC *gc;
GdkColor tmp_color;
......@@ -530,7 +550,19 @@ gdk_pixmap_create_from_xpm_d (GdkWindow *window,
_GdkPixmapColor *colors = NULL, *color = NULL;
gulong index;
g_return_val_if_fail (window != NULL, NULL);
if ((window == NULL) && (colormap == NULL))
g_warning ("Creating pixmap from xpm with NULL window and colormap");
if (window == NULL)
window = (GdkWindow *)&gdk_root_parent;
if (colormap == NULL)
{
colormap = gdk_window_get_colormap (window);
visual = gdk_window_get_visual (window);
}
else
visual = ((GdkColormapPrivate *)colormap)->visual;
i = 0;
buffer = data[i++];
......@@ -538,9 +570,6 @@ gdk_pixmap_create_from_xpm_d (GdkWindow *window,
colors = g_new(_GdkPixmapColor, num_cols);
colormap = gdk_window_get_colormap (window);
visual = gdk_window_get_visual (window);
if (transparent_color == NULL)
{
gdk_color_white (colormap, &tmp_color);
......@@ -657,6 +686,16 @@ gdk_pixmap_create_from_xpm_d (GdkWindow *window,
return pixmap;
}
GdkPixmap*
gdk_pixmap_create_from_xpm_d (GdkWindow *window,
GdkBitmap **mask,
GdkColor *transparent_color,
gchar **data)
{
return gdk_pixmap_colormap_create_from_xpm_d (window, NULL, mask,
transparent_color, data);
}
GdkPixmap*
gdk_pixmap_ref (GdkPixmap *pixmap)
{
......
......@@ -223,6 +223,9 @@ void gdk_xid_table_insert (XID *xid,
void gdk_xid_table_remove (XID xid);
gpointer gdk_xid_table_lookup (XID xid);
gint gdk_send_xevent (Window window, gboolean propagate, glong event_mask,
XEvent *event_send);
/* If you pass x = y = -1, it queries the pointer
to find out where it currently is.
If you pass x = y = -2, it does anything necessary
......
......@@ -1551,9 +1551,12 @@ gdk_window_dnd_data_set (GdkWindow *window,
sev.xclient.data.l[3] = 0;
sev.xclient.data.l[4] = 0;
XSendEvent (gdk_display, event->dragrequest.requestor, False,
NoEventMask, &sev);
if (!gdk_send_xevent (event->dragrequest.requestor, False,
NoEventMask, &sev))
GDK_NOTE (DND, g_print("Sending XdeDataAvailable to %#x failed\n",
event->dragrequest.requestor));
}
void
......
......@@ -2714,8 +2714,10 @@ gdk_event_translate (GdkEvent *event,
replyev.xclient.data.l[2] = replyev.xclient.data.l[3] = 0;
replyev.xclient.data.l[4] = reptype;
XSendEvent (gdk_display, replyev.xclient.window,
False, NoEventMask, &replyev);
if (!gdk_send_xevent (replyev.xclient.window, False,
NoEventMask, &replyev))
GDK_NOTE (DND, g_print("Sending XdeRequest to %#lx failed\n",
replyev.xclient.window));
event->any.type = GDK_DROP_ENTER;
event->any.window = window;
......@@ -3176,7 +3178,9 @@ gdk_dnd_drag_enter (Window dest)
}
else
sev.xclient.data.l[3] = sev.xclient.data.l[4] = None;
XSendEvent (gdk_display, dest, False, NoEventMask, &sev);
if (!gdk_send_xevent (dest, False, NoEventMask, &sev))
GDK_NOTE (DND, g_print("Sending XdeEnter to %#lx failed\n",
dest));
}
}
......@@ -3731,7 +3735,9 @@ gdk_dnd_drag_leave (Window dest)
{
wp = (GdkWindowPrivate *) gdk_dnd.drag_startwindows[i];
sev.xclient.data.l[0] = wp->xwindow;
XSendEvent(gdk_display, dest, False, NoEventMask, &sev);
if (!gdk_send_xevent (dest, False, NoEventMask, &sev))
GDK_NOTE (DND, g_print("Sending XdeLeave to %#lx failed\n",
dest));
wp->dnd_drag_accepted = 0;
}
}
......@@ -3990,7 +3996,9 @@ gdk_event_send_clientmessage_toall(GdkEvent *event)
for(i = 0; i < ret_nchildren; i++) {
curwin = gdk_get_client_window(gdk_display, ret_children[i]);
sev.xclient.window = curwin;
XSendEvent(gdk_display, curwin, False, NoEventMask, &sev);
if (!gdk_send_xevent (curwin, False, NoEventMask, &sev))
GDK_NOTE (MISC, g_print("Sending client message %ld to %#lx failed\n",
event->client.message_type, curwin));
}
XFree(ret_children);
......@@ -4001,3 +4009,19 @@ gdk_get_display(void)
{
return (gchar *)XDisplayName (gdk_display_name);
}
gint
gdk_send_xevent (Window window, gboolean propagate, glong event_mask,
XEvent *event_send)
{
Status result;
gdk_error_code = 0;
gdk_error_warnings = 0;
result = XSendEvent (gdk_display, window, propagate, event_mask, event_send);
XSync (gdk_display, False);
gdk_error_warnings = 1;
return result && (gdk_error_code != -1);
}
......@@ -351,15 +351,15 @@ gdk_pixmap_extract_color (gchar *buffer)
GdkPixmap*
gdk_pixmap_create_from_xpm (GdkWindow *window,
GdkBitmap **mask,
GdkColor *transparent_color,
const gchar *filename)
gdk_pixmap_colormap_create_from_xpm (GdkWindow *window,
GdkColormap *colormap,
GdkBitmap **mask,
GdkColor *transparent_color,
const gchar *filename)
{
FILE *infile = NULL;
GdkPixmap *pixmap = NULL;
GdkImage *image = NULL;
GdkColormap *colormap;
GdkVisual *visual;
GdkGC *gc;
GdkColor tmp_color;
......@@ -369,7 +369,19 @@ gdk_pixmap_create_from_xpm (GdkWindow *window,
_GdkPixmapColor *colors = NULL, *color = NULL;
gulong index;
g_return_val_if_fail (window != NULL, NULL);
if ((window == NULL) && (colormap == NULL))
g_warning ("Creating pixmap from xpm with NULL window and colormap");
if (window == NULL)
window = (GdkWindow *)&gdk_root_parent;
if (colormap == NULL)
{
colormap = gdk_window_get_colormap (window);
visual = gdk_window_get_visual (window);
}
else
visual = ((GdkColormapPrivate *)colormap)->visual;
infile = fopen (filename, "rb");
if (infile != NULL)
......@@ -386,9 +398,6 @@ gdk_pixmap_create_from_xpm (GdkWindow *window,
colors = g_new(_GdkPixmapColor, num_cols);
colormap = gdk_window_get_colormap (window);
visual = gdk_window_get_visual (window);
if (transparent_color == NULL)
{
gdk_color_white (colormap, &tmp_color);
......@@ -514,14 +523,25 @@ gdk_pixmap_create_from_xpm (GdkWindow *window,
}
GdkPixmap*
gdk_pixmap_create_from_xpm_d (GdkWindow *window,
GdkBitmap **mask,
GdkColor *transparent_color,
gchar **data)
gdk_pixmap_create_from_xpm (GdkWindow *window,
GdkBitmap **mask,
GdkColor *transparent_color,
const gchar *filename)
{
return gdk_pixmap_colormap_create_from_xpm (window, NULL, mask,
transparent_color, filename);
}
GdkPixmap*
gdk_pixmap_colormap_create_from_xpm_d (GdkWindow *window,
GdkColormap *colormap,
GdkBitmap **mask,
GdkColor *transparent_color,
gchar **data)
{
GdkPixmap *pixmap = NULL;
GdkImage *image = NULL;
GdkColormap *colormap;
GdkVisual *visual;
GdkGC *gc;
GdkColor tmp_color;
......@@ -530,7 +550,19 @@ gdk_pixmap_create_from_xpm_d (GdkWindow *window,
_GdkPixmapColor *colors = NULL, *color = NULL;
gulong index;
g_return_val_if_fail (window != NULL, NULL);
if ((window == NULL) && (colormap == NULL))
g_warning ("Creating pixmap from xpm with NULL window and colormap");
if (window == NULL)
window = (GdkWindow *)&gdk_root_parent;
if (colormap == NULL)
{
colormap = gdk_window_get_colormap (window);
visual = gdk_window_get_visual (window);
}
else
visual = ((GdkColormapPrivate *)colormap)->visual;
i = 0;
buffer = data[i++];
......@@ -538,9 +570,6 @@ gdk_pixmap_create_from_xpm_d (GdkWindow *window,
colors = g_new(_GdkPixmapColor, num_cols);
colormap = gdk_window_get_colormap (window);