all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Paul Eggert <eggert@cs.ucla.edu>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 8664@debbugs.gnu.org
Subject: bug#8664: Being more-systematic about user-interface timestamps
Date: Sat, 14 May 2011 02:10:27 -0700	[thread overview]
Message-ID: <4DCE4703.30703@cs.ucla.edu> (raw)
In-Reply-To: <831v03gewe.fsf@gnu.org>

On 05/13/11 01:53, Eli Zaretskii wrote:
>> +#ifdef HAVE_X_WINDOWS
>> +# include <X11/X.h>
>> +#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 <windows.h>

+#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 */
-







  reply	other threads:[~2011-05-14  9:10 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-12 19:58 bug#8664: * keyboard.c (make_lispy_event): Fix problem in integer overflow Paul Eggert
2011-05-12 20:26 ` bug#8664: Being more-systematic about user-interface timestamps Paul Eggert
2011-05-13  8:53   ` Eli Zaretskii
2011-05-14  9:10     ` Paul Eggert [this message]
2011-05-14  9:41       ` Eli Zaretskii
2011-05-14 19:09         ` Paul Eggert
2011-05-14 20:47           ` Eli Zaretskii
  -- strict thread matches above, loose matches on Subject: below --
2011-05-16  5:07 bug#8675: lisp_string_width and strings wider than INT_MAX Paul Eggert
2011-05-16  5:30 ` Eli Zaretskii
2011-05-16  5:33   ` Paul Eggert
2011-05-16  7:57     ` Eli Zaretskii
2011-05-16 16:37       ` Paul Eggert
2011-05-16 16:48       ` Stefan Monnier
2011-05-17  9:52         ` Eli Zaretskii
2011-05-17 10:30         ` merge-commits policy (was: bug#8675: lisp_string_width and strings wider than INT_MAX) Eli Zaretskii
2011-05-17 13:42           ` merge-commits policy Stefan Monnier
2011-05-17 17:57             ` Eli Zaretskii
2011-05-17 19:50               ` Stefan Monnier
2011-05-18  1:33 ` bug#8675: committed fix into trunk Paul Eggert
2011-05-18  2:26   ` Christoph Scholtes
2011-05-18  2:48     ` Paul Eggert
2011-05-18  3:19       ` Christoph Scholtes
2011-05-18 12:39       ` Andreas Schwab
2011-05-18 19:55         ` bug#8675: error: token "@" is not valid in preprocessor expressions Paul Eggert
     [not found]         ` <4DD42421.6090906@cs.ucla.edu>
2011-05-18 20:35           ` Andreas Schwab
     [not found]           ` <m262p7u4ph.fsf@igel.home>
2011-05-18 22:59             ` Paul Eggert
     [not found]             ` <4DD44F42.1050405@cs.ucla.edu>
2011-05-19  0:27               ` Bruno Haible
     [not found]               ` <201105190227.26215.bruno@clisp.org>
2011-05-19  1:47                 ` Christoph Scholtes
2011-05-19  7:39                   ` Paul Eggert
2011-05-18  6:54   ` bug#8664: committed fix into trunk Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4DCE4703.30703@cs.ucla.edu \
    --to=eggert@cs.ucla.edu \
    --cc=8664@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.