Skip to content
  • Benjamin Otte's avatar
    widgetpaintable: Protect against too many signals · 12fedca7
    Benjamin Otte authored
    This is actually not just a mechnaism to protect against too many
    signals, but it's also a method to getting those signals at the wrong
    time.
    
    For every size/content change, a widget needs to invalidate twice:
    Once when it queues a resize/redraw (going valid => invalid) and once
    when the new size/content is actually assigned (going invalid => valid).
    
    However, one of those invalidations might be inconvenient for the
    listener. GtkImage for example does not like receiving
    invalidate-contents signals when new contents are assigned, but is fine
    with them when the old ones go invalid. And it will not try to draw the
    paintable in between anyway.
    
    So by bypassing the 2nd emission if nothing was changed, we can make
    GtkImage happy.
    12fedca7