summaryrefslogtreecommitdiff
path: root/src/screen.c
diff options
context:
space:
mode:
authorJérémie Courrèges-Anglas <jca@wxcvbn.org>2017-09-18 06:56:12 +0200
committerJérémie Courrèges-Anglas <jca@wxcvbn.org>2017-09-18 06:56:12 +0200
commitcbd91e801bf71eb0e7b2d5a2264c36007a3e12cc (patch)
tree482d38dbd98a11bcd9f8ad02557f3f16a0b0e7c2 /src/screen.c
parent0a90c2ac60cbb511ec24a52d723291d82a0124ba (diff)
downloadratpoison-cbd91e801bf71eb0e7b2d5a2264c36007a3e12cc.zip
Move #ifdef HAVE_XRANDR in xrandr.c
- always build xrandr.c - provide stubs in xrandr.c; only init_xrandr() anc xrandr_fill_screen() are safe to call if XRandR support is not built in Code that wants to use XRandR outside xrandr.c should test rp_have_xrandr.
Diffstat (limited to 'src/screen.c')
-rw-r--r--src/screen.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/src/screen.c b/src/screen.c
index 65cca2e..1e62964 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -258,7 +258,6 @@ screen_select_primary (void)
if (!rp_current_screen)
rp_current_screen = cur;
-#ifdef HAVE_XRANDR
if (!rp_have_xrandr)
return;
@@ -271,7 +270,6 @@ screen_select_primary (void)
break;
}
}
-#endif
}
static void
@@ -298,13 +296,10 @@ init_screens (void)
rp_screen *screen;
/* Get the number of screens */
- if (rp_have_xrandr) {
-#ifdef HAVE_XRANDR
+ if (rp_have_xrandr)
screen_count = xrandr_query_screen (&rr_outputs);
-#endif
- } else {
+ else
screen_count = ScreenCount (dpy);
- }
/* Create our global frame numset */
rp_frame_numset = numset_new();
@@ -316,10 +311,11 @@ init_screens (void)
screen = xmalloc (sizeof(*screen));
list_add (&screen->node, &rp_screens);
-#ifdef HAVE_XRANDR
if (rp_have_xrandr)
xrandr_fill_screen (rr_outputs[i], screen);
-#endif
+ else
+ xrandr_fill_screen (i, screen);
+
init_screen (screen);
}
@@ -635,10 +631,7 @@ screen_add (int rr_output)
screen->number = numset_request (rp_glob_screen.numset);
-#ifdef HAVE_XRANDR
- if (rp_have_xrandr)
- xrandr_fill_screen (rr_output, screen);
-#endif
+ xrandr_fill_screen (rr_output, screen);
init_screen (screen);
init_frame_list (screen);