all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Anders Lindgren <andlind@gmail.com>
To: "Charles A. Roelli" <charles@aurox.ch>
Cc: 25818@debbugs.gnu.org
Subject: bug#25818: 25.2; frame moved off display does not return (OS X)
Date: Mon, 27 Mar 2017 20:22:00 +0200	[thread overview]
Message-ID: <CABr8ebZWLUqT4+bLcZmnchSLZFee3_v4dJYh7+vLW1uiJskuDg@mail.gmail.com> (raw)
In-Reply-To: <m2wpblqcol.fsf@aurox.ch>

[-- Attachment #1: Type: text/plain, Size: 3254 bytes --]

Hi!

Sorry for not getting back to you immediately.

Anyway, I did try your original patch. Unfortunately, the effect is as I
anticipated. When the patch is applied, if a frame is placed slightly
outside the display area, it will be moved back inside the borders.
Effectively, this means that you can't place the title bar above the top of
the display, which is possible (by design) with an unpatched Emacs. (By the
way, this is possible in Emacs on Windows as well.)

I use OS X 10.10.5 (Yosemite). I have "spaces" disabled, which allows an
Emacs frame to be stretched across multiple monitors.

To solve your problem, and to ensure that we don't break anything for my
use case, we would need to call "[super constrainFrameRect:frameRect
toScreen:screen];" only when the frame is determined to be fully outside
any monitor. This is not rocket science -- just iterate over all monitors
and check that the frame overlap at least one.

Sincerely,
    Anders Lindgren

On Sun, Mar 19, 2017 at 8:38 PM, Charles A. Roelli <charles@aurox.ch> wrote:

> Hi again,
>
> Sorry for taking a while to get back on this.
>
> Looking at this issue again, it would be helpful to know what version of
> OS X you use and whether you see the issue that I described in the first
> message of this thread (*), and also whether the patch I suggested stops
> frames from being placed above the top of the screen.  Because from what
> I can see, I don't see how the patch will prevent you from doing so,
> unless you have "Spaces" turned off.
>
> (*) One quick way of finding out is running something like
>     `(set-frame-position (selected-frame) 0 10000)' (best done from
>     `emacs -Q').  If the moved frame cannot be returned on-screen
>     programmatically, then you have the issue.  If it stays on-screen,
>     then you don't.
>
> My patch got rid of these lines:
>
> -#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_9
> -  // If separate spaces is on, it is like each screen is independent.
> There is
> -  // no spanning of frames across screens.
> -  if ([NSScreen screensHaveSeparateSpaces])
> -    {
> -      NSTRACE_MSG ("Screens have separate spaces");
> -      frameRect = [super constrainFrameRect:frameRect toScreen:screen];
> -      NSTRACE_RETURN_RECT (frameRect);
> -      return frameRect;
> -    }
> -#endif
>
> According to the Apple documentation, screensHaveSeparateSpaces()
> "returns a Boolean value that indicates whether each screen can have its
> own set of spaces.  This method reflects whether the “Displays have
> separate Spaces” option is enabled in Mission Control system
> preference. You might use the return value to determine how to present
> your app when in fullscreen mode."
>
> So the idea of this code was to constrain a frame only if "Spaces" is
> enabled, right?  I assume then, that if you have "Spaces" turned on (but
> even if you don't necessarily use the feature), then frames are
> prevented from going entirely off-screen (which is a must for OS X).
>
> The reason I ask this is because I have no idea whether the problem
> exists in Emacs on newer versions of OS X.  If it doesn't, then the fix
> can be added only for OS X < 10.9.
>

[-- Attachment #2: Type: text/html, Size: 3927 bytes --]

  reply	other threads:[~2017-03-27 18:22 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-20 20:04 bug#25818: 25.2; frame moved off display does not return (OS X) Charles A. Roelli
2017-02-23  8:49 ` martin rudalics
2017-02-26 11:26   ` Charles A. Roelli
2017-02-26 15:40     ` Charles A. Roelli
2017-02-26 16:45       ` martin rudalics
2017-02-26 19:42         ` Charles A. Roelli
2017-02-27  8:05           ` martin rudalics
2017-02-27 10:34             ` Charles A. Roelli
2017-02-27 20:47             ` Charles A. Roelli
2017-02-28 10:12               ` Charles A. Roelli
2017-02-28 13:20               ` Anders Lindgren
2017-02-28 15:05                 ` Charles A. Roelli
2017-02-28 20:35                   ` Anders Lindgren
2017-02-28 22:05                     ` Drew Adams
2017-03-01 10:48                       ` Anders Lindgren
2017-03-01 16:10                         ` Drew Adams
2017-03-19 19:38                     ` Charles A. Roelli
2017-03-27 18:22                       ` Anders Lindgren [this message]
2017-04-02 14:14                         ` Charles A. Roelli
2017-04-03  8:33                           ` Anders Lindgren
2017-04-08 20:40                             ` Charles A. Roelli
2017-04-09 19:13                               ` Anders Lindgren
2017-04-10 19:54                                 ` Charles A. Roelli
2017-04-11 18:35                                   ` Anders Lindgren
2017-04-27 19:14                                     ` Charles A. Roelli
2017-04-27 20:05                                       ` Alan Third
2017-04-28 17:33                                         ` Charles A. Roelli
2017-05-02 20:33                                           ` Alan Third
2017-05-05 18:30                                             ` Charles A. Roelli
2017-04-29 10:30                                       ` martin rudalics
2017-04-29 11:15                                         ` Charles A. Roelli
2017-04-29 14:51                                           ` Alan Third
2017-04-29 17:23                                           ` Anders Lindgren
2017-04-30  8:32                                           ` martin rudalics

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=CABr8ebZWLUqT4+bLcZmnchSLZFee3_v4dJYh7+vLW1uiJskuDg@mail.gmail.com \
    --to=andlind@gmail.com \
    --cc=25818@debbugs.gnu.org \
    --cc=charles@aurox.ch \
    /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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.