emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 1/2] Add frame-pointer-visible-p


From: Julien Danjou
Subject: Re: [PATCH 1/2] Add frame-pointer-visible-p
Date: Mon, 18 Oct 2010 11:31:30 +0200
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/24.0.50 (gnu/linux)

On Sun, Oct 17 2010, Stefan Monnier wrote:

> Looks pretty good, thank you, except for:

Stefan, thanks a lot for the review. That's my first C patch for Emacs,
so I'm glad to see your comments and learn!

> One more thing: while I see that the C code currently stores the
> visibility in the frame data-structure, I'm not completely sure if this
> data is truly frame-specific as opposed to terminal-specific.
> Can someone confirm this issue?

In theory, since you can have more pointers nowadays, it should/can be
frame specific. Not sure it's really the case in Emacs, since Emacs
probably does not support multi-pointer right now (but I don't know for
sure).
Anyhow that may be raise a problem if you have multiple pointer on a
single frame.
Well, just thinking out loud. :)

Attached is a corrected version of the patch 1.

>From ca2e3eff6772f6fb2153ff61687764d6d1444be4 Mon Sep 17 00:00:00 2001
From: Julien Danjou <address@hidden>
Date: Thu, 14 Oct 2010 15:53:27 +0200
Subject: [PATCH 1/2] Add frame-pointer-visible-p

Signed-off-by: Julien Danjou <address@hidden>
---
 doc/lispref/frames.texi |    7 +++++++
 src/ChangeLog           |    5 +++++
 src/frame.c             |   14 ++++++++++++++
 3 files changed, 26 insertions(+), 0 deletions(-)

diff --git a/doc/lispref/frames.texi b/doc/lispref/frames.texi
index d27010d..854e7b0 100644
--- a/doc/lispref/frames.texi
+++ b/doc/lispref/frames.texi
@@ -1748,6 +1748,13 @@ If @var{frame} is not visible, this function does 
nothing.  The return
 value is not significant.
 @end defun
 
address@hidden frame-pointer-visible-p &opt frame
+This function return the current visibility status of the mouse
+pointer in @var{frame}. This is useful when
address@hidden is set to @code{t}: it allows to know if
+the pointer has been hidden.
address@hidden defun
+
 @need 3000
 
 @node Pop-Up Menus
diff --git a/src/ChangeLog b/src/ChangeLog
index da344a4..95d4ad3 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -27,6 +27,11 @@
        * font.c (Ffont_variation_glyphs):
        * ccl.c (Fccl_execute_on_string): Fix typo in docstring.
 
+2010-10-14  Julien Danjou  <address@hidden>
+
+       * frame.c (Fframe_pointer_visible_p): Add
+       `frame-pointer-visible-p' to get the pointer visibility.
+
 2010-10-14  Juanma Barranquero  <address@hidden>
 
        * w32fns.c (w32_wnd_proc, file_dialog_callback):
diff --git a/src/frame.c b/src/frame.c
index 04cc1ca..92c6925 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -4314,6 +4314,19 @@ frame_make_pointer_visible (void)
     }
 }
 
+DEFUN ("frame-pointer-visible-p", Fframe_pointer_visible_p,
+       Sframe_pointer_visible_p, 0, 1, 0,
+       doc: /* Return FRAME pointer visibility status.
+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 +4636,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);
-- 
1.7.1

-- 
Julien Danjou
// ᐰ <address@hidden>   http://julien.danjou.info

reply via email to

[Prev in Thread] Current Thread [Next in Thread]