unofficial mirror of bug-gnu-emacs@gnu.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: Sun, 9 Apr 2017 21:13:08 +0200	[thread overview]
Message-ID: <CABr8ebbDmgvR2mbW7SyGNyhyN=X_BJ4jy-4zfikkZPht_Y_R8Q@mail.gmail.com> (raw)
In-Reply-To: <m2efx21vls.fsf@aurox.ch>

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

Hi!


> Following your idea, here's an updated patch that works equivalently.
> Please let me know what you think.
>

It looks really good! I've applied it and it works for my use case (placing
the menu bar above the top of the screen) and also for your (the frame
isn't visible at all). Also, I'm sure it will work with L-shaped layouts as
well, even though I haven't tried it.

I've got two minor comments. And when I say "minor" they really are minor,
feel free to disregard them if you like:

* The nsterm.m file is (almost) tab free, so I would appreciate if you
would untabify the code.

* Replace the comment with something like the following:

    // Check that the proposed frame placement is visible in at least
    // one screen.  If it is not, ask the system to reposition it.

If someone doesn't understand what the code does and why, the original
comment doesn't help as it only repeats the algorithm of the code. Also, I
don't see the need to refer to a bug number in the comment, except under
very special circumstances -- that information is available in the git
commit message.


> 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.)
>
> Hm... but what if a second display is in the negative coordinate space?
> How would you place a frame on it programmatically?


You can set the `left' and `top' frame parameters. If they are assigned an
integer they act like `set-frame-position' is supposed to work. However, if
they are assigned `(+ INTEGER)' or `(- INTEGER)' the value is specified
relative to the left (top) or right (bottom) edge of the display,
respectively. This allows a frame to be placed anywhere.


In any case I'll
> try to build the X11 version and see how it does it -- I wasn't aware
> that it still works on Mac OS.
>

It does. I've been using it as "the" reference implementation, whenever the
documentation isn't 100% clear.

    -- Anders

Cheers,
> Charles
>
> >> 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)
>
>

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

  reply	other threads:[~2017-04-09 19:13 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
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 [this message]
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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to='CABr8ebbDmgvR2mbW7SyGNyhyN=X_BJ4jy-4zfikkZPht_Y_R8Q@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 public inbox

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

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 read-only IMAP folder(s) and NNTP newsgroup(s).