9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: "andrey mirtchovski" <mirtchovski@gmail.com>
To: "Fans of the OS Plan 9 from Bell Labs" <9fans@9fans.net>
Subject: Re: [9fans] 9vx.OSX bug: resize on second display causes window to go wrong
Date: Thu,  3 Jul 2008 08:57:17 -0600	[thread overview]
Message-ID: <14ec7b180807030757u32f499ebvb918df63fdaf1c48@mail.gmail.com> (raw)
In-Reply-To: <509071940807030738r4dae6987j57b3db92bf7606bf@mail.gmail.com>

I think the problem comes from 9vx picking up the main display's
dimensions as the preallocation for "full screen". Drawterm has a fix
for that which loops through all the currently attached displays and
picks up the one with the largest size to decide what the "maximum
dimensions" should be.

here's the relevant code from drawterm:

/* figure out which display is the largest and return its bounds so we can
 * preallocate drawterm's screen to that
 */
Point
get_largest_screen()
{
	CGDirectDisplayID 	*displaylist;
	CGDisplayCount 		displaycount;
	OSErr 				err;
	int i;
	Point max = Pt(0, 0);
	Point curr;
	err = CGGetActiveDisplayList(0, NULL, &displaycount);
	if(err != noErr)
		sysfatal("can not enumerate active displays");

	displaylist = (CGDirectDisplayID *)malloc(displaycount *
sizeof(CGDirectDisplayID));
	if(displaylist == NULL)
		sysfatal("can not allocate memory for display list");

	err = CGGetActiveDisplayList(displaycount, displaylist, &displaycount);
	if(err != noErr)
		sysfatal("can not obtain active display list");

	for(i = 0; i < displaycount; i++) {
		curr.x = CGDisplayPixelsWide(displaylist[i]);
		curr.y = CGDisplayPixelsHigh(displaylist[i]);

		if(max.x < curr.x)
			max.x = curr.x;
		if(max.y < curr.y)
			max.y = curr.y;
	}

	free(displaylist);

	return max;

}
you will need to modify _screeninit() in 9vx/osx/screen.c to something like:

Point max = get_largest_screen();
osx.fullscreenr = Rect(0, 0, max.size.width, max.size.height);

this is tentative. i have no second screen to test right now.

On Thu, Jul 3, 2008 at 8:38 AM, Anthony Sorace <anothy@gmail.com> wrote:
> I have a 10.5 MacBook with an external display attached. When I start
> 9vx, things look normal. I can resize the window on the main display.
> If I move it to the second display and resize, the window goes from
> "good" to "bad":
>
> http://strand1.com/who/anthony/bug/good.png
> http://strand1.com/who/anthony/bug/bad.png
>
> Resizing the window back to the original geometry makes the window "good" again.
>
> Note that this is "just" a display issue. Things within 9vx continue
> to run just fine, and can update the display (although that becomes
> unreliable, especially in the portion of rio windows to the left of
> where they should be). Dragging my mouse over where the rio window
> border should be causes the cursor to turn into the "resize" cursor,
> and resizing works fine, dragging the still-slanted window around.
>
> This happens independent of what's running within 9vx: I see the same
> thing even with no rio.
> Anthony
>
>



  reply	other threads:[~2008-07-03 14:57 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-03 14:38 Anthony Sorace
2008-07-03 14:57 ` andrey mirtchovski [this message]
2008-07-03 15:13   ` Uriel
2008-07-03 15:30     ` andrey mirtchovski
2008-07-03 15:55       ` Uriel
2008-07-03 16:05         ` ron minnich
2008-07-03 16:10           ` [9fans] 9vx.OSX bug: resize on second display causes window to erik quanstrom
2008-07-03 16:25           ` [9fans] 9vx.OSX bug: resize on second display causes window to go wrong underspecified
2008-07-03 16:32             ` andrey mirtchovski
2008-07-03 16:33             ` underspecified
2008-07-03 17:28     ` Russ Cox

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=14ec7b180807030757u32f499ebvb918df63fdaf1c48@mail.gmail.com \
    --to=mirtchovski@gmail.com \
    --cc=9fans@9fans.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).