summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/screen.c2
-rw-r--r--src/xrandr.c11
-rw-r--r--src/xrandr.h2
3 files changed, 7 insertions, 8 deletions
diff --git a/src/screen.c b/src/screen.c
index 2c36a6b..65cca2e 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -300,7 +300,7 @@ init_screens (void)
/* Get the number of screens */
if (rp_have_xrandr) {
#ifdef HAVE_XRANDR
- rr_outputs = xrandr_query_screen (&screen_count);
+ screen_count = xrandr_query_screen (&rr_outputs);
#endif
} else {
screen_count = ScreenCount (dpy);
diff --git a/src/xrandr.c b/src/xrandr.c
index de0cde3..365602d 100644
--- a/src/xrandr.c
+++ b/src/xrandr.c
@@ -53,8 +53,8 @@ init_xrandr (void)
rp_have_xrandr = 1;
}
-int *
-xrandr_query_screen (int *screen_count)
+int
+xrandr_query_screen (int **outputs)
{
XRRScreenResources *res;
XRROutputInfo *outinfo;
@@ -70,16 +70,15 @@ xrandr_query_screen (int *screen_count)
if (!outinfo->crtc)
continue;
- output_array[count] = res->outputs[i];
- count++;
+ output_array[count++] = res->outputs[i];
XRRFreeOutputInfo (outinfo);
}
- *screen_count = count;
XRRFreeScreenResources (res);
- return output_array;
+ *outputs = output_array;
+ return count;
}
static rp_screen *
diff --git a/src/xrandr.h b/src/xrandr.h
index 25ff830..67a139b 100644
--- a/src/xrandr.h
+++ b/src/xrandr.h
@@ -25,7 +25,7 @@
#include "ratpoison.h"
void init_xrandr(void);
-int *xrandr_query_screen(int *screen_count);
+int xrandr_query_screen(int **outputs);
int xrandr_is_primary (rp_screen *screen);
void xrandr_fill_screen(int rr_output, rp_screen *screen);
void xrandr_notify(XEvent *ev);