Skip to content

Commit

Permalink
Fix dialogs flickering when dismissed on Mac (#2817)
Browse files Browse the repository at this point in the history
* Fix dialogs flickering when dismissed on Mac

* Add explanatory comment
  • Loading branch information
errissa authored Dec 24, 2020
1 parent c7de912 commit 68e0ab3
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions cpp/open3d/visualization/gui/Window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -690,6 +690,15 @@ void Window::CloseDialog() {
impl_->active_dialog_.reset();

ForceRedrawSceneWidget();

// Closing a dialog does not change the layout of widgets so the following
// is not necessary. However, on Apple, ForceRedrawSceneWidget isn't
// sufficent to force a SceneWidget to redraw and therefore flickering of
// the now closed dialog may occur. SetNeedsLayout ensures that
// SceneWidget::Layout gets called which will guarantee proper redraw of the
// SceneWidget.
SetNeedsLayout();

// The dialog might not be closing from within a draw call, such as when
// a native file dialog closes, so we need to post a redraw, just in case.
// If it is from within a draw call, then any redraw request from that will
Expand Down

0 comments on commit 68e0ab3

Please sign in to comment.