9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: underspecified <underspecified@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: Fri,  4 Jul 2008 01:33:14 +0900	[thread overview]
Message-ID: <ab4cf6420807030933o2607478aiaa2d7db6cba9294@mail.gmail.com> (raw)
In-Reply-To: <ab4cf6420807030925j34f06deat6951b4ffb0751688@mail.gmail.com>

Sorry, I was a bit hasty with the patch. This one should compile properly:

diff -r ca5b26cbe43a src/9vx/osx/screen.c
--- a/src/9vx/osx/screen.c	Tue Jul 01 17:27:41 2008 -0400
+++ b/src/9vx/osx/screen.c	Fri Jul 04 01:31:37 2008 +0900
@@ -513,7 +511,9 @@
 	}else{
 		HideWindow(osx.window);
 		oldwindow = osx.window;
-		BeginFullScreen(&restore, 0, 0, 0, &osx.window, 0, 0);
+		GDHandle device;
+		GetWindowGreatestAreaDevice(osx.window, kWindowTitleBarRgn, &device, NULL);
+		BeginFullScreen(&restore, device, 0, 0, &osx.window, 0, 0);
 		osx.isfullscreen = 1;
 		osx.fullscreentime = msec();
 	}

--underspecified

On Fri, Jul 4, 2008 at 1:25 AM, underspecified <underspecified@gmail.com> wrote:
> Greetings,
>
> Thanks for finding that snippet, andrey :-) I was about to search the
> acme-sac code for it so I could post a patch.
> After looking through the 9vx code, it looks like russ is handling
> memory allocation for the screen a little differently
> than acme-sac (and possibly drawterm).
>
> In acme-sac, I:
>
> * calculate the maximum possible screen size using the function andrey posted
> * allocate a giant block of memory to handle this size once in screeninit()
>
> In 9vx it looks like russ is:
>
> * calculating the new window size on resize event
> * dynamically reallocating the necessary memory for each resize
>
> Perhaps this has something to do with andrey's problems?
>
> --underspecified
>
> P.S. 9vx will only go into fullscreen on the main display.
> The follow fix should work, but I can't test it now, as I am without
> an external monitor.
>
> diff -r ca5b26cbe43a src/9vx/osx/screen.c
> --- a/src/9vx/osx/screen.c      Tue Jul 01 17:27:41 2008 -0400
> +++ b/src/9vx/osx/screen.c      Fri Jul 04 01:20:59 2008 +0900
> @@ -513,7 +511,9 @@
>       }else{
>               HideWindow(osx.window);
>               oldwindow = osx.window;
> -               BeginFullScreen(&restore, 0, 0, 0, &osx.window, 0, 0);
> +               GDHandle device;
> +               GetWindowGreatestAreaDevice(&osx.window,
> kWindowTitleBarRgn, &device, NULL);
> +               BeginFullScreen(&fullScreenRestore, device, 0, 0,
> &osx.window, 0, 0);
>               osx.isfullscreen = 1;
>               osx.fullscreentime = msec();
>
>
> On Fri, Jul 4, 2008 at 1:05 AM, ron minnich <rminnich@gmail.com> wrote:
>> On Thu, Jul 3, 2008 at 8:55 AM, Uriel <uriel99@gmail.com> wrote:
>>> If there was a single codebase shared
>>> across projects none of this would be an issue at all.
>>
>> you are right but it's a hard problem, we're all tight for time, so
>> the only fix is for somebody to step up and do it.
>>
>> But your question, 'wouldn't it be better to have one thing to do all
>> this different stuff', is certainly answered "probably".
>>
>> ron
>>
>>
>



  parent reply	other threads:[~2008-07-03 16:33 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
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 [this message]
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=ab4cf6420807030933o2607478aiaa2d7db6cba9294@mail.gmail.com \
    --to=underspecified@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).