all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: martin rudalics <rudalics@gmx.at>
To: Trevor Spiteri <tspiteri@ieee.org>, 40817@debbugs.gnu.org
Subject: bug#40817: 27.0.91; setting frame parameter '(left - 0) leaves gap to the right under GTK
Date: Fri, 24 Apr 2020 19:55:04 +0200	[thread overview]
Message-ID: <956c9571-f688-9122-52bd-e6fee7b6322f@gmx.at> (raw)
In-Reply-To: <34de64f4-564b-936a-2728-b9763b475aad@ieee.org>

 > If I evaluate this when using GTK
 >
 > (modify-frame-parameters nil '((left - 0)))
 >
 > there is a gap to the right of the frame equal to the total size of the
 > horizontal window decorations.
 >
 > I tried to debug this and this is what I found. (This is what I think
 > causes the bug.)
 >
 > This calls xterm.c:x_set_offset with f->left_pos = 0 and
 > f->size_hint_flags = XNegative.
 >
 > This in turn calls xterm.c:x_calc_absolute_position. Here, the edges are
 > found using Fx_frame_edges ( frame, Qouter_edges), and the width of the
 > frame *with* decorations is thus used. Then, f->left_pos is set to
 > display_pixel_width - width_including_decorations + 0.
 >
 > Back in x_set_offset, x_gtk_use_window_move is used to move the window;
 > there is a function call to
 >
 > gtk_window_move (..., f->leftpos / scale, ...)
 >
 > However, gtk_window_move seems to be correcting for window decorations
 > itself, so that if we are to use gtk_window_move,
 > x_calc_absolute_position should have used the width *without* window
 > decorations.
 >
 > I can reproduce this in Emacs 26, so it is not an Emacs 27 regression.

 > Thinking about this a bit more, it is not clear to me what the frame
 > decorations actually are: are they a solid outside border, or a shadow
 > added by the window manager, or both? And I'm thinking the issue I'm
 > seeing is caused by the shadow under GNOME, but if there is a solid
 > border, the current behaviour would be correct maybe?

I suppose this happens with GNOME shell and the mutter window manager.

Most window managers draw a solid outer border which can be turned off
optionally.  But mutter "draws" an invisible outer border (IIRC Windows
10 does the same) which causes all sorts of problems.  For example, if
you ask mutter to position a frame at (0, 0) of your display, it will
apparently put it there but report a position of (-10, -8) which is
where the invisible borders start (compare Bug#38452).

Such invisible borders make calculated frame positioning difficult.  For
example, positioning two frames side by side to fill the whole display
becomes a real pain.  Note that Emacs also has a method to "correct"
such incorrect positioning but that works for Lucid and Motif only.  And
it's completely useless for invisible borders because it would put a
frame Emacs wants to position at (0, 0) at (10, 8) which is probably not
what the user wants.

Your scenario demonstrates that such invisible borders make putting a
frame at the right or bottom edge of the display hard as well.

martin





  parent reply	other threads:[~2020-04-24 17:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-24 13:36 bug#40817: 27.0.91; setting frame parameter '(left - 0) leaves gap to the right under GTK Trevor Spiteri
     [not found] ` <handler.40817.B.15877354202944.ack@debbugs.gnu.org>
2020-04-24 14:44   ` bug#40817: Acknowledgement (27.0.91; setting frame parameter '(left - 0) leaves gap to the right under GTK) Trevor Spiteri
2020-04-24 17:55 ` martin rudalics [this message]
2020-04-29 14:12   ` bug#40817: 27.0.91; setting frame parameter '(left - 0) leaves gap to the right under GTK Robert Pluim
2020-04-29 15:03     ` martin rudalics
2020-04-29 16:51       ` Robert Pluim

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=956c9571-f688-9122-52bd-e6fee7b6322f@gmx.at \
    --to=rudalics@gmx.at \
    --cc=40817@debbugs.gnu.org \
    --cc=tspiteri@ieee.org \
    /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.