mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-11 03:10:09 +00:00
Fix up getting colormap for FOREIGN windows to go along with Raster's fix
Fri May 1 00:42:25 1998 Owen Taylor <otaylor@gtk.org> * gdk/gdkwindow.c (gdk_window_get_colormap): Fix up getting colormap for FOREIGN windows to go along with Raster's fix for visuals.
This commit is contained in:
parent
05bc6a5b36
commit
005626bd4d
@ -1185,8 +1185,11 @@ gdk_window_get_visual (GdkWindow *window)
|
||||
XWindowAttributes window_attributes;
|
||||
|
||||
g_return_val_if_fail (window != NULL, NULL);
|
||||
|
||||
|
||||
window_private = (GdkWindowPrivate*) window;
|
||||
/* Huh? ->parent is never set for a pixmap. We should just return
|
||||
* null immeditately
|
||||
*/
|
||||
while (window_private && (window_private->window_type == GDK_WINDOW_PIXMAP))
|
||||
window_private = (GdkWindowPrivate*) window_private->parent;
|
||||
|
||||
@ -1210,14 +1213,23 @@ GdkColormap*
|
||||
gdk_window_get_colormap (GdkWindow *window)
|
||||
{
|
||||
GdkWindowPrivate *window_private;
|
||||
XWindowAttributes window_attributes;
|
||||
|
||||
g_return_val_if_fail (window != NULL, NULL);
|
||||
|
||||
window_private = (GdkWindowPrivate*) window;
|
||||
|
||||
|
||||
g_return_val_if_fail (window_private->window_type != GDK_WINDOW_PIXMAP, NULL);
|
||||
if (!window_private->destroyed)
|
||||
{
|
||||
return window_private->colormap;
|
||||
if (window_private->window_type == GDK_WINDOW_FOREIGN)
|
||||
{
|
||||
XGetWindowAttributes (window_private->xdisplay,
|
||||
window_private->xwindow,
|
||||
&window_attributes);
|
||||
return gdk_colormap_lookup (window_attributes.colormap);
|
||||
}
|
||||
else
|
||||
return window_private->colormap;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
|
@ -1185,8 +1185,11 @@ gdk_window_get_visual (GdkWindow *window)
|
||||
XWindowAttributes window_attributes;
|
||||
|
||||
g_return_val_if_fail (window != NULL, NULL);
|
||||
|
||||
|
||||
window_private = (GdkWindowPrivate*) window;
|
||||
/* Huh? ->parent is never set for a pixmap. We should just return
|
||||
* null immeditately
|
||||
*/
|
||||
while (window_private && (window_private->window_type == GDK_WINDOW_PIXMAP))
|
||||
window_private = (GdkWindowPrivate*) window_private->parent;
|
||||
|
||||
@ -1210,14 +1213,23 @@ GdkColormap*
|
||||
gdk_window_get_colormap (GdkWindow *window)
|
||||
{
|
||||
GdkWindowPrivate *window_private;
|
||||
XWindowAttributes window_attributes;
|
||||
|
||||
g_return_val_if_fail (window != NULL, NULL);
|
||||
|
||||
window_private = (GdkWindowPrivate*) window;
|
||||
|
||||
|
||||
g_return_val_if_fail (window_private->window_type != GDK_WINDOW_PIXMAP, NULL);
|
||||
if (!window_private->destroyed)
|
||||
{
|
||||
return window_private->colormap;
|
||||
if (window_private->window_type == GDK_WINDOW_FOREIGN)
|
||||
{
|
||||
XGetWindowAttributes (window_private->xdisplay,
|
||||
window_private->xwindow,
|
||||
&window_attributes);
|
||||
return gdk_colormap_lookup (window_attributes.colormap);
|
||||
}
|
||||
else
|
||||
return window_private->colormap;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user