[Pkg-wmaker-commits] [wmmon] 12/38: Fix two bugs related to command execution:

Doug Torrance dtorrance-guest at moszumanska.debian.org
Sat Aug 12 22:43:07 UTC 2017


This is an automated email from the git hooks/post-receive script.

dtorrance-guest pushed a commit to branch upstream
in repository wmmon.

commit 39c35866a4538cfe0ed8425ec85b86d87231940f
Author: Len Trigg <lenbok at gmail.com>
Date:   Thu Dec 5 13:11:59 2013 +1300

    Fix two bugs related to command execution:
    
    - When executing a command, control flow would fall through to the
      display cycle code, changing the display.
    
    - When display cycling was prevented by the user (via -l), command
      execution was also disabled.
---
 wmmon/wmmon.c | 45 ++++++++++++++++++++++++---------------------
 1 file changed, 24 insertions(+), 21 deletions(-)

diff --git a/wmmon/wmmon.c b/wmmon/wmmon.c
index 10750d6..48f1041 100644
--- a/wmmon/wmmon.c
+++ b/wmmon/wmmon.c
@@ -522,7 +522,7 @@ void wmmon_routine(int argc, char **argv)
 				break;
 			case ButtonRelease:
 				i = CheckMouseRegion(Event.xbutton.x, Event.xbutton.y);
-				if (but_stat == i && but_stat >= 0 && mode_cycling) {
+				if (but_stat == i && but_stat >= 0) {
 					switch (but_stat) {
 					case 0:
 						switch (Event.xbutton.button) {
@@ -539,28 +539,31 @@ void wmmon_routine(int argc, char **argv)
 								execCommand(right_action);
 							break;
 						}
+						break;
 					case 1:
-						stat_current++;
-						if (stat_current == stat_online)
-							stat_current = 0;
-
-						DrawActive(stat_device[stat_current].name);
-						if (stat_current == 0)
-							DrawStats(stat_device[stat_current].his, 
-								  HISTORY_ENTRIES-1, 40, 5, 58);
-
-						if (stat_current == 1)
-							DrawStats_io(stat_device[stat_current].his, 
-								     HISTORY_ENTRIES-1, 40, 5, 58);
-
-						if (stat_current == 2) {
-							xpm_X = 64;
-							setMaskXY(-64, 0);
-						} else {
-							xpm_X = 0;
-							setMaskXY(0, 0);
+						if (mode_cycling) {
+							stat_current++;
+							if (stat_current == stat_online)
+								stat_current = 0;
+
+							DrawActive(stat_device[stat_current].name);
+							if (stat_current == 0)
+								DrawStats(stat_device[stat_current].his,
+									  HISTORY_ENTRIES-1, 40, 5, 58);
+
+							if (stat_current == 1)
+								DrawStats_io(stat_device[stat_current].his,
+									     HISTORY_ENTRIES-1, 40, 5, 58);
+
+							if (stat_current == 2) {
+								xpm_X = 64;
+								setMaskXY(-64, 0);
+							} else {
+								xpm_X = 0;
+								setMaskXY(0, 0);
+							}
+							RedrawWindowXY(xpm_X, xpm_Y);
 						}
-						RedrawWindowXY(xpm_X, xpm_Y);
 						break;
 					}
 				}

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-wmaker/wmmon.git



More information about the Pkg-wmaker-commits mailing list