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

git pushed a commit to branch master
in repository e16.

View the commit online.

commit ee3355669c764a7c27559c5bafb876f6a60fc539
Author: Kim Woelders <k...@woelders.dk>
AuthorDate: Mon Jul 18 13:04:39 2022 +0200

    edge: Cosmetics
---
 src/edge.c | 40 +++++++++++++++++++++++-----------------
 1 file changed, 23 insertions(+), 17 deletions(-)

diff --git a/src/edge.c b/src/edge.c
index eadf65c6..add60c40 100644
--- a/src/edge.c
+++ b/src/edge.c
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 2000-2007 Carsten Haitzler, Geoff Harrison and various contributors
- * Copyright (C) 2004-2015 Kim Woelders
+ * Copyright (C) 2004-2021 Kim Woelders
  *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (the "Software"), to
@@ -33,6 +33,11 @@
 #include "timers.h"
 #include "xwin.h"
 
+#define EW_L	0		/* Left   */
+#define EW_R	1		/* Right  */
+#define EW_T	2		/* Top    */
+#define EW_B	3		/* Bottom */
+
 static EObj        *w1 = NULL, *w2 = NULL, *w3 = NULL, *w4 = NULL;
 static Timer       *edge_timer = NULL;
 
@@ -66,25 +71,25 @@ EdgeTimeout(void *data)
    day = 0;
    switch (val)
      {
-     case 0:
+     case EW_L:
 	if (ax == 0 && !Conf.desks.areas_wraparound)
 	   goto done;
 	dx = WinGetW(VROOT) - 2;
 	dax = -1;
 	break;
-     case 1:
+     case EW_R:
 	if (ax == (aw - 1) && !Conf.desks.areas_wraparound)
 	   goto done;
 	dx = -(WinGetW(VROOT) - 2);
 	dax = 1;
 	break;
-     case 2:
+     case EW_T:
 	if (ay == 0 && !Conf.desks.areas_wraparound)
 	   goto done;
 	dy = WinGetH(VROOT) - 2;
 	day = -1;
 	break;
-     case 3:
+     case EW_B:
 	if (ay == (ah - 1) && !Conf.desks.areas_wraparound)
 	   goto done;
 	dy = -(WinGetH(VROOT) - 2);
@@ -173,6 +178,7 @@ EdgeCheckMotion(int x, int y)
       dir = 3;
    else
       dir = -1;
+
    EdgeEvent(dir);
 }
 
@@ -188,20 +194,20 @@ EdgeWindowShow(int which, int on)
    switch (which)
      {
      default:
-     case 1:			/* Left */
+     case EW_L:		/* Left */
 	eo = w1;
 	h = WinGetH(VROOT);
 	break;
-     case 2:			/* Right */
+     case EW_R:		/* Right */
 	eo = w2;
 	x = WinGetW(VROOT) - 1;
 	h = WinGetH(VROOT);
 	break;
-     case 3:			/* Top */
+     case EW_T:		/* Top */
 	eo = w3;
 	w = WinGetW(VROOT);
 	break;
-     case 4:			/* Bottom */
+     case EW_B:		/* Bottom */
 	eo = w4;
 	y = WinGetH(VROOT) - 1;
 	w = WinGetW(VROOT);
@@ -246,18 +252,18 @@ EdgeWindowsShow(void)
 	ESelectInput(EobjGetWin(w2), EnterWindowMask | LeaveWindowMask);
 	ESelectInput(EobjGetWin(w3), EnterWindowMask | LeaveWindowMask);
 	ESelectInput(EobjGetWin(w4), EnterWindowMask | LeaveWindowMask);
-	EventCallbackRegister(EobjGetWin(w1), EdgeHandleEvents, (void *)0);
-	EventCallbackRegister(EobjGetWin(w2), EdgeHandleEvents, (void *)1);
-	EventCallbackRegister(EobjGetWin(w3), EdgeHandleEvents, (void *)2);
-	EventCallbackRegister(EobjGetWin(w4), EdgeHandleEvents, (void *)3);
+	EventCallbackRegister(EobjGetWin(w1), EdgeHandleEvents, (void *)EW_L);
+	EventCallbackRegister(EobjGetWin(w2), EdgeHandleEvents, (void *)EW_R);
+	EventCallbackRegister(EobjGetWin(w3), EdgeHandleEvents, (void *)EW_T);
+	EventCallbackRegister(EobjGetWin(w4), EdgeHandleEvents, (void *)EW_B);
      }
    DeskCurrentGetArea(&cx, &cy);
    DesksGetAreaSize(&ax, &ay);
 
-   EdgeWindowShow(1, cx != 0 || Conf.desks.areas_wraparound);
-   EdgeWindowShow(2, cx != (ax - 1) || Conf.desks.areas_wraparound);
-   EdgeWindowShow(3, cy != 0 || Conf.desks.areas_wraparound);
-   EdgeWindowShow(4, cy != (ay - 1) || Conf.desks.areas_wraparound);
+   EdgeWindowShow(EW_L, cx != 0 || Conf.desks.areas_wraparound);
+   EdgeWindowShow(EW_R, cx != (ax - 1) || Conf.desks.areas_wraparound);
+   EdgeWindowShow(EW_T, cy != 0 || Conf.desks.areas_wraparound);
+   EdgeWindowShow(EW_B, cy != (ay - 1) || Conf.desks.areas_wraparound);
 }
 
 void

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.

Reply via email to