diff --git a/src/conio/x_events.c b/src/conio/x_events.c
index 912ff02d2a44a8f349d49ffa04be193c8cf0e4c9..f057eee8ddcb05dc6c960bf50393f63653021d30 100644
--- a/src/conio/x_events.c
+++ b/src/conio/x_events.c
@@ -456,6 +456,7 @@ fullscreen_geometry(int *x_org, int *y_org, int *width, int *height)
 	int wx, wy;
 #if defined(WITH_XRANDR) || defined(WITH_XINERAMA)
 	int cx, cy;
+	int i;
 #endif
 #ifdef WITH_XRANDR
 	static XRRScreenResources *xrrsr = NULL;
@@ -464,7 +465,6 @@ fullscreen_geometry(int *x_org, int *y_org, int *width, int *height)
 	bool found;
 #endif
 #ifdef WITH_XINERAMA
-	int i;
 	int nscrn;
 	XineramaScreenInfo *xsi;
 #endif