From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Alex Newsgroups: gmane.emacs.bugs Subject: bug#24084: 25.1; GTK3 mode-line drop down menu partially off-screen Date: Thu, 15 Jun 2017 23:31:51 -0600 Message-ID: <87y3ssxzug.fsf@lylat> References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1497591194 20834 195.159.176.226 (16 Jun 2017 05:33:14 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 16 Jun 2017 05:33:14 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) Cc: 24084@debbugs.gnu.org To: Sebastian Schueppel Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jun 16 07:33:09 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dLjsa-00054f-Ew for geb-bug-gnu-emacs@m.gmane.org; Fri, 16 Jun 2017 07:33:08 +0200 Original-Received: from localhost ([::1]:57181 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dLjsf-0007mH-OD for geb-bug-gnu-emacs@m.gmane.org; Fri, 16 Jun 2017 01:33:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50952) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dLjsZ-0007mC-IT for bug-gnu-emacs@gnu.org; Fri, 16 Jun 2017 01:33:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dLjsU-00081P-LH for bug-gnu-emacs@gnu.org; Fri, 16 Jun 2017 01:33:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:47410) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dLjsU-00080X-He for bug-gnu-emacs@gnu.org; Fri, 16 Jun 2017 01:33:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dLjsU-0007Jv-6Z for bug-gnu-emacs@gnu.org; Fri, 16 Jun 2017 01:33:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alex Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 16 Jun 2017 05:33:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24084 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 24084-submit@debbugs.gnu.org id=B24084.149759112528070 (code B ref 24084); Fri, 16 Jun 2017 05:33:02 +0000 Original-Received: (at 24084) by debbugs.gnu.org; 16 Jun 2017 05:32:05 +0000 Original-Received: from localhost ([127.0.0.1]:50086 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dLjrY-0007Ig-O0 for submit@debbugs.gnu.org; Fri, 16 Jun 2017 01:32:04 -0400 Original-Received: from mail-it0-f67.google.com ([209.85.214.67]:35128) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dLjrW-0007ID-Q7 for 24084@debbugs.gnu.org; Fri, 16 Jun 2017 01:32:03 -0400 Original-Received: by mail-it0-f67.google.com with SMTP id f20so3749015itb.2 for <24084@debbugs.gnu.org>; Thu, 15 Jun 2017 22:32:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=g4i+tm1XIPUITTJpVurF8FuCRmLqi+hXiX/UEKY1e/Y=; b=egb1c0mO5ig9/tFxIT8viBgwFT9r0StpGTiCz4GQjWw0UAQEgV1fUqlVw/UcBBo1v1 JLNv/hk71/PtH5Lz+Enoh/37eCU7HqNi321i9FFui8Wk7gmSBc2kAgm5phKyBku4pxvy HSiaKBIQliUV+0pAglX89oGI2n6F9+aL5/5CJq/0VY63VmII2zRoGQOyY1ntDi4h85V9 70MVCJxKtOjWtU7a29habJ9RCvloZ4C+McUQOc9Or+NowOGZ8fSMwiYsh8Z7iTfAHzAY bRodiikR4V/a7AceCzPO2fAMbsChOibn2uJdmQyMc4ZIbiQ9GriuSDw+8f0uNqs6PQVg 6TUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=g4i+tm1XIPUITTJpVurF8FuCRmLqi+hXiX/UEKY1e/Y=; b=AYwHMuNhWi9OLBE4b52+KFAT0ieBlodAP069SumYQAVflSszc9dHB0htrnjClMXyht r9e72qrp9GbQwRK1nUCAJ7w+cG/psl/+dDKMZZfUp81Jq9Sq9Kai3PN1IRDju6/vn4Sa Ul1MXqLFdXLN8whWnhQudBJKCA9eUqZtctJ1AeV0koqjRk5dNmX49sy5ctgc2qnVoYvt 0VzbvHIAEDocRvs89Booj7T7jNGWTkKOSJKjYGZ8JGiQCGYrKU3j2Q927KglfJvb0So+ sGp70GivyB3KaFlx5Gcwq72cFdJwJWgCYLy6rWk8wJYP9AGtca03tRdoRvu2RXeVuyXV oIWw== X-Gm-Message-State: AKS2vOwuGF9GxOeD9ptSjxpqoGk1jaQ3ckgK80a9PGXySfNlQ3CBUGrA /R58JyoTv6oMW/m8 X-Received: by 10.36.108.131 with SMTP id w125mr8858371itb.91.1497591116830; Thu, 15 Jun 2017 22:31:56 -0700 (PDT) Original-Received: from lylat (S010664777d9cebe3.ss.shawcable.net. [70.64.85.59]) by smtp.gmail.com with ESMTPSA id x29sm730906ioi.14.2017.06.15.22.31.55 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 15 Jun 2017 22:31:55 -0700 (PDT) In-Reply-To: (Sebastian Schueppel's message of "Wed, 27 Jul 2016 01:00:42 +0000") 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:133627 Archived-At: Sebastian Schueppel 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. > > > #include > > 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 > > > 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.