all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: martin rudalics <rudalics@gmx.at>
To: Ryan Prior <ryanprior@gmail.com>
Cc: 21348@debbugs.gnu.org
Subject: bug#21348: bug#21469: bug#21348: 25.0.50; Screen scaling factor >=2 causes menus, tooltips to display in the wrong place
Date: Wed, 14 Oct 2015 10:49:47 +0200	[thread overview]
Message-ID: <561E172B.8010500@gmx.at> (raw)
In-Reply-To: <CAHDL8odeS36QM4WZRwSc-+BtSX_5FCWiuOA5sMGaHTsWFJ8qPw@mail.gmail.com>

 >>   Can you try again with the
 >> ‘user-position’ frame parameter non-nil?
 >
 > The behavior is identical.

So Unity seems to ignore ‘user-position’.  Can you manually move
(mouse-drag) the frame to the left edge?  Did you ever try to tweak the
window placement settings in the Compiz Setting Manager?

 >> You mean on a subsequent attempt the frame is flushed left or still at
 >> position 20.  What happens when you try something similar with the ‘top’
 >> parameter?
 >
 > The frame is never flush left except during brief flash. Immediately
 > afterward, and subsequent to each additional call, the actual frame
 > position is offset by 20 pixels. This is true for top just as it is
 > for left.

I could imagine Unity to not allow the frame enter a 20 pixels zone if
there's some launcher or panel there.  But why should it move a frame
from position 500 to 520?  That simply doesn't make sense.  BTW, does
maximizing the frame horizontally work?  What does evaluating

(set-frame-parameter nil 'fullscreen 'fullwidth)

give?

 >> Does that mean the offset of 20 pixels appears with scaling turned off
 >> and on?
 >
 > Not quite. With scaling at 2x, the offset is 20 pixels. With scaling
 > at 1x, the offset is 10 pixels.

And with scalings 1.5, 2.5 and 3 you consistently get 15, 25 and 30?  If
so then we can conclude that the frame position does not scale with the
x-coordinate Emacs supplies but shifts by the scale factor times ten.

 > The answer, on Ubuntu Trusty with Unity (Compiz) window manager, is
 > that it depends on which virtual desktop you are on. I have four
 > virtual desktops laid out in a 2x2 grid, which I'll refer to clockwise
 > like so:
 >
 > [1][2]
 > [4][3]
 >
 > On desktop 1, it behaves the same as for a frame which is smaller than
 > the screen size and not flush with the right screen edge: offset of
 > (10*scale) pixels when positioning left or top, doesn't appear to
 > "stick" to anything.

So it can't go more to the left or upwards due to the 10*scale
restriction, I suppose.

 > On desktop 2, positioning top behaves the same as desktop 1, but
 > positioning left results in a frame flush with the left screen edge.
 > This is not true of frames smaller than the screen size, which I
 > previously tested on each virtual desktop and displayed consistent
 > behavior.

You mean that a large frame on desktop 2 gets flushed left, a smaller
one gets still set off at the 10*scale position.

 > On desktop 4, we see a symmetric behavior where positioning left
 > behaves the same as desktop 1, but positioning top results in a frame
 > flush with the screen top edge.

Sounds consistent.

 > On desktop 3, positioning both left and top results in a frame flush
 > with the respective screen edge, and I observed an additional curious
 > behavior. Each call to set the top position also decreases the left
 > position by a small amount, if the number of pixels specified as the
 > top position is small. In the range of 10-30, it budged the left side;
 > in the range of 100-500, it didn't.

In all these calls did you also specify a left position or did you only
specify the top position?

 > When I came to write up my results, I decided to try to pin down
 > exactly where the cut-off was between values which would or wouldn't
 > budge the frame to the left, so I restarted emacs and set about trying
 > to reproduce it. But I can't. This time around, a frame larger than
 > the screen behaves in all ways as I described for desktop 1.

That is the behavior on desktop 4 is the same as the behavior on desktop
1: A 10*scale pixel zone on the left and the top are left free?

 > This test could be exercising some little-tested code paths in Emacs,
 > Unity, or both.

Apart from occasional specifications like (0, 0) or a user supplied
position, Emacs never tries to enforce a particular frame position.
Also, Emacs nowhere samples the screen size in order to get a fitting
initial size of the frame.  The default size of the initial frame is
80x35 characters, hardcoded somewhere in frame.c.

So all this positioning stuff should be in Unity.  How they could
possibly have coded such a thing is a mystery to me.

 >> And does ‘set-mouse-absolute-pixel-position’ work normally?
 >
 > In fact, mouse-set-absolute-pixel-position works flawlessly as
 > expected. If I set the frame left position to 0 and the mouse x
 > position to (10*scale), they line up precisely.

OK.  One problem less to care about.

 > Similarly, I can set
 > the mouse position to (0,0) with no problem.

‘set-mouse-absolute-pixel-position’ operates on the "default root
window" of the selected frame's display.  Does
‘set-mouse-pixel-position’ also work as expected?  For example, does

(set-mouse-pixel-position (selected-frame) 0 0)

correctly move the mouse pointer to a position right under the start of
the menu or tool bar?

martin






      reply	other threads:[~2015-10-14  8:49 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-25 22:51 bug#21348: 25.0.50; Screen scaling factor >=2 causes menus, tooltips to display in the wrong place Ryan Prior
2015-08-26  2:48 ` Eli Zaretskii
2015-08-26  8:56   ` martin rudalics
2015-08-26 15:33     ` Eli Zaretskii
2015-08-26 16:07       ` Glenn Morris
2015-08-27  7:58       ` martin rudalics
2015-08-26  8:56 ` martin rudalics
2015-10-12 21:10 ` bug#21469: " Ryan Prior
2015-10-13 15:51   ` bug#21348: " martin rudalics
2015-10-13 16:34     ` bug#18429: " Ryan Prior
2015-10-13 17:21       ` bug#20619: " martin rudalics
2015-10-13 20:37         ` bug#21348: " Ryan Prior
2015-10-14  8:49           ` martin rudalics [this message]

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=561E172B.8010500@gmx.at \
    --to=rudalics@gmx.at \
    --cc=21348@debbugs.gnu.org \
    --cc=ryanprior@gmail.com \
    /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.