File: 0010-check-boxes-more-often.patch

package info (click to toggle)
xbuffy 3.3.bl.3.dfsg-10
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, buster, jessie, jessie-kfreebsd, stretch
  • size: 1,204 kB
  • ctags: 1,497
  • sloc: ansic: 2,900; sh: 175; makefile: 147
file content (76 lines) | stat: -rw-r--r-- 2,005 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
From 002735478918010800017ec7a1de672433d264f8 Mon Sep 17 00:00:00 2001
From: Joel Rosdahl <joel@debian.org>
Date: Sat, 19 Dec 2009 13:20:13 +0100
Subject: check boxes more often

taken from 01_original.dpatch by Joel Rosdahl <joel@debian.org>
---
 xbuffy.c | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

diff --git a/xbuffy.c b/xbuffy.c
index bce8d93..1b40165 100644
--- a/xbuffy.c
+++ b/xbuffy.c
@@ -71,6 +71,7 @@
 
 #ifdef USE_LED
 #include <signal.h>
+#include <wait.h>
 #endif
 
 #include "xbuffy.xbm"
@@ -188,6 +189,13 @@ void CheckBox(i)
     BoxInfo_t *currentBox;
     Boolean beenTouched;
     Boolean isIcon = FALSE;
+    Boolean isTimedPoll = TRUE;
+
+    if (i < 0)
+    {
+        i = -1 - i;
+        isTimedPoll = FALSE;
+    }
 
     currentBox = &boxInfo[i];
 
@@ -207,8 +215,8 @@ void CheckBox(i)
     XtSetArg(args[nargs], XtNiconic, &isIcon);
 
 
-    if ((num > currentBox->n) ||
-        ((!currentBox->origMode) && ((num != currentBox->n) || (beenTouched))))
+    if (isTimedPoll && ((num > currentBox->n) ||
+        ((!currentBox->origMode) && ((num != currentBox->n) || (beenTouched)))))
     {
 
         if ((currentBox->headerTime != 0) && (!isIcon) && (num > 0))
@@ -235,8 +243,10 @@ void CheckBox(i)
         UpdateBoxNumber(currentBox);
     }
 
-
-    XtAppAddTimeOut(app, (currentBox->pollTime * 1000), CheckBox, (XtPointer) i);
+    if (isTimedPoll)
+    {
+        XtAppAddTimeOut(app, (currentBox->pollTime * 1000), CheckBox, (XtPointer) i);
+    }
 }
 
 
@@ -427,6 +437,7 @@ void ButtonDownHandler(w, i, event, cont)
 {
     if (event->xbutton.button == 1)
     {
+        CheckBox(-1 - *i);
         PopupHeader(w, *i, event, cont);
     }
     /* don't do anything else for other button clicks */
@@ -447,6 +458,7 @@ void ButtonUpHandler(w, i, event, cont)
     else if (event->xbutton.button == 2)
     {
         ExecuteCommand(w, *i, event, cont);
+        CheckBox(-1 - *i);
     }
     else if (event->xbutton.button == 3)
     {