[comp.os.minix] MacMinix window positions

paul@ukpoit.co.uk (Paul Wood) (12/18/90)

When MacMinix starts-up there are two windows available. This is great - one
for root and one for a normal login - or whatever you want. The windows,
however, are not located very well on my "venerable" MacPlus. The bottom of
the first window drops off the bottom of the screen, and subsequent windows
are offset downwards and rightwards by five pixels. This make these windows
worse. This is fine for those of us that have larger screens, but every time
I boot MacMinix I have to move the winbdows. My natural lazyness sent me
rooting around looking for a solution.

The following changes are to console.c. They make the original positions of
the windows central on the screen with some of the drag bar (top part of the
window) hidden by the menu. Enough of the drag bar remains to drag or close
the window using the mouse (I tend to not use the mouse at all while operating
MacMinix - this will change when I have written "macsh", more of that in a few
months :-) - if ever :-) ). The bottom of the windows are just above the bottom
of the screen, just what I wanted ...

Here is a context diff of the changes. My apologies if it contains any errors,
but I am typing this in - my MacPlus is not online, also I have just got back
from a Christmas lunch - so let the user beware ...

*** console.orig
--- console.c
***************
*** 35,40 ****
--- 35,43 ----
  #define NROW		25	/* number of lines */
  #define HBORDER	 5	/* horizontal border */
  #define VBORDER	 5	/* vertical border */
+ #define WTOP		30	/* window origin - top */
+ #define WLEFT		 3	/* window origin - left */
+ #define WOFFSET	 0	/* window offset */
  #define CONSOLE	 0	/* console line for kernel printf */
  $define cpychar(r1, c1, r2, c2) \
	vdupaintchar(->vram[(r1 * NCOL) + c1], r2, c2, v->attx[(r1 * NCOL) +c1])
**************
*** 917,923 ***
    if (new) {
      name = "TTY  ";
      name[4] = line + '0';
!     SetRect(&br, 5+(line*5), 40+(line*5), 5+(line*5)+1, 40+(line*5)+1);
      NewWindow(wp, &br, name, FALSE, 8, -1L, TRUE, 1n);
      if (front == 0)
	SendBehind(&v->w, 0L);
--- 920,931 ----
    if (new) {
      name = "TTY  ";
      name[4] = line + '0';
!     SetRect(&br,
!         WLEFT+(line*WOFFSET),
!         WTOP+(line*WOFFSET),
!         WLEFT+(line*WOFFSET)+1,
!         WTOP+(line*WOFFSET)+1
!     );
      NewWindow(wp, &br, name, FALSE, 8, -1L, TRUE, 1n);
      if (front == 0)
	SendBehind(&v->w, 0L);

Paul Wood           | UUCP Mail:  paul@ukpoit.co.uk   | Merry Christmas!
31 Buttermere Drive | Bang-Style: ...!ukc!ukpoit!paul |
Dronfield Woodhouse | Voice:      +44 246 214256      |
Sheffield           | FAX:        +44 246 214353      |
England S18 5PX     | Postline:   5403 4256           |