From: Julien Danjou Date: Mon, 18 Oct 2010 21:07:31 +0000 (-0400) Subject: * src/frame.c (Fframe_pointer_visible_p): X-Git-Tag: emacs-pretest-24.0.90~104^2~275^2~438^2~45^2~572 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=c978536f741b75ff44639f723984abf983d9063a;p=emacs.git * src/frame.c (Fframe_pointer_visible_p): Add `frame-pointer-visible-p' to get the pointer visibility. --- diff --git a/doc/lispref/frames.texi b/doc/lispref/frames.texi index d27010d2096..4c44d0a6439 100644 --- a/doc/lispref/frames.texi +++ b/doc/lispref/frames.texi @@ -1748,6 +1748,15 @@ If @var{frame} is not visible, this function does nothing. The return value is not significant. @end defun +@defun frame-pointer-visible-p &optional frame +This predicate function returns non-@code{nil} if the mouse pointer +displayed on @var{frame} is visible; otherwise it returns @code{nil}. +@var{frame} omitted or @code{nil} means the selected frame. This is +useful when @code{make-pointer-invisible} is set to @code{t}: it +allows to know if the pointer has been hidden. +@xref{Mouse Avoidance,,,emacs}. +@end defun + @need 3000 @node Pop-Up Menus diff --git a/src/ChangeLog b/src/ChangeLog index 7755ed8c82b..7046d13262f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2010-10-18 Julien Danjou + + * frame.c (Fframe_pointer_visible_p): + Add `frame-pointer-visible-p' to get the pointer visibility. + 2010-10-18 Lars Magne Ingebrigtsen * gnutls.c (emacs_gnutls_read): Return 0 if we get a diff --git a/src/frame.c b/src/frame.c index 04cc1ca07da..ed54d24197f 100644 --- a/src/frame.c +++ b/src/frame.c @@ -4314,6 +4314,20 @@ frame_make_pointer_visible (void) } } +DEFUN ("frame-pointer-visible-p", Fframe_pointer_visible_p, + Sframe_pointer_visible_p, 0, 1, 0, + doc: /* Return t if the mouse pointer displayed on FRAME is visible. +Otherwise it returns nil. FRAME omitted or nil means the +selected frame. This is useful when `make-pointer-invisible' is set. */) + (Lisp_Object frame) +{ + if (NILP (frame)) + frame = selected_frame; + + CHECK_FRAME (frame); + + return (XFRAME (frame)->pointer_invisible ? Qnil : Qt); +} /*********************************************************************** @@ -4623,6 +4637,7 @@ automatically. See also `mouse-autoselect-window'. */); defsubr (&Sset_frame_width); defsubr (&Sset_frame_size); defsubr (&Sset_frame_position); + defsubr (&Sframe_pointer_visible_p); #ifdef HAVE_WINDOW_SYSTEM defsubr (&Sx_get_resource);