| Summary: | Linux X11 message boxes 32 lines or longer display newlines as vertical tabs | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Daniel Bokser <dan.bokser> |
| Component: | video | Assignee: | Ryan C. Gordon <icculus> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | dan.bokser, icculus |
| Version: | 2.0.9 | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Attachments: |
screenshot
sample program |
||
Created attachment 3367 [details]
sample program
Apologies, I was assuming that the latest LTS ubuntu had 2.0.8, when in fact it has 2.0.4. Putting this into waiting until I can test on 2.0.8 tonight Confirmed this issue happens in 2.0.8 and the latest repo pull (2.0.9) on Ubuntu 16.04 LTS. Reopening... Found the reason for this. In SDL_x11messagebox.c it looks like the maximum number of lines is 32
>#define MAX_TEXT_LINES 32 /* Maximum number of text lines supported */
Increasing this value fixes my problem. I could not find any documented reason for this limit. The SDL_ShowMessageBox page does not document this limitation either.
What is the reason for this limit?
(In reply to Daniel Bokser from comment #4) > What is the reason for this limit? Probably an assumption that it would be more than anyone would need, since it specifies the size of a static array. To be clear, 32 lines in a messagebox is probably more than one should put in a messagebox, but who am I to dictate absolute limits? This is fixed now, in https://hg.libsdl.org/SDL/rev/cf64a70ad02a Thanks! --ryan. Thanks for the fix Ryan! Works perfect for me. Yea, agreed that 32 lines should be more than enough for a message box, but I am currently using it as a stop-gap to display controls for my emulator until I have a proper UI. |
Created attachment 3366 [details] screenshot I am running into a bug where i have a fairly large which is longer than 31 lines. After line 31, newlines are replaced with the vertical tab character (shown as VT). I have this issue only on X11. It looks fine on Mac and Windows. I have attached a screenshot and sample program.