From: Pascal Lambrechts <pascal.lambrechts@uclouvain.be>
To: martin rudalics <rudalics@gmx.at>
Cc: "38452@debbugs.gnu.org" <38452@debbugs.gnu.org>
Subject: bug#38452: 26.3; set-frame-position is slightly drifted
Date: Tue, 3 Dec 2019 18:18:43 +0000 [thread overview]
Message-ID: <8436e1b7cu.fsf@PC-1S0-327.i-did-not-set--mail-host-address--so-tickle-me> (raw)
In-Reply-To: <4e51fee7-4c0d-aee8-57fc-6e6bff41fabb@gmx.at>
martin rudalics <rudalics@gmx.at> writes:
> My guess is that Emacs initially sets the parameter values to the
> requested values and asks the window manager to apply them and later
> sets the parameters to what the window manager has applied. If you
> retrieve their values in between these two steps, Emacs reports the
> requested and not the finally realized values.
Make sense. I inserted a (sleep-for 5) in the progn between the
set-frame-position and reading the parameters: in that case again the
value of the parameters are also changed (see the scracth eperiment at
end of mail).
> BTW, I still don't
> know what your window manager is.
I guess it is gdm3 as I entered the following commands:
M-! cat /etc/X11/default-display-manager
==> /usr/sbin/gdm3
M-! ps -e |grep gdm
==> 80 ? 00:00:00 watchdogd
829 ? 00:00:01 rsyslogd
1006 ? 00:00:00 gdm3
1119 ? 00:00:00 gdm-session-wor
1138 tty1 00:00:00 gdm-x-session
9679 ? 00:00:00 gdm-session-wor
9701 tty2 00:00:00 gdm-x-session
>
>
> If we say that the origin for things to display on screen is (-10, -8)
> - something you could probably verify by moving the dock to the right
> and the menu bar line to the bottom - we have a clue. Just that it
> doesn't make sense to me, yet.
Not sure: when I try with (undecorated.t) I get LEFT=0 TOP=(+ -30)
So the left side seems to be at 0.
>
> > If I set-frame-position at (x,y) with 0<=x<=55 and 0<=y<=27 then the
> > frame does not move and the values are reset to (45,19).
> > If I set-frame-position at (60,30) then the frame moved a little bit and
> > the parameters evaluate to (50,22).
>
> These fit into the picture sketched above.
>
> > Here is a scratch file on which I did some experiment commented.
> Fine exercise. Appreciated!
>
>
> (modify-frame-parameters nil '((left . 0) (top . 0) (undecorated . t)))
> yield (to find out whether these 10/8 are due to the decorations)?
>
" LEFT=0 TOP=(+ -30)"
;; This buffer is for text that is not saved, and for Lisp evaluation.
;; To create a file, visit it with <open> and enter text in its buffer.
;; Experiments with set-frame-position and the result values of the parameters left and top of the frame
;; Each parenthesis sexp has been evaluated with C-j = eval-print-last-sexp
(defun pl-lt ()
"Returns a string giving the left/top positions of the current frame"
(concat " LEFT="
(prin1-to-string (frame-parameter nil 'left))
" TOP="
(prin1-to-string (frame-parameter nil 'top))))
;; 4eme experience 2 displays: on left: internal screen=2ndary display , on right: external=primary display with dock and menu on right
;; the frame is located in the internal screen
(display-monitor-attributes-list)
(((name . "HDMI-1") (geometry 1920 0 1920 1080) (workarea 1920 27 1920 1053) (mm-size 521 293) (frames) (source . "Gdk")) ((name . "eDP-1") (geometry 0 0 1920 1080) (workarea 0 0 1920 1080) (mm-size 309 174) (frames #<frame *unsent mail to martin rudalics* 0x5289930> #<frame test-frame-set-position-Martin-1.el 0x624cc90>) (source . "Gdk")))
(set-frame-position nil 0 0)
t
(pl-lt)
" LEFT=(+ -10) TOP=(+ -8)"
(progn (set-frame-position nil 0 0) (pl-lt))
" LEFT=0 TOP=0"
(progn (set-frame-position nil 0 0) (sleep-for 5) (pl-lt))
" LEFT=(+ -10) TOP=(+ -8)"
(modify-frame-parameters nil '((left . 0) (top . 0) (undecorated . t)))
nil
(pl-lt)
" LEFT=0 TOP=(+ -30)"
(modify-frame-parameters nil '((user-position . t) (left . 0) (top . 0)))
nil
(pl-lt)
" LEFT=0 TOP=(+ -30)"
(modify-frame-parameters nil '((user-position . t) (left . 0) (top . 0) (undecorated . nil)))
nil
(pl-lt)
" LEFT=(+ -10) TOP=(+ -8)"
===================================
Best,Pascal
next prev parent reply other threads:[~2019-12-03 18:18 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <84blspbiy0.fsf@PC-1S0-327.i-did-not-set--mail-host-address--so-tickle-me>
2019-12-02 3:14 ` bug#38452: 26.3; set-frame-position is slightly drifted Pascal Lambrechts
2019-12-02 9:41 ` martin rudalics
[not found] ` <84h82iwio0.fsf@PC-1S0-327.i-did-not-set--mail-host-address--so-tickle-me>
2019-12-03 9:40 ` martin rudalics
2019-12-03 15:04 ` bug#38452: [Pascal Lambrechts] " Pascal Lambrechts
2019-12-03 15:59 ` martin rudalics
2019-12-03 18:18 ` Pascal Lambrechts [this message]
2019-12-03 18:37 ` martin rudalics
2019-12-03 18:53 ` Pascal Lambrechts
2019-12-04 9:20 ` martin rudalics
[not found] ` <84eexjjy5g.fsf@PC-1S0-327.i-did-not-set--mail-host-address--so-tickle-me>
2019-12-05 9:06 ` martin rudalics
2019-12-06 9:12 ` Pascal Lambrechts
2019-12-07 9:40 ` martin rudalics
2019-12-07 16:37 ` Pascal Lambrechts
2019-12-08 8:58 ` martin rudalics
2019-12-08 10:02 ` Pascal Lambrechts
2019-12-09 9:20 ` martin rudalics
2022-04-13 2:01 ` Lars Ingebrigtsen
2022-04-13 8:45 ` martin rudalics
2022-04-13 11:55 ` Lars Ingebrigtsen
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=8436e1b7cu.fsf@PC-1S0-327.i-did-not-set--mail-host-address--so-tickle-me \
--to=pascal.lambrechts@uclouvain.be \
--cc=38452@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.