See https://www.klayout.de/forum/discussion/2365/problem-with-saving-screenshots-while-changing-layers-groups-visibility#latest for ongoing discussion.
Technically the reason for the problem is that LayoutViewBase::refresh down in the call chain sometimes skips set_view_ops if the view is not active. But calling "update_content" in that case should fix the problem as a workaround.
See https://www.klayout.de/forum/discussion/2365/problem-with-saving-screenshots-while-changing-layers-groups-visibility#latest for ongoing discussion.
Technically the reason for the problem is that
LayoutViewBase::refreshdown in the call chain sometimes skipsset_view_opsif the view is not active. But calling "update_content" in that case should fix the problem as a workaround.