src/osd/sdl/debugosx.c
| r1205 | r1206 | |
| 533 | 533 | static debugwin_info *debug_window_create(const char *title, void *unused) |
| 534 | 534 | { |
| 535 | 535 | CGDirectDisplayID mainID = CGMainDisplayID(); |
| 536 | HIRect mainBounds; |
| 536 | 537 | |
| 537 | 538 | debugwin_info *info = NULL; |
| 538 | 539 | Rect work_bounds; |
| 539 | | HIRect mainBounds; |
| 540 | 540 | |
| 541 | 541 | (void)unused; |
| 542 | 542 | |
| r1205 | r1206 | |
| 578 | 578 | } |
| 579 | 579 | |
| 580 | 580 | // fill in some defaults |
| 581 | | mainBounds = CGDisplayBounds( mainID ); |
| 581 | HIWindowGetAvailablePositioningBounds( mainID, kHICoordSpaceScreenPixel, &mainBounds ); |
| 582 | work_bounds.left = mainBounds.origin.x; |
| 583 | work_bounds.top = mainBounds.origin.y; |
| 584 | work_bounds.right = mainBounds.origin.x + mainBounds.size.width; |
| 585 | work_bounds.bottom = mainBounds.origin.y + mainBounds.size.height; |
| 582 | 586 | info->minwidth = 200; |
| 583 | 587 | info->minheight = 200; |
| 584 | | info->maxwidth = mainBounds.size.width; |
| 585 | | info->maxheight = mainBounds.size.height; |
| 588 | info->maxwidth = work_bounds.right - work_bounds.left; |
| 589 | info->maxheight = work_bounds.bottom - work_bounds.top; |
| 586 | 590 | |
| 587 | 591 | // set the default handlers |
| 588 | 592 | info->handle_command = global_handle_command; |
| r1205 | r1206 | |
| 3015 | 3019 | { |
| 3016 | 3020 | debugwin_info *info; |
| 3017 | 3021 | int bestwidth, bestheight; |
| 3018 | | Rect bounds; |
| 3022 | Rect bounds, work_bounds; |
| 3019 | 3023 | MenuRef optionsmenu, popupmenu; |
| 3020 | 3024 | UINT32 cpunum; |
| 3021 | 3025 | ControlFontStyleRec style; |
| r1205 | r1206 | |
| 3142 | 3146 | } |
| 3143 | 3147 | |
| 3144 | 3148 | // get the work bounds |
| 3145 | | mainBounds = CGDisplayBounds( mainID ); |
| 3149 | HIWindowGetAvailablePositioningBounds( mainID, kHICoordSpaceScreenPixel, &mainBounds ); |
| 3150 | work_bounds.left = mainBounds.origin.x; |
| 3151 | work_bounds.top = mainBounds.origin.y; |
| 3152 | work_bounds.right = mainBounds.origin.x + mainBounds.size.width; |
| 3153 | work_bounds.bottom = mainBounds.origin.y + mainBounds.size.height; |
| 3146 | 3154 | |
| 3147 | 3155 | // adjust the min/max sizes for the window style |
| 3148 | 3156 | bounds.top = bounds.left = 0; |
| r1205 | r1206 | |
| 3156 | 3164 | info->maxwidth = bounds.right - bounds.left; |
| 3157 | 3165 | |
| 3158 | 3166 | // position the window at the bottom-right |
| 3159 | | bestwidth = (info->maxwidth < (mainBounds.size.width)) ? info->maxwidth : (mainBounds.size.width); |
| 3160 | | bestheight = (500 < (mainBounds.size.height)) ? 500 : (mainBounds.size.height); |
| 3167 | bestwidth = (info->maxwidth < (work_bounds.right - work_bounds.left)) ? info->maxwidth : (work_bounds.right - work_bounds.left); |
| 3168 | bestheight = (500 < (work_bounds.bottom - work_bounds.top)) ? 500 : (work_bounds.bottom - work_bounds.top); |
| 3161 | 3169 | |
| 3162 | | bounds.left = (mainBounds.origin.x+mainBounds.size.width) - bestwidth; |
| 3163 | | bounds.top = (mainBounds.origin.y+mainBounds.size.height) - bestheight; |
| 3164 | | bounds.right = mainBounds.origin.x + bestwidth; |
| 3165 | | bounds.bottom = mainBounds.origin.y + bestheight; |
| 3170 | bounds.left = work_bounds.right - bestwidth; |
| 3171 | bounds.top = work_bounds.bottom - bestheight; |
| 3172 | bounds.right = bounds.left + bestwidth; |
| 3173 | bounds.bottom = bounds.top + bestheight; |
| 3166 | 3174 | |
| 3167 | 3175 | SetWindowBounds(info->wnd, kWindowStructureRgn, &bounds ); |
| 3168 | 3176 | |