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

Bug#566169: marked as done (google-gadgets: Fix gtk expose events (gtk >= 2.18))



Your message dated Thu, 04 Mar 2010 23:02:42 +0000
with message-id <E1NnK42-0004eN-5O@ries.debian.org>
and subject line Bug#566169: fixed in google-gadgets 0.11.2-1
has caused the Debian Bug report #566169,
regarding google-gadgets: Fix gtk expose events (gtk >= 2.18)
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
566169: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=566169
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: google-gadgets
Version: 0.11.1-1.1
Severity: normal
Tags: patch
User: ubuntu-devel@lists.ubuntu.com
Usertags: origin-ubuntu lucid ubuntu-patch

In Ubuntu, we've applied the attached patch to achieve the following:

  * debian/patches/14_svn_1264_gtk_events.patch: Patch from upstream SVN to
    fix events using gtk 2.18 or higher. (Upstream bug #335)

We thought you might be interested in doing the same. 


-- System Information:
Debian Release: squeeze/sid
  APT prefers karmic-updates
  APT policy: (500, 'karmic-updates'), (500, 'karmic-security'), (500, 'karmic')
Architecture: i386 (i686)

Kernel: Linux 2.6.31-17-generic (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
--- google-gadgets-0.11.1/debian/patches/series
+++ google-gadgets-0.11.1/debian/patches/series
@@ -3,0 +4,2 @@
+14_svn_1264_gtk_events.patch
only in patch2:
unchanged:
--- google-gadgets-0.11.1.orig/debian/patches/14_svn_1264_gtk_events.patch
+++ google-gadgets-0.11.1/debian/patches/14_svn_1264_gtk_events.patch
@@ -0,0 +1,755 @@
+Description: Fix expose events with GTK+ >= 2.18
+Bug: http://code.google.com/p/google-gadgets-for-linux/issues/detail?id=335
+Origin: http://code.google.com/p/google-gadgets-for-linux/source/detail?r=1264
+
+Index: google-gadgets-0.11.1/ggadget/gtk/view_widget_binder.cc
+===================================================================
+--- google-gadgets-0.11.1.orig/ggadget/gtk/view_widget_binder.cc	2009-06-07 22:45:35.000000000 -0400
++++ google-gadgets-0.11.1/ggadget/gtk/view_widget_binder.cc	2010-01-21 09:57:46.000000000 -0500
+@@ -58,6 +58,9 @@
+ // Update input shape mask once per second.
+ static const uint64_t kUpdateMaskInterval = 1000;
+ 
++// Minimal interval between self draws.
++static const unsigned int kSelfDrawInterval = 40;
++
+ class ViewWidgetBinder::Impl : public SmallObject<> {
+  public:
+   Impl(ViewInterface *view,
+@@ -69,6 +72,8 @@
+ #if GTK_CHECK_VERSION(2,10,0)
+       input_shape_mask_(NULL),
+       last_mask_time_(0),
++      should_update_input_shape_mask_(false),
++      enable_input_shape_mask_(false),
+ #endif
+       handlers_(new gulong[kEventHandlersNum]),
+       current_drag_event_(NULL),
+@@ -76,7 +81,6 @@
+       dbl_click_(false),
+       composited_(false),
+       no_background_(no_background),
+-      enable_input_shape_mask_(false),
+       focused_(false),
+       button_pressed_(false),
+ #ifdef GRAB_POINTER_EXPLICITLY
+@@ -91,7 +95,11 @@
+       mouse_down_y_(-1),
+       mouse_down_hittest_(ViewInterface::HT_CLIENT),
+       last_width_(0),
+-      last_height_(0) {
++      last_height_(0),
++      self_draw_(false),
++      self_draw_timer_(0),
++      last_self_draw_time_(0),
++      sys_clip_region_(NULL) {
+     ASSERT(view);
+     ASSERT(host);
+     ASSERT(GTK_IS_WIDGET(widget));
+@@ -145,6 +153,16 @@
+   ~Impl() {
+     view_ = NULL;
+ 
++    if (self_draw_timer_) {
++      g_source_remove(self_draw_timer_);
++      self_draw_timer_ = 0;
++    }
++
++    if (sys_clip_region_) {
++      gdk_region_destroy(sys_clip_region_);
++      sys_clip_region_ = NULL;
++    }
++
+     for (size_t i = 0; i < kEventHandlersNum; ++i) {
+       if (handlers_[i] > 0)
+         g_signal_handler_disconnect(G_OBJECT(widget_), handlers_[i]);
+@@ -185,6 +203,148 @@
+     }
+   }
+ 
++  GdkRegion *CreateExposeRegionFromViewClipRegion() {
++    GdkRegion *region = gdk_region_new();
++    const ClipRegion *view_region = view_->GetClipRegion();
++    size_t count = view_region->GetRectangleCount();
++    if (count) {
++      Rectangle rect;
++      GdkRectangle gdk_rect;
++      for (size_t i = 0; i < count; ++i) {
++        rect = view_region->GetRectangle(i);
++        if (zoom_ != 1.0) {
++          rect.Zoom(zoom_);
++          rect.Integerize(true);
++        }
++        gdk_rect.x = static_cast<int>(rect.x);
++        gdk_rect.y = static_cast<int>(rect.y);
++        gdk_rect.width = static_cast<int>(rect.w);
++        gdk_rect.height = static_cast<int>(rect.h);
++        gdk_region_union_with_rect(region, &gdk_rect);
++      }
++    }
++    return region;
++  }
++
++  void AddGdkRectToSystemClipRegion(GdkRectangle *rect) {
++    if (!sys_clip_region_)
++      sys_clip_region_ = gdk_region_new();
++    gdk_region_union_with_rect(sys_clip_region_, rect);
++  }
++
++  void AddGdkRegionToSystemClipRegion(GdkRegion *region) {
++    if (!sys_clip_region_)
++      sys_clip_region_ = gdk_region_new();
++    gdk_region_union(sys_clip_region_, region);
++  }
++
++  void AddExtendedWindowAreaToSystemClipRegion(int width, int height) {
++    GdkRectangle gdk_rect;
++    if (width > last_width_) {
++      gdk_rect.x = last_width_;
++      gdk_rect.y = 0;
++      gdk_rect.width = width - last_width_;
++      gdk_rect.height = height;
++      AddGdkRectToSystemClipRegion(&gdk_rect);
++    }
++    if (height > last_height_) {
++      gdk_rect.x = 0;
++      gdk_rect.y = last_height_;
++      gdk_rect.width = width;
++      gdk_rect.height = height - last_height_;
++      AddGdkRectToSystemClipRegion(&gdk_rect);
++    }
++
++    last_width_ = width;
++    last_height_ = height;
++  }
++
++  void AddGdkRectToViewClipRegion(const GdkRectangle &gdk_rect) {
++    Rectangle rect(gdk_rect.x, gdk_rect.y, gdk_rect.width, gdk_rect.height);
++    rect.Zoom(1.0 / zoom_);
++    rect.Integerize(true);
++    view_->AddRectangleToClipRegion(rect);
++  }
++
++  void AddGdkRegionToViewClipRegion(GdkRegion *region) {
++    if (!gdk_region_empty(region)) {
++      GdkRectangle *rects;
++      gint n_rects;
++      gdk_region_get_rectangles(region, &rects, &n_rects);
++      for (gint i = 0; i < n_rects; ++i) {
++        AddGdkRectToViewClipRegion(rects[i]);
++      }
++      g_free(rects);
++    }
++  }
++
++#if GTK_CHECK_VERSION(2,10,0)
++  bool ShouldUpdateInputShapeMask(int width, int height) {
++    bool update_input_shape_mask = enable_input_shape_mask_ &&
++        (GetCurrentTime() - last_mask_time_ > kUpdateMaskInterval) &&
++        no_background_ && composited_;
++
++    // We need set input shape mask if there is no background.
++    if (update_input_shape_mask) {
++      if (input_shape_mask_) {
++        gint mask_width, mask_height;
++        gdk_drawable_get_size(GDK_DRAWABLE(input_shape_mask_),
++                              &mask_width, &mask_height);
++        if (mask_width != width || mask_height != height) {
++          // input shape mask needs recreate.
++          g_object_unref(G_OBJECT(input_shape_mask_));
++          input_shape_mask_ = NULL;
++        }
++      }
++
++      if (input_shape_mask_ == NULL) {
++        GdkRectangle rect;
++        rect.x = 0;
++        rect.y = 0;
++        rect.width = width;
++        rect.height = height;
++        input_shape_mask_ = gdk_pixmap_new(NULL, width, height, 1);
++
++        // Redraw whole view.
++        AddGdkRectToSystemClipRegion(&rect);
++      }
++    }
++
++    return update_input_shape_mask;
++  }
++#endif
++
++  GdkRegion *GetInvalidateRegion() {
++    gint width, height;
++    gdk_drawable_get_size(widget_->window, &width, &height);
++    view_->Layout();
++#if GTK_CHECK_VERSION(2,10,0)
++    should_update_input_shape_mask_ = ShouldUpdateInputShapeMask(width, height);
++#endif
++    AddExtendedWindowAreaToSystemClipRegion(width, height);
++    GdkRegion *region = CreateExposeRegionFromViewClipRegion();
++    if (sys_clip_region_) {
++      AddGdkRegionToViewClipRegion(sys_clip_region_);
++      gdk_region_union(region, sys_clip_region_);
++      gdk_region_destroy(sys_clip_region_);
++      sys_clip_region_ = NULL;
++    }
++    return region;
++  }
++
++  void SelfDraw() {
++    if (!widget_->window || !gdk_window_is_visible(widget_->window))
++      return;
++
++    self_draw_ = true;
++    GdkRegion *region = GetInvalidateRegion();
++    gdk_window_invalidate_region(widget_->window, region, TRUE);
++    gdk_region_destroy(region);
++    gdk_window_process_updates(widget_->window, TRUE);
++    last_self_draw_time_ = GetCurrentTime();
++    self_draw_ = false;
++  }
++
+   static gboolean ButtonPressHandler(GtkWidget *widget, GdkEventButton *event,
+                                      gpointer user_data) {
+     Impl *impl = reinterpret_cast<Impl *>(user_data);
+@@ -364,137 +524,29 @@
+     return result != EVENT_RESULT_UNHANDLED;
+   }
+ 
+-  static GdkRegion *CreateExposeRegion(const ClipRegion *view_region,
+-                                       int width, int height,
+-                                       int last_width, int last_height,
+-                                       double zoom) {
+-    GdkRegion *region = gdk_region_new();
+-    size_t count = view_region->GetRectangleCount();
+-    GdkRectangle gdk_rect;
+-    if (count) {
+-      Rectangle rect;
+-      for (size_t i = 0; i < count; ++i) {
+-        rect = view_region->GetRectangle(i);
+-        if (zoom != 1.0) {
+-          rect.Zoom(zoom);
+-          rect.Integerize(true);
+-        }
+-        gdk_rect.x = static_cast<int>(rect.x);
+-        gdk_rect.y = static_cast<int>(rect.y);
+-        gdk_rect.width = static_cast<int>(rect.w);
+-        gdk_rect.height = static_cast<int>(rect.h);
+-        gdk_region_union_with_rect(region, &gdk_rect);
+-      }
+-    }
+-    if (width > last_width) {
+-      gdk_rect.x = last_width;
+-      gdk_rect.y = 0;
+-      gdk_rect.width = width - last_width;
+-      gdk_rect.height = height;
+-      gdk_region_union_with_rect(region, &gdk_rect);
+-    }
+-    if (height > last_height) {
+-      gdk_rect.x = 0;
+-      gdk_rect.y = last_height;
+-      gdk_rect.width = width;
+-      gdk_rect.height = height - last_height;
+-      gdk_region_union_with_rect(region, &gdk_rect);
+-    }
+-    return region;
+-  }
+-
+-  static void AddGdkRectangleToViewClipRegion(ViewInterface *view,
+-                                              const GdkRectangle &gdk_rect,
+-                                              bool zoom) {
+-    Rectangle rect(gdk_rect.x, gdk_rect.y, gdk_rect.width, gdk_rect.height);
+-    rect.Zoom(1.0 / zoom);
+-    rect.Integerize(true);
+-    view->AddRectangleToClipRegion(rect);
+-  }
+-
+-  static void AddGdkRegionToViewClipRegion(ViewInterface *view,
+-                                           GdkRegion *region,
+-                                           bool zoom) {
+-    if (!gdk_region_empty(region)) {
+-      GdkRectangle *rects;
+-      gint n_rects;
+-      gdk_region_get_rectangles(region, &rects, &n_rects);
+-      for (gint i = 0; i < n_rects; ++i) {
+-        AddGdkRectangleToViewClipRegion(view, rects[i], zoom);
+-      }
+-      g_free(rects);
+-    }
+-  }
+-
+   static gboolean ExposeHandler(GtkWidget *widget, GdkEventExpose *event,
+                                 gpointer user_data) {
+     Impl *impl = reinterpret_cast<Impl *>(user_data);
+-    gint last_width = impl->last_width_;
+-    gint last_height = impl->last_height_;
+-    gint width, height;
+-    gdk_drawable_get_size(widget->window, &width, &height);
+-
+-    impl->last_width_ = width;
+-    impl->last_height_ = height;
+-
+-    impl->view_->Layout();
+-
+-    GdkRegion *region = CreateExposeRegion(
+-        impl->view_->GetClipRegion(), width, height,
+-        last_width, last_height, impl->zoom_);
+ 
+-    uint64_t current_time = GetCurrentTime();
+-#if GTK_CHECK_VERSION(2,10,0)
+-    bool update_input_shape_mask = impl->enable_input_shape_mask_ &&
+-        (current_time - impl->last_mask_time_ > kUpdateMaskInterval) &&
+-        impl->no_background_ && impl->composited_;
+-
+-    // We need set input shape mask if there is no background.
+-    if (update_input_shape_mask) {
+-      if (impl->input_shape_mask_) {
+-        gint mask_width, mask_height;
+-        gdk_drawable_get_size(GDK_DRAWABLE(impl->input_shape_mask_),
+-                              &mask_width, &mask_height);
+-        if (mask_width != width || mask_height != height) {
+-          // input shape mask needs recreate.
+-          g_object_unref(G_OBJECT(impl->input_shape_mask_));
+-          impl->input_shape_mask_ = NULL;
++    if (!impl->self_draw_) {
++      impl->AddGdkRegionToSystemClipRegion(event->region);
++      GdkRegion *invalidate_region = impl->GetInvalidateRegion();
++
++      // We can't update the region outside event->region, so update them in a
++      // new self draw request.
++      gdk_region_subtract(invalidate_region, event->region);
++      if (!gdk_region_empty(invalidate_region)) {
++        impl->AddGdkRegionToSystemClipRegion(invalidate_region);
++        if (!impl->self_draw_timer_) {
++          impl->self_draw_timer_ =
++              g_idle_add_full(GDK_PRIORITY_REDRAW, Impl::SelfDrawHandler,
++                              impl, NULL);
+         }
+       }
+-
+-      if (impl->input_shape_mask_ == NULL) {
+-        DLOG("View(%p): need (re)create input shape mask.", impl->view_);
+-        GdkRectangle rect;
+-        rect.x = 0;
+-        rect.y = 0;
+-        rect.width = width;
+-        rect.height = height;
+-        gdk_region_union_with_rect(region, &rect);
+-        impl->input_shape_mask_ = gdk_pixmap_new(NULL, width, height, 1);
+-
+-        // Redraw whole view.
+-        AddGdkRectangleToViewClipRegion(impl->view_, rect, impl->zoom_);
+-      }
++      gdk_region_destroy(invalidate_region);
+     }
+-#endif
+ 
+-    if (event->area.x == 0 && event->area.y == 0 &&
+-        event->area.width == 1 && event->area.height == 1) {
+-      //DLOG("View(%p): self queue draw.", impl->view_);
+-      if (gdk_region_empty(region)) {
+-        DLOG("View(%p) has pending queue draw, but doesn't have clip region.",
+-             impl->view_);
+-        gdk_region_destroy(region);
+-        // No need to redraw.
+-        return TRUE;
+-      }
+-      gdk_window_begin_paint_region(widget->window, region);
+-    } else {
+-      //DLOG("System requires redraw view(%p)", impl->view_);
+-      gdk_region_union(region, event->region);
+-      AddGdkRegionToViewClipRegion(impl->view_, event->region, impl->zoom_);
+-      gdk_window_begin_paint_region(widget->window, region);
+-    }
++    gdk_window_begin_paint_region(widget->window, event->region);
+ 
+     cairo_t *cr = gdk_cairo_create(widget->window);
+ 
+@@ -522,9 +574,9 @@
+ 
+ #if GTK_CHECK_VERSION(2,10,0)
+     // We need set input shape mask if there is no background.
+-    if (update_input_shape_mask && impl->input_shape_mask_) {
++    if (impl->should_update_input_shape_mask_ && impl->input_shape_mask_) {
+       cairo_t *mask_cr = gdk_cairo_create(impl->input_shape_mask_);
+-      gdk_cairo_region(mask_cr, region);
++      gdk_cairo_region(mask_cr, event->region);
+       cairo_clip(mask_cr);
+       cairo_set_operator(mask_cr, CAIRO_OPERATOR_CLEAR);
+       cairo_paint(mask_cr);
+@@ -534,16 +586,16 @@
+       cairo_destroy(mask_cr);
+       gdk_window_input_shape_combine_mask(widget->window,
+                                           impl->input_shape_mask_, 0, 0);
+-      impl->last_mask_time_ = current_time;
++      impl->last_mask_time_ = GetCurrentTime();
+     }
+ #endif
+ 
+     // Copy off-screen buffer to screen.
+     gdk_window_end_paint(widget->window);
+-    gdk_region_destroy(region);
+ 
+ #ifdef _DEBUG
+     ++impl->draw_count_;
++    uint64_t current_time = GetCurrentTime();
+     uint64_t duration = current_time - impl->last_fps_time_;
+     if (duration >= kFPSCountDuration) {
+       impl->last_fps_time_ = current_time;
+@@ -915,12 +967,21 @@
+     return FALSE;
+   }
+ 
++  static gboolean SelfDrawHandler(gpointer user_data) {
++    Impl *impl = reinterpret_cast<Impl *>(user_data);
++    impl->self_draw_timer_ = 0;
++    impl->SelfDraw();
++    return FALSE;
++  }
++
+   ViewInterface *view_;
+   ViewHostInterface *host_;
+   GtkWidget *widget_;
+ #if GTK_CHECK_VERSION(2,10,0)
+   GdkBitmap *input_shape_mask_;
+   uint64_t last_mask_time_;
++  bool should_update_input_shape_mask_;
++  bool enable_input_shape_mask_;
+ #endif
+   gulong *handlers_;
+   DragEvent *current_drag_event_;
+@@ -928,7 +989,6 @@
+   bool dbl_click_;
+   bool composited_;
+   bool no_background_;
+-  bool enable_input_shape_mask_;
+   bool focused_;
+   bool button_pressed_;
+ #ifdef GRAB_POINTER_EXPLICITLY
+@@ -946,6 +1006,11 @@
+   int last_width_;
+   int last_height_;
+ 
++  bool self_draw_;
++  guint self_draw_timer_;
++  uint64_t last_self_draw_time_;
++  GdkRegion *sys_clip_region_;
++
+   struct EventHandlerInfo {
+     const char *event;
+     void (*handler)(void);
+@@ -991,9 +1056,9 @@
+ }
+ 
+ void ViewWidgetBinder::EnableInputShapeMask(bool enable) {
++#if GTK_CHECK_VERSION(2,10,0)
+   if (impl_->enable_input_shape_mask_ != enable) {
+     impl_->enable_input_shape_mask_ = enable;
+-#if GTK_CHECK_VERSION(2,10,0)
+     if (impl_->widget_ && impl_->no_background_ &&
+         impl_->composited_ && !enable) {
+       if (impl_->widget_->window) {
+@@ -1004,6 +1069,7 @@
+         impl_->input_shape_mask_ = NULL;
+       }
+     }
++    gtk_widget_queue_draw(impl_->widget_);
+   }
+ #endif
+ }
+@@ -1013,5 +1079,34 @@
+   impl_ = NULL;
+ }
+ 
++void ViewWidgetBinder::QueueDraw() {
++  if (!impl_->self_draw_timer_) {
++    uint64_t current_time = GetCurrentTime();
++    if (current_time - impl_->last_self_draw_time_ >= kSelfDrawInterval) {
++      impl_->self_draw_timer_ =
++          g_idle_add_full(GDK_PRIORITY_REDRAW, Impl::SelfDrawHandler,
++                          impl_, NULL);
++    } else {
++      impl_->self_draw_timer_ =
++          g_timeout_add(kSelfDrawInterval -
++                        (current_time - impl_->last_self_draw_time_),
++                        Impl::SelfDrawHandler, impl_);
++    }
++  }
++}
++
++void ViewWidgetBinder::DrawImmediately() {
++  // Remove pending queue draw, as we don't need it anymore.
++  if (impl_->self_draw_timer_) {
++    g_source_remove(impl_->self_draw_timer_);
++    impl_->self_draw_timer_ = 0;
++  }
++  impl_->SelfDraw();
++}
++
++bool ViewWidgetBinder::DrawQueued() {
++  return impl_->self_draw_timer_ != 0;
++}
++
+ } // namespace gtk
+ } // namespace ggadget
+Index: google-gadgets-0.11.1/ggadget/gtk/single_view_host.cc
+===================================================================
+--- google-gadgets-0.11.1.orig/ggadget/gtk/single_view_host.cc	2009-05-24 22:18:33.000000000 -0400
++++ google-gadgets-0.11.1/ggadget/gtk/single_view_host.cc	2010-01-21 09:57:46.000000000 -0500
+@@ -47,12 +47,6 @@
+ static const int kStopMoveDragTimeout = 200;
+ static const char kMainViewWindowRole[] = "Google-Gadgets";
+ 
+-// Minimal interval between queue draws.
+-static const unsigned int kQueueDrawInterval = 40;
+-
+-// Maximum live duration of queue draw timer.
+-static const uint64_t kQueueDrawTimerDuration = 1000;
+-
+ class SingleViewHost::Impl {
+  public:
+   Impl(SingleViewHost *owner, ViewHostInterface::Type type,
+@@ -92,13 +86,9 @@
+       is_keep_above_(false),
+       move_dragging_(false),
+       enable_signals_(true),
+-      draw_queued_(false),
+-      draw_finished_(true),
+-      queue_draw_timer_(0),
+-      last_queue_draw_time_(0),
+       queue_resize_timer_(0),
+-      last_allocated_width_(0),
+-      last_allocated_height_(0),
++      fixed_width_from_view_(0),
++      fixed_height_from_view_(0),
+       feedback_handler_(NULL),
+       can_close_dialog_(false) {
+     ASSERT(owner);
+@@ -115,10 +105,6 @@
+     // To make sure that it won't be accessed anymore.
+     view_ = NULL;
+ 
+-    if (queue_draw_timer_)
+-      g_source_remove(queue_draw_timer_);
+-    queue_draw_timer_ = 0;
+-
+     if (queue_resize_timer_)
+       g_source_remove(queue_resize_timer_);
+     queue_resize_timer_ = 0;
+@@ -234,9 +220,6 @@
+     g_signal_connect(G_OBJECT(fixed_), "size-allocate",
+                      G_CALLBACK(FixedSizeAllocateHandler), this);
+ 
+-    g_signal_connect(G_OBJECT(widget_), "expose-event",
+-                     G_CALLBACK(ExposeHandler), this);
+-
+     g_signal_connect(G_OBJECT(fixed_), "set-focus-child",
+                      G_CALLBACK(FixedSetFocusChildHandler), this);
+ 
+@@ -275,6 +258,11 @@
+     int width = static_cast<int>(ceil(view_->GetWidth() * zoom));
+     int height = static_cast<int>(ceil(view_->GetHeight() * zoom));
+ 
++    // Stores the expected size of the GtkFixed widget, which will be used in
++    // FixedSizeAllocateHandler().
++    fixed_width_from_view_ = width;
++    fixed_height_from_view_ = height;
++
+     GtkRequisition req;
+     gtk_widget_set_size_request(widget_, width, height);
+     gtk_widget_size_request(window_, &req);
+@@ -293,8 +281,6 @@
+       win_width_ = req.width;
+       win_height_ = req.height;
+     }
+-
+-    DLOG("New window size: %d %d", req.width, req.height);
+   }
+ 
+   void QueueResize() {
+@@ -311,33 +297,13 @@
+       DLOG("SingleViewHost::EnableInputShapeMask(%s)",
+            enable ? "true" : "false");
+       binder_->EnableInputShapeMask(enable);
+-      QueueDraw();
+     }
+   }
+ 
+   void QueueDraw() {
+     ASSERT(GTK_IS_WIDGET(widget_));
+-    draw_finished_ = false;
+-    if (queue_draw_timer_) {
+-      draw_queued_ = true;
+-      return;
+-    }
+-
+-    uint64_t current_time = GetCurrentTime();
+-    if (current_time - last_queue_draw_time_ >= kQueueDrawInterval) {
+-      gtk_widget_queue_draw(widget_);
+-      draw_queued_ = false;
+-      last_queue_draw_time_ = current_time;
+-    } else {
+-      draw_queued_ = true;
+-    }
+-
+-    // Can't call view's GetCaption() here, because at this point, view might
+-    // not be fully initialized yet.
+-    DLOG("Install queue draw timer of view: %p", view_);
+-    queue_draw_timer_ = g_timeout_add(kQueueDrawInterval,
+-                                      QueueDrawTimeoutHandler,
+-                                      this);
++    if (binder_)
++      binder_->QueueDraw();
+   }
+ 
+   void SetResizable(ViewInterface::ResizableMode mode) {
+@@ -861,7 +827,7 @@
+ #endif
+       }
+ 
+-      if (impl->draw_queued_ || !impl->draw_finished_)
++      if (impl->binder_ && impl->binder_->DrawQueued())
+         return TRUE;
+ 
+       int button = ConvertGdkModifierToButton(event->state);
+@@ -881,7 +847,6 @@
+           double view_width = new_width / impl->resize_view_zoom_;
+           double view_height = new_height / impl->resize_view_zoom_;
+           if (impl->view_->OnSizing(&view_width, &view_height)) {
+-            DLOG("Resize view to: %lf %lf", view_width, view_height);
+             impl->view_->SetSize(view_width, view_height);
+             width = impl->view_->GetWidth() * impl->resize_view_zoom_;
+             height = impl->view_->GetHeight() * impl->resize_view_zoom_;
+@@ -891,7 +856,6 @@
+           double yzoom = new_height / impl->resize_view_height_;
+           double zoom = std::min(xzoom, yzoom);
+           zoom = Clamp(zoom, kMinimumZoom, kMaximumZoom);
+-          DLOG("Zoom view to: %lf", zoom);
+           impl->view_->GetGraphics()->SetZoom(zoom);
+           impl->view_->MarkRedraw();
+           width = impl->resize_view_width_ * zoom;
+@@ -910,9 +874,6 @@
+           int win_width = impl->resize_win_width_ + int(delta_x);
+           int win_height = impl->resize_win_height_ + int(delta_y);
+           gdk_window_move_resize(widget->window, x, y, win_width, win_height);
+-          gdk_window_process_updates(widget->window, TRUE);
+-          DLOG("Move resize window: x:%d, y:%d, w:%d, h:%d", x, y,
+-               win_width, win_height);
+         }
+ 
+         return TRUE;
+@@ -965,16 +926,12 @@
+                                        GtkAllocation *allocation,
+                                        gpointer user_data) {
+     Impl *impl = reinterpret_cast<Impl *>(user_data);
+-    DLOG("Size allocate(%d, %d)", allocation->width, allocation->height);
+     if (GTK_WIDGET_VISIBLE(impl->window_) &&
+         !impl->resize_width_mode_ && !impl->resize_height_mode_ &&
+         !impl->queue_resize_timer_ &&
+         allocation->width >= 1 && allocation->height >= 1 &&
+-        (impl->last_allocated_width_ != allocation->width ||
+-         impl->last_allocated_height_ != allocation->height)) {
+-      impl->last_allocated_width_ = allocation->width;
+-      impl->last_allocated_height_ = allocation->height;
+-
++        (impl->fixed_width_from_view_ != allocation->width ||
++         impl->fixed_height_from_view_ != allocation->height)) {
+       double old_width = impl->view_->GetWidth();
+       double old_height = impl->view_->GetHeight();
+       double old_zoom = impl->view_->GetGraphics()->GetZoom();
+@@ -984,7 +941,6 @@
+         double new_height = allocation->height / old_zoom;
+         if (impl->view_->OnSizing(&new_width, &new_height) &&
+             (new_width != old_width || new_height != old_height)) {
+-          DLOG("Resize view to: %lf %lf", new_width, new_height);
+           impl->view_->SetSize(new_width, new_height);
+         }
+       } else if (impl->resizable_mode_ == ViewInterface::RESIZABLE_ZOOM &&
+@@ -994,7 +950,6 @@
+         double new_zoom = Clamp(std::min(xzoom, yzoom),
+                                 kMinimumZoom, kMaximumZoom);
+         if (old_zoom != new_zoom) {
+-          DLOG("Zoom view to: %lf", new_zoom);
+           impl->view_->GetGraphics()->SetZoom(new_zoom);
+           impl->view_->MarkRedraw();
+         }
+@@ -1021,27 +976,6 @@
+     return FALSE;
+   }
+ 
+-  static gboolean QueueDrawTimeoutHandler(gpointer data) {
+-    Impl *impl = reinterpret_cast<Impl *>(data);
+-    uint64_t current_time = GetCurrentTime();
+-    if (impl->draw_queued_) {
+-      ASSERT(GTK_IS_WIDGET(impl->widget_));
+-      // Special hack to inform ViewWidgetBinder this queue draw request is
+-      // generated by us instead of system.
+-      gtk_widget_queue_draw_area(impl->widget_, 0, 0, 1, 1);
+-      impl->draw_queued_ = false;
+-      impl->last_queue_draw_time_ = current_time;
+-    }
+-
+-    if (current_time - impl->last_queue_draw_time_ > kQueueDrawTimerDuration) {
+-      DLOG("Remove queue draw timer of view: %p (%s)", impl->view_,
+-           impl->view_->GetCaption().c_str());
+-      impl->queue_draw_timer_ = 0;
+-      return FALSE;
+-    }
+-    return TRUE;
+-  }
+-
+   static gboolean QueueResizeTimeoutHandler(gpointer data) {
+     Impl *impl = reinterpret_cast<Impl *>(data);
+     impl->AdjustWindowSize();
+@@ -1049,14 +983,6 @@
+     return false;
+   }
+ 
+-  static gboolean ExposeHandler(GtkWidget *widget, GdkEventExpose *event,
+-                                gpointer data) {
+-    Impl *impl = reinterpret_cast<Impl *>(data);
+-    impl->draw_finished_ = true;
+-    // Make sure view widget binder can receive this event.
+-    return FALSE;
+-  }
+-
+   // Some elements may create gtk native widgets under this widget. When such
+   // a widget get focus, we must update the focus chain though the view
+   // hierachy.
+@@ -1136,14 +1062,9 @@
+   bool move_dragging_;
+   bool enable_signals_;
+ 
+-  bool draw_queued_;
+-  bool draw_finished_;
+-  guint queue_draw_timer_;
+-  uint64_t last_queue_draw_time_;
+-
+   guint queue_resize_timer_;
+-  gint last_allocated_width_;
+-  gint last_allocated_height_;
++  int fixed_width_from_view_;
++  int fixed_height_from_view_;
+ 
+   Slot1<bool, int> *feedback_handler_;
+   bool can_close_dialog_; // Only useful when a model dialog is running.
+Index: google-gadgets-0.11.1/ggadget/gtk/view_widget_binder.h
+===================================================================
+--- google-gadgets-0.11.1.orig/ggadget/gtk/view_widget_binder.h	2009-03-15 00:12:51.000000000 -0400
++++ google-gadgets-0.11.1/ggadget/gtk/view_widget_binder.h	2010-01-21 09:57:46.000000000 -0500
+@@ -54,6 +54,15 @@
+    */
+   void EnableInputShapeMask(bool enable);
+ 
++  /** Called by ViewHost to queue a redraw request. */
++  void QueueDraw();
++
++  /** Checks if a redraw request has been queued. */
++  bool DrawQueued();
++
++  /** Redraws the gadget immediately. */
++  void DrawImmediately();
++
+  private:
+   DISALLOW_EVIL_CONSTRUCTORS(ViewWidgetBinder);
+   class Impl;

--- End Message ---
--- Begin Message ---
Source: google-gadgets
Source-Version: 0.11.2-1

We believe that the bug you reported is fixed in the latest version of
google-gadgets, which is due to be installed in the Debian FTP archive:

google-gadgets-common_0.11.2-1_amd64.deb
  to main/g/google-gadgets/google-gadgets-common_0.11.2-1_amd64.deb
google-gadgets-gst_0.11.2-1_amd64.deb
  to main/g/google-gadgets/google-gadgets-gst_0.11.2-1_amd64.deb
google-gadgets-gtk_0.11.2-1_amd64.deb
  to main/g/google-gadgets/google-gadgets-gtk_0.11.2-1_amd64.deb
google-gadgets-qt_0.11.2-1_amd64.deb
  to main/g/google-gadgets/google-gadgets-qt_0.11.2-1_amd64.deb
google-gadgets-xul_0.11.2-1_amd64.deb
  to main/g/google-gadgets/google-gadgets-xul_0.11.2-1_amd64.deb
google-gadgets_0.11.2-1.diff.gz
  to main/g/google-gadgets/google-gadgets_0.11.2-1.diff.gz
google-gadgets_0.11.2-1.dsc
  to main/g/google-gadgets/google-gadgets_0.11.2-1.dsc
google-gadgets_0.11.2.orig.tar.gz
  to main/g/google-gadgets/google-gadgets_0.11.2.orig.tar.gz
libggadget-1.0-0b_0.11.2-1_amd64.deb
  to main/g/google-gadgets/libggadget-1.0-0b_0.11.2-1_amd64.deb
libggadget-1.0-dev_0.11.2-1_amd64.deb
  to main/g/google-gadgets/libggadget-1.0-dev_0.11.2-1_amd64.deb
libggadget-gtk-1.0-0b_0.11.2-1_amd64.deb
  to main/g/google-gadgets/libggadget-gtk-1.0-0b_0.11.2-1_amd64.deb
libggadget-gtk-1.0-dev_0.11.2-1_amd64.deb
  to main/g/google-gadgets/libggadget-gtk-1.0-dev_0.11.2-1_amd64.deb
libggadget-qt-1.0-0b_0.11.2-1_amd64.deb
  to main/g/google-gadgets/libggadget-qt-1.0-0b_0.11.2-1_amd64.deb
libggadget-qt-1.0-dev_0.11.2-1_amd64.deb
  to main/g/google-gadgets/libggadget-qt-1.0-dev_0.11.2-1_amd64.deb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 566169@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Modestas Vainius <modax@debian.org> (supplier of updated google-gadgets package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Thu, 04 Mar 2010 20:41:01 +0200
Source: google-gadgets
Binary: libggadget-1.0-0b libggadget-1.0-dev libggadget-gtk-1.0-0b libggadget-gtk-1.0-dev libggadget-qt-1.0-0b libggadget-qt-1.0-dev google-gadgets-common google-gadgets-gtk google-gadgets-qt google-gadgets-gst google-gadgets-xul
Architecture: source amd64
Version: 0.11.2-1
Distribution: experimental
Urgency: low
Maintainer: Debian Krap Maintainers <debian-qt-kde@lists.debian.org>
Changed-By: Modestas Vainius <modax@debian.org>
Description: 
 google-gadgets-common - Common files for Qt and GTK+ versions of google-gadgets
 google-gadgets-gst - GStreamer Module for Google Gadgets
 google-gadgets-gtk - GTK+ Version of Google Gadgets
 google-gadgets-qt - Qt4 version of Google Gadgets
 google-gadgets-xul - XULRunner module for Google Gadgets
 libggadget-1.0-0b - Google Gadgets main library
 libggadget-1.0-dev - Google Gadgets main development files
 libggadget-gtk-1.0-0b - Google Gadgets GTK+ library
 libggadget-gtk-1.0-dev - Google Gadgets GTK+ development files
 libggadget-qt-1.0-0b - Google Gadgets Qt library
 libggadget-qt-1.0-dev - Google Gadgets Qt development files
Closes: 554696 566167 566168 566169
Changes: 
 google-gadgets (0.11.2-1) experimental; urgency=low
 .
   [ Pino Toscano ]
   * New upstream release:
     - fixes a typo in the "World Daylight Clock". (Closes: #566168)
     - fixes GTK+ expose events with GTK+ >= 2.18. (Closes: #566169)
     - links ggl-qt to X11 and Xrender (Closes: #554696)
   * This new version of google-gadgets breaks API and ABI once again, so:
     - rename library packages, 'b' suffix this time.
     - add conflict against 'a' libraries.
     - update -dev packages dependency accordingly.
   * Make use of the xulrunner dh addon, so dh_xulrunner is run again.
   * Switch from cURL to SOUP for the xml_http_request module. Other than being
     recommended upstream, this also avoid crashes which can happen with
     gnutls. (Closes: #566167)
   * Install the html-flash-element extension in the -common package.
   * Make libggadget-gtk-1.0-dev and libggadget-qt-1.0-dev depend respectively
     on libgtk2.0-dev and libqt4-dev, as they use their host libraries in the
     public headers.
   * Add patch 05_hurd_pthread.patch to force linking with pthread (workaround
     Hurd issue).
   * Add author and small descriptions to all the patches.
   * Refresh patch 03_GRE_Version.patch, thanks Mike Hommey for the hints.
   * Bump Standards-Version to 3.8.4, no changes required.
   * Slightly improve descriptions: add main blurb in each package, fix a couple
     of typos.
   * Add lintian overrides:
     - the names of the lib* packages don't reflect the SO-names of the
       library/ies contained.
   * Make dh_install ignore .la files.
   * Adjust capitalisation of "QT" to "Qt" also in the ggl-qt.7 manpage.
   * Add also the SOVERSION to the .install files.
 .
   [ Modestas Vainius ]
   * Since ABI breakages are going to continue, add *-api virtual packages
     to keep library count in the conflicts at the manageable level.
Checksums-Sha1: 
 84e1c88d1a23eaf4fd7fa10252a488b8006824a9 1933 google-gadgets_0.11.2-1.dsc
 50ede37a7a7c759ccd7bc537d7c0d808d17cc17a 3258898 google-gadgets_0.11.2.orig.tar.gz
 5a701db12fec11bf4c87ba5ceaf373c591c0bc67 25270 google-gadgets_0.11.2-1.diff.gz
 89066b45de967b4309a59a824637605d0145154e 1282182 libggadget-1.0-0b_0.11.2-1_amd64.deb
 7914b678fc01757b44f3cb18cc8f4372bee6e8f2 2221694 libggadget-1.0-dev_0.11.2-1_amd64.deb
 a4523797ed5e91d6a110573815213af3800977fd 142256 libggadget-gtk-1.0-0b_0.11.2-1_amd64.deb
 463aaf91ed1f1d90dc867b3ac3cec4dcacca9a1f 190130 libggadget-gtk-1.0-dev_0.11.2-1_amd64.deb
 5b266c6a35c38b39c8309c06b5749ac6d5028f1a 92542 libggadget-qt-1.0-0b_0.11.2-1_amd64.deb
 d68964e319b4d354247904c88c134b50364be105 115934 libggadget-qt-1.0-dev_0.11.2-1_amd64.deb
 14bd541bd438e0fbbfe6bdb26441d7452cf0a6af 915734 google-gadgets-common_0.11.2-1_amd64.deb
 b750d95ee35f7a9ed3445348cb2546f890a49db2 155912 google-gadgets-gtk_0.11.2-1_amd64.deb
 b590f8654071cc5866ac6f3f94b811e0e2ec787d 218302 google-gadgets-qt_0.11.2-1_amd64.deb
 9023657417734ceb9bb0ac5ce51f8fa461acd91c 52700 google-gadgets-gst_0.11.2-1_amd64.deb
 94aa616cde345e2dba7f1f4e0b171c1d4dd0432d 182440 google-gadgets-xul_0.11.2-1_amd64.deb
Checksums-Sha256: 
 daf482495ac50b650a13fe9e6801089fef338b6dbb8ebd3aad3d89576856bd09 1933 google-gadgets_0.11.2-1.dsc
 a902225450f2d756662e1b766ec3d68f6aa471cc8c334b1b5c1168a90a73fae4 3258898 google-gadgets_0.11.2.orig.tar.gz
 500e301c79894930355c3b706167908f0c4c9e5320b81f35a618839a2bdd3a08 25270 google-gadgets_0.11.2-1.diff.gz
 5991822a58eadb72ea6f4898808a2851dd54d82157909c382ff988e1923975be 1282182 libggadget-1.0-0b_0.11.2-1_amd64.deb
 705d3314c21ed83ae3cb16128799e59a428a7e3e501c7d2cea71f5de5d889688 2221694 libggadget-1.0-dev_0.11.2-1_amd64.deb
 4783c4e4935d9c9a9d85beb24179025404a4b50de67202a3e0493e6745e64344 142256 libggadget-gtk-1.0-0b_0.11.2-1_amd64.deb
 b123888a1cea598db1120705f3881f7f20a01f44b3de0465fa50b166450cc44f 190130 libggadget-gtk-1.0-dev_0.11.2-1_amd64.deb
 a2e44980989b80b7a44dbbc5d8dc90a8a28b5492232fa00b87474583e987a5b7 92542 libggadget-qt-1.0-0b_0.11.2-1_amd64.deb
 d557b0a310e4ba4e97f49b8e6a5bf6e8acde65d8087a92e63494793457683407 115934 libggadget-qt-1.0-dev_0.11.2-1_amd64.deb
 8ed17c02088759fb4590a240ea0a6efcf6100ebea7ef6a526653fd075e3f558e 915734 google-gadgets-common_0.11.2-1_amd64.deb
 dd52cd66edd71c949737b82e1a44aabb6144b68e6dc9de084f4040239f93008b 155912 google-gadgets-gtk_0.11.2-1_amd64.deb
 eaa94b496ec8f722f3e6fca4bbaf004e283c97b29bcf594c62b24b9fe1e02c7e 218302 google-gadgets-qt_0.11.2-1_amd64.deb
 637704deab8db5509d9bacf30ad87cbacf3d37011c95e04224c61aac71ebdb0a 52700 google-gadgets-gst_0.11.2-1_amd64.deb
 b8c9868b04522d922a42c1bf8a871036749362760853bf45ccfad973c17f5780 182440 google-gadgets-xul_0.11.2-1_amd64.deb
Files: 
 d970ca016fc423d06758a9f3c819dcdd 1933 misc extra google-gadgets_0.11.2-1.dsc
 92b8190fea559317944fbc00acb2901a 3258898 misc extra google-gadgets_0.11.2.orig.tar.gz
 0e9e98db987889a4760ee41cfd47c528 25270 misc extra google-gadgets_0.11.2-1.diff.gz
 741fc3b43f3663605aba3f91662f3b5b 1282182 libs extra libggadget-1.0-0b_0.11.2-1_amd64.deb
 34fa5ffad24e82d0961e49f5bb24c99b 2221694 libdevel extra libggadget-1.0-dev_0.11.2-1_amd64.deb
 aa272845b63beee946413cb39edddeac 142256 libs extra libggadget-gtk-1.0-0b_0.11.2-1_amd64.deb
 780455ed148e99ec8726f2a783c17c9c 190130 libdevel extra libggadget-gtk-1.0-dev_0.11.2-1_amd64.deb
 62d3c981ff873f45b7069e538cf5a218 92542 libs extra libggadget-qt-1.0-0b_0.11.2-1_amd64.deb
 93f04ff78780fc73a6c1476d5cbb5d42 115934 libdevel extra libggadget-qt-1.0-dev_0.11.2-1_amd64.deb
 aef10a893d4b7e6f2e354dbbc1f36e61 915734 misc extra google-gadgets-common_0.11.2-1_amd64.deb
 d88970f2a5952eafe84557da17a42e76 155912 gnome extra google-gadgets-gtk_0.11.2-1_amd64.deb
 3f428c7dfa67e0eebf6558f50cf87682 218302 kde extra google-gadgets-qt_0.11.2-1_amd64.deb
 ae36cee1dbbb6161d6028b68a61f57e2 52700 misc extra google-gadgets-gst_0.11.2-1_amd64.deb
 9abde0acbb502a04861128bf1b70ecb0 182440 misc extra google-gadgets-xul_0.11.2-1_amd64.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iEYEARECAAYFAkuQBY8ACgkQHO9JRnPq4hR9TQCgt0rhdX7W2yJJfgLSHJb2fD/v
aDUAoLQVxbMmhehZQJlpgz4T1n+94qhi
=DpWk
-----END PGP SIGNATURE-----



--- End Message ---

Reply to: