To: vim-dev@vim.org Subject: Patch 5.6a.016 (extra) Fcc: outbox From: Bram Moolenaar ------------ Patch 5.6a.016 (extra) Problem: Mac: Window size is restricted when starting. Cannot drag the window all over the desktop. Solution: Get real screen size instead of assuming 640x400. Do not use a fixed number for the drag limits. (Axel Kielhorn) Files: src/gui_mac.c *** ../vim-5.6a.15/src/gui_mac.c Mon Dec 20 09:59:11 1999 --- src/gui_mac.c Thu Dec 30 10:07:36 1999 *************** *** 22,27 **** --- 22,30 ---- #ifdef USE_AEVENT # include #endif + #if UNIVERSAL_INTERFACES_VERSION >= 0x0330 + # include + #endif #define kNothing 0 #define kCreateEmpty 2 /*1*/ *************** *** 637,654 **** } /* ! * Allow 10 pixels for horizontal borders, 30 for vertical borders. ! * Is there no way in X to find out how wide the borders really are? */ void gui_mch_get_screen_dimensions(screen_w, screen_h) int *screen_w; int *screen_h; { ! /* TODO: Go get the real screen dimension ! * add live udate of those value on suspend/resume */ ! *screen_w = 640 - 10; ! *screen_h = 400 - 30; } /* Convert a string representing a point size into pixels. The string should --- 640,660 ---- } /* ! * Get the screen dimensions. ! * Allow 10 pixels for horizontal borders, 40 for vertical borders. ! * Is there no way to find out how wide the borders really are? ! * TODO: Add live udate of those value on suspend/resume. */ void gui_mch_get_screen_dimensions(screen_w, screen_h) int *screen_w; int *screen_h; { ! GDHandle dominantDevice = GetMainDevice(); ! Rect screenRect = (**dominantDevice).gdRect; ! ! *screen_w = screenRect.right - 10; ! *screen_h = screenRect.bottom - 40; } /* Convert a string representing a point size into pixels. The string should *************** *** 1365,1371 **** break; case (inDrag): ! SetRect (&movingLimits, 0, 0, 832, 624); DragWindow (whichWindow, theEvent->where, &movingLimits); break; --- 1371,1378 ---- break; case (inDrag): ! /* SetRect (&movingLimits, 0, 0, 832, 624); */ ! movingLimits = (*GetGrayRgn())->rgnBBox; DragWindow (whichWindow, theEvent->where, &movingLimits); break; *** ../vim-5.6a.15/src/version.c Wed Dec 29 12:19:30 1999 --- src/version.c Thu Dec 30 10:15:26 1999 *************** *** 420,421 **** --- 420,423 ---- { /* Add new patch number below this line */ + /**/ + 16, /**/ -- BEDEVERE: Wait. Wait ... tell me, what also floats on water? ALL: Bread? No, no, no. Apples .... gravy ... very small rocks ... ARTHUR: A duck. "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD --/-/---- Bram Moolenaar ---- Bram@moolenaar.net ---- Bram@vim.org ---\-\-- \ \ www.vim.org/iccf www.moolenaar.net www.vim.org / /