[gtk+] gdk: Don't set backgrounds on input-only windows



commit 2a4c361831f5b3fa986bd4d03b3beabaeffec1d8
Author: Benjamin Otte <otte redhat com>
Date:   Wed Jun 8 15:46:50 2011 +0200

    gdk: Don't set backgrounds on input-only windows
    
    It doesn't make sense to allow a background on input-only windows, so
    instead of setting it and then never using it, we just don't ever set
    it.

 gdk/gdkwindow.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c
index 0be4656..210e517 100644
--- a/gdk/gdkwindow.c
+++ b/gdk/gdkwindow.c
@@ -6534,14 +6534,16 @@ gdk_window_set_background_pattern (GdkWindow *window,
 {
   g_return_if_fail (GDK_IS_WINDOW (window));
 
+  if (window->input_only)
+    return;
+
   if (pattern)
     cairo_pattern_reference (pattern);
   if (window->background)
     cairo_pattern_destroy (window->background);
   window->background = pattern;
 
-  if (gdk_window_has_impl (window) &&
-      !window->input_only)
+  if (gdk_window_has_impl (window))
     {
       GdkWindowImplClass *impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl);
       impl_class->set_background (window, pattern);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]