[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] emacs etc/NEWS lisp/ChangeLog lisp/cus-start.el...
From: |
Jan Djärv |
Subject: |
[Emacs-diffs] emacs etc/NEWS lisp/ChangeLog lisp/cus-start.el... |
Date: |
Fri, 03 Jul 2009 11:07:14 +0000 |
CVSROOT: /cvsroot/emacs
Module name: emacs
Changes by: Jan Djärv <jhd> 09/07/03 11:07:13
Modified files:
etc : NEWS
lisp : ChangeLog cus-start.el
src : ChangeLog frame.c frame.h keyboard.c
termhooks.h xfns.c xterm.c xterm.h
Log message:
* xterm.h (struct x_display_info): Add invisible_cursor.
(struct x_output): Add current_cursor.
* xterm.c (XTtoggle_invisible_pointer): New function.
(x_define_frame_cursor): Don't define cursor if invisible or the
same as before. Set current_cursor.
(x_create_terminal): Set toggle_invisible_pointer_hook.
* xfns.c (make_invisible_cursor): New function.
(x_set_mouse_color): Call make_invisible_cursor.
Set current_cursor.
(x_window): Set current_cursor.
* termhooks.h (struct terminal): Add toggle_invisible_pointer_hook.
* keyboard.c (command_loop_1): Call frame_make_pointer_invisible after
inserting a character.
(read_avail_input): Call frame_make_pointer_visible.
* frame.c (Vmake_pointer_invisible): New variable.
(frame_make_pointer_invisible, frame_make_pointer_visible): New
functions.
(syms_of_frame): DEFVAR make-pointer-invisible, initialize to Qt.
* frame.h: Declare frame_make_pointer_invisible and
frame_make_pointer_visible.
(struct frame): Add pointer_invisible.
* cus-start.el (all): Added make-pointer-invisible.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/etc/NEWS?cvsroot=emacs&r1=1.2037&r2=1.2038
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/ChangeLog?cvsroot=emacs&r1=1.15756&r2=1.15757
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/cus-start.el?cvsroot=emacs&r1=1.137&r2=1.138
http://cvs.savannah.gnu.org/viewcvs/emacs/src/ChangeLog?cvsroot=emacs&r1=1.7625&r2=1.7626
http://cvs.savannah.gnu.org/viewcvs/emacs/src/frame.c?cvsroot=emacs&r1=1.422&r2=1.423
http://cvs.savannah.gnu.org/viewcvs/emacs/src/frame.h?cvsroot=emacs&r1=1.149&r2=1.150
http://cvs.savannah.gnu.org/viewcvs/emacs/src/keyboard.c?cvsroot=emacs&r1=1.1007&r2=1.1008
http://cvs.savannah.gnu.org/viewcvs/emacs/src/termhooks.h?cvsroot=emacs&r1=1.103&r2=1.104
http://cvs.savannah.gnu.org/viewcvs/emacs/src/xfns.c?cvsroot=emacs&r1=1.738&r2=1.739
http://cvs.savannah.gnu.org/viewcvs/emacs/src/xterm.c?cvsroot=emacs&r1=1.1035&r2=1.1036
http://cvs.savannah.gnu.org/viewcvs/emacs/src/xterm.h?cvsroot=emacs&r1=1.212&r2=1.213
Patches:
Index: etc/NEWS
===================================================================
RCS file: /cvsroot/emacs/emacs/etc/NEWS,v
retrieving revision 1.2037
retrieving revision 1.2038
diff -u -b -r1.2037 -r1.2038
--- etc/NEWS 2 Jul 2009 23:01:42 -0000 1.2037
+++ etc/NEWS 3 Jul 2009 11:07:02 -0000 1.2038
@@ -38,6 +38,9 @@
+++
** New frame parameter sticky makes Emacs frames sticky in virtual desktops.
+** The pointer now becomes invisible when typing.
+Customize make-pointer-invisible to turn it off.
+
* Changes in Specialized Modes and Packages in Emacs 23.2
Index: lisp/ChangeLog
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/ChangeLog,v
retrieving revision 1.15756
retrieving revision 1.15757
diff -u -b -r1.15756 -r1.15757
--- lisp/ChangeLog 3 Jul 2009 01:43:33 -0000 1.15756
+++ lisp/ChangeLog 3 Jul 2009 11:07:03 -0000 1.15757
@@ -1,3 +1,7 @@
+2009-07-03 Jan Djärv <address@hidden>
+
+ * cus-start.el (all): Added make-pointer-invisible.
+
2009-07-03 Jay Belanger <address@hidden>
* calc-math.el (math-use-emacs-fn): Make sure that the number is
Index: lisp/cus-start.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/cus-start.el,v
retrieving revision 1.137
retrieving revision 1.138
diff -u -b -r1.137 -r1.138
--- lisp/cus-start.el 23 Jun 2009 07:07:47 -0000 1.137
+++ lisp/cus-start.el 3 Jul 2009 11:07:08 -0000 1.138
@@ -179,6 +179,7 @@
(const :tag "always shown" t)
(other :tag "hidden by keypress" 1))
"22.1")
+ (make-pointer-invisible mouse boolean "23.2")
;; fringe.c
(overflow-newline-into-fringe fringe boolean)
;; indent.c
Index: src/ChangeLog
===================================================================
RCS file: /cvsroot/emacs/emacs/src/ChangeLog,v
retrieving revision 1.7625
retrieving revision 1.7626
diff -u -b -r1.7625 -r1.7626
--- src/ChangeLog 2 Jul 2009 12:27:23 -0000 1.7625
+++ src/ChangeLog 3 Jul 2009 11:07:08 -0000 1.7626
@@ -1,3 +1,33 @@
+2009-07-03 Jan Djärv <address@hidden>
+
+ * xterm.h (struct x_display_info): Add invisible_cursor.
+ (struct x_output): Add current_cursor.
+
+ * xterm.c (XTtoggle_invisible_pointer): New function.
+ (x_define_frame_cursor): Don't define cursor if invisible or the
+ same as before. Set current_cursor.
+ (x_create_terminal): Set toggle_invisible_pointer_hook.
+
+ * xfns.c (make_invisible_cursor): New function.
+ (x_set_mouse_color): Call make_invisible_cursor.
+ Set current_cursor.
+ (x_window): Set current_cursor.
+
+ * termhooks.h (struct terminal): Add toggle_invisible_pointer_hook.
+
+ * keyboard.c (command_loop_1): Call frame_make_pointer_invisible after
+ inserting a character.
+ (read_avail_input): Call frame_make_pointer_visible.
+
+ * frame.c (Vmake_pointer_invisible): New variable.
+ (frame_make_pointer_invisible, frame_make_pointer_visible): New
+ functions.
+ (syms_of_frame): DEFVAR make-pointer-invisible, initialize to Qt.
+
+ * frame.h: Declare frame_make_pointer_invisible and
+ frame_make_pointer_visible.
+ (struct frame): Add pointer_invisible.
+
2009-07-02 Jan Djärv <address@hidden>
* gtkutil.c (xg_frame_set_char_size): Do set width/height if the
Index: src/frame.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/frame.c,v
retrieving revision 1.422
retrieving revision 1.423
diff -u -b -r1.422 -r1.423
--- src/frame.c 1 Jul 2009 16:48:37 -0000 1.422
+++ src/frame.c 3 Jul 2009 11:07:10 -0000 1.423
@@ -52,6 +52,9 @@
#endif
+/* If we shall make pointer invisible when typing or not. */
+Lisp_Object Vmake_pointer_invisible;
+
#ifdef HAVE_WINDOW_SYSTEM
/* The name we're using in resource queries. Most often "emacs". */
@@ -4350,6 +4353,37 @@
#endif /* HAVE_WINDOW_SYSTEM */
+void
+frame_make_pointer_invisible ()
+{
+ if (! NILP (Vmake_pointer_invisible))
+ {
+ struct frame *f = SELECTED_FRAME ();
+ if (f && !f->pointer_invisible
+ && FRAME_TERMINAL (f)->toggle_invisible_pointer_hook)
+ {
+ f->mouse_moved = 0;
+ FRAME_TERMINAL (f)->toggle_invisible_pointer_hook (f, 1);
+ f->pointer_invisible = 1;
+ }
+ }
+}
+
+void
+frame_make_pointer_visible ()
+{
+ /* We don't check Vmake_pointer_invisible here in case the
+ pointer was invisible when Vmake_pointer_invisible was set to nil. */
+
+ struct frame *f = SELECTED_FRAME ();
+ if (f && f->pointer_invisible && f->mouse_moved
+ && FRAME_TERMINAL (f)->toggle_invisible_pointer_hook)
+ {
+ FRAME_TERMINAL (f)->toggle_invisible_pointer_hook (f, 0);
+ f->pointer_invisible = 0;
+ }
+}
+
/***********************************************************************
@@ -4552,6 +4586,11 @@
when the mouse is over clickable text. */);
Vmouse_highlight = Qt;
+ DEFVAR_LISP ("make-pointer-invisible", &Vmake_pointer_invisible,
+ doc: /* If non-nil, make pointer invisible while typing.
+The pointer becomes visible again when the mouse is moved. */);
+ Vmake_pointer_invisible = Qt;
+
DEFVAR_LISP ("delete-frame-functions", &Vdelete_frame_functions,
doc: /* Functions to be run before deleting a frame.
The functions are run with one arg, the frame to be deleted.
Index: src/frame.h
===================================================================
RCS file: /cvsroot/emacs/emacs/src/frame.h,v
retrieving revision 1.149
retrieving revision 1.150
diff -u -b -r1.149 -r1.150
--- src/frame.h 1 Jul 2009 16:58:07 -0000 1.149
+++ src/frame.h 3 Jul 2009 11:07:11 -0000 1.150
@@ -440,6 +440,9 @@
since the last time we checked. */
unsigned char mouse_moved :1;
+ /* Nonzero means that the pointer is invisible. */
+ unsigned char pointer_invisible :1;
+
/* If can_have_scroll_bars is non-zero, this is non-zero if we should
actually display them on this frame. */
enum vertical_scroll_bar_type vertical_scroll_bar_type;
@@ -830,6 +833,8 @@
Lisp_Object));
#endif /* HAVE_WINDOW_SYSTEM */
extern int other_visible_frames P_ ((struct frame *));
+extern void frame_make_pointer_invisible P_ ((void));
+extern void frame_make_pointer_visible P_ ((void));
extern Lisp_Object Vframe_list;
extern Lisp_Object Vdefault_frame_alist;
Index: src/keyboard.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/keyboard.c,v
retrieving revision 1.1007
retrieving revision 1.1008
diff -u -b -r1.1007 -r1.1008
--- src/keyboard.c 1 Jul 2009 11:37:19 -0000 1.1007
+++ src/keyboard.c 3 Jul 2009 11:07:11 -0000 1.1008
@@ -1867,6 +1867,8 @@
if (value == 2)
nonundocount = 0;
+ frame_make_pointer_invisible ();
+
if (! NILP (Vpost_command_hook))
/* Put this before calling adjust_point_for_property
so it will only get called once in any case. */
@@ -7134,6 +7136,8 @@
if (err && !nread)
nread = -1;
+ frame_make_pointer_visible ();
+
return nread;
}
Index: src/termhooks.h
===================================================================
RCS file: /cvsroot/emacs/emacs/src/termhooks.h,v
retrieving revision 1.103
retrieving revision 1.104
diff -u -b -r1.103 -r1.104
--- src/termhooks.h 27 Mar 2009 16:14:25 -0000 1.103
+++ src/termhooks.h 3 Jul 2009 11:07:11 -0000 1.104
@@ -427,6 +427,7 @@
void (*delete_glyphs_hook) P_ ((struct frame *, int));
void (*ring_bell_hook) P_ ((struct frame *f));
+ void (*toggle_invisible_pointer_hook) P_ ((struct frame *f, int invisible));
void (*reset_terminal_modes_hook) P_ ((struct terminal *));
void (*set_terminal_modes_hook) P_ ((struct terminal *));
Index: src/xfns.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/xfns.c,v
retrieving revision 1.738
retrieving revision 1.739
diff -u -b -r1.738 -r1.739
--- src/xfns.c 1 Jul 2009 16:48:38 -0000 1.738
+++ src/xfns.c 3 Jul 2009 11:07:11 -0000 1.739
@@ -941,6 +941,35 @@
}
}
+static Cursor
+make_invisible_cursor (f)
+ struct frame *f;
+{
+ Display *dpy = FRAME_X_DISPLAY (f);
+ static char const no_data[] = { 0 };
+ Pixmap pix;
+ XColor col;
+ Cursor c;
+
+ x_catch_errors (dpy);
+ pix = XCreateBitmapFromData (dpy, FRAME_X_DISPLAY_INFO (f)->root_window,
+ no_data, 1, 1);
+ if (! x_had_errors_p (dpy) && pix != None)
+ {
+ col.pixel = 0;
+ col.red = col.green = col.blue = 0;
+ col.flags = DoRed | DoGreen | DoBlue;
+ c = XCreatePixmapCursor (dpy, pix, pix, &col, &col, 0, 0);
+ if (x_had_errors_p (dpy) || c == None)
+ c = 0;
+ XFreePixmap (dpy, pix);
+ }
+
+ x_uncatch_errors ();
+
+ return c;
+}
+
void
x_set_mouse_color (f, arg, oldval)
struct frame *f;
@@ -1046,7 +1075,11 @@
}
if (FRAME_X_WINDOW (f) != 0)
- XDefineCursor (dpy, FRAME_X_WINDOW (f), cursor);
+ XDefineCursor (dpy, FRAME_X_WINDOW (f),
+ f->output_data.x->current_cursor = cursor);
+
+ if (FRAME_X_DISPLAY_INFO (f)->invisible_cursor == 0)
+ FRAME_X_DISPLAY_INFO (f)->invisible_cursor = make_invisible_cursor (f);
if (cursor != x->text_cursor
&& x->text_cursor != 0)
@@ -2671,7 +2704,7 @@
}
XDefineCursor (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
- f->output_data.x->text_cursor);
+ f->output.x->current_cursor = f->output_data.x->text_cursor);
UNBLOCK_INPUT;
@@ -2816,7 +2849,7 @@
}
XDefineCursor (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
- f->output_data.x->text_cursor);
+ f->output.x->current_cursor = f->output_data.x->text_cursor);
UNBLOCK_INPUT;
Index: src/xterm.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/xterm.c,v
retrieving revision 1.1035
retrieving revision 1.1036
diff -u -b -r1.1035 -r1.1036
--- src/xterm.c 2 Jul 2009 12:27:25 -0000 1.1035
+++ src/xterm.c 3 Jul 2009 11:07:12 -0000 1.1036
@@ -3128,6 +3128,25 @@
#endif /* defined (HAVE_TIMEVAL) && defined (HAVE_SELECT) */
+static void
+XTtoggle_invisible_pointer (f, invisible)
+ FRAME_PTR f;
+ int invisible;
+{
+ BLOCK_INPUT;
+ if (invisible)
+ {
+ if (FRAME_X_DISPLAY_INFO (f)->invisible_cursor != 0)
+ XDefineCursor (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
+ FRAME_X_DISPLAY_INFO (f)->invisible_cursor);
+ }
+ else
+ XDefineCursor (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
+ f->output_data.x->current_cursor);
+ UNBLOCK_INPUT;
+}
+
+
/* Make audible bell. */
void
@@ -7344,7 +7363,10 @@
struct frame *f;
Cursor cursor;
{
+ if (!f->pointer_invisible
+ && f->output_data.x->current_cursor != cursor)
XDefineCursor (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), cursor);
+ f->output_data.x->current_cursor = cursor;
}
@@ -10657,6 +10679,7 @@
terminal->ins_del_lines_hook = x_ins_del_lines;
terminal->delete_glyphs_hook = x_delete_glyphs;
terminal->ring_bell_hook = XTring_bell;
+ terminal->toggle_invisible_pointer_hook = XTtoggle_invisible_pointer;
terminal->reset_terminal_modes_hook = XTreset_terminal_modes;
terminal->set_terminal_modes_hook = XTset_terminal_modes;
terminal->update_begin_hook = x_update_begin;
Index: src/xterm.h
===================================================================
RCS file: /cvsroot/emacs/emacs/src/xterm.h,v
retrieving revision 1.212
retrieving revision 1.213
diff -u -b -r1.212 -r1.213
--- src/xterm.h 1 Jul 2009 16:58:07 -0000 1.212
+++ src/xterm.h 3 Jul 2009 11:07:13 -0000 1.213
@@ -166,6 +166,9 @@
/* The cursor to use for vertical scroll bars. */
Cursor vertical_scroll_bar_cursor;
+ /* The invisible cursor used for pointer blanking. */
+ Cursor invisible_cursor;
+
#ifdef USE_GTK
/* The GDK cursor for scroll bars and popup menus. */
GdkCursor *xg_cursor;
@@ -522,6 +525,7 @@
Cursor hand_cursor;
Cursor hourglass_cursor;
Cursor horizontal_drag_cursor;
+ Cursor current_cursor;
/* Window whose cursor is hourglass_cursor. This window is temporarily
mapped to display an hourglass cursor. */
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] emacs etc/NEWS lisp/ChangeLog lisp/cus-start.el...,
Jan Djärv <=