diff --git a/configure.ac b/configure.ac index 4ddd1116c..c74dd6dda 100644 --- a/configure.ac +++ b/configure.ac @@ -525,31 +525,16 @@ AH_TEMPLATE([HAVE_TAILQ],[Check if tailq is present.]) AC_CHECK_HEADER(queue.h, AC_DEFINE(HAVE_TAILQ)) # ********* XRandR -problem_xrandr="" - -AC_ARG_ENABLE(xrandr, - AS_HELP_STRING([--disable-xrandr],[disable XRandR support]), - [ if test x"$enableval" = xyes; then - with_xrandr="yes, check" - else - with_xrandr="no" - problem_xrandr=": Explicitly disabled" - fi ], - [ with_xrandr="not specified, check" ] -) - AH_TEMPLATE([HAVE_XRANDR],[Define if XRandR library is used.]) -if test ! x"$with_xrandr" = xno; then - if $PKG_CONFIG --exists "xrandr >= 1.5.0"; then - AC_DEFINE(HAVE_XRANDR) - with_xrandr=yes - XRandR_LIBS=-lXrandr - else - with_xrandr=no - problem_xrandr="Couldn't detect libxrandr, or version < 1.5.0" - fi - #],[$X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS]) -fi +AC_MSG_CHECKING([for XRandR...]) +PKG_CHECK_MODULES([xrandr], [xrandr >= 1.5], +[ + AC_DEFINE(HAVE_XRANDR) + XRandR_LIBS=-lXrandr +], +[ + AC_MSG_ERROR([*** XRandR not found. Install its header files. ***]) +]) AC_SUBST(XRandR_LIBS) AC_SUBST(XRandR_CFLAGS) @@ -1727,7 +1712,6 @@ Fvwm3 Configuration: With Session Management support? $with_sm$problem_sm With SVG image support? $with_rsvg$problem_rsvg With Xcursor support? $with_xcursor$problem_xcursor - With XRandR support? $with_xrandr$problem_xrandr With Xft anti-alias font support? $with_xft$problem_xft With XPM image support? $with_xpm$problem_xpm With Xrender image support? $with_xrender$problem_xrender diff --git a/libs/FScreen.c b/libs/FScreen.c index 695524601..9756a6c9e 100644 --- a/libs/FScreen.c +++ b/libs/FScreen.c @@ -323,7 +323,7 @@ scan_screens(Display *dpy) rrm = XRRGetMonitors(dpy, root, false, &n); if (n <= 0) { fvwm_debug(__func__, "get monitors failed\n"); - return; + exit(101); } for (i = 0; i < n; i++) { @@ -390,9 +390,8 @@ void FScreenInit(Display *dpy) if (!XRRQueryExtension(dpy, &randr_event, &err_base) || !XRRQueryVersion (dpy, &major, &minor)) { - fvwm_debug(__func__, - "RandR not present, falling back to single screen\n"); - goto single_screen; + fvwm_debug(__func__, "RandR not present"); + goto randr_fail; } if (major == 1 && minor >= 5) @@ -403,9 +402,7 @@ void FScreenInit(Display *dpy) /* Something went wrong. */ fvwm_debug(__func__, "Couldn't initialise XRandR: %s\n", strerror(errno)); - fvwm_debug(__func__, "Falling back to single screen...\n"); - - goto single_screen; + goto randr_fail; } fvwm_debug(__func__, "Using RandR %d.%d\n", major, minor); @@ -415,9 +412,8 @@ void FScreenInit(Display *dpy) if (res == NULL || (res != NULL && res->noutput == 0)) { XRRFreeScreenResources(res); - fvwm_debug(__func__, "RandR present, yet no ouputs found. " - "Using single screen...\n"); - goto single_screen; + fvwm_debug(__func__, "RandR present, yet no ouputs found."); + goto randr_fail; } XRRFreeScreenResources(res); @@ -435,17 +431,9 @@ void FScreenInit(Display *dpy) return; -single_screen: - m = monitor_new(); - m->si->name = fxstrdup(GLOBAL_SCREEN_NAME); - m->si->rr_output = -1; - m->si->x = 0, - m->si->y = 0, - m->si->w = DisplayWidth(disp, DefaultScreen(disp)), - m->si->h = DisplayHeight(disp, DefaultScreen(disp)); - m->flags |= MONITOR_NEW|MONITOR_PRIMARY; - - TAILQ_INSERT_TAIL(&monitor_q, m, entry); +randr_fail: + fprintf(stderr, "Unable to initialise RandR\n"); + exit(101); } void