From 206cff154788922a0e6017d6f7fcc902b444edfb Mon Sep 17 00:00:00 2001 From: Havoc Pennington Date: Sat, 13 Apr 2002 20:26:45 +0000 Subject: [PATCH] same fix as libwnck, avoid using cmap with the wrong depth 2002-04-13 Havoc Pennington * src/ui.c (get_cmap): same fix as libwnck, avoid using cmap with the wrong depth --- ChangeLog | 5 +++++ src/ui.c | 9 +++++++++ 2 files changed, 14 insertions(+) diff --git a/ChangeLog b/ChangeLog index 1115f84f1..e37661e75 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2002-04-13 Havoc Pennington + + * src/ui.c (get_cmap): same fix as libwnck, avoid using cmap + with the wrong depth + 2002-04-13 Havoc Pennington * src/delete.c: new file containing all the diff --git a/src/ui.c b/src/ui.c index 3df901974..5a512ec37 100644 --- a/src/ui.c +++ b/src/ui.c @@ -374,6 +374,15 @@ get_cmap (GdkPixmap *pixmap) } } + /* Be sure we aren't going to blow up due to visual mismatch */ + if (cmap && + (gdk_colormap_get_visual (cmap)->depth != + gdk_drawable_get_depth (pixmap))) + { + cmap = NULL; + meta_verbose ("Switching back to NULL cmap because of depth mismatch\n"); + } + return cmap; }