From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.bugs Subject: bug#8664: Being more-systematic about user-interface timestamps Date: Sat, 14 May 2011 02:10:27 -0700 Organization: UCLA Computer Science Department Message-ID: <4DCE4703.30703@cs.ucla.edu> References: <4DCC3BD6.3000200@cs.ucla.edu> <4DCC425E.2070608@cs.ucla.edu> <831v03gewe.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1305364279 18572 80.91.229.12 (14 May 2011 09:11:19 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 14 May 2011 09:11:19 +0000 (UTC) Cc: 8664@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat May 14 11:11:15 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QLAsR-0007Fb-4X for geb-bug-gnu-emacs@m.gmane.org; Sat, 14 May 2011 11:11:11 +0200 Original-Received: from localhost ([::1]:50811 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QLAsQ-0006fS-D6 for geb-bug-gnu-emacs@m.gmane.org; Sat, 14 May 2011 05:11:10 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:53111) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QLAsJ-0006fJ-Rx for bug-gnu-emacs@gnu.org; Sat, 14 May 2011 05:11:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QLAsI-0006gO-UE for bug-gnu-emacs@gnu.org; Sat, 14 May 2011 05:11:03 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:52930) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QLAsI-0006gJ-Sa for bug-gnu-emacs@gnu.org; Sat, 14 May 2011 05:11:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1QLAsI-0006AN-E3; Sat, 14 May 2011 05:11:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Paul Eggert Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 14 May 2011 09:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 8664 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 8664-submit@debbugs.gnu.org id=B8664.130536423623670 (code B ref 8664); Sat, 14 May 2011 09:11:02 +0000 Original-Received: (at 8664) by debbugs.gnu.org; 14 May 2011 09:10:36 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QLArs-00069j-3o for submit@debbugs.gnu.org; Sat, 14 May 2011 05:10:36 -0400 Original-Received: from smtp.cs.ucla.edu ([131.179.128.62]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QLArq-00069U-8L for 8664@debbugs.gnu.org; Sat, 14 May 2011 05:10:35 -0400 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 768F739E812A; Sat, 14 May 2011 02:10:28 -0700 (PDT) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Original-Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id BTaO4LbwFM3Z; Sat, 14 May 2011 02:10:27 -0700 (PDT) Original-Received: from [192.168.1.10] (pool-71-189-109-235.lsanca.fios.verizon.net [71.189.109.235]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 9A37B39E8113; Sat, 14 May 2011 02:10:27 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.17) Gecko/20110424 Thunderbird/3.1.10 In-Reply-To: <831v03gewe.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Sat, 14 May 2011 05:11:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:46461 Archived-At: On 05/13/11 01:53, Eli Zaretskii wrote: >> +#ifdef HAVE_X_WINDOWS >> +# include >> +#else >> +typedef unsigned long Time; >> +#endif > > Wouldn't this clash with the typedef in w32gui.h? Yes, thanks, good catch. Proposed fix below. > This needs a corresponding change in all the functions used as > mouse_position_hook on different platforms. You made such a change > only in 2 of them: term_mouse_position and XTmouse_position. Thanks for that too. For NextStep a change is needed, also proposed below. No change should be needed for w32's hooks, since there's no actual change to the data type there. For documentation purposes it might be nice to run through the hooks and change 'unsigned long' to 'Time' where appropriate, but that's not essential. Normally I'm reluctant to mess with the w32 code as I can't easily test it. Fixups, following up to the user-interface timestamp change. * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time for UI timestamps, instead of unsigned long. * w32gui.h (Time): Define by including "systime.h" rather than by declaring it ourselves. (Bug#8664) === modified file 'src/nsterm.m' --- src/nsterm.m 2011-04-03 08:30:57 +0000 +++ src/nsterm.m 2011-05-14 08:56:08 +0000 @@ -158,7 +158,7 @@ /* display update */ NSPoint last_mouse_motion_position; static NSRect last_mouse_glyph; -static unsigned long last_mouse_movement_time = 0; +static Time last_mouse_movement_time = 0; static Lisp_Object last_mouse_motion_frame; static EmacsScroller *last_mouse_scroll_bar = nil; static struct frame *ns_updating_frame; @@ -1789,7 +1789,7 @@ static void ns_mouse_position (struct frame **fp, int insist, Lisp_Object *bar_window, enum scroll_bar_part *part, Lisp_Object *x, Lisp_Object *y, - unsigned long *time) + Time *time) /* -------------------------------------------------------------------------- External (hook): inform emacs about mouse position and hit parts. If a scrollbar is being dragged, set bar_window, part, x, y, time. @@ -6531,5 +6531,3 @@ /* Tell emacs about this window system. */ Fprovide (intern ("ns"), Qnil); } - - === modified file 'src/w32gui.h' --- src/w32gui.h 2011-01-25 04:08:28 +0000 +++ src/w32gui.h 2011-05-14 09:01:32 +0000 @@ -20,6 +20,8 @@ #define EMACS_W32GUI_H #include +#include "systime.h" /* for Time */ + /* Local memory management for menus. */ #define local_heap (GetProcessHeap ()) #define local_alloc(n) (HeapAlloc (local_heap, HEAP_ZERO_MEMORY, (n))) @@ -47,7 +49,6 @@ typedef XGCValues * GC; typedef COLORREF Color; -typedef DWORD Time; typedef HWND Window; typedef HDC Display; /* HDC so it doesn't conflict with xpm lib. */ typedef HCURSOR Cursor; @@ -147,4 +148,3 @@ #endif /* EMACS_W32GUI_H */ -