isl-org / isl-org/Open3D

Strange update behaviours of SceneWidget when directly layouted in on_layout

Open
#4,315 2 comments 0 reactions 0 assignees View on GitHub
ui
Dominant language
C++
Stars
14k
Forks
2.6k
Avg merge
5d 18h
Merged PRs (30d)
6

Description

**IMPORTANT: Please use the following template to report the bug.**

Before submitting:

1. Search for [similar issues](https://github.com/isl-org/Open3D/issues).
2. For Python issues, please test with the [latest development wheel](http://www.open3d.org/docs/latest/getting_started.html#development-version-pip). It may be already fixed!
_____

**Describe the bug**

When building my own multipannel viewer using the new gui i obeserve the following strange behavior. The frame property of each widget is updated by my custom on_layout function which is registered to the window using set_on_layout method. When starting the viewer and for example maximize the window the following happens.
1) the top right compas view appears on the maximized window some where in the middle. Respective it stays where it was layouted on the not maximized window and thus overlays the other views which are properly resized. This behaviour is most likely caused by the lines 829 of [`SceneWidget.cpp`](https://github.com/isl-org/Open3D/blob/master/cpp/open3d/visualization/gui/SceneWidget.cpp) file on current master. This line does only update the frame when the frame size has changed but not its position. As the compas widget has constant size and should not change its size it will not be repositioned to its new location top right on the maximized window but stays within the window where it was placed intitally on th the non maximized window.
My current workarround is set frame twice with two differnt clearly distinct sizes. Thereby the second one is the final size the widgets should have on the maximized or when demaximizing on the non maximized window.

2) It seems that the gui window is not cleared before the widgets are redrawn in their new layout. The previous content of the window stays in the background and is over drawn by the widgets in their new position.

**To Reproduce**

Use the attached python script creating the described viewer.
Start the script
Maximize the window
Unmaximize the window

**Expected behavior**

That SceneWidget is moved to its intended position even if its size has not be changed. Make line 829 also check if position of frame has changed not just its size. Or if that is not possible discard this line and do not try to optimize for widgets not changed in size.

**Screenshots**

**Environment (please complete the following information):**

- Operating system: Ubuntu 20.04 (Mint 20)
- Python version: Python 3.8
- Open3D version: 0.13.0
- Is this remote workstation?: no
- How did you install Open3D?: pip
- Compiler version (if built from source): N/A

[wreckout.py.gz](https://github.com/isl-org/Open3D/files/7564398/wreckout.py.gz)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.