Ticket #565 (closed defect: fixed)
Opened 3 years ago
Last modified 9 months ago
Debug printf left
| Reported by: | pulkomandy | Owned by: | pulkomandy |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | media-libs/libsdl | Version: | |
| Severity: | normal | Keywords: | |
| Cc: |
Description
In Haiku's current libsdl optional package, there is a BRect printed to stdout each time the window is resized. This only happens with apps that allow resizing, try GrafX2 for example.
Change History
comment:1 Changed 3 years ago by scottmc
comment:2 Changed 3 years ago by augiedoggie
comment:3 Changed 3 years ago by pulkomandy
Here is the output :
BRect(l:0.0, t:0.0, r:1399.0, b:1049.0)
It looks like a BMessage->printToStream, rather than a printf.
I still see it on 1.2.15.
comment:4 Changed 3 years ago by pulkomandy
Patch submitted upstream :
http://bugzilla.libsdl.org/show_bug.cgi?id=1517
comment:5 Changed 3 years ago by scottmc
- Owner changed from scottmc to pulkomandy
Did you test your patch with both sdl1.2.15 and sdl1.3-hg? SDL is prepping for a release of SDL2.0, so it might be nice to get this fix tested and upstreamed soon. Once you are certain the patch is ready to go just ping the SDL mailing list and chances are it'll get looked at and applied quicker.
comment:6 Changed 23 months ago by scottmc
Can this be closed?
comment:7 Changed 23 months ago by pulkomandy
The current patch for SDL 1.2-hg removes the print, but it also removes the screen centering code. As a result, all windows open at (0,0), with the titlebar off screen. Doing it the right way (opening the window on screen center the first time, then resizing it without moving it when needed) needs deeper refactoring. So, this should be cleaned and the part that removes the debug print be merged in our 1.2.14 patch. Not sure what to do with the other part.
The patch for SDL 1.2.14 does not remove the print.
As said in upstream, they won't merge patches for 1.2 anymore. I didn't check the 2.0 code, but since it is a complete rewrite I expect it to not have the problem.
comment:8 Changed 9 months ago by pulkomandy
- Resolution set to fixed
- Status changed from new to closed
Properly fixed now.

Can you paste a sample f the output you are getting? All of the printf occurances in bwindow in libsdl-1.2.15 are commented out, so I suspect it would be fixed with a simple switch to the latest released version. Can you run haikuporter -i libsdl-1.2.15 and see if that indeed does fix it?
/boot/common/develop/haikuports/media-libs/libsdl/work/SDL-1.2.15/src/video/bwindow> grep -nri 'printf' * SDL_sysvideo.cc:222: fprintf(stderr, "We already have mode %dx%d at %d bytes per pixel\n", w, h, index+1); SDL_sysvideo.cc:240: fprintf(stderr, "Adding mode %dx%d at %d bytes per pixel\n", w, h, index+1); SDL_sysvideo.cc:407: // printf("SetFullScreen(%d)\n", fullscreen); SDL_sysvideo.cc:440: // printf("Could not set new mode.\n"); SDL_sysvideo.cc:454: // printf("Going fullscreen\n"); SDL_sysvideo.cc:456: // printf("Going windowed\n"); SDL_sysvideo.cc:466: // printf ("cx = %d, cy = %d\n", cx, cy); SDL_sysvideo.cc:468: // printf("Doing not fullscreen stuff.\n"); SDL_sysvideo.cc:477: // printf("Doing fullscreen stuff."); SDL_sysyuv.cc:68: fprintf(stderr,"GetOverlayBitmap failed height alignment\n"); SDL_sysyuv.cc:69: fprintf(stderr,"- height = %lu, aligned_height = %lu\n",height,aligned_height); SDL_sysyuv.cc:78: fprintf(stderr,"GetOverlayBitmap failed bounds tests\n");