-
-
Notifications
You must be signed in to change notification settings - Fork 10.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adjust viewport work area for mobile platforms #7823
Comments
It seems adequate to modify the monitor WorkPos/WorkSize values to convey this. Monitor data is submitted by backends already. But maybe it is going to be more practical for backend or user app to fill a separate field that I don’t know. It would depend on where the data comes up and if it is easy for us to add it to many backends. |
Thanks for the quick reply! I looked into setting the Monitor data, but it is ignored for this purpose (and I think correctly so). Window Pos/Size are synchronized between ImGui and the backend as the window could be technically anywhere. If the app isn't fullscreen (e.g. split mode with two apps), then the monitor WorkArea wouldn't make sense to apply. iOS exposes this as a view property which makes sense to me. While uncommon, mobile devices can have multiple screens/views and there are view settings to show/hide these extra elements. It's also unusual compared to the desktop paradigm that this space is shared between app and system. The app can render there, and it will be displayed behind the system contents. The design I would investigate is a new Platform callback to query the WorkPos/WorkArea. It's easy to leave them as nullptr, and the system work as it is today. |
…top-right0 into WorkInset (positive everywhere). (#7823)
This is working for me on iOS and expected Android should be fine as well - thanks! One minor issue is that |
Fixed with 7b6314f |
Version/Branch of Dear ImGui:
v1.90.8-docking
Back-ends:
custom
Compiler, OS:
NA
Full config/build information:
No response
Details:
I would like for ImGui applications to respect the mobile work area constraints (e.g. status bar, navigation bar, notch). I think that the existing machinery is sufficient but I am not sure there is an API/path for the backend to communicate requirements.
MainPos
/MainSize
+WorkPos
/WorkSize
to indicate where it is safe for Windows to exist.WorkPos
/WorkSize
used for ImGui constructs like the menu bar.Maybe for mobile, the Monitor MainArea == Monitor WorkArea, but the viewport WorkArea is inset as needed by a value provided by the backend?
Screenshots/Video:
No response
Minimal, Complete and Verifiable Example code:
No response
The text was updated successfully, but these errors were encountered: