Skip to content
  • Alexander Larsson's avatar
    gdkwindow: Allow gdk_window_set_opacity on non-native children · 4d3c77f9
    Alexander Larsson authored
    We now store the current opacity for all windows. For native windows
    we just call into the native implementation whenever the opacity changes.
    However, for non-native windows we implement opacity by pushing a
    second implicit paint that "stacks" on the existing one, acting as
    an opacity group while rendering the window and its children.
    
    This works well in general, although any native child windows will of
    course not be opaque. However, there is no way to implement
    implicit paint flushing (i.e. draw the currently drawn double buffer
    to the window in order to allow direct drawing to the window).
    We can't flush in the stacked implicit paint case because there
    is no way to get the right drawing behaviour when drawing directly
    to the window. We *must* draw to the opacity group to get the right
    behaviour.
    
    We currently flush if:
    * A widget disables double buffering
    * You call move/resize/scroll a window and it has non-native children
      during the expose handler
    
    In case this happens we warn and flush the outermost group, so there may
    be drawing errors.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=687842
    4d3c77f9