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: Tue, 28 Feb 2017 14:20:55 +0100	[thread overview]
Message-ID: <CABr8ebYagdaSONVmmrYVBoTachfWJzBw-nV89ZXgjA=MJZz23g@mail.gmail.com> (raw)
In-Reply-To: <m2zih72weq.fsf@aurox.ch>


[-- Attachment #1.1: Type: text/plain, Size: 2272 bytes --]

Hi!

I'm the author behind the changes you are discussing.

Emacs 24.3 demonstrates a number of problems when you want to stretch Emacs
across two screens and also when placing the title bar above the top of the
screen (which is very useful when `ns-auto-hide-menu-bar' is non-nil).
Applying the suggested patch would only reintroduce those problems.

A better solution would be to add to code to check if the Emacs frame is
outside any monitor, and then (and only then) call the constrainFrameRect
method of the parent class.

Also, if I remember correctly, 24.3 behaved differently when you had one
monitor compared to multiple monitors. I removed this, as I didn't see the
point of it, and because if introduced an extra level of complexity when it
came to testing.

When it comes to `display-pixel-width', it should return the combined width
of side-by-side monitors, so 24.4 and newer Emacs versions behave correctly.

I have attached a test file I used when I worked with the NS port.

Anyway, I'm glad that you have looked into this. The number of people
actively working on the NS port are close to zero (I threw in the towel
about a year ago, simply because I couldn't find the time I needed to spend
on it). If you are interested in contributing, you can look at the
"NeXTstep port" section of the "TODO" file.

    -- Anders


On Mon, Feb 27, 2017 at 9:47 PM, Charles A. Roelli <charles@aurox.ch> wrote:

> Bisecting between emacs-24.3 and emacs-24.4 led me to commit
> 680e6b8c5a28489733df544edb074fd29d0522a0, which introduces the
> regression.  There is also a possibly related commit two hours later,
> 1269a680862a9bc6cd65e3d26ef05f68c7521632.
>
> Commit 680e6b8c introduces the behavior observed in 24.4, where a frame
> is not constrained to the screen area.  Also interesting is that
> `display-pixel-width' works correctly (for multiple monitors as well,
> that is) in the commit and the commits immediately preceding it, so it
> may only be tangentially related.
>
> I'm attaching the changeset of 680e6b8c and CCing the author.
>
> I looked into constrainFrameRect, and it seems to have different
> behavior depending on whether "Spaces" are available (introduced in OS X
> 10.9 apparently).  Might also have something to with the issue at hand.
>
>

[-- Attachment #1.2: Type: text/html, Size: 2903 bytes --]

[-- Attachment #2: ns-frame-test.el --]
[-- Type: application/octet-stream, Size: 3839 bytes --]

;; ns-frame-test.el --- test for NextStep (Mac OS X) frame positioning.

;; Author: Anders Lindgren

;; This file is *not* intended to be loaded into Emacs. Instead, it
;; contains individual expressions that should be evaluated one by
;; one, with accompanying manual test steps.

;; Future development:
;;
;; * Add more test cases, like resolution change, frame stretching
;;   multiple screens, and dragging between different sized screens.
;;
;; * Automatic testing using a unit test framework, for example ert.
;;
(error "You should not load this file, read the file comments for details")

;; ----------------------------------------
;; Basics
;;

;; Initially, Emacs should be placed under the menu bar.

;; After each test in this section, it should be possible to drag the
;; frame around, but it should not be possible to drag it in under the
;; menu bar.

;; The following should not place the window under the menu bar.
(set-frame-position (selected-frame) 0 -10)

;; The following will create a frame taller than screen. (90 is
;; suitable for a 1200 pixel display, you mileage may wary.)
;;
;; The frame should not be resized to fit the screen.
(set-frame-size (selected-frame) 80 90)

;; The following should move the frame down a bit. It should not be
;; resized to fit the screen.
(set-frame-position (selected-frame) 0 50)


;; ----------------------------------------
;; Auto hide menu
;;

;; In this section, the auto-hide feature of the menu bar is
;; tested. After each step it should be possible do drag the window
;; around. It should not be possible to drag the window from within
;; the screen to above the screen. However, if it already is above the
;; screen, it should be possible to drag it around there.

;; Start with a frame smaller than the screen.
(set-frame-size (selected-frame) 80 50)

;; After this, the menu bar should be hidden (unless the mouse pointer
;; is at the top of the screen).
(setq ns-auto-hide-menu-bar t)

;; This will place the window title *above* the top of the screen (as
;; intended).
(set-frame-position (selected-frame) 0 -10)

;; Frame will be higher than screen.
(set-frame-size (selected-frame) 80 90)


;; ----------------------------------------
;; Exit auto hide menu
;;

;; Redisplay the menu bar. After this, the frame should be placed
;; *below* the menu bar.
(setq ns-auto-hide-menu-bar nil)


;; ----------------------------------------
;; Pixelwise resize.
;;

;; The following tests assums that the Dock is configured to be on the
;; bottom of the screen and in auto-hide mode.


;; ----------
;; Restart Emacs.
;;
;; Evaluate the following. The frame should stretch from the menu bar
;; to four pixels from the bottom.

(progn
  (setq frame-resize-pixelwise t)
  (set-frame-parameter (selected-frame) 'fullscreen 'fullheight))


;; ----------
;; Restart Emcas
;;
;; Evaluate the following. The frame should stretch from the top of
;; the screen to four pixels from the bottom.

(progn
  (setq frame-resize-pixelwise t)
  (setq ns-auto-hide-menu-bar t)
  (set-frame-parameter (selected-frame) 'fullscreen 'fullheight))


;; ----------
;; Restart Emcas
;;
;; Evaluate the following and press the alt-click the green button (it
;; should display a plus). The frame should stretch from the menu bar
;; to four pixels from the bottom.
;;
;; Click again, the frame should conver the entire screen, except the
;; menu bar and four pixels from the bottom.
;;
;; Click again, the frame return to its original size and place.

(setq frame-resize-pixelwise t)


;; ----------
;; Restart Emcas
;;
;; Evaluate the following and press the alt-click the green button (it
;; should display a plus). The frame should stretch from the top to
;; four pixels from the bottom.

(progn
  (setq frame-resize-pixelwise t)
  (setq ns-auto-hide-menu-bar t))

;; ns-frame-test.el ends here.

  parent reply	other threads:[~2017-02-28 13:20 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 [this message]
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
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='CABr8ebYagdaSONVmmrYVBoTachfWJzBw-nV89ZXgjA=MJZz23g@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.