-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
ImGui windows don't render when screen is small (too short) #72470
Comments
I did a bit of testing on this one. A couple of observations:
simplescreenrecorder-2024-03-17_22.25.53.mp4(I also checked that the behaviour was the same prior to #72353) |
A bit more testing, unfortunately still inconclusive. This feels like an issue where the ui_adaptor is made too big for the window and fails to draw (see, e.g. #52688), but I don't really have any evidence to back that up, and can't find where it might be going wrong. To back up my previous assertion that this is Tiles only, here's an example of the keybindings screen showing up in Curses at 80x24: To see if the window is being sized correctly I added a bunch of size checks to demo_ui::draw_controls() . You can see that at a height of 976 pixels, the screen works. At 975 pixels, it breaks. However, SDL, ImGui, and the numbers being given to the underlying ui_adaptor all seem to make sense for a screen height of 975 pixels. One note is that on Curses, demo_ui only shows the ImGui demo screen. This screen that I populated with information for testing does not show up in Curses. Is that relevant? Maybe? Have I figured out why? No. |
I just noticed that in-game keybindings don't work either, nor a new screen I made (when the height is too small). I wrongly assumed they did work. |
best i can tell, something is going wrong internal to imgui. below a certain window size, imgui simply stops rendering. input gets handled silently, but it's like the SDL backend just kicks the bucket. resizing the window forces a single draw operation to happen, otherwise you get nothing. |
Spent a few more minutes looking at it, this actually is a CDDA problem, sorry. Because the actual ImGui drawing code was moved into ui_manager::redraw_invalidated, when redraw calls happen too far from calls to refresh_display, then the ImGui window is not actually updated on the screen - this seems to happen when the window is small. We need to either fix the way rendering is done on SDL, or add a hack to force refresh_display to be called every time ui_manager::redraw_invalidated is called. |
Describe the bug
When you (click / press key) to open a window in the main menu, it looks like nothing happened, just as if the input broke, since you cannot see the selection moving and sound pinging. When you resize the game window, the ImGui window shows up.
The keybinding and popup windows both fail to render.
Attach save file
N/A
Steps to reproduce
widthheight to very small (actually 1000px is around the braking point)Expected behavior
Windows always render even with the smallest size CDDA supports.
Screenshots
Versions and configuration
Dark Days Ahead [dda],
Disable NPC Needs [no_npc_food],
Portal Storms Ignore NPCs [personal_portal_storms],
Slowdown Fungal Growth [no_fungal_growth]
]
Additional context
I don't know what is the version doing. I am recompiling on master, stashing everything, editing files to bump their edit date and editing them back so that VS recompiles it.
Rebuilding the whole project.
Still the "version" is garbage.
This report should be better, but I am gonna go to sleep now.
The text was updated successfully, but these errors were encountered: