GNU bug report logs - #25818
25.2; frame moved off display does not return (OS X)

Previous Next

Package: emacs;

Reported by: charles <at> aurox.ch (Charles A. Roelli)

Date: Mon, 20 Feb 2017 20:06:02 UTC

Severity: normal

Tags: fixed

Found in version 25.2

Fixed in version 26.1

Done: Alan Third <alan <at> idiocy.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Anders Lindgren <andlind <at> gmail.com>
To: "Charles A. Roelli" <charles <at> aurox.ch>
Cc: 25818 <at> debbugs.gnu.org, martin rudalics <rudalics <at> gmx.at>
Subject: bug#25818: 25.2; frame moved off display does not return (OS X)
Date: Mon, 3 Apr 2017 10:33:04 +0200
[Message part 1 (text/plain, inline)]
Hi!

I think this is a good start. However, there is a case that your patch
miss. If you have multiple monitors arranged in, say, an L-shape, a frame
might be placed inside "multiscreenRect", without actually being visible on
any screen. (This typically occur when you have a large desktop monitor
connected to a laptop or when you have one monitor placed horizontally and
one vertically.)

Fortunately, it should be easy to fix. What about something like (in
pseudo-code):

     BOOL in_any_screen = NO;
     for (screen = /* Loop over all screens */ ...)
       {
         if (overlapping(frame, scree))
           {
              in_any_screen = YES;
              break;
           }
        }
     if ( ! in_any_screen )
       {
         /* Move the frame in */
       }

Anyway, I think that we're on the right track and I appreciate that you
have taken time to work on this!

    -- Anders

PS. I just found another, unrelated, problem, when comparing the NS and X11
versions. When passing a negative value to `set-frame-position' it is
supposed to place the frame relative to the right/bottom border of the
display, but in the NS version it doesn't. (The X11 version gets the Y
placement wrong with 48 pixels, but that is another story.)

On Sun, Apr 2, 2017 at 4:14 PM, Charles A. Roelli <charles <at> aurox.ch> wrote:

> Hi Anders,
>
> Does the attached patch work for you?  It's still a bit rough around the
> edges, but seems to do the right thing.
>
> A quick test on 10.6:
>
> (setq ns-auto-hide-menu-bar t)
>
> ;; Places the frame just above the top of the screen.
> (set-frame-position (selected-frame) 0 -20)
>
> ;; Frame would be completely offscreen; so it's constrained and brought
> ;; back.
> (set-frame-position (selected-frame) 0 -10000)
>
> Cheers,
> Charles
>
>
[Message part 2 (text/html, inline)]

This bug report was last modified 8 years and 17 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.