From 1dd8a1453ff45d26e9c8c497e58070da5043eb7f Mon Sep 17 00:00:00 2001 From: Owen Taylor Date: Tue, 14 May 2002 19:45:08 +0000 Subject: [PATCH] Add a sanity g_return_if_fail() check for the depths for the window and Tue May 14 15:40:49 2002 Owen Taylor * gdk/x11/gdkwindow-{linux-fb,win32,x11.c} (gdk_window_set_back_pixmap): Add a sanity g_return_if_fail() check for the depths for the window and pixmap. (#79191, Shivaram Upadhyayula) --- ChangeLog | 6 ++++++ ChangeLog.pre-2-10 | 6 ++++++ ChangeLog.pre-2-2 | 6 ++++++ ChangeLog.pre-2-4 | 6 ++++++ ChangeLog.pre-2-6 | 6 ++++++ ChangeLog.pre-2-8 | 6 ++++++ gdk/linux-fb/gdkwindow-fb.c | 1 + gdk/win32/gdkwindow-win32.c | 1 + gdk/x11/gdkwindow-x11.c | 3 ++- 9 files changed, 40 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 14fdb81fef..01f15e5616 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Tue May 14 15:40:49 2002 Owen Taylor + + * gdk/x11/gdkwindow-{linux-fb,win32,x11.c} (gdk_window_set_back_pixmap): + Add a sanity g_return_if_fail() check for the depths + for the window and pixmap. (#79191, Shivaram Upadhyayula) + Tue May 14 15:09:33 2002 Owen Taylor * gdk/x11/gdkkeys-x11.c: Try adding a #ifndef/#define diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 14fdb81fef..01f15e5616 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,9 @@ +Tue May 14 15:40:49 2002 Owen Taylor + + * gdk/x11/gdkwindow-{linux-fb,win32,x11.c} (gdk_window_set_back_pixmap): + Add a sanity g_return_if_fail() check for the depths + for the window and pixmap. (#79191, Shivaram Upadhyayula) + Tue May 14 15:09:33 2002 Owen Taylor * gdk/x11/gdkkeys-x11.c: Try adding a #ifndef/#define diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 14fdb81fef..01f15e5616 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,9 @@ +Tue May 14 15:40:49 2002 Owen Taylor + + * gdk/x11/gdkwindow-{linux-fb,win32,x11.c} (gdk_window_set_back_pixmap): + Add a sanity g_return_if_fail() check for the depths + for the window and pixmap. (#79191, Shivaram Upadhyayula) + Tue May 14 15:09:33 2002 Owen Taylor * gdk/x11/gdkkeys-x11.c: Try adding a #ifndef/#define diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 14fdb81fef..01f15e5616 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,9 @@ +Tue May 14 15:40:49 2002 Owen Taylor + + * gdk/x11/gdkwindow-{linux-fb,win32,x11.c} (gdk_window_set_back_pixmap): + Add a sanity g_return_if_fail() check for the depths + for the window and pixmap. (#79191, Shivaram Upadhyayula) + Tue May 14 15:09:33 2002 Owen Taylor * gdk/x11/gdkkeys-x11.c: Try adding a #ifndef/#define diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 14fdb81fef..01f15e5616 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,9 @@ +Tue May 14 15:40:49 2002 Owen Taylor + + * gdk/x11/gdkwindow-{linux-fb,win32,x11.c} (gdk_window_set_back_pixmap): + Add a sanity g_return_if_fail() check for the depths + for the window and pixmap. (#79191, Shivaram Upadhyayula) + Tue May 14 15:09:33 2002 Owen Taylor * gdk/x11/gdkkeys-x11.c: Try adding a #ifndef/#define diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 14fdb81fef..01f15e5616 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,9 @@ +Tue May 14 15:40:49 2002 Owen Taylor + + * gdk/x11/gdkwindow-{linux-fb,win32,x11.c} (gdk_window_set_back_pixmap): + Add a sanity g_return_if_fail() check for the depths + for the window and pixmap. (#79191, Shivaram Upadhyayula) + Tue May 14 15:09:33 2002 Owen Taylor * gdk/x11/gdkkeys-x11.c: Try adding a #ifndef/#define diff --git a/gdk/linux-fb/gdkwindow-fb.c b/gdk/linux-fb/gdkwindow-fb.c index 44a674cf6e..30090fd53a 100644 --- a/gdk/linux-fb/gdkwindow-fb.c +++ b/gdk/linux-fb/gdkwindow-fb.c @@ -1469,6 +1469,7 @@ gdk_window_set_back_pixmap (GdkWindow *window, g_return_if_fail (window != NULL); g_return_if_fail (GDK_IS_WINDOW (window)); g_return_if_fail (pixmap == NULL || !parent_relative); + g_return_if_fail (pixmap == NULL || gdk_drawable_get_depth (window) == gdk_drawable_get_depth (pixmap)); old_pixmap = private->bg_pixmap; diff --git a/gdk/win32/gdkwindow-win32.c b/gdk/win32/gdkwindow-win32.c index da6b50d835..f46dd666f5 100644 --- a/gdk/win32/gdkwindow-win32.c +++ b/gdk/win32/gdkwindow-win32.c @@ -1563,6 +1563,7 @@ gdk_window_set_back_pixmap (GdkWindow *window, g_return_if_fail (window != NULL); g_return_if_fail (GDK_IS_WINDOW (window)); g_return_if_fail (pixmap == NULL || !parent_relative); + g_return_if_fail (pixmap == NULL || gdk_drawable_get_depth (window) == gdk_drawable_get_depth (pixmap)); if (private->bg_pixmap && private->bg_pixmap != GDK_PARENT_RELATIVE_BG && diff --git a/gdk/x11/gdkwindow-x11.c b/gdk/x11/gdkwindow-x11.c index 903afe68ab..91ec8fe084 100644 --- a/gdk/x11/gdkwindow-x11.c +++ b/gdk/x11/gdkwindow-x11.c @@ -2129,7 +2129,8 @@ gdk_window_set_back_pixmap (GdkWindow *window, g_return_if_fail (window != NULL); g_return_if_fail (GDK_IS_WINDOW (window)); g_return_if_fail (pixmap == NULL || !parent_relative); - + g_return_if_fail (pixmap == NULL || gdk_drawable_get_depth (window) == gdk_drawable_get_depth (pixmap)); + if (private->bg_pixmap && private->bg_pixmap != GDK_PARENT_RELATIVE_BG && private->bg_pixmap != GDK_NO_BG)