From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Anders Lindgren Newsgroups: gmane.emacs.bugs Subject: bug#25818: 25.2; frame moved off display does not return (OS X) Date: Sun, 9 Apr 2017 21:13:08 +0200 Message-ID: References: <58AEA232.4000708@gmx.at> <58B30634.1090904@gmx.at> <58B3DDBA.6060003@gmx.at> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=f403043621d62cc6f7054cc0a6e2 X-Trace: blaine.gmane.org 1491765258 28816 195.159.176.226 (9 Apr 2017 19:14:18 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 9 Apr 2017 19:14:18 +0000 (UTC) Cc: 25818@debbugs.gnu.org To: "Charles A. Roelli" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Apr 09 21:14:14 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cxIHq-0007M4-DX for geb-bug-gnu-emacs@m.gmane.org; Sun, 09 Apr 2017 21:14:10 +0200 Original-Received: from localhost ([::1]:59455 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cxIHw-00054j-8s for geb-bug-gnu-emacs@m.gmane.org; Sun, 09 Apr 2017 15:14:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60008) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cxIHm-00050X-5y for bug-gnu-emacs@gnu.org; Sun, 09 Apr 2017 15:14:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cxIHi-0000CZ-NV for bug-gnu-emacs@gnu.org; Sun, 09 Apr 2017 15:14:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:41879) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cxIHi-0000B9-Im for bug-gnu-emacs@gnu.org; Sun, 09 Apr 2017 15:14:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cxIHh-00050a-S2 for bug-gnu-emacs@gnu.org; Sun, 09 Apr 2017 15:14:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Anders Lindgren Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 09 Apr 2017 19:14:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25818 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 25818-submit@debbugs.gnu.org id=B25818.149176519819182 (code B ref 25818); Sun, 09 Apr 2017 19:14:01 +0000 Original-Received: (at 25818) by debbugs.gnu.org; 9 Apr 2017 19:13:18 +0000 Original-Received: from localhost ([127.0.0.1]:40078 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cxIGz-0004zK-Jd for submit@debbugs.gnu.org; Sun, 09 Apr 2017 15:13:17 -0400 Original-Received: from mail-ua0-f177.google.com ([209.85.217.177]:35752) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cxIGw-0004z6-KN for 25818@debbugs.gnu.org; Sun, 09 Apr 2017 15:13:16 -0400 Original-Received: by mail-ua0-f177.google.com with SMTP id 49so18264738uau.2 for <25818@debbugs.gnu.org>; Sun, 09 Apr 2017 12:13:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=QJLYYKP0dbpvDpjjuPD2ZfS9igLoWVNjPB9SbMu0Emk=; b=mf5g42mJzMz8yzwmc1bhOqobAg1M5e19eNF9wLntcJ7eHpaulvz/SR1ZdzU3tYVzNl xkQ04YY74WrGmvuGZhsPBy/4a8nNdhv7yC0Kt0IYvxCAWVXBy/I3oG0AKp8z1slGYnEk MXs780RxbtY0zfvuL9zQK3Wn38170UUIlVAYDCxV8mi2PsQg+H7Ue2ZedEgR0xi1HW7V PpR9dBNbBVgq/PKFHAeW2I42HBCxHtNm10Cz4GRZxUuNGX69dMCECIzZq2MRCpLCZi+m t55eAXHonVTFAv0Ccg0GBU1mgQE5nYU6KYh52WMTbVLcLsuDdI9bs/c1inbBAvuEvUCP iMNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=QJLYYKP0dbpvDpjjuPD2ZfS9igLoWVNjPB9SbMu0Emk=; b=ZWIfoPNQ2gdmG587hx2HQk+nd45BAh51GXW5e9m3baySuDkag1/CIyZzEQ3A7mh5pI gfHgTv2bpLHguv2v+5yNnGw/s+f9s+o8NQEx2EaJGWvoB+yUesKLqFbJB6k3r2PskxCE Gph2r6oZPvV34sYU6kLjfUZkQQVtPtGLn2vz9mweARh0o8tvlci1adaJe3Sb8xwBOhAS swHpFeU+IHsjsK4bKSH7y7fgG92TNDqa7w1/63xVv4xYYMZi2ks077hNabc5vDIY2w3+ 3ffiYMBszduhITfZ6tRXMuwyO/3HXnd5hcxaeHN++ApdugErk/SFRQ1eNm6imlCcL+jo dZDg== X-Gm-Message-State: AFeK/H0I+Hn3gsgVdsGkCDtujFHr1iI328woEOMlEKfdKfhChD5wFGZzOnu7rOJHPJLafVVvzBLbJNrYgeBjbA== X-Received: by 10.176.92.36 with SMTP id q36mr22866511uaf.93.1491765188935; Sun, 09 Apr 2017 12:13:08 -0700 (PDT) Original-Received: by 10.31.165.71 with HTTP; Sun, 9 Apr 2017 12:13:08 -0700 (PDT) In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:131417 Archived-At: --f403043621d62cc6f7054cc0a6e2 Content-Type: text/plain; charset=UTF-8 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) > > --f403043621d62cc6f7054cc0a6e2 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi!
=C2=A0
> PS. I just found another, unrelated, problem, when comparing the NS an= d 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 t= he Y
> placement wrong with 48 pixels, but that is another story.)

Hm... but what if a second display is in the negative coordinate spa= ce?
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)&#= 39; the value is specified relative to the left (top) or right (bottom) edg= e of the display, respectively. This allows a frame to be placed anywhere.<= /div>


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, whenev= er the documentation isn't 100% clear.

=C2=A0 = =C2=A0 -- 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 an= d brought
>> ;; back.
>> (set-frame-position (selected-frame) 0 -10000)


--f403043621d62cc6f7054cc0a6e2--