unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#31880: 26.1; VC mode line popup when clicked is off screen
@ 2018-06-18 14:59 Brian Zwahr
  2018-06-19  7:17 ` martin rudalics
  0 siblings, 1 reply; 21+ messages in thread
From: Brian Zwahr @ 2018-06-18 14:59 UTC (permalink / raw)
  To: 31880

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

When I use Emacs via the GUI and I maximize the window, clicking on a
git branch in the mode line of a buffer produces the actions popup, but
it is unusable because it is either squished at the bottom of the screen
or it extends off the buttom of the screen. If I make the Emacs frame
smaller so that the bottom of the frame is not at the bottom of the
screen, then I get a usable scrollable list of VC actions when I click
the git branch information in the mode line.

It seems like this popup always popups up below/beneath/downward of the
Emacs frame. Instead, if the bottom of the frame is at the bottom of the
screen (or close to it even, maybe?), then the VC popup should display
above/upwards. 


In GNU Emacs 26.1 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.22.30)
 of 2018-05-29 built on lcy01-amd64-029
Windowing system distributor 'The X.Org Foundation', version 11.0.11906000
System Description:	Pop!_OS 18.04 LTS

Recent messages:
Loading /home/echosa/.emacs.d/emacs-config.el (source)...
Loading /home/echosa/.emacs.d/custom.el (source)...done
Loading /home/echosa/.emacs.d/emacs-config.el (source)...done
Loaded /home/echosa/.emacs.d/emacs-config.el
Initialization done. (1.384s)
Wrote /home/echosa/.emacs.d/.emacs.desktop.lock
Desktop: 4 frames, 11 buffers restored.
For information about GNU Emacs and the GNU system, type C-h C-a.
Quit
Type C-x 1 to remove help window.  

Configured using:
 'configure --build=x86_64-linux-gnu --prefix=/usr
 '--includedir=${prefix}/include' '--mandir=${prefix}/share/man'
 '--infodir=${prefix}/share/info' --sysconfdir=/etc --localstatedir=/var
 --disable-silent-rules '--libdir=${prefix}/lib/x86_64-linux-gnu'
 '--libexecdir=${prefix}/lib/x86_64-linux-gnu' --disable-maintainer-mode
 --disable-dependency-tracking --prefix=/usr --sharedstatedir=/var/lib
 --program-suffix=26 --with-modules --with-file-notification=inotify
 --with-mailutils --with-x=yes --with-x-toolkit=gtk3 --with-xwidgets
 --with-lcms2 'CFLAGS=-g -O2
 -fdebug-prefix-map=/build/emacs26-pCvJBp/emacs26-26.1~1.git07f8f9b=. -fstack-protector-strong
 -Wformat -Werror=format-security -no-pie' 'CPPFLAGS=-Wdate-time
 -D_FORTIFY_SOURCE=2' 'LDFLAGS=-Wl,-Bsymbolic-functions -Wl,-z,relro
 -no-pie''

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GSETTINGS NOTIFY
LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB
TOOLKIT_SCROLL_BARS GTK3 X11 MODULES THREADS XWIDGETS LIBSYSTEMD LCMS2

Important settings:
  value of $LC_MONETARY: en_US.UTF-8
  value of $LC_NUMERIC: en_US.UTF-8
  value of $LC_TIME: en_US.UTF-8
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8-unix

Major mode: PHP//l

Minor modes in effect:
  winner-mode: t
  projectile-mode: t
  diff-auto-refine-mode: t
  global-display-line-numbers-mode: t
  display-line-numbers-mode: t
  global-hl-line-mode: t
  show-paren-mode: t
  shell-dirtrack-mode: t
  flymake-mode: t
  global-company-mode: t
  company-mode: t
  global-git-gutter-mode: t
  git-gutter-mode: t
  ido-everywhere: t
  icomplete-mode: t
  desktop-save-mode: t
  override-global-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t
  abbrev-mode: t

Load-path shadows:
/usr/share/emacs/site-lisp/dictionaries-common/ispell hides /usr/share/emacs/26.1/lisp/textmodes/ispell
/usr/share/emacs/site-lisp/dictionaries-common/flyspell hides /usr/share/emacs/26.1/lisp/textmodes/flyspell

Features:
(shadow sort mail-extr emacsbug message rmc puny rfc822 mml mml-sec epa
epg gnus-util rmail rmail-loaddefs mm-decode mm-bodies mm-encode
mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047
rfc2045 ietf-drums mm-util mail-prsvr mail-utils apropos winner paredit
elec-pair yaml-mode autorevert filenotify projectile grep ibuf-ext
ibuffer ibuffer-loaddefs vc-git diff-mode company-php deeper-blue-theme
display-line-numbers hl-line paren cider cider-repl-history pulse
derived tramp-sh cider-debug cider-browse-ns cider-inspector cider-mode
cider-profile cider-interaction arc-mode archive-mode cider-repl
cider-resolve cider-test cider-overlays cider-stacktrace cider-doc
cider-browse-spec org-table cider-grimoire cider-popup cider-eldoc
cider-client cider-common cider-util clojure-mode align color
nrepl-client tramp tramp-compat tramp-loaddefs trampver ucs-normalize
shell parse-time queue nrepl-dict cider-compat ewoc spinner php-cs-fixer
cl ac-php auto-complete ac-php-core popup f json map php-mode
php-project mode-local imenu speedbar sb-image ezimage dframe
flymake-proc flymake warnings thingatpt add-log cc-langs cc-mode
cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars
cc-defs ag vc-svn compile find-dired s dash dired dired-loaddefs
company-oddmuse company-keywords company-etags etags xref project
company-gtags company-dabbrev-code company-dabbrev company-files
company-capf company-cmake company-xcode company-clang company-semantic
company-eclim company-template company-bbdb company edmacro kmacro pcase
delight git-gutter-fringe fringe-helper git-gutter ido icomplete
cl-extra help-mode desktop frameset use-package use-package-ensure
use-package-delight use-package-diminish use-package-bind-key bind-key
use-package-core subr-x finder-inf rx info package epg-config
url-handlers url-parse auth-source eieio eieio-core cl-macs
eieio-loaddefs password-cache url-vars seq byte-opt gv bytecomp
byte-compile cconv org-element cl-seq avl-tree generator org advice
org-macro org-footnote org-pcomplete pcomplete org-list org-faces
org-entities noutline outline easy-mmode org-version ob-emacs-lisp ob
ob-tangle org-src ob-ref ob-lob ob-table ob-keys ob-exp ob-comint comint
ansi-color ring ob-core ob-eval org-compat org-macs org-loaddefs
format-spec find-func cal-menu easymenu calendar cal-loaddefs
cl-loaddefs cl-lib time-date mule-util tooltip eldoc electric uniquify
ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win
term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe
tabulated-list replace newcomment text-mode elisp-mode lisp-mode
prog-mode register page menu-bar rfn-eshadow isearch timer select
scroll-bar mouse jit-lock font-lock syntax facemenu font-core
term/tty-colors frame cl-generic cham georgian utf-8-lang misc-lang
vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932
hebrew greek romanian slovak czech european ethiopic indian cyrillic
chinese composite charscript charprop case-table epa-hook jka-cmpr-hook
help simple abbrev obarray minibuffer cl-preloaded nadvice loaddefs
button faces cus-face macroexp files text-properties overlay sha1 md5
base64 format env code-pages mule custom widget hashtable-print-readable
backquote dbusbind inotify lcms2 dynamic-setting system-font-setting
font-render-setting xwidget-internal move-toolbar gtk x-toolkit x
multi-tty make-network-process emacs)

Memory information:
((conses 16 541865 22063)
 (symbols 48 45965 2)
 (miscs 40 243 398)
 (strings 32 131830 3547)
 (string-bytes 1 3990062)
 (vectors 16 73627)
 (vector-slots 8 1179695 16022)
 (floats 8 359 1209)
 (intervals 56 8846 0)
 (buffers 992 33))

[-- Attachment #2: Type: text/html, Size: 9106 bytes --]

^ permalink raw reply	[flat|nested] 21+ messages in thread

* bug#31880: 26.1; VC mode line popup when clicked is off screen
  2018-06-18 14:59 bug#31880: 26.1; VC mode line popup when clicked is off screen Brian Zwahr
@ 2018-06-19  7:17 ` martin rudalics
       [not found]   ` <380133793885a54af49bbc8715cfea4ced525342.camel@echosa.net>
  2018-06-25 10:33   ` João Távora
  0 siblings, 2 replies; 21+ messages in thread
From: martin rudalics @ 2018-06-19  7:17 UTC (permalink / raw)
  To: Brian Zwahr, 31880

 > When I use Emacs via the GUI and I maximize the window, clicking on a
 > git branch in the mode line of a buffer produces the actions popup, but
 > it is unusable because it is either squished at the bottom of the screen
 > or it extends off the buttom of the screen. If I make the Emacs frame
 > smaller so that the bottom of the frame is not at the bottom of the
 > screen, then I get a usable scrollable list of VC actions when I click
 > the git branch information in the mode line.
 >
 > It seems like this popup always popups up below/beneath/downward of the
 > Emacs frame. Instead, if the bottom of the frame is at the bottom of the
 > screen (or close to it even, maybe?), then the VC popup should display
 > above/upwards.
 >
 >
 > In GNU Emacs 26.1 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.22.30)
 >   of 2018-05-29 built on lcy01-amd64-029
 > Windowing system distributor 'The X.Org Foundation', version 11.0.11906000
 > System Description:	Pop!_OS 18.04 LTS

Thank you for your report.  Similar problems have been mentioned in
bugs 24084, 25064, 26130, 26855 and 27131, most of them for Emacs 25
and GTK 3.22.  Can you see related GTK error messages when running
Emacs from a console?  Are you using multiple monitors, a high
resolution display or any other peculiar configuration that has been
mentioned in those reports?

martin





^ permalink raw reply	[flat|nested] 21+ messages in thread

* bug#31880: 26.1; VC mode line popup when clicked is off screen
       [not found]   ` <380133793885a54af49bbc8715cfea4ced525342.camel@echosa.net>
@ 2018-06-20  7:42     ` martin rudalics
  2018-06-20  9:52       ` Robert Pluim
  0 siblings, 1 reply; 21+ messages in thread
From: martin rudalics @ 2018-06-20  7:42 UTC (permalink / raw)
  To: Brian Zwahr; +Cc: Robert Pluim, 31880

 > I am using a high resolution display (built-in Retina display on a MacBook Pro).
 > I have the scaling set to 200%. When I change to 100%, the popup works fine. When
 > I change to LoDPI mode, the popup works fine. It definitely seems to be an issue
 > with scaled HiDPI.

Thanks for the information.  Please keep 31880@debbugs.gnu.org cc'ed.

Robert what do you think?  create_and_show_popup_menu has

#ifdef HAVE_GTK3
       /* Use window scaling factor to adjust position for hidpi screens. */
       x /= xg_get_scale (f);
       y /= xg_get_scale (f);
#endif

Shouldn't this take of Brian's problem?  If not, could you tell him
how to debug this?

Thanks, martin





^ permalink raw reply	[flat|nested] 21+ messages in thread

* bug#31880: 26.1; VC mode line popup when clicked is off screen
  2018-06-20  7:42     ` martin rudalics
@ 2018-06-20  9:52       ` Robert Pluim
  2018-06-20 11:55         ` martin rudalics
  0 siblings, 1 reply; 21+ messages in thread
From: Robert Pluim @ 2018-06-20  9:52 UTC (permalink / raw)
  To: martin rudalics; +Cc: Brian Zwahr, 31880

martin rudalics <rudalics@gmx.at> writes:

>> I am using a high resolution display (built-in Retina display on a MacBook Pro).
>> I have the scaling set to 200%. When I change to 100%, the popup works fine. When
>> I change to LoDPI mode, the popup works fine. It definitely seems to be an issue
>> with scaled HiDPI.
>
> Thanks for the information.  Please keep 31880@debbugs.gnu.org cc'ed.
>
> Robert what do you think?  create_and_show_popup_menu has
>
> #ifdef HAVE_GTK3
>       /* Use window scaling factor to adjust position for hidpi screens. */
>       x /= xg_get_scale (f);
>       y /= xg_get_scale (f);
> #endif
>
> Shouldn't this take of Brian's problem?  If not, could you tell him
> how to debug this?

It should, but it doesnʼt. I see similar problems here, but I donʼt
understand why (unless this is another instance of "Mixing X and GTK
calls will bite your arse eventually").

GTK tooltips seem to appear in the right place, so Iʼll look for
inspiration there.

Robert





^ permalink raw reply	[flat|nested] 21+ messages in thread

* bug#31880: 26.1; VC mode line popup when clicked is off screen
  2018-06-20  9:52       ` Robert Pluim
@ 2018-06-20 11:55         ` martin rudalics
  2018-06-20 14:31           ` Robert Pluim
  0 siblings, 1 reply; 21+ messages in thread
From: martin rudalics @ 2018-06-20 11:55 UTC (permalink / raw)
  To: Robert Pluim; +Cc: Brian Zwahr, 31880

 > It should, but it doesnʼt. I see similar problems here, but I donʼt
 > understand why (unless this is another instance of "Mixing X and GTK
 > calls will bite your arse eventually").

What happens when you move a frame to the bottom of your screen and
open a menu bar entry?  Does it also get hidden?

 > GTK tooltips seem to appear in the right place, so Iʼll look for
 > inspiration there.

It's up to GTK to decide whether a menu fits on the screen so maybe it
messes up the height of menu bar text when scaling is in effect.  Does
scaling affect the height of menus in the first place?  Does it affect
the height of tooltips?

Thanks for looking into this, martin






^ permalink raw reply	[flat|nested] 21+ messages in thread

* bug#31880: 26.1; VC mode line popup when clicked is off screen
  2018-06-20 11:55         ` martin rudalics
@ 2018-06-20 14:31           ` Robert Pluim
  2018-06-20 20:15             ` Brian Zwahr
  2018-06-21  7:15             ` martin rudalics
  0 siblings, 2 replies; 21+ messages in thread
From: Robert Pluim @ 2018-06-20 14:31 UTC (permalink / raw)
  To: martin rudalics; +Cc: Brian Zwahr, 31880

martin rudalics <rudalics@gmx.at> writes:

>> It should, but it doesnʼt. I see similar problems here, but I donʼt
>> understand why (unless this is another instance of "Mixing X and GTK
>> calls will bite your arse eventually").
>
> What happens when you move a frame to the bottom of your screen and
> open a menu bar entry?  Does it also get hidden?

No, menu bar menus are fine.

>> GTK tooltips seem to appear in the right place, so Iʼll look for
>> inspiration there.
>
> It's up to GTK to decide whether a menu fits on the screen so maybe it
> messes up the height of menu bar text when scaling is in effect.  Does
> scaling affect the height of menus in the first place?  Does it affect
> the height of tooltips?
>

Yes and yes, because it affects the size of the font used to display
them.

> Thanks for looking into this, martin

Yet another instance of a disagreement between how GTK and X calculate
pixels. Who will rid me of this turbulent mix?

Brian, would it be possible for you to try out the following patch? It
fixes things for me here.

diff --git i/src/xmenu.c w/src/xmenu.c
index e7ef31ac56..3a245771e1 100644
--- i/src/xmenu.c
+++ w/src/xmenu.c
@@ -1162,11 +1162,16 @@ menu_position_func (GtkMenu *menu, gint *x, gint *y, gboolean *push_in, gpointer
   GtkRequisition req;
   int max_x = -1;
   int max_y = -1;
+  int scale = 1;
 
   Lisp_Object frame, workarea;
 
   XSETFRAME (frame, data->f);
 
+#ifdef HAVE_GTK3
+  scale = xg_get_scale (data->f);
+#endif
+
   /* TODO: Get the monitor workarea directly without calculating other
      items in x-display-monitor-attributes-list. */
   workarea = call3 (Qframe_monitor_workarea,
@@ -1192,11 +1197,18 @@ menu_position_func (GtkMenu *menu, gint *x, gint *y, gboolean *push_in, gpointer
       max_y = x_display_pixel_height (dpyinfo);
     }
 
+  /* frame-monitor-workarea and {x,y}_display_pixel_width/height all
+     return device pixels, but GTK wants scaled pixels.  The positions
+     passed in via data were already scaled for us.  */
+  max_x /= scale;
+  max_y /= scale;
   *x = data->x;
   *y = data->y;
 
   /* Check if there is room for the menu.  If not, adjust x/y so that
-     the menu is fully visible.  */
+     the menu is fully visible.  gtk_widget_get_preferred_size returns
+     scaled pixels, so there is no need to apply the scaling
+     factor.  */
   gtk_widget_get_preferred_size (GTK_WIDGET (menu), NULL, &req);
   if (data->x + req.width > max_x)
     *x -= data->x + req.width - max_x;







^ permalink raw reply related	[flat|nested] 21+ messages in thread

* bug#31880: 26.1; VC mode line popup when clicked is off screen
  2018-06-20 14:31           ` Robert Pluim
@ 2018-06-20 20:15             ` Brian Zwahr
  2018-06-21  8:08               ` Robert Pluim
  2018-06-21  7:15             ` martin rudalics
  1 sibling, 1 reply; 21+ messages in thread
From: Brian Zwahr @ 2018-06-20 20:15 UTC (permalink / raw)
  To: Robert Pluim, martin rudalics; +Cc: 31880

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

I'm not exactly sure what to do with this. I assume I need to get the
latest source and build it, after applying this diff? Where do I get
the source? I've never built Emacs from source before. I'll try to get
to it when I can.

On Wed, 2018-06-20 at 16:31 +0200, Robert Pluim wrote:
> martin rudalics <rudalics@gmx.at> writes:
> It should, but it doesnʼt. I see similar problems here, but I
> donʼtunderstand why (unless this is another instance of "Mixing X and
> GTKcalls will bite your arse eventually").
> What happens when you move a frame to the bottom of your screen
> andopen a menu bar entry?  Does it also get hidden?
> No, menu bar menus are fine.
> GTK tooltips seem to appear in the right place, so Iʼll look
> forinspiration there.
> It's up to GTK to decide whether a menu fits on the screen so maybe
> itmesses up the height of menu bar text when scaling is in
> effect.  Doesscaling affect the height of menus in the first
> place?  Does it affectthe height of tooltips?
> 
> Yes and yes, because it affects the size of the font used to
> displaythem.
> Thanks for looking into this, martin
> Yet another instance of a disagreement between how GTK and X
> calculatepixels. Who will rid me of this turbulent mix?
> Brian, would it be possible for you to try out the following patch?
> Itfixes things for me here.
> diff --git i/src/xmenu.c w/src/xmenu.cindex e7ef31ac56..3a245771e1
> 100644--- i/src/xmenu.c+++ w/src/xmenu.c@@ -1162,11 +1162,16 @@
> menu_position_func (GtkMenu *menu, gint *x, gint *y, gboolean
> *push_in, gpointer   GtkRequisition req;   int max_x = -1;   int
> max_y = -1;+  int scale = 1;    Lisp_Object frame,
> workarea;    XSETFRAME (frame, data->f); +#ifdef HAVE_GTK3+  scale =
> xg_get_scale (data->f);+#endif+   /* TODO: Get the monitor workarea
> directly without calculating other      items in x-display-monitor-
> attributes-list. */   workarea = call3 (Qframe_monitor_workarea,@@
> -1192,11 +1197,18 @@ menu_position_func (GtkMenu *menu, gint *x, gint
> *y, gboolean *push_in, gpointer       max_y = x_display_pixel_height
> (dpyinfo);     } +  /* frame-monitor-workarea and
> {x,y}_display_pixel_width/height all+     return device pixels, but
> GTK wants scaled pixels.  The positions+     passed in via data were
> already scaled for us.  */+  max_x /= scale;+  max_y /= scale;   *x =
> data->x;   *y = data->y;    /* Check if there is room for the
> menu.  If not, adjust x/y so that-     the menu is fully
> visible.  */+     the menu is fully
> visible.  gtk_widget_get_preferred_size returns+     scaled pixels,
> so there is no need to apply the
> scaling+     factor.  */   gtk_widget_get_preferred_size (GTK_WIDGET
> (menu), NULL, &req);   if (data->x + req.width > max_x)     *x -=
> data->x + req.width - max_x;
> 
> 
> 

[-- Attachment #2: Type: text/html, Size: 4473 bytes --]

^ permalink raw reply	[flat|nested] 21+ messages in thread

* bug#31880: 26.1; VC mode line popup when clicked is off screen
  2018-06-20 14:31           ` Robert Pluim
  2018-06-20 20:15             ` Brian Zwahr
@ 2018-06-21  7:15             ` martin rudalics
  2018-06-21  8:31               ` Robert Pluim
  1 sibling, 1 reply; 21+ messages in thread
From: martin rudalics @ 2018-06-21  7:15 UTC (permalink / raw)
  To: Robert Pluim; +Cc: Brian Zwahr, 31880

 > Yet another instance of a disagreement between how GTK and X calculate
 > pixels. Who will rid me of this turbulent mix?

In xg_show_tooltip we have

       gtk_window_move (x->ttip_window, root_x / xg_get_scale (f),
		       root_y / xg_get_scale (f));

I suppose this is TRT with a scaled display because root_x and root_y
are unscaled and hence we have to scale them to get the appropriate
coordinates for scaled displays.  Right?

Then what happens when we turn off GTK tooltips on a scaled display by
setting 'x-gtk-use-system-tooltips' to nil?  IIUC the tooltip will now
appear at the "wrong" position.  Or am I missing something?

martin





^ permalink raw reply	[flat|nested] 21+ messages in thread

* bug#31880: 26.1; VC mode line popup when clicked is off screen
  2018-06-20 20:15             ` Brian Zwahr
@ 2018-06-21  8:08               ` Robert Pluim
  2018-06-21 14:41                 ` Brian Zwahr
  0 siblings, 1 reply; 21+ messages in thread
From: Robert Pluim @ 2018-06-21  8:08 UTC (permalink / raw)
  To: Brian Zwahr; +Cc: 31880

Brian Zwahr <echosa@echosa.net> writes:

> I'm not exactly sure what to do with this. I assume I need to get the
> latest source and build it, after applying this diff? Where do I get
> the source? I've never built Emacs from source before. I'll try to get
> to it when I can.

Yes. You can get the emacs-26 branch sources by doing

    git clone -b emacs-26 https://git.savannah.gnu.org/git/emacs.git

then

    sudo apt-get build-dep emacs
    cd emacs
    git apply menus.patch #assuming you put my patch in menus.patch
    ./autogen.sh
    ./configure
    make
    src/emacs -Q

and then let us know how it goes.

Regards

Robert





^ permalink raw reply	[flat|nested] 21+ messages in thread

* bug#31880: 26.1; VC mode line popup when clicked is off screen
  2018-06-21  7:15             ` martin rudalics
@ 2018-06-21  8:31               ` Robert Pluim
  2018-06-21  8:56                 ` martin rudalics
  0 siblings, 1 reply; 21+ messages in thread
From: Robert Pluim @ 2018-06-21  8:31 UTC (permalink / raw)
  To: martin rudalics; +Cc: Brian Zwahr, 31880

martin rudalics <rudalics@gmx.at> writes:

>> Yet another instance of a disagreement between how GTK and X calculate
>> pixels. Who will rid me of this turbulent mix?
>
> In xg_show_tooltip we have
>
>       gtk_window_move (x->ttip_window, root_x / xg_get_scale (f),
> 		       root_y / xg_get_scale (f));
>
> I suppose this is TRT with a scaled display because root_x and root_y
> are unscaled and hence we have to scale them to get the appropriate
> coordinates for scaled displays.  Right?
>
> Then what happens when we turn off GTK tooltips on a scaled display by
> setting 'x-gtk-use-system-tooltips' to nil?  IIUC the tooltip will now
> appear at the "wrong" position.  Or am I missing something?

When not using GTK tooltips, we end up using XMoveResizeWindow (near
the end of Fx_show_tip), which wants device pixel positions, which is
what compute_tip_xy produces, so the tooltip appears in the right
place.

Robert







^ permalink raw reply	[flat|nested] 21+ messages in thread

* bug#31880: 26.1; VC mode line popup when clicked is off screen
  2018-06-21  8:31               ` Robert Pluim
@ 2018-06-21  8:56                 ` martin rudalics
  0 siblings, 0 replies; 21+ messages in thread
From: martin rudalics @ 2018-06-21  8:56 UTC (permalink / raw)
  To: Robert Pluim; +Cc: Brian Zwahr, 31880

 > When not using GTK tooltips, we end up using XMoveResizeWindow (near
 > the end of Fx_show_tip), which wants device pixel positions, which is
 > what compute_tip_xy produces, so the tooltip appears in the right
 > place.

I see.

Thanks for the information, martin





^ permalink raw reply	[flat|nested] 21+ messages in thread

* bug#31880: 26.1; VC mode line popup when clicked is off screen
  2018-06-21  8:08               ` Robert Pluim
@ 2018-06-21 14:41                 ` Brian Zwahr
  2018-06-21 15:05                   ` Robert Pluim
  0 siblings, 1 reply; 21+ messages in thread
From: Brian Zwahr @ 2018-06-21 14:41 UTC (permalink / raw)
  To: Robert Pluim; +Cc: 31880

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

Finally was able to compile and make after installing a bunch of libs.
The patch seems to work!
On Thu, 2018-06-21 at 10:08 +0200, Robert Pluim wrote:
> Brian Zwahr <echosa@echosa.net> writes:
> I'm not exactly sure what to do with this. I assume I need to get
> thelatest source and build it, after applying this diff? Where do I
> getthe source? I've never built Emacs from source before. I'll try to
> getto it when I can.
> Yes. You can get the emacs-26 branch sources by doing
>     git clone -b emacs-26 https://git.savannah.gnu.org/git/emacs.git
> then
>     sudo apt-get build-dep emacs    cd emacs    git apply menus.patch
> #assuming you put my patch in
> menus.patch    ./autogen.sh    ./configure    make    src/emacs -Q
> and then let us know how it goes.
> Regards
> Robert

[-- Attachment #2: Type: text/html, Size: 1504 bytes --]

^ permalink raw reply	[flat|nested] 21+ messages in thread

* bug#31880: 26.1; VC mode line popup when clicked is off screen
  2018-06-21 14:41                 ` Brian Zwahr
@ 2018-06-21 15:05                   ` Robert Pluim
  2018-06-21 15:39                     ` Eli Zaretskii
  2018-06-22  8:56                     ` martin rudalics
  0 siblings, 2 replies; 21+ messages in thread
From: Robert Pluim @ 2018-06-21 15:05 UTC (permalink / raw)
  To: Brian Zwahr; +Cc: 31880

Brian Zwahr <echosa@echosa.net> writes:

> Finally was able to compile and make after installing a bunch of libs.
> The patch seems to work!

Thanks for testing.  Hopefully there are no other scaling issues.

Eli, the patch fixes mode-line popup menu positioning on HiDpi screens
when using GTK and scaling. Would you like it in master or emacs-26?

Thanks

Robert





^ permalink raw reply	[flat|nested] 21+ messages in thread

* bug#31880: 26.1; VC mode line popup when clicked is off screen
  2018-06-21 15:05                   ` Robert Pluim
@ 2018-06-21 15:39                     ` Eli Zaretskii
  2018-06-22  8:04                       ` Robert Pluim
  2018-06-22  8:56                     ` martin rudalics
  1 sibling, 1 reply; 21+ messages in thread
From: Eli Zaretskii @ 2018-06-21 15:39 UTC (permalink / raw)
  To: Robert Pluim; +Cc: echosa, 31880

> From: Robert Pluim <rpluim@gmail.com>
> Cc: 31880@debbugs.gnu.org, eliz@gnu.org
> Date: Thu, 21 Jun 2018 17:05:09 +0200
> 
> Eli, the patch fixes mode-line popup menu positioning on HiDpi screens
> when using GTK and scaling. Would you like it in master or emacs-26?

Please push to emacs-26, and thanks.





^ permalink raw reply	[flat|nested] 21+ messages in thread

* bug#31880: 26.1; VC mode line popup when clicked is off screen
  2018-06-21 15:39                     ` Eli Zaretskii
@ 2018-06-22  8:04                       ` Robert Pluim
  0 siblings, 0 replies; 21+ messages in thread
From: Robert Pluim @ 2018-06-22  8:04 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 31880-done, echosa

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Robert Pluim <rpluim@gmail.com>
>> Cc: 31880@debbugs.gnu.org, eliz@gnu.org
>> Date: Thu, 21 Jun 2018 17:05:09 +0200
>> 
>> Eli, the patch fixes mode-line popup menu positioning on HiDpi screens
>> when using GTK and scaling. Would you like it in master or emacs-26?
>
> Please push to emacs-26, and thanks.

Done as d22b8d1ad1

Closing bug.

Robert





^ permalink raw reply	[flat|nested] 21+ messages in thread

* bug#31880: 26.1; VC mode line popup when clicked is off screen
  2018-06-21 15:05                   ` Robert Pluim
  2018-06-21 15:39                     ` Eli Zaretskii
@ 2018-06-22  8:56                     ` martin rudalics
  1 sibling, 0 replies; 21+ messages in thread
From: martin rudalics @ 2018-06-22  8:56 UTC (permalink / raw)
  To: Robert Pluim, Brian Zwahr; +Cc: 31880

 >> Finally was able to compile and make after installing a bunch of libs.
 >> The patch seems to work!
 >
 > Thanks for testing.  Hopefully there are no other scaling issues.

Great!

Many thanks for testing and patch, martin





^ permalink raw reply	[flat|nested] 21+ messages in thread

* bug#31880: 26.1; VC mode line popup when clicked is off screen
  2018-06-19  7:17 ` martin rudalics
       [not found]   ` <380133793885a54af49bbc8715cfea4ced525342.camel@echosa.net>
@ 2018-06-25 10:33   ` João Távora
  2018-06-27  7:33     ` martin rudalics
  1 sibling, 1 reply; 21+ messages in thread
From: João Távora @ 2018-06-25 10:33 UTC (permalink / raw)
  To: martin rudalics; +Cc: Brian Zwahr, 31880

martin rudalics <rudalics@gmx.at> writes:

>> When I use Emacs via the GUI and I maximize the window, clicking on a
>> git branch in the mode line of a buffer produces the actions popup, but
>> it is unusable because it is either squished at the bottom of the screen
>> or it extends off the buttom of the screen. If I make the Emacs frame
>> smaller so that the bottom of the frame is not at the bottom of the
>> screen, then I get a usable scrollable list of VC actions when I click
>> the git branch information in the mode line.
>>
>> It seems like this popup always popups up below/beneath/downward of the
>> Emacs frame. Instead, if the bottom of the frame is at the bottom of the
>> screen (or close to it even, maybe?), then the VC popup should display
>> above/upwards.
>>
>>
>> In GNU Emacs 26.1 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.22.30)
>>   of 2018-05-29 built on lcy01-amd64-029
>> Windowing system distributor 'The X.Org Foundation', version 11.0.11906000
>> System Description:	Pop!_OS 18.04 LTS
>
> Thank you for your report.  Similar problems have been mentioned in
> bugs 24084, 25064, 26130, 26855 and 27131, most of them for Emacs 25
> and GTK 3.22.

FWIW, I have a very similar same problem with the Lucid toolkit, and not
just for the VC popup: for all but the shortest popups it extends off
the usable area of the screen, to the bottom.

> Can you see related GTK error messages when running
> Emacs from a console?  Are you using multiple monitors, a high
> resolution display or any other peculiar configuration that has been
> mentioned in those reports?

I don't see any in the console.

João





^ permalink raw reply	[flat|nested] 21+ messages in thread

* bug#31880: 26.1; VC mode line popup when clicked is off screen
  2018-06-25 10:33   ` João Távora
@ 2018-06-27  7:33     ` martin rudalics
  2018-06-27  8:24       ` João Távora
  0 siblings, 1 reply; 21+ messages in thread
From: martin rudalics @ 2018-06-27  7:33 UTC (permalink / raw)
  To: João Távora; +Cc: Brian Zwahr, 31880

 > FWIW, I have a very similar same problem with the Lucid toolkit, and not
 > just for the VC popup: for all but the shortest popups it extends off
 > the usable area of the screen, to the bottom.

On a high resolution display?  Can you try building without toolkit
support?

 >> Can you see related GTK error messages when running
 >> Emacs from a console?
[...]
 >
 > I don't see any in the console.

You don't get GTK messages when building with another toolkit.

martin





^ permalink raw reply	[flat|nested] 21+ messages in thread

* bug#31880: 26.1; VC mode line popup when clicked is off screen
  2018-06-27  7:33     ` martin rudalics
@ 2018-06-27  8:24       ` João Távora
  2018-06-27  9:56         ` Robert Pluim
  0 siblings, 1 reply; 21+ messages in thread
From: João Távora @ 2018-06-27  8:24 UTC (permalink / raw)
  To: martin rudalics; +Cc: Brian Zwahr, 31880

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

On Wed, Jun 27, 2018, 08:33 martin rudalics <rudalics@gmx.at> wrote:

>  > FWIW, I have a very similar same problem with the Lucid toolkit, and not
>  > just for the VC popup: for all but the shortest popups it extends off
>  > the usable area of the screen, to the bottom.
>
> On a high resolution display?


On a normal display.

>

Can you try building without toolkit
> support?
>

I'm confused, sorry.  You mean without X? Or with something else other than
lucid?

João

[-- Attachment #2: Type: text/html, Size: 1337 bytes --]

^ permalink raw reply	[flat|nested] 21+ messages in thread

* bug#31880: 26.1; VC mode line popup when clicked is off screen
  2018-06-27  8:24       ` João Távora
@ 2018-06-27  9:56         ` Robert Pluim
  2018-06-27 11:16           ` João Távora
  0 siblings, 1 reply; 21+ messages in thread
From: Robert Pluim @ 2018-06-27  9:56 UTC (permalink / raw)
  To: João Távora; +Cc: Brian Zwahr, 31880

João Távora <joaotavora@gmail.com> writes:

> On Wed, Jun 27, 2018, 08:33 martin rudalics <rudalics@gmx.at> wrote:
>
>>  > FWIW, I have a very similar same problem with the Lucid toolkit, and not
>>  > just for the VC popup: for all but the shortest popups it extends off
>>  > the usable area of the screen, to the bottom.
>>
>> On a high resolution display?
>
>
> On a normal display.
>
>>
>
> Can you try building without toolkit
>> support?
>>
>
> I'm confused, sorry.  You mean without X? Or with something else other than
> lucid?

Martin means

./configure --with-x-toolkit=no

which I think means we only do direct XLib calls.

Iʼve tried both that and --with-x-toolkit=lucid and see no problems
with popup menu positioning.

Regards

Robert





^ permalink raw reply	[flat|nested] 21+ messages in thread

* bug#31880: 26.1; VC mode line popup when clicked is off screen
  2018-06-27  9:56         ` Robert Pluim
@ 2018-06-27 11:16           ` João Távora
  0 siblings, 0 replies; 21+ messages in thread
From: João Távora @ 2018-06-27 11:16 UTC (permalink / raw)
  To: Robert Pluim; +Cc: Brian Zwahr, 31880

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

Thanks for the clarification. I'll try that later today.

João

On Wed, Jun 27, 2018, 10:57 Robert Pluim <rpluim@gmail.com> wrote:

> João Távora <joaotavora@gmail.com> writes:
>
> > On Wed, Jun 27, 2018, 08:33 martin rudalics <rudalics@gmx.at> wrote:
> >
> >>  > FWIW, I have a very similar same problem with the Lucid toolkit, and
> not
> >>  > just for the VC popup: for all but the shortest popups it extends off
> >>  > the usable area of the screen, to the bottom.
> >>
> >> On a high resolution display?
> >
> >
> > On a normal display.
> >
> >>
> >
> > Can you try building without toolkit
> >> support?
> >>
> >
> > I'm confused, sorry.  You mean without X? Or with something else other
> than
> > lucid?
>
> Martin means
>
> ./configure --with-x-toolkit=no
>
> which I think means we only do direct XLib calls.
>
> Iʼve tried both that and --with-x-toolkit=lucid and see no problems
> with popup menu positioning.
>
> Regards
>
> Robert
>

[-- Attachment #2: Type: text/html, Size: 1600 bytes --]

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2018-06-27 11:16 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-18 14:59 bug#31880: 26.1; VC mode line popup when clicked is off screen Brian Zwahr
2018-06-19  7:17 ` martin rudalics
     [not found]   ` <380133793885a54af49bbc8715cfea4ced525342.camel@echosa.net>
2018-06-20  7:42     ` martin rudalics
2018-06-20  9:52       ` Robert Pluim
2018-06-20 11:55         ` martin rudalics
2018-06-20 14:31           ` Robert Pluim
2018-06-20 20:15             ` Brian Zwahr
2018-06-21  8:08               ` Robert Pluim
2018-06-21 14:41                 ` Brian Zwahr
2018-06-21 15:05                   ` Robert Pluim
2018-06-21 15:39                     ` Eli Zaretskii
2018-06-22  8:04                       ` Robert Pluim
2018-06-22  8:56                     ` martin rudalics
2018-06-21  7:15             ` martin rudalics
2018-06-21  8:31               ` Robert Pluim
2018-06-21  8:56                 ` martin rudalics
2018-06-25 10:33   ` João Távora
2018-06-27  7:33     ` martin rudalics
2018-06-27  8:24       ` João Távora
2018-06-27  9:56         ` Robert Pluim
2018-06-27 11:16           ` João Távora

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).