wayfire
wayfire copied to clipboard
view_3D: use a sensible default for depth scale
Fixes #1359
This is a workaround that avoids a segfault if output is null by using a default value for "size". I'm assuming that a view without an output will not be rendered, so the actual value does not really matters.
Notice: Wayfire's development is temporarily happening in the stabilize-api
branch. If you open a pull request for the master branch, it will likely not be merged before the stabilize-api branch is itself merged into master.
Looking at this again, I have the feeling we must be doing something wrong, but I don't know what :/ This seems more like a hack to get it working, not a real solution (the current state of the code isn't any better)
My intuition is that the correct value for the depth scale should depend on the relation between the distance the user's eyes are from the screen and the physical size of the display. But since the output is 2D content, there is likely a broader range of values that look reasonably well, so maybe any dependence on screen size could be avoided?
I submitted a slightly better fix in #1883, thanks for this PR nonetheless :)