From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Anders Lindgren Newsgroups: gmane.emacs.bugs Subject: bug#21415: 25.0.50; Emacs Trunk -- pixelwise width/height for x-create-frame Date: Sat, 12 Sep 2015 21:57:35 +0200 Message-ID: References: <55F40854.9070006@gmx.at> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a1142a4045cda67051f923e58 X-Trace: ger.gmane.org 1442087903 451 80.91.229.3 (12 Sep 2015 19:58:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 12 Sep 2015 19:58:23 +0000 (UTC) Cc: Keith David Bershatsky , 21415@debbugs.gnu.org To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Sep 12 21:58:14 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Zaqw6-0002Ag-AX for geb-bug-gnu-emacs@m.gmane.org; Sat, 12 Sep 2015 21:58:10 +0200 Original-Received: from localhost ([::1]:33564 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zaqw5-0007Ag-Ty for geb-bug-gnu-emacs@m.gmane.org; Sat, 12 Sep 2015 15:58:09 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46684) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zaqw1-00079f-S4 for bug-gnu-emacs@gnu.org; Sat, 12 Sep 2015 15:58:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zaqvy-0001IA-5J for bug-gnu-emacs@gnu.org; Sat, 12 Sep 2015 15:58:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:38113) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zaqvy-0001I6-1a for bug-gnu-emacs@gnu.org; Sat, 12 Sep 2015 15:58:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Zaqvx-0003PH-RJ for bug-gnu-emacs@gnu.org; Sat, 12 Sep 2015 15:58: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: Sat, 12 Sep 2015 19:58:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21415 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 21415-submit@debbugs.gnu.org id=B21415.144208786113068 (code B ref 21415); Sat, 12 Sep 2015 19:58:01 +0000 Original-Received: (at 21415) by debbugs.gnu.org; 12 Sep 2015 19:57:41 +0000 Original-Received: from localhost ([127.0.0.1]:58556 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Zaqvb-0003Oh-VW for submit@debbugs.gnu.org; Sat, 12 Sep 2015 15:57:40 -0400 Original-Received: from mail-vk0-f47.google.com ([209.85.213.47]:33136) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZaqvY-0003OY-FG for 21415@debbugs.gnu.org; Sat, 12 Sep 2015 15:57:37 -0400 Original-Received: by vkgd64 with SMTP id d64so41230073vkg.0 for <21415@debbugs.gnu.org>; Sat, 12 Sep 2015 12:57:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=nzr/mgxBLDLQuoijAvSg7ZlxfPnXMe4gGoxFdpUei+Q=; b=hGfD01+ei9+0gLBRO5bZWMttmw+PJqWENvELUNF7uU9PDzPTRKAyTNOVFC5umqrLp9 gP0a6JLNRQUDLUItQLXU0LhlVFz14bKCxJzG4Y1/8T8kNv1csfd//VjihDlBtyOBoCYx l9JQ/0vFH4LBKbXsbbP636Eujz9lk9r3+tMaku1/Tg9tDKqYtQwX1Ej+Bw+v3DMhvSdp 2lnpENUrtAPAmFrc6fuh66NzLKOn7opKKTMXAQKp6NaERFzScAcTBsqNCc+vc/N/RWp7 5UdJbYNFCeIQeK/V65VvNrEvMqlagwiVv+CRvyWvluCHh3vK5WUuVpaYbW3H0ufnWIgJ Yvtg== X-Received: by 10.31.128.78 with SMTP id b75mr5043491vkd.70.1442087855510; Sat, 12 Sep 2015 12:57:35 -0700 (PDT) Original-Received: by 10.31.139.21 with HTTP; Sat, 12 Sep 2015 12:57:35 -0700 (PDT) In-Reply-To: <55F40854.9070006@gmx.at> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x 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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:106462 Archived-At: --001a1142a4045cda67051f923e58 Content-Type: text/plain; charset=UTF-8 Hi Martin and Keith! Unfortunately, removing the suggested lines break another feature. The system is designed so that it should be possible to programmatically place the top of the frame above the top of the screen (when the menu bar is hidden). This is useful to hide the window title so that the full height of the screen can be utilised to edit text. When the suggested patch is applied, this no longer is possible. I would say that the problem is not related to this, but to `make-frame' itself. When a weight higher than the default is specified, it should adjust the window to start further down. As it is today, it always seem to start mid screen. Below is a small test file I have used to test the frame placement features. If you come up with another solution, you can use it to check that it doesn't break existing features. By the way, it's not intended to be loaded, instead follow the comment and evaluate the expression one by one and check that the result is as described in the file. Sincerely, Anders Lindgren ;; 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) ;; ns-frame-test.el ends here. On Sat, Sep 12, 2015 at 1:11 PM, martin rudalics wrote: > > Commenting out the following small segment in `nsterm.m` fixes the > > problem with large frames being created partially above the top of the > > display -- i.e., it is no longer necessary to correct the bug by > > following a `make-frame` with `set-frame-position` (to move it > > squarely onto the screen) when `ns-auto-hide-menu-bar` is set to `t`. > > As it stands now, the default position is `top 0` and `left 0` -- > > perfect! > > > > if (ns_menu_bar_should_be_hidden ()) > > return frameRect; > > That check probably had a purpose. Anders, what's your opinion on > removing it? > > Thanks, martin > --001a1142a4045cda67051f923e58 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi Martin and Keith!

Unfortunately, rem= oving the suggested lines break another feature.

T= he system is designed so that it should be possible to programmatically pla= ce the top of the frame above the top of the screen (when the menu bar is h= idden). This is useful to hide the window title so that the full height of = the screen can be utilised to edit text. When the suggested patch is applie= d, this no longer is possible.

I would say that th= e problem is not related to this, but to `make-frame' itself. When a we= ight higher than the default is specified, it should adjust the window to s= tart further down. As it is today, it always seem to start mid screen.

Below is a small test file I have used to test the fra= me placement features. If you come up with another solution, you can use it= to check that it doesn't break existing features. By the way, it's= not intended to be loaded, instead follow the comment and evaluate the exp= ression one by one and check that the result is as described in the file.

Sincerely,
=C2=A0 =C2=A0 Anders Lindgren<= /div>

;; ns-frame-test.el --- test for NextStep (Mac OS X) frame positi=
oning.

;; Author: Anders Lindgren

;; This file is *not* intended to be loaded int=
o Emacs. Instead, it
;; contains individual expressions that =
should be evaluated one by
;; one, with accompanying manual test st=
eps.

;; Future development:
;;
;; * Add more test cases, like resolutio=
n change, frame stretching
;;   multiple screens, and dragging betw=
een different sized screens.
;;
;; * Automatic testing using a unit test=
 framework, for example ert.
;;
(error &qu=
ot;You should not load this file, read the file comments for details"<=
/span>)

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

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

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

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

;; The following will create a frame taller tha=
n screen. (90 is
;; suitable for a 1200 pixel display, yo=
u mileage may wary.)
;;
;; The frame should not be resized to fi=
t the screen.
(set-frame-size (selected-frame) 80 90)

;; The following should move the frame down a b=
it. 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 th=
e 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. Howev=
er, 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 (u=
nless 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 fram=
e should be placed
;; *below* the menu bar.
(setq ns-auto-hide-menu-bar nil)

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

On Sat, Sep 12,= 2015 at 1:11 PM, martin rudalics <rudalics@gmx.at> wrote:
=
> Commenting out the following small segment in `nsterm= .m` fixes the
> problem with large frames being created partially above the top of the=
> display -- i.e., it is no longer necessary to correct the bug by
> following a `make-frame` with `set-frame-position` (to move it
> squarely onto the screen) when `ns-auto-hide-menu-bar` is set to `t`.<= br> > As it stands now, the default position is `top 0` and `left 0` --
> perfect!
>
>=C2=A0 =C2=A0 =C2=A0if (ns_menu_bar_should_be_hidden ())
>=C2=A0 =C2=A0 =C2=A0 =C2=A0return frameRect;

That check probably had a purpose.=C2=A0 Anders, what's your opinion on=
removing it?

Thanks, martin

--001a1142a4045cda67051f923e58--