[Pkg-wmaker-commits] [wmbiff] 22/38: show a watch pointer while working behind the scenes
Doug Torrance
dtorrance-guest at moszumanska.debian.org
Thu Aug 20 03:03:39 UTC 2015
This is an automated email from the git hooks/post-receive script.
dtorrance-guest pushed a commit to tag wmbiff_0_4_16
in repository wmbiff.
commit 08ab1b9dfc587885bab3d69e01ab077d0178b1c2
Author: bluehal <bluehal>
Date: Sun Jun 8 06:59:45 2003 +0000
show a watch pointer while working behind the scenes
---
wmbiff/wmbiff.c | 36 +++++++++++++++++++++++++++++-------
1 file changed, 29 insertions(+), 7 deletions(-)
diff --git a/wmbiff/wmbiff.c b/wmbiff/wmbiff.c
index 54146ba..c46ae09 100644
--- a/wmbiff/wmbiff.c
+++ b/wmbiff/wmbiff.c
@@ -1,4 +1,4 @@
-/* $Id: wmbiff.c,v 1.54 2003/04/16 08:18:35 bluehal Exp $ */
+/* $Id: wmbiff.c,v 1.55 2003/06/08 06:59:45 bluehal Exp $ */
#ifdef HAVE_CONFIG_H
#include <config.h>
@@ -20,6 +20,7 @@
#include <X11/Xlib.h>
#include <X11/xpm.h>
+#include <X11/cursorfont.h>
#include <errno.h>
#include <string.h>
@@ -84,7 +85,12 @@ static int notWithdrawn = 0;
static unsigned int num_mailboxes = 1;
static const int x_origin = 5;
static const int y_origin = 5;
-static int forever = 1;
+static int forever = 1; /* keep running. */
+
+extern Window win;
+extern Window iconwin;
+
+Cursor busy_cursor, ready_cursor;
static __inline /*@out@ */ void *malloc_ordie(size_t len)
{
@@ -341,6 +347,7 @@ static void init_biff(char *config_file)
mbox[i].fetchcmd[0] = '\0';
mbox[i].loopinterval = 0;
mbox[i].getHeaders = NULL;
+ mbox[i].releaseHeaders = NULL;
mbox[i].debug = debug_default;
mbox[i].askpass = DEFAULT_ASKPASS;
}
@@ -720,7 +727,14 @@ static int periodic_mail_check(void)
(int) curtime, (int) mbox[i].prevtime,
mbox[i].loopinterval);
mbox[i].prevtime = curtime;
+
+ XDefineCursor(display, iconwin, busy_cursor);
+ RedrawWindow();
+
mailstat = count_mail(i);
+
+ XUndefineCursor(display, iconwin);
+
if ((mailstat == 2) && (mbox[i].notify[0] == '\0')) {
/* for global notify */
NewMail = 1;
@@ -741,7 +755,14 @@ static int periodic_mail_check(void)
if (mbox[i].fetchinterval > 0 && mbox[i].fetchcmd[0] != '\0'
&& curtime >=
mbox[i].prevfetch_time + mbox[i].fetchinterval) {
+
+ XDefineCursor(display, iconwin, busy_cursor);
+ RedrawWindow();
+
(void) execCommand(mbox[i].fetchcmd);
+
+ XUndefineCursor(display, iconwin);
+
mbox[i].prevfetch_time = curtime;
}
}
@@ -883,9 +904,6 @@ static void restart_wmbiff(int sig
exit(EXIT_FAILURE);
}
-extern Window win;
-extern Window iconwin;
-
static void do_biff(int argc, const char **argv)
{
unsigned int i;
@@ -921,6 +939,11 @@ static void do_biff(int argc, const char **argv)
openXwindow(argc, argv, bkg_xpm, skin_xpm, wmbiff_mask_bits,
wmbiff_mask_width, wmbiff_mask_height, notWithdrawn);
+ /* now that display is set, we can create the cursors
+ (mouse pointer shapes) */
+ busy_cursor = XCreateFontCursor(display, XC_watch);
+ ready_cursor = XCreateFontCursor(display, XC_left_ptr);
+
if (font != NULL) {
if (loadFont(font) < 0) {
DMA(DEBUG_ERROR, "unable to load font. exiting.\n");
@@ -1262,12 +1285,11 @@ int main(int argc, const char *argv[])
signal(SIGCHLD, sigchld_handler);
signal(SIGUSR1, restart_wmbiff);
signal(SIGPIPE, SIG_IGN); /* write() may fail */
+
do_biff(argc, argv);
return 0;
}
-
-
/* vim:set ts=4: */
/*
* Local Variables:
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-wmaker/wmbiff.git
More information about the Pkg-wmaker-commits
mailing list