all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alex <agrambot@gmail.com>
To: Sebastian Schueppel <Sebastian.Schueppel@endace.com>
Cc: 24084@debbugs.gnu.org
Subject: bug#24084: 25.1; GTK3 mode-line drop down menu partially off-screen
Date: Thu, 15 Jun 2017 23:31:51 -0600	[thread overview]
Message-ID: <87y3ssxzug.fsf@lylat> (raw)
In-Reply-To: <E8420E6948C7644DAF98011B10F2034D5FEF425A@nzaklmbx01.ad.endace.com> (Sebastian Schueppel's message of "Wed, 27 Jul 2016 01:00:42 +0000")

Sebastian Schueppel <Sebastian.Schueppel@endace.com> writes:

> This is related to a multi monitor setup: I have 3 monitors set from left to
> right. The middle monitor has a vertical orientation therefore the pixels
> available on that one is swapped. The monitors have the following resolutions:
> (1680x1050)(1050x1680)(1680x1050)
> If I do the following on one of the horizontal/normal oriented monitors the mode-line drop down menu disappears partially off-screen.
>
> starting from 'emacs -Q'
>
> maximize the frame on one of the monitors with normal orientation (1680x1050)
> and click in the mode-line on the line number or column number. The
> popup/dropdown menu will partially disappear at the bottom of the monitor.
>
> --
> My debug/quickfix so far: 
>
> The popup menus like this are defined in emacs/src/xmenu.c 
> Since I'm using GTK3 the 'menu_position_func' function is always used to define the position of the popup menu. Which is certainly the correct thing to do, otherwise GTK3 does sometimes some funky stuff. Now in my 3 monitor set-up, the function within 'menu_position_func' called 'x_display_pixel_height' always thinks the height of my screen is 1680 and therefore thinks there is room to display the menu below. It doesn't take into account that one monitor is vertical oriented and has a height of 1680, but the other 2 monitor are set up normal with a height of 1080. 
>
> I have used the following quickfix using GTK3 build in functions using monitors rather than the whole screen information. Adding the following to 'menu_position_func' to get the geometry of the monitor the frame is on. I understand that this might not be generic enough, but it works for me. 
>
> <code>
> #include <gdk/gdk.h>
>
> GdkRectangle workarea;
> // get the monitor the current frame is on
> gint widgetMonitor = gdk_screen_get_monitor_at_point(gtk_widget_get_screen(FRAME_GTK_OUTER_WIDGET (data->f)),*x,*y);
> gdk_screen_get_monitor_workarea(gtk_widget_get_screen(FRAME_GTK_OUTER_WIDGET (data->f)),widgetMonitor,&workarea);
> // now instead of using disp_width and disp_height we use a combination of monitor absolut position and monitor working area.
> // monitor absolute position being  workarea.x workarea.y and monitor size being workarea.height and workarea.width
> </code>
>
> I'm omitting the rest of the code here where those values are used as it should be obvious. Hope this will help to get a more generic solution out there. 

I believe this is fixed in the latest master. Can you confirm? It should
work for any GTK version.





  reply	other threads:[~2017-06-16  5:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-27  1:00 bug#24084: 25.1; GTK3 mode-line drop down menu partially off-screen Sebastian Schueppel
2017-06-16  5:31 ` Alex [this message]
2019-09-29  4:54 ` Stefan Kangas

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=87y3ssxzug.fsf@lylat \
    --to=agrambot@gmail.com \
    --cc=24084@debbugs.gnu.org \
    --cc=Sebastian.Schueppel@endace.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.