Repository navigation
arigl on a phone: windows as a list, labels in view - #974
Merged
Merged
Conversation
Driving cyprty as a phone (headless Chrome: 390 x 844 CSS px at pixel ratio 3, real touch events) after #967 showed two things wrong. The conference's windows piled up. The document lays them out for a laptop (My Camera at 20,40, Users at 390,40, Avatar at 20,610), and on a phone each was moved into the view, all onto the same spot, the front one translucent over the others. On a phone (a view under 500 CSS px on its short side) a window whose authored place or size does not fit now opens collapsed, its title bar under the others' from the top of the view: a list of titles over the scene, to open one at a time. Opened, it unfolds from its title, as wide as the view and no taller than the room below. Windows that fit, those with no pos: (the flow), and every view wider than a phone are as before. Labels were cut off in a window that fits its widgets (the Controls window: "UI", "Sen", "Car"). ImGui gives such a window's widgets 16 lines' width, most of a phone's at its UI size, and #967 stops the window at the view's edge, so reserve_label_width's "the window grows to the label" no longer held. There the widget now leaves its label room up to the widest the window can be (the view less ImGui's safe-area padding), which does not depend on the window's own size, so it holds still. cvcgl_imgui_ui_size covers both: the stacked titles, the windows unfolding from them, a slider in a fitting window with nothing to scroll to, and a laptop where nothing opens collapsed.
transfix
added a commit
that referenced
this pull request
Nov 2, 2026
#974 (windows as a list of titles on a phone) and this branch both changed where ImGuiBackend::begin_window opens a window. Both stay: a window that does not fit a phone's view opens collapsed in the list, and one moved in anywhere else keeps its home. A window in the list gets no home: one would pull it back out of the list, on the phone and again when the view grows. reset_layout clears the list count, the last views and the homes. cvcgl_imgui_view_shrink gains the case (it fails without the rule), and section 5.8 says a window in a phone's list stays there.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #967 (arigl on a phone). I drove cyprty, built from master, as a phone: headless Chrome over the DevTools protocol, 390 × 844 CSS px at pixel ratio 3, touch emulation on, and real (trusted) touch events. #967's pieces work there, but two things were wrong.
The conference's windows piled up
The conference document lays its windows out for a laptop: My Camera at (20, 40), Users at (390, 40), Avatar at (20, 610). #967 moves each window into the view, and on a phone that put them all on the same spot, the front one translucent over the others.
Now: on a phone, a window whose authored place or size doesn't fit opens collapsed.
What counts as a phone: a view under 500 CSS px on its short side, either way up. Today's phones are 360 to 430; a tablet or a laptop window is well over.
What is unchanged:
pos:(the flow, §5.8);Labels were cut off in windows that fit their widgets
In the Controls window, "UI size", "Sensitivity" and "Camera distance" showed as "UI", "Sen" and "Car".
Why: ImGui makes a widget 16 lines wide in a window that fits its widgets, which is most of a phone's width at its UI size.
reserve_label_widthskipped such windows on the grounds that the window grows to the label. #967 now stops the window at the view's edge, so it can't grow any more.Now: the widget leaves its label room up to the widest the window can be: the view, less ImGui's safe-area padding on each side. That bound doesn't depend on the window's own size, so it holds still from frame to frame. On a wide view it never applies.
Checked on the emulated phone (cyprty from this branch, against a master relay)
UiSettingsfix. All three labels are now whole.<input>and moves it to the field's caret.Input.insertText, which is what a soft keyboard does) arrives in the field; Backspace deletes.Not covered by the emulation: iOS's rule that only a focus made inside a user gesture raises its keyboard. Chrome focuses outside a gesture too. That still wants a real iPhone.
Tests
cvcgl_imgui_ui_sizenow also checks:Windows (MSVC 14.44, shared, RelWithDebInfo):
ariadne_runtime_test: 248 passed;ariadne_loader_test: 213 passed, 2 skipped.The cyprty wasm builds and links.