diff --git a/include/logglobals.h b/include/logglobals.h
index 03014474158f7b56bfe73d4c2d67d89588cd8461..e9170a108bbd356a574558daac55b48e6aca1c65 100644
--- a/include/logglobals.h
+++ b/include/logglobals.h
@@ -36,7 +36,6 @@
 
 extern log_action_t gg;   /* External global variables */
 
-extern short cursx, cursy;   /* Current position of cursor */
 extern short cursx1, cursy1;   /* Wire starting point */
 extern short cursx2, cursy2;   /* Wire ending point */
 extern short chairx, chairy;   /* Current position of crosshair */
diff --git a/include/window.h b/include/window.h
index 6a255a97932fbfc328f0cd2ee2d1dfd1afc4b11d..3ba494b9a54b789628b1455c697866ede71893f1 100644
--- a/include/window.h
+++ b/include/window.h
@@ -133,4 +133,7 @@ int hvline(short x1, short y1, short *x2, short *y2);
 
 void init_X_window();
 
+short getcursorxposition();
+short getcursoryposition();
+
 #endif
diff --git a/src/pen.c b/src/pen.c
index bc62e0c4cdaa9ec8aa0ae01255bf04733242f588..6ff04f8f612328e9743a64145a27e00684674369 100644
--- a/src/pen.c
+++ b/src/pen.c
@@ -192,6 +192,8 @@ void pen()
 
 	if (gg.probemode)
 	{
+		short cursx = getcursorxposition();
+		short cursy = getcursoryposition();
 		if (cursx != gg.t.x || cursy != gg.t.y)
 		{
 			if (gg.probesimtype != NULL)
diff --git a/src/window.c b/src/window.c
index 1649469f32b5886eda3f3cd916197745372dd156..caac8f32b6718fa643a90ca6a6daefaf6cb53c25 100644
--- a/src/window.c
+++ b/src/window.c
@@ -2185,3 +2185,13 @@ void init_X_window()
 	choose_log_cursor(0);
 }
 
+short getcursorxposition()
+{
+	return cursx;
+}
+
+short getcursoryposition()
+{
+	return cursy;
+}
+