From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Jan D." Newsgroups: gmane.emacs.devel Subject: x-popup-menu pops up at funny positions Date: Fri, 03 Jan 2003 17:15:18 +0100 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <3E15B716.6080301@swipnet.se> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------000508000102020709060509" X-Trace: main.gmane.org 1041610725 24950 80.91.224.249 (3 Jan 2003 16:18:45 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Fri, 3 Jan 2003 16:18:45 +0000 (UTC) Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18UUWy-0006UH-00 for ; Fri, 03 Jan 2003 17:18:44 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 18UUZe-0001zh-00 for ; Fri, 03 Jan 2003 17:21:30 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18UUVR-0005BH-02 for emacs-devel@quimby.gnus.org; Fri, 03 Jan 2003 11:17:09 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 18UUTo-0004Xn-00 for emacs-devel@gnu.org; Fri, 03 Jan 2003 11:15:28 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 18UUTm-0004Wn-00 for emacs-devel@gnu.org; Fri, 03 Jan 2003 11:15:28 -0500 Original-Received: from stubby.bodenonline.com ([193.201.16.94]) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18UUTm-0004Ur-00 for emacs-devel@gnu.org; Fri, 03 Jan 2003 11:15:26 -0500 Original-Received: from swipnet.se (accessno42.bodenonline.com [193.201.16.44]) by stubby.bodenonline.com (8.12.1/8.12.1) with ESMTP id h03HAqdw016742 for ; Fri, 3 Jan 2003 18:10:53 +0100 User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2a) Gecko/20020910 X-Accept-Language: en-us, en Original-To: emacs-devel@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Emacs development discussions. List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:10434 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:10434 This is a multi-part message in MIME format. --------------000508000102020709060509 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Hello. While trying to reproduce a reported problem with x-popup-menu (that problem seems to be gone), I saw that x-popup-menu doesn't put the menu in the correct position if the (x y) variant is used, like this: (x-popup-menu (list '(1 1) (selected-window)) (list "title" (cons "title" '(("ignore" 'ignore))) )) For lucid and motif, this puts the popup menu at a position that would be correct if the Emacs edit window is at (0 0) on the root window. If Emacs is anywhere else on the root window, this is wrong. Here is a patch to fix that. Is it OK to check in? Jan D. --------------000508000102020709060509 Content-Type: text/plain; name="xmenu.c.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="xmenu.c.patch" *** src/xmenu.c.~1.239.~ 2002-12-27 16:43:12.000000000 +0100 --- src/xmenu.c 2003-01-03 16:48:42.000000000 +0100 *************** *** 2279,2315 **** popup_deactivate_callback, menu_highlight_callback); - /* Adjust coordinates to relative to the outer (window manager) window. */ - { - Window child; - int win_x = 0, win_y = 0; - - /* Find the position of the outside upper-left corner of - the inner window, with respect to the outer window. */ - if (f->output_data.x->parent_desc != FRAME_X_DISPLAY_INFO (f)->root_window) - { - BLOCK_INPUT; - XTranslateCoordinates (FRAME_X_DISPLAY (f), - - /* From-window, to-window. */ - f->output_data.x->window_desc, - f->output_data.x->parent_desc, - - /* From-position, to-position. */ - 0, 0, &win_x, &win_y, - - /* Child of window. */ - &child); - UNBLOCK_INPUT; - x += win_x; - y += win_y; - } - } - - /* Adjust coordinates to be root-window-relative. */ - x += f->output_data.x->left_pos; - y += f->output_data.x->top_pos; - dummy.type = ButtonPress; dummy.serial = 0; dummy.send_event = 0; --- 2279,2284 ---- *************** *** 2318,2327 **** dummy.root = FRAME_X_DISPLAY_INFO (f)->root_window; dummy.window = dummy.root; dummy.subwindow = dummy.root; - dummy.x_root = x; - dummy.y_root = y; dummy.x = x; dummy.y = y; dummy.state = (FRAME_X_DISPLAY_INFO (f)->grabbed >> 1) * Button1Mask; dummy.button = 0; for (i = 0; i < 5; i++) --- 2287,2299 ---- dummy.root = FRAME_X_DISPLAY_INFO (f)->root_window; dummy.window = dummy.root; dummy.subwindow = dummy.root; dummy.x = x; dummy.y = y; + /* Adjust coordinates to be root-window-relative. */ + x += f->output_data.x->left_pos; + y += f->output_data.x->top_pos; + dummy.x_root = x; + dummy.y_root = y; dummy.state = (FRAME_X_DISPLAY_INFO (f)->grabbed >> 1) * Button1Mask; dummy.button = 0; for (i = 0; i < 5; i++) --------------000508000102020709060509 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://mail.gnu.org/mailman/listinfo/emacs-devel --------------000508000102020709060509--