]> git.mdlowis.com Git - proto/anvil.git/commitdiff
moved get_mouse to mouse.c
authorMichael D. Lowis <mike@mdlowis.com>
Sun, 5 Apr 2020 18:57:39 +0000 (14:57 -0400)
committerMichael D. Lowis <mike@mdlowis.com>
Sun, 5 Apr 2020 18:57:39 +0000 (14:57 -0400)
anvil.h
mons.c
mouse.c
util.c

diff --git a/anvil.h b/anvil.h
index 4cf1199d455577e62e8f3ef5916600c0433d610f..c675f422be6a0d9800f6f402b30f7d6050784194 100644 (file)
--- a/anvil.h
+++ b/anvil.h
@@ -176,6 +176,7 @@ void mouse_up(XButtonEvent* ev, Location* loc);
 void mouse_drag(XMotionEvent* ev, Location* loc);
 void mouse_tocorner(Client* c);
 void mouse_totitle(Client* c);
+void mouse_get(int* ptrx, int* ptry);
 
 /* tile.c */
 void monocled_add(Monitor* mon, Column* col, Client* c);
@@ -199,4 +200,3 @@ void* ecalloc(size_t n, size_t sz);
 void xfree(void* p);
 Atom atom(char* str);
 void sendmsg(Window win, Atom proto, Atom type);
-void get_mouse(int* ptrx, int* ptry);
diff --git a/mons.c b/mons.c
index acb113238bb642b1c1e252e925c3c475ad950c74..05e8afc905089d6ce54c62e99d1466f2c5cedde4 100644 (file)
--- a/mons.c
+++ b/mons.c
@@ -206,7 +206,7 @@ void mons_towspace(Client* c, int wsid)
     Location loc = {0};
     if (mons_find(c->win, &loc))
     {
-        get_mouse(&PtrX, &PtrY);
+        mouse_get(&PtrX, &PtrY);
         Workspace* wspace = pickws(loc.monitor, wsid);
         if (wspace != loc.workspace)
         {
@@ -369,7 +369,7 @@ void mons_activate(Window win)
 
 static Monitor* pickmon(void)
 {
-    get_mouse(&PtrX, &PtrY);
+    mouse_get(&PtrX, &PtrY);
     Monitor* mon;
     LIST_FOR_EACH_UNTIL(mon, Monitors,
         (mon->x <= PtrX && PtrX < mon->x+mon->w) &&
diff --git a/mouse.c b/mouse.c
index e666709c9a1949a7e0db1e019fde19ff98bd3f1b..1423b9c840e50ca937be9f295579b672bb1d5580 100644 (file)
--- a/mouse.c
+++ b/mouse.c
@@ -180,4 +180,10 @@ void mouse_totitle(Client* c)
     XWarpPointer(X.disp, None, X.root, 0, 0, 0, 0, (c->x + c->w/2), c->y + (MIN_HEIGHT/2));
 }
 
+void mouse_get(int* ptrx, int* ptry)
+{
+    Window root = 0, child = 0;
+    int winx = 0, winy = 0, mask = 0;
+    XQueryPointer(X.disp, X.root, &root, &child, ptrx, ptry, &winx, &winy, (unsigned int*)&mask);
+}
 
diff --git a/util.c b/util.c
index 8b0b77ca7b52a01bd5bccd35b19f231cca7c0c4a..7bf4227a312d264175b8231a51eb26787d606a97 100644 (file)
--- a/util.c
+++ b/util.c
@@ -50,10 +50,3 @@ void sendmsg(Window win, Atom proto, Atom type)
     XSendEvent(X.disp, win, False, 0, &ev);
     XSync(X.disp, False);
 }
-
-void get_mouse(int* ptrx, int* ptry)
-{
-    Window root = 0, child = 0;
-    int winx = 0, winy = 0, mask = 0;
-    XQueryPointer(X.disp, X.root, &root, &child, ptrx, ptry, &winx, &winy, (unsigned int*)&mask);
-}