From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Sebastian Schueppel Newsgroups: gmane.emacs.bugs Subject: bug#24084: 25.1; GTK3 mode-line drop down menu partially off-screen Date: Wed, 27 Jul 2016 01:00:42 +0000 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1469584295 9654 80.91.229.3 (27 Jul 2016 01:51:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 27 Jul 2016 01:51:35 +0000 (UTC) To: 24084@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jul 27 03:51:23 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bSE0E-0005TC-D3 for geb-bug-gnu-emacs@m.gmane.org; Wed, 27 Jul 2016 03:51:18 +0200 Original-Received: from localhost ([::1]:43263 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bSE07-0005rG-RS for geb-bug-gnu-emacs@m.gmane.org; Tue, 26 Jul 2016 21:51:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51154) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bSE01-0005r6-M8 for bug-gnu-emacs@gnu.org; Tue, 26 Jul 2016 21:51:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bSDzy-0004Nc-Ef for bug-gnu-emacs@gnu.org; Tue, 26 Jul 2016 21:51:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:54441) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bSDzy-0004NL-B4 for bug-gnu-emacs@gnu.org; Tue, 26 Jul 2016 21:51:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bSDzx-0007fZ-Tj for bug-gnu-emacs@gnu.org; Tue, 26 Jul 2016 21:51:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Sebastian Schueppel Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 27 Jul 2016 01:51:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 24084 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: "bug-gnu-emacs@gnu.org" Original-Received: via spool by submit@debbugs.gnu.org id=B.146958422429428 (code B ref -1); Wed, 27 Jul 2016 01:51:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 27 Jul 2016 01:50:24 +0000 Original-Received: from localhost ([127.0.0.1]:38545 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bSDzK-0007eZ-KE for submit@debbugs.gnu.org; Tue, 26 Jul 2016 21:50:24 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:54758) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bSDDf-0006Jz-OA for submit@debbugs.gnu.org; Tue, 26 Jul 2016 21:01:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bSDDZ-0004JB-3P for submit@debbugs.gnu.org; Tue, 26 Jul 2016 21:01:02 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:52620) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bSDDZ-0004I1-0F for submit@debbugs.gnu.org; Tue, 26 Jul 2016 21:01:01 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45718) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bSDDW-0005l7-Cf for bug-gnu-emacs@gnu.org; Tue, 26 Jul 2016 21:00:59 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bSDDT-0004GK-7H for bug-gnu-emacs@gnu.org; Tue, 26 Jul 2016 21:00:58 -0400 Original-Received: from out1103.nz.smxemail.com ([203.84.134.34]:4275) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bSDDS-0004FD-Lc for bug-gnu-emacs@gnu.org; Tue, 26 Jul 2016 21:00:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; d=nz.smxemail.com; s=alpha; c=relaxed/relaxed; q=dns/txt; i=@nz.smxemail.com; t=1469581247; h=From:Sender:Reply-To:Subject:Date:Message-ID:To:Cc; bh=38qiqVJVcSy0FccyB5pGTuWbkwMLxc9pCFNtnfacyoA=; b=WZN59wo+mWJH10EHDtAodWE1SvN5n/G0R17pTxFXiLc39Zrwfzi6i8ZYVlQ0Ysp5 XKKXHhKhESAwsnTJlED3i412GK1j/YtQx4e6NsFWtY3koUipx5raLBUDD5X0qT/o n7Be+PeADCwRblj3Q+BQcMlJ8xP4a17vZ0kCASqwxCQ=; Original-Received: from mail.ems.endace.com ([131.203.121.19]) by omr.nz.smxemail.com with ESMTP (using TLSv1 with cipher AES128-SHA (128/128 bits)) id 579807BE-359B0A53@mta1101.omr; Wed, 27 Jul 2016 01:00:46 +0000 Original-Received: from NZAKLMBX01.ad.endace.com ([::1]) by nzaklmbx01.ad.endace.com ([::1]) with mapi id 14.03.0146.002; Wed, 27 Jul 2016 13:00:43 +1200 Thread-Topic: 25.1; GTK3 mode-line drop down menu partially off-screen Thread-Index: AdHnmNyu9uqIBuxnSq6A2vZCyeF6ZA== Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [192.168.69.124] X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Mailman-Approved-At: Tue, 26 Jul 2016 21:50:21 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:121572 Archived-At: This is related to a multi monitor setup: I have 3 monitors set from left t= o right. The middle monitor has a vertical orientation therefore the pixels= available on that one is swapped. The monitors have the following resoluti= ons: (1680x1050)(1050x1680)(1680x1050)=0A= If I do the following on one of the horizontal/normal oriented monitors the= mode-line drop down menu disappears partially off-screen.=0A= =0A= starting from 'emacs -Q'=0A= =0A= maximize the frame on one of the monitors with normal orientation (1680x105= 0) and click in the mode-line on the line number or column number. The popu= p/dropdown menu will partially disappear at the bottom of the monitor. =0A= =0A= --=0A= My debug/quickfix so far: =0A= =0A= The popup menus like this are defined in emacs/src/xmenu.c =0A= Since I'm using GTK3 the 'menu_position_func' function is always used to de= fine the position of the popup menu. Which is certainly the correct thing t= o do, otherwise GTK3 does sometimes some funky stuff. Now in my 3 monitor s= et-up, the function within 'menu_position_func' called 'x_display_pixel_hei= ght' always thinks the height of my screen is 1680 and therefore thinks the= re 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 mon= itor are set up normal with a height of 1080. =0A= =0A= I have used the following quickfix using GTK3 build in functions using moni= tors rather than the whole screen information. Adding the following to 'men= u_position_func' to get the geometry of the monitor the frame is on. I unde= rstand that this might not be generic enough, but it works for me. =0A= =0A= =0A= #include =0A= =0A= GdkRectangle workarea;=0A= // get the monitor the current frame is on=0A= gint widgetMonitor =3D gdk_screen_get_monitor_at_point(gtk_widget_get_scree= n(FRAME_GTK_OUTER_WIDGET (data->f)),*x,*y);=0A= gdk_screen_get_monitor_workarea(gtk_widget_get_screen(FRAME_GTK_OUTER_WIDGE= T (data->f)),widgetMonitor,&workarea);=0A= // now instead of using disp_width and disp_height we use a combination of = monitor absolut position and monitor working area.=0A= // monitor absolute position being workarea.x workarea.y and monitor size = being workarea.height and workarea.width=0A= =0A= =0A= I'm omitting the rest of the code here where those values are used as it sh= ould be obvious. Hope this will help to get a more generic solution out the= re. =0A= =0A= =0A= =0A= In GNU Emacs 25.1.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.10.8)=0A= of 2016-07-26 built on mymachine=0A= Repository revision: 0f0b191a5324115fe9e8c438eceef4043decf209=0A= Windowing system distributor 'The X.Org Foundation', version 11.0.11501000= =0A= System Description: Ubuntu 14.04.4 LTS=0A= =0A= Configured features:=0A= XPM JPEG TIFF GIF PNG RSVG SOUND DBUS GSETTINGS NOTIFY LIBSELINUX GNUTLS=0A= LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11=0A= =0A= Important settings:=0A= value of $LC_ALL: en_NZ.utf-8=0A= value of $LANG: en_NZ.UTF-8=0A= value of $XMODIFIERS: @im=3Dibus=0A= locale-coding-system: utf-8-unix=0A= =0A= Major mode: Fundamental=0A= =0A= Minor modes in effect:=0A= tooltip-mode: t=0A= global-eldoc-mode: t=0A= electric-indent-mode: t=0A= mouse-wheel-mode: t=0A= tool-bar-mode: t=0A= menu-bar-mode: t=0A= file-name-shadow-mode: t=0A= global-font-lock-mode: t=0A= blink-cursor-mode: t=0A= auto-composition-mode: t=0A= auto-encryption-mode: t=0A= auto-compression-mode: t=0A= buffer-read-only: t=0A= line-number-mode: t=0A= transient-mark-mode: t=0A= =0A= Recent messages:=0A= For information about GNU Emacs and the GNU system, type C-h C-a.=0A= Making completion list...=0A= =0A= Load-path shadows:=0A= None found.=0A= =0A= Features:=0A= (shadow sort mail-extr emacsbug message dired format-spec rfc822 mml=0A= mml-sec password-cache epg epg-config gnus-util mm-decode mm-bodies=0A= mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail=0A= rfc2047 rfc2045 ietf-drums mm-util help-fns help-mode easymenu=0A= cl-loaddefs pcase cl-lib mail-prsvr mail-utils time-date mule-util=0A= tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type=0A= mwheel x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt=0A= fringe tabulated-list newcomment elisp-mode lisp-mode prog-mode register=0A= page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock=0A= font-lock syntax facemenu font-core frame cl-generic cham georgian=0A= utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean=0A= japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european=0A= ethiopic indian cyrillic chinese charscript case-table epa-hook=0A= jka-cmpr-hook help simple abbrev minibuffer cl-preloaded nadvice=0A= loaddefs button faces cus-face macroexp files text-properties overlay=0A= sha1 md5 base64 format env code-pages mule custom widget=0A= hashtable-print-readable backquote dbusbind inotify dynamic-setting=0A= system-font-setting font-render-setting move-toolbar gtk x-toolkit x=0A= multi-tty make-network-process emacs)=0A= =0A= Memory information:=0A= ((conses 16 90185 6392)=0A= (symbols 48 19738 0)=0A= (miscs 40 363 146)=0A= (strings 32 14712 4043)=0A= (string-bytes 1 433457)=0A= (vectors 16 12041)=0A= (vector-slots 8 437199 5168)=0A= (floats 8 165 69)=0A= (intervals 56 240 10)=0A= (buffers 976 22)=0A= (heap 1024 30448 957))=0A= =0A=