[hackers] [st] removed useless cursor colors, sticking to fg colors

From: Anselm R. Garbe <arg_AT_suckless.org>
Date: Fri Mar 02 16:12:19 2007

changeset: 59:265c6ff60a2b
tag: tip
user: Anselm R. Garbe <arg_AT_suckless.org>
date: Fri Mar 02 16:11:38 2007 +0100
summary: removed useless cursor colors, sticking to fg colors

diff -r 90251a9a4b58 -r 265c6ff60a2b main.c
--- a/main.c Fri Mar 02 16:07:31 2007 +0100
+++ b/main.c Fri Mar 02 16:11:38 2007 +0100
@@ -54,7 +54,6 @@ initcolors(void) {
                 dc.fg[i] = initcolor(fgcolors[i]);
         for(i = 0; i < dc.nbg; i++)
                 dc.bg[i] = initcolor(bgcolors[i]);
- dc.cursor = initcolor("lightgreen");
 }
 
 static void
diff -r 90251a9a4b58 -r 265c6ff60a2b process.c
--- a/process.c Fri Mar 02 16:07:31 2007 +0100
+++ b/process.c Fri Mar 02 16:11:38 2007 +0100
@@ -2,6 +2,7 @@
  * See LICENSE file for license details.
  */
 #include "st.h"
+#define _XOPEN_SOURCE
 #include <assert.h>
 #include <fcntl.h>
 #include <pwd.h>
@@ -16,6 +17,12 @@
 #include <sys/wait.h>
 #include <unistd.h>
 
+#define TIMEOUT_USEC 10000
+
+extern int getpt(void);
+extern int grantpt(int fd);
+extern int unlockpt(int fd);
+
 static unsigned char output_buf[512];
 static unsigned int startptr = 0; /* index into output_buf to where data starts */
 static unsigned int endptr = 0; /* index into output_buf to where data ends */
@@ -147,7 +154,6 @@ execute_command(int argc, const char **a
         return 0;
 }
 
-#define TIMEOUT_USEC 10000
 void
 wait_for_input(void) {
         int len;
diff -r 90251a9a4b58 -r 265c6ff60a2b st.h
--- a/st.h Fri Mar 02 16:07:31 2007 +0100
+++ b/st.h Fri Mar 02 16:11:38 2007 +0100
@@ -43,7 +43,6 @@ typedef struct {
         unsigned long *fg;
         unsigned int nbg;
         unsigned long *bg;
- unsigned long cursor;
         struct {
                 XFontStruct *xfont;
                 XFontSet set;
diff -r 90251a9a4b58 -r 265c6ff60a2b vt.c
--- a/vt.c Fri Mar 02 16:07:31 2007 +0100
+++ b/vt.c Fri Mar 02 16:11:38 2007 +0100
@@ -203,9 +203,9 @@ show_cursor(void) {
         if(!dc.font.set)
                 XSetFont(dpy, gc, dc.font.xfont->fid);
         win_clear_region((cursor_col - 1) * dc.font.width, (cursor_row - 1) * dc.font.height,
- cursor_col * dc.font.width, cursor_row * dc.font.height, dc.cursor);
+ cursor_col * dc.font.width, cursor_row * dc.font.height, dc.fg[0]);
         XSetForeground(dpy, gc, dc.fg[0]);
- XSetBackground(dpy, gc, dc.cursor);
+ XSetBackground(dpy, gc, dc.fg[1]);
         win_draw_string(cursor_row - 1, cursor_col - 1, &(text_screen[cursor_row - 1].line[cursor_col - 1]), 1);
         XFlush(dpy);
         cursor_is_visible = 1;
Received on Fri Mar 02 2007 - 16:12:19 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 15:56:05 UTC