Skip to Content.
Sympa Menu

sm-commit - [SM-Commit] GIT changes to master grimoire by Ismael Luceno (d16700082f4a8cea628b48f7fb4f509113cdfa84)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Ismael Luceno <scm AT sourcemage.org>
  • To: sm-commit AT lists.ibiblio.org
  • Subject: [SM-Commit] GIT changes to master grimoire by Ismael Luceno (d16700082f4a8cea628b48f7fb4f509113cdfa84)
  • Date: Sat, 12 Jul 2014 13:22:44 -0500

GIT changes to master grimoire by Ismael Luceno <ismael AT sourcemage.org>:

shell-term-fm/st/HISTORY | 4
shell-term-fm/st/PRE_BUILD | 9 +-
shell-term-fm/st/patches/st-0.5-hidexcursor.diff | 96
+++++++++++++++++++++++
3 files changed, 108 insertions(+), 1 deletion(-)

New commits:
commit d16700082f4a8cea628b48f7fb4f509113cdfa84
Author: Ismael Luceno <ismael AT sourcemage.org>
Commit: Ismael Luceno <ismael AT sourcemage.org>

st: Add patch to hide X cursor when typing

diff --git a/shell-term-fm/st/HISTORY b/shell-term-fm/st/HISTORY
index d07b5c2..4255bf0 100644
--- a/shell-term-fm/st/HISTORY
+++ b/shell-term-fm/st/HISTORY
@@ -1,3 +1,7 @@
+2014-07-12 Ismael Luceno <ismael AT sourcemage.org>
+ * PRE_BUILD, patches/st-0.5-hidexcursor.diff:
+ Add patch to hide X cursor when typing.
+
2014-07-11 Ismael Luceno <ismael AT sourcemage.org>
* DETAILS: updated spell to 0.5

diff --git a/shell-term-fm/st/PRE_BUILD b/shell-term-fm/st/PRE_BUILD
index c59a232..886a469 100755
--- a/shell-term-fm/st/PRE_BUILD
+++ b/shell-term-fm/st/PRE_BUILD
@@ -1,3 +1,10 @@
default_pre_build &&
cd ${SOURCE_DIRECTORY} &&
-sedit "s:/local::" config.mk
+sedit "s:/local::" config.mk &&
+
+for i in "$SPELL_DIRECTORY"/patches/*; do
+ desc="$(sed -nr '/^Subject: /!d;s@[^ ]* *(\[[A-Za-z0-9 ]*\] *)*@@;p;q'
"$i")" &&
+ if query "Apply ${i##*/} ($desc)?" n; then
+ patch -sp1 -i "$i"
+ fi
+done
diff --git a/shell-term-fm/st/patches/st-0.5-hidexcursor.diff
b/shell-term-fm/st/patches/st-0.5-hidexcursor.diff
new file mode 100644
index 0000000..3bbe602
--- /dev/null
+++ b/shell-term-fm/st/patches/st-0.5-hidexcursor.diff
@@ -0,0 +1,96 @@
+From d081963fc75e1656f5ee4305947384a00b9e5f39 Mon Sep 17 00:00:00 2001
+From: Colona <colona AT ycc.fr>
+Date: Mon, 9 Jun 2014 00:55:54 -0700
+Subject: [PATCH] Hide X cursor when typing.
+
+Hide the X cursor when typing in the terminal. The cursor is displayed again
+when the mouse is moved.
+---
+ st.c | 33 +++++++++++++++++++++++++++------
+ 1 file changed, 27 insertions(+), 6 deletions(-)
+
+diff --git a/st.c b/st.c
+index 392f12d..52deb92 100644
+--- a/st.c
++++ b/st.c
+@@ -248,6 +248,8 @@ typedef struct {
+ Draw draw;
+ Visual *vis;
+ XSetWindowAttributes attrs;
++ Cursor cursor, bcursor; /* visible and blank cursors */
++ bool cursorstate; /* is cursor currently visible */
+ int scr;
+ bool isfixed; /* is fixed geometry? */
+ int fx, fy, fw, fh; /* fixed geometry */
+@@ -1112,6 +1114,13 @@ void
+ bmotion(XEvent *e) {
+ int oldey, oldex, oldsby, oldsey;
+
++ if(!xw.cursorstate) {
++ XDefineCursor(xw.dpy, xw.win, xw.cursor);
++ xw.cursorstate = true;
++ if(!IS_SET(MODE_MOUSEMANY))
++ xsetpointermotion(0);
++ }
++
+ if(IS_SET(MODE_MOUSE)) {
+ mousereport(e);
+ return;
+@@ -2984,10 +2993,12 @@ xzoom(const Arg *arg) {
+ void
+ xinit(void) {
+ XGCValues gcvalues;
+- Cursor cursor;
+ Window parent;
+ int sw, sh;
+ pid_t thispid = getpid();
++ XColor xcwhite = {.red = 0xffff, .green = 0xffff, .blue = 0xffff};
++ XColor xcblack = {.red = 0x0000, .green = 0x0000, .blue = 0x0000};
++ Pixmap blankpm;
+
+ if(!(xw.dpy = XOpenDisplay(NULL)))
+ die("Can't open display\n");
+@@ -3071,11 +3082,13 @@ xinit(void) {
+ die("XCreateIC failed. Could not obtain input method.\n");
+
+ /* white cursor, black outline */
+- cursor = XCreateFontCursor(xw.dpy, XC_xterm);
+- XDefineCursor(xw.dpy, xw.win, cursor);
+- XRecolorCursor(xw.dpy, cursor,
+- &(XColor){.red = 0xffff, .green = 0xffff, .blue = 0xffff},
+- &(XColor){.red = 0x0000, .green = 0x0000, .blue = 0x0000});
++ xw.cursor = XCreateFontCursor(xw.dpy, XC_xterm);
++ XDefineCursor(xw.dpy, xw.win, xw.cursor);
++ XRecolorCursor(xw.dpy, xw.cursor, &xcwhite, &xcblack);
++ xw.cursorstate = true;
++ blankpm = XCreateBitmapFromData(xw.dpy, xw.win, &(char){0}, 1, 1);
++ xw.bcursor = XCreatePixmapCursor(xw.dpy, blankpm, blankpm,
++
&xcblack, &xcblack, 0, 0);
+
+ xw.xembed = XInternAtom(xw.dpy, "_XEMBED", False);
+ xw.wmdeletewin = XInternAtom(xw.dpy, "WM_DELETE_WINDOW", False);
+@@ -3537,6 +3550,8 @@ unmap(XEvent *ev) {
+
+ void
+ xsetpointermotion(int set) {
++ if(!set && !xw.cursorstate)
++ return;
+ MODBIT(xw.attrs.event_mask, set, PointerMotionMask);
+ XChangeWindowAttributes(xw.dpy, xw.win, CWEventMask, &xw.attrs);
+ }
+@@ -3630,6 +3645,12 @@ kpress(XEvent *ev) {
+ Status status;
+ Shortcut *bp;
+
++ if(xw.cursorstate) {
++ XDefineCursor(xw.dpy, xw.win, xw.bcursor);
++ xsetpointermotion(1);
++ xw.cursorstate = false;
++ }
++
+ if(IS_SET(MODE_KBDLOCK))
+ return;
+
+--
+2.0.0
+



  • [SM-Commit] GIT changes to master grimoire by Ismael Luceno (d16700082f4a8cea628b48f7fb4f509113cdfa84), Ismael Luceno, 07/12/2014

Archive powered by MHonArc 2.6.24.

Top of Page