Previous 15994 Revisions Next

r1206 Wednesday 31st October, 2007 at 13:46:55 UTC by R. Belmont
[SDLMESS] More OS X debugger fixes [Ernesto Corvi]
[src/osd/sdl]debugosx.c

src/osd/sdl/debugosx.c
r1205r1206
533533static debugwin_info *debug_window_create(const char *title, void *unused)
534534{
535535   CGDirectDisplayID   mainID = CGMainDisplayID();
536   HIRect            mainBounds;
536537
537538   debugwin_info *info = NULL;
538539   Rect work_bounds;
539   HIRect            mainBounds;
540540   
541541   (void)unused;
542542   
r1205r1206
578578   }
579579   
580580   // 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;
582586   info->minwidth = 200;
583587   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;
586590
587591   // set the default handlers
588592   info->handle_command = global_handle_command;
r1205r1206
30153019{
30163020   debugwin_info *info;
30173021   int bestwidth, bestheight;
3018   Rect bounds;
3022   Rect bounds, work_bounds;
30193023   MenuRef optionsmenu, popupmenu;
30203024   UINT32 cpunum;
30213025   ControlFontStyleRec      style;
r1205r1206
31423146      }
31433147
31443148   // 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;
31463154
31473155   // adjust the min/max sizes for the window style
31483156   bounds.top = bounds.left = 0;
r1205r1206
31563164   info->maxwidth = bounds.right - bounds.left;
31573165
31583166   // 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);
31613169
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;
31663174
31673175   SetWindowBounds(info->wnd, kWindowStructureRgn, &bounds );
31683176

Previous 15994 Revisions Next


© 1998-2018 The MESS Team