From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: YAMAMOTO Mitsuharu Newsgroups: gmane.emacs.devel Subject: Re: Emacs geometry Date: Fri, 28 Jul 2006 11:57:04 +0900 Organization: Faculty of Science, Chiba University Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-Trace: sea.gmane.org 1154055453 32274 80.91.229.2 (28 Jul 2006 02:57:33 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 28 Jul 2006 02:57:33 +0000 (UTC) Cc: angeli@caeruleus.net, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jul 28 04:57:31 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1G6IXY-0006UD-GW for ged-emacs-devel@m.gmane.org; Fri, 28 Jul 2006 04:57:28 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1G6IXY-00063j-1t for ged-emacs-devel@m.gmane.org; Thu, 27 Jul 2006 22:57:28 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1G6IXN-00062A-Nu for emacs-devel@gnu.org; Thu, 27 Jul 2006 22:57:17 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1G6IXL-00060J-P9 for emacs-devel@gnu.org; Thu, 27 Jul 2006 22:57:17 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1G6IXL-00060E-ME for emacs-devel@gnu.org; Thu, 27 Jul 2006 22:57:15 -0400 Original-Received: from [133.82.132.2] (helo=mathmail.math.s.chiba-u.ac.jp) by monty-python.gnu.org with esmtp (Exim 4.52) id 1G6IZB-0001ft-EF; Thu, 27 Jul 2006 22:59:09 -0400 Original-Received: from church.math.s.chiba-u.ac.jp (church [133.82.132.36]) by mathmail.math.s.chiba-u.ac.jp (Postfix) with ESMTP id DD8962C83; Fri, 28 Jul 2006 11:57:04 +0900 (JST) Original-To: Eli Zaretskii In-Reply-To: User-Agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.6 (Marutamachi) APEL/10.6 Emacs/22.0.50 (sparc-sun-solaris2.8) MULE/5.0 (SAKAKI) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:57710 Archived-At: >>>>> On Tue, 25 Jul 2006 23:41:47 +0300, Eli Zaretskii said: > you should instead honor f->left_pos and f->top_pos, if they were > set from initial-frame-alist. The problem is to decide correctly > when to honor them. Maybe XSizeHints emulation on the Mac Carbon port is relevant to this. 1. `struct mac_output' (in macterm.h) has a member for size hints. #define FRAME_SIZE_HINTS(f) ((f)->output_data.mac->size_hints) 2. `x_make_frame_visible' (in macterm.c) checks the flag in the size hints to see if f->left_pos and f->top_pos are set by the user. If not, reposition the frame to the center of the main screen when there is no selected frame, and to the cascading position with respect to the selected frame when it is available. if (! FRAME_ICONIFIED_P (f) && ! f->output_data.mac->asked_for_visible) { #if TARGET_API_MAC_CARBON if (!(FRAME_SIZE_HINTS (f)->flags & (USPosition | PPosition))) { struct frame *sf = SELECTED_FRAME (); if (!FRAME_MAC_P (sf)) RepositionWindow (FRAME_MAC_WINDOW (f), NULL, kWindowCenterOnMainScreen); else RepositionWindow (FRAME_MAC_WINDOW (f), FRAME_MAC_WINDOW (sf), #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1020 kWindowCascadeStartAtParentWindowScreen #else kWindowCascadeOnParentWindowScreen #endif ); x_real_positions (f, &f->left_pos, &f->top_pos); } else #endif x_set_offset (f, f->left_pos, f->top_pos, 0); } 3. `x_set_offset' (in macterm.c) enforces a constraint that the title bar should be visible at least partially. We have a menu bar at the top of screen on Mac, so it is needed in order to prevent the title bar from being hidden when f->top_pos == 0. #if TARGET_API_MAC_CARBON MoveWindowStructure (FRAME_MAC_WINDOW (f), f->left_pos, f->top_pos); /* If the title bar is completely outside the screen, adjust the position. */ ConstrainWindowToScreen (FRAME_MAC_WINDOW (f), kWindowTitleBarRgn, kWindowConstrainMoveRegardlessOfFit | kWindowConstrainAllowPartial, NULL, NULL); x_real_positions (f, &f->left_pos, &f->top_pos); #else YAMAMOTO Mitsuharu mituharu@math.s.chiba-u.ac.jp