all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: <david@ngdr.net>
To: martin rudalics <rudalics@gmx.at>
Cc: "25943@debbugs.gnu.org" <25943@debbugs.gnu.org>
Subject: bug#25943: 21.5  Frame Display Difficulties
Date: Tue, 28 Mar 2017 16:43:08 -0600	[thread overview]
Message-ID: <f11e0586822cab78b35c54434571756e@127.0.0.1> (raw)
In-Reply-To: <58D38075.2030409@gmx.at>

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

Hello Martin,

I have run your frame-position code a few times; I have not had time to do
anything else.

GNU Emacs 25.1.3 (x86_64-unknown-linux-gnu, GTK+ Version 3.18.9) of
2017-03-19
Linux Mint 18.1 Serena (GNU/Linux 4.4.0-53-generic x86_64)

The screenshots show the result of running your code under both 23.2 and
25.1.  As you can see, 23.2 produced the four stacks of three frames as
expected.  Also clear is that three of the four stacks under 25.1 are not
even: there is positional scatter.  What is not clear is that the 25.1
stacks do not always have three frames each.

I modified your code to help me look at what was happening, this code is
attached.  I ran both sets of code several times.  The results are
interesting because the behaviour usually changed from run to run; in
other words the code is not deterministic.

The attached file list-output-unmodified shows output from a 25.1 run that
had 5 frames in the left top corner, 3 frames in the right bottom corner,
and 2 in each of the other corners.  I emphasize that these stack sizes
are not consistent.  I am unable to do anything similar for 23.2 because
function frame-position does not exist in 23.2.

The modified code labels the frames and so it is possible to see which are
the rogue frames in any given run.  A correct run gives the result below,
and it is easy to see how this is correct since 1-4 are the arg frames,
5-8 are par, 9-C are fun, and the position order is LT, LB, RT, RB.  The
9-C frames are on top of the stack, so they are the first that are seen.
LT 951            RT B73
LB A62            RB C84

Here are some results from other runs:
   9651              B73    see list-output-1
   A2                 C84

   BA987651          3    see list-output-2
   2                     C4

   9651              B73
   A2                 C84

   987651            B3
   A2                   C4

Mostly, but not always, the 9-C (fun) frames are consistently in their
correct corner.  This is true for the 1-4 (arg) frames as well; I do not
have any record of a deviation, so arg frames may be perfect.  The 5-8
(par) frames are the deviants, which seem to go the the Left Top corner.

I hope that this helps.  I shall do more as soon as I have time.

David


On Thu, 23 Mar 2017 08:59:49 +0100, martin rudalics <rudalics@gmx.at>
wrote:
>> I'll eventually push a "fix" to the repository but this
>  > will certainly not become part of the Emacs 25 series.
> 
> I've pushed a fix to master now.  So if you can work with master please
> update your copy and set, in your init file, the variable
> `x-gtk-use-window-move' to t and see whether your problem one is fixed
> now.
> 
> To everyone who sets negative frame positions in her programs or init
> file: Please try loading the attached file frame-position.el, evaluate
> it, call `frame-position-make' which will create twelve frames evenly
> distributed among the corners of your screen and finally run the
> function `frame-position-list' whose return value lists position and
> size information about these frames.  Here this gets me a list like
> 
> ((display-pixel-width . 1680)
>   (display-pixel-height . 1050)
>   (arg
>    (p-left . 40)
>    (p-top . 40)
>    (left . 40)
>    (top . 40)
>    (width . 750)
>    (height . 360))
>    ...
> (arg
>    (p-left . -40)
>    (p-top . -40)
>    (left . 904)
>    (top . 564)
>    (width . 750)
>    (height . 360)
>    (r-left . -26)
>    (r-top . -126))
>    ...
>   (fun
>    (p-left . -40)
>    (p-top . -40)
>    (left . 890)
>    (top . 564)
>    (width . 750)
>    (height . 360)
>    (r-left . -40)
>    (r-top . -126)))
> 
> The "arg" frames were produced by supplying sizes and positions via the
> argument list of `make-frame'.  The "par" frames were produced by
> calling `modify-frame-parameters' with the sizes and positions after the
> frame was made and making the frame visible after that.  The "fun"
> frames were produced by setting frame sizes and positions after the
> frame was made and making the frame visible after that.
> 
> p-left stands for the programmed and r-left for the realized left
> position.  p-top and r-top do that for the top position.  Ideally, these
> values are the same, often they aren't.  Here, the difference between
> the "arg" and the "fun" values is that the latter apparently already
> counts in 14 pixels for the scroll bar.
> 
> Besides that, the values are still far from correct on GNU/Linux since
> they do not account for the window manager decorations.  I would be
> interested if people get results that differ from the examples I gave
> above.
> 
> Thanks, martin

[-- Attachment #2: Screenshot from 2017-03-28 12-14-48.png --]
[-- Type: application/octet-stream, Size: 300816 bytes --]

[-- Attachment #3: Screenshot from 2017-03-28 12-12-54.png --]
[-- Type: application/octet-stream, Size: 376881 bytes --]

[-- Attachment #4: frame-position-modified.el --]
[-- Type: text/plain, Size: 3500 bytes --]

(setq x-gtk-use-window-move t)

\f

(defun frame-position-make-frame-arg (p-left p-top id)
  (let ((frame (make-frame `((name . ,id)
                             (p-type . arg)
                             (p-left . ,p-left) (left . ,p-left)
                             (p-top . ,p-top) (top . ,p-top)
                             (width . 80) (height . 20)))))
    frame))

(defun frame-position-make-frame-par (p-left p-top id)
  (let ((frame (make-frame `((name . ,id)
                             (visibility . nil) (p-type . par)
			     (p-left . ,p-left) (p-top . ,p-top)))))
    (modify-frame-parameters frame `((left . ,p-left) (top . ,p-top)
				     (width . 80) (height . 20)))
    (make-frame-visible frame)
    frame))

(defun frame-position-make-frame-fun (p-left p-top id)
  (let ((frame (make-frame `((name . ,id)
                             (visibility . nil) (p-type . fun)
			     (p-left . ,p-left) (p-top . ,p-top)))))
    (set-frame-size frame 80 20)
    (set-frame-position frame p-left p-top)
    (make-frame-visible frame)
    frame))

\f

(defconst  frame-position-frame-list  '())

(defun frame-position-make ()
  (interactive)
  (let (frame)
    (dolist (frame (frame-list))
      (set-frame-parameter frame 'p-type nil)))
  (setq  frame-position-frame-list
         (list
          (frame-position-make-frame-arg  40  40 "1 Left Top")
          (frame-position-make-frame-arg  40 -40 "2 Left Bottom")
          (frame-position-make-frame-arg -40  40 "3 Right Top")
          (frame-position-make-frame-arg -40 -40 "4 Right Bottom")
          (frame-position-make-frame-par  40  40 "5 Left Top")
          (frame-position-make-frame-par  40 -40 "6 Left Bottom")
          (frame-position-make-frame-par -40  40 "7 Right Top")
          (frame-position-make-frame-par -40 -40 "8 Right Bottom")
          (frame-position-make-frame-fun  40  40 "9 Left Top")
          (frame-position-make-frame-fun  40 -40 "A Left Bottom")
          (frame-position-make-frame-fun -40  40 "B Right Top")
          (frame-position-make-frame-fun -40 -40 "C Right Bottom"))) )

\f

(defvar display-pixel-width (display-pixel-width))
(defvar display-pixel-height (display-pixel-height))

(defun frame-position-test-1 (frame)
  (let* ((type (frame-parameter frame 'p-type))
         (name (frame-parameter frame 'name))
	 (p-left (frame-parameter frame 'p-left))
	 (p-top (frame-parameter frame 'p-top))
	 (pos (frame-position frame))
	 (left (car pos))
	 (top (cdr pos))
	 (width (frame-pixel-width frame))
	 (height (frame-pixel-height frame))
	 (list (list type (cons 'name name)
		     (cons 'p-left p-left) (cons 'p-top p-top)
		     (cons 'left left) (cons 'top top)
		     (cons 'width width) (cons 'height height))))
    (when (< p-left 0)
      (let ((r-left (+ (- display-pixel-width) left width)))
	(setq list (nconc list (list (cons 'r-left r-left))))))
    (when (< p-top 0)
      (let ((r-top (+ (- display-pixel-height) top height)))
	(setq list (nconc list (list (cons 'r-top r-top))))))
    (YS
     list))
  )

(defun frame-position-list ()
  (interactive)
  (let ((list (list (cons 'display-pixel-height display-pixel-height)
		    (cons 'display-pixel-width display-pixel-width)))
	frame)
    (dolist (frame (nreverse frame-position-frame-list))
      (when (frame-parameter frame 'p-type)
	(setq list (cons (frame-position-test-1 frame) list))))
    
    list))

\f
;; (eval-buffer)
;; (frame-position-make)
;; (insert (format "\n%s" (pp (nreverse (frame-position-list)))))

[-- Attachment #5: list-output-unmodified --]
[-- Type: text/plain, Size: 1563 bytes --]

This output corresponds to stacks of frames like this:
LT 5 frames
LB 2  ..
RT 2  ..
RB 3  ..

(
 (fun
  (p-left . -40)
  (p-top . -40)
  (left . 1183)
  (top . 704)
  (width . 816)
  (height . 400)
  (r-left . -49)
  (r-top . -48))
 (fun
  (p-left . -40)
  (p-top . 40)
  (left . 1183)
  (top . 32)
  (width . 816)
  (height . 400)
  (r-left . -49))
 (fun
  (p-left . 40)
  (p-top . -40)
  (left . 31)
  (top . 704)
  (width . 816)
  (height . 400)
  (r-top . -48))
 (fun
  (p-left . 40)
  (p-top . 40)
  (left . 31)
  (top . 32)
  (width . 816)
  (height . 400))
 (par
  (p-left . -40)
  (p-top . -40)
  (left . 1183)
  (top . 704)
  (width . 816)
  (height . 400)
  (r-left . -49)
  (r-top . -48))
 (par
  (p-left . -40)
  (p-top . 40)
  (left . -9)
  (top . 30)
  (width . 816)
  (height . 400)
  (r-left . -1241))
 (par
  (p-left . 40)
  (p-top . -40)
  (left . -9)
  (top . 30)
  (width . 816)
  (height . 400)
  (r-top . -722))
 (par
  (p-left . 40)
  (p-top . 40)
  (left . -9)
  (top . 30)
  (width . 816)
  (height . 400))
 (arg
  (p-left . -40)
  (p-top . -40)
  (left . 1181)
  (top . 694)
  (width . 816)
  (height . 400)
  (r-left . -51)
  (r-top . -58))
 (arg
  (p-left . -40)
  (p-top . 40)
  (left . 1181)
  (top . 32)
  (width . 816)
  (height . 400)
  (r-left . -51))
 (arg
  (p-left . 40)
  (p-top . -40)
  (left . 31)
  (top . 694)
  (width . 816)
  (height . 400)
  (r-top . -58))
 (arg
  (p-left . 40)
  (p-top . 40)
  (left . 31)
  (top . 32)
  (width . 816)
  (height . 400))
 (display-pixel-height . 1152)
 (display-pixel-width . 2048))

[-- Attachment #6: list-output-1 --]
[-- Type: text/plain, Size: 1781 bytes --]


(
 (arg
  (name . "1 Left Top")
  (p-left . 40)
  (p-top . 40)
  (left . 31)
  (top . 32)
  (width . 816)
  (height . 400))
 (arg
  (name . "2 Left Bottom")
  (p-left . 40)
  (p-top . -40)
  (left . 31)
  (top . 694)
  (width . 816)
  (height . 400)
  (r-top . -58))
 (arg
  (name . "3 Right Top")
  (p-left . -40)
  (p-top . 40)
  (left . 1181)
  (top . 32)
  (width . 816)
  (height . 400)
  (r-left . -51))
 (arg
  (name . "4 Right Bottom")
  (p-left . -40)
  (p-top . -40)
  (left . 1181)
  (top . 694)
  (width . 816)
  (height . 400)
  (r-left . -51)
  (r-top . -58))
 (par
  (name . "5 Left Top")
  (p-left . 40)
  (p-top . 40)
  (left . -9)
  (top . 30)
  (width . 816)
  (height . 400))
 (par
  (name . "6 Left Bottom")
  (p-left . 40)
  (p-top . -40)
  (left . -9)
  (top . 30)
  (width . 816)
  (height . 400)
  (r-top . -722))
 (par
  (name . "7 Right Top")
  (p-left . -40)
  (p-top . 40)
  (left . 1183)
  (top . 32)
  (width . 816)
  (height . 400)
  (r-left . -49))
 (par
  (name . "8 Right Bottom")
  (p-left . -40)
  (p-top . -40)
  (left . 1183)
  (top . 704)
  (width . 816)
  (height . 400)
  (r-left . -49)
  (r-top . -48))
 (fun
  (name . "9 Left Top")
  (p-left . 40)
  (p-top . 40)
  (left . 31)
  (top . 32)
  (width . 816)
  (height . 400))
 (fun
  (name . "A Left Bottom")
  (p-left . 40)
  (p-top . -40)
  (left . 31)
  (top . 704)
  (width . 816)
  (height . 400)
  (r-top . -48))
 (fun
  (name . "B Right Top")
  (p-left . -40)
  (p-top . 40)
  (left . 1183)
  (top . 32)
  (width . 816)
  (height . 400)
  (r-left . -49))
 (fun
  (name . "C Right Bottom")
  (p-left . -40)
  (p-top . -40)
  (left . 1183)
  (top . 704)
  (width . 816)
  (height . 400)
  (r-left . -49)
  (r-top . -48))
 (display-pixel-height . 1152)
 (display-pixel-width . 2048))

[-- Attachment #7: list-output-2 --]
[-- Type: text/plain, Size: 1781 bytes --]


(
 (arg
  (name . "1 Left Top")
  (p-left . 40)
  (p-top . 40)
  (left . 31)
  (top . 32)
  (width . 816)
  (height . 400))
 (arg
  (name . "2 Left Bottom")
  (p-left . 40)
  (p-top . -40)
  (left . 31)
  (top . 694)
  (width . 816)
  (height . 400)
  (r-top . -58))
 (arg
  (name . "3 Right Top")
  (p-left . -40)
  (p-top . 40)
  (left . 1181)
  (top . 32)
  (width . 816)
  (height . 400)
  (r-left . -51))
 (arg
  (name . "4 Right Bottom")
  (p-left . -40)
  (p-top . -40)
  (left . 1181)
  (top . 694)
  (width . 816)
  (height . 400)
  (r-left . -51)
  (r-top . -58))
 (par
  (name . "5 Left Top")
  (p-left . 40)
  (p-top . 40)
  (left . -9)
  (top . 30)
  (width . 816)
  (height . 400))
 (par
  (name . "6 Left Bottom")
  (p-left . 40)
  (p-top . -40)
  (left . -9)
  (top . 30)
  (width . 816)
  (height . 400)
  (r-top . -722))
 (par
  (name . "7 Right Top")
  (p-left . -40)
  (p-top . 40)
  (left . -9)
  (top . 30)
  (width . 816)
  (height . 400)
  (r-left . -1241))
 (par
  (name . "8 Right Bottom")
  (p-left . -40)
  (p-top . -40)
  (left . -9)
  (top . 30)
  (width . 816)
  (height . 400)
  (r-left . -1241)
  (r-top . -722))
 (fun
  (name . "9 Left Top")
  (p-left . 40)
  (p-top . 40)
  (left . -9)
  (top . 30)
  (width . 816)
  (height . 400))
 (fun
  (name . "A Left Bottom")
  (p-left . 40)
  (p-top . -40)
  (left . -9)
  (top . 30)
  (width . 816)
  (height . 400)
  (r-top . -722))
 (fun
  (name . "B Right Top")
  (p-left . -40)
  (p-top . 40)
  (left . -9)
  (top . 30)
  (width . 816)
  (height . 400)
  (r-left . -1241))
 (fun
  (name . "C Right Bottom")
  (p-left . -40)
  (p-top . -40)
  (left . 1183)
  (top . 704)
  (width . 816)
  (height . 400)
  (r-left . -49)
  (r-top . -48))
 (display-pixel-height . 1152)
 (display-pixel-width . 2048))

  reply	other threads:[~2017-03-28 22:43 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-03  3:51 bug#25943: 21.5 Frame Display Difficulties david
2017-03-03  8:13 ` martin rudalics
     [not found]   ` <af552a322a8a630796cbddf1133b6dbe@127.0.0.1>
2017-03-04  9:59     ` martin rudalics
2017-03-07  1:51       ` david
2017-03-07  9:45         ` martin rudalics
2017-03-08 22:58           ` david
2017-03-09  8:56             ` martin rudalics
2017-03-10 18:44               ` david
2017-03-11 10:21                 ` martin rudalics
2017-03-23  7:59                   ` martin rudalics
2017-03-28 22:43                     ` david [this message]
2017-03-29  7:36                       ` martin rudalics
2017-03-29 19:53                         ` david
2017-03-30  7:29                           ` martin rudalics
2017-04-01  4:35                             ` david
2017-04-01  7:36                               ` martin rudalics
     [not found]                                 ` <7ee8200b866d8067514fb8b0bb9e814b@127.0.0.1>
2017-04-02  7:55                                   ` martin rudalics
2017-04-04  0:35                                     ` david
2017-04-04  7:25                                       ` martin rudalics
2017-04-07  0:12                                         ` david
2017-04-07  5:56                                           ` martin rudalics
2017-04-07 21:16                                             ` david
2022-04-25 14:48                                               ` Lars Ingebrigtsen
2022-05-24 12:50                                                 ` Lars Ingebrigtsen
2017-04-07 21:19                                             ` david
2017-04-08  9:00                                               ` martin rudalics
2017-04-11  6:49                     ` 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=f11e0586822cab78b35c54434571756e@127.0.0.1 \
    --to=david@ngdr.net \
    --cc=25943@debbugs.gnu.org \
    --cc=rudalics@gmx.at \
    /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.