Gitweb links:
...log
http://git.netsurf-browser.org/netsurf.git/shortlog/99c47eb99be4309e996f4...
...commit
http://git.netsurf-browser.org/netsurf.git/commit/99c47eb99be4309e996f4cb...
...tree
http://git.netsurf-browser.org/netsurf.git/tree/99c47eb99be4309e996f4cb03...
The branch, master has been updated
via 99c47eb99be4309e996f4cb038916260fd2bcb44 (commit)
from f0f05d691ba748314e57da754518dfbad6a7a339 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=99c47eb99be4309e996...
commit 99c47eb99be4309e996f4cb038916260fd2bcb44
Author: Steve Fryatt <stevef(a)netsurf-browser.org>
Commit: Steve Fryatt <stevef(a)netsurf-browser.org>
Allow mouse tracking events to terminate without a PointerLeaving event being
received.
This change should handle the situation where a PointerEntering event is received
without a corresponding PointerLeaving event, which appears to be caused by some
third-party OS addons. This could cause unexpected consequences, so all such terminations
are currently logged.
diff --git a/riscos/mouse.c b/riscos/mouse.c
index a20965e..e934c1c 100644
--- a/riscos/mouse.c
+++ b/riscos/mouse.c
@@ -163,9 +163,11 @@ void ro_mouse_drag_end(wimp_dragged *dragged)
* Start tracking the mouse in a window, providing a function to be called on
* null polls and optionally one to be called when it leaves the window.
*
- * \param *drag_end Callback for when the pointer leaves the window, or
- * NULL for none.
- * \param *drag_track Callback for mouse tracking while the pointer remains
+ * \param *poll_end Callback for when the pointer leaves the window, or
+ * NULL for none. Claimants can receive *leaving==NULL if
+ * a new tracker is started before a PointerLeaving event
+ * is received.
+ * \param *poll_track Callback for mouse tracking while the pointer remains
* in the window, or NULL for none.
* \param *data Data to be passed to the callback functions, or NULL.
*/
@@ -175,12 +177,31 @@ void ro_mouse_track_start(void (*poll_end)(wimp_leaving *leaving,
void *data),
void *data)
{
/* It should never be possible for the mouse to be in two windows
- * at the same time!
+ * at the same time! However, some third-party extensions to RISC OS
+ * appear to make this possible (MouseAxess being one), so in the
+ * event that there's still a claimant we tidy them up first and then
+ * log the fact in case there are any unexpected consequences.
+ *
+ * NB: The Poll End callback will get called with *leaving == NULL in
+ * this situation, as there's no PointerLeaving event to pass on.
*/
- assert(ro_mouse_poll_end_callback == NULL &&
- ro_mouse_poll_track_callback == NULL &&
- ro_mouse_poll_data == NULL);
+ if (ro_mouse_poll_end_callback != NULL ||
+ ro_mouse_poll_track_callback != NULL ||
+ ro_mouse_poll_data != NULL) {
+ if (ro_mouse_poll_end_callback != NULL &&
+ ro_mouse_ignore_leaving_event == false)
+ ro_mouse_poll_end_callback(NULL, ro_mouse_poll_data);
+
+ LOG(("Unexpected mouse track termination."));
+
+ ro_mouse_ignore_leaving_event = false;
+ ro_mouse_poll_end_callback = NULL;
+ ro_mouse_poll_track_callback = NULL;
+ ro_mouse_poll_data = NULL;
+ }
+
+ /* Now record details of the new claimant. */
ro_mouse_poll_end_callback = poll_end;
ro_mouse_poll_track_callback = poll_track;
diff --git a/riscos/mouse.h b/riscos/mouse.h
index bcb3b50..8a7405a 100644
--- a/riscos/mouse.h
+++ b/riscos/mouse.h
@@ -65,9 +65,11 @@ void ro_mouse_drag_end(wimp_dragged *dragged);
* Start tracking the mouse in a window, providing a function to be called on
* null polls and optionally one to be called when it leaves the window.
*
- * \param *drag_end Callback for when the pointer leaves the window, or
- * NULL for none.
- * \param *drag_track Callback for mouse tracking while the pointer remains
+ * \param *poll_end Callback for when the pointer leaves the window, or
+ * NULL for none. Claimants can receive *leaving==NULL if
+ * a new tracker is started before a PointerLeaving event
+ * is received.
+ * \param *poll_track Callback for mouse tracking while the pointer remains
* in the window, or NULL for none.
* \param *data Data to be passed to the callback functions, or NULL.
*/
-----------------------------------------------------------------------
Summary of changes:
riscos/mouse.c | 35 ++++++++++++++++++++++++++++-------
riscos/mouse.h | 8 +++++---
2 files changed, 33 insertions(+), 10 deletions(-)
diff --git a/riscos/mouse.c b/riscos/mouse.c
index a20965e..e934c1c 100644
--- a/riscos/mouse.c
+++ b/riscos/mouse.c
@@ -163,9 +163,11 @@ void ro_mouse_drag_end(wimp_dragged *dragged)
* Start tracking the mouse in a window, providing a function to be called on
* null polls and optionally one to be called when it leaves the window.
*
- * \param *drag_end Callback for when the pointer leaves the window, or
- * NULL for none.
- * \param *drag_track Callback for mouse tracking while the pointer remains
+ * \param *poll_end Callback for when the pointer leaves the window, or
+ * NULL for none. Claimants can receive *leaving==NULL if
+ * a new tracker is started before a PointerLeaving event
+ * is received.
+ * \param *poll_track Callback for mouse tracking while the pointer remains
* in the window, or NULL for none.
* \param *data Data to be passed to the callback functions, or NULL.
*/
@@ -175,12 +177,31 @@ void ro_mouse_track_start(void (*poll_end)(wimp_leaving *leaving,
void *data),
void *data)
{
/* It should never be possible for the mouse to be in two windows
- * at the same time!
+ * at the same time! However, some third-party extensions to RISC OS
+ * appear to make this possible (MouseAxess being one), so in the
+ * event that there's still a claimant we tidy them up first and then
+ * log the fact in case there are any unexpected consequences.
+ *
+ * NB: The Poll End callback will get called with *leaving == NULL in
+ * this situation, as there's no PointerLeaving event to pass on.
*/
- assert(ro_mouse_poll_end_callback == NULL &&
- ro_mouse_poll_track_callback == NULL &&
- ro_mouse_poll_data == NULL);
+ if (ro_mouse_poll_end_callback != NULL ||
+ ro_mouse_poll_track_callback != NULL ||
+ ro_mouse_poll_data != NULL) {
+ if (ro_mouse_poll_end_callback != NULL &&
+ ro_mouse_ignore_leaving_event == false)
+ ro_mouse_poll_end_callback(NULL, ro_mouse_poll_data);
+
+ LOG(("Unexpected mouse track termination."));
+
+ ro_mouse_ignore_leaving_event = false;
+ ro_mouse_poll_end_callback = NULL;
+ ro_mouse_poll_track_callback = NULL;
+ ro_mouse_poll_data = NULL;
+ }
+
+ /* Now record details of the new claimant. */
ro_mouse_poll_end_callback = poll_end;
ro_mouse_poll_track_callback = poll_track;
diff --git a/riscos/mouse.h b/riscos/mouse.h
index bcb3b50..8a7405a 100644
--- a/riscos/mouse.h
+++ b/riscos/mouse.h
@@ -65,9 +65,11 @@ void ro_mouse_drag_end(wimp_dragged *dragged);
* Start tracking the mouse in a window, providing a function to be called on
* null polls and optionally one to be called when it leaves the window.
*
- * \param *drag_end Callback for when the pointer leaves the window, or
- * NULL for none.
- * \param *drag_track Callback for mouse tracking while the pointer remains
+ * \param *poll_end Callback for when the pointer leaves the window, or
+ * NULL for none. Claimants can receive *leaving==NULL if
+ * a new tracker is started before a PointerLeaving event
+ * is received.
+ * \param *poll_track Callback for mouse tracking while the pointer remains
* in the window, or NULL for none.
* \param *data Data to be passed to the callback functions, or NULL.
*/
--
NetSurf Browser