This fixes a bug with the captured background being wrong when using double buffering. Also it ensures that for example the clock in the status bar is updated when the context menu is open.