~ctwm/ctwm/trunk

« back to all changes in this revision

Viewing changes to cmake_files/build_options.cmake

  • Committer: Matthew Fuller
  • Date: 2018-11-10 23:59:32 UTC
  • mfrom: (614.1.131 randr)
  • Revision ID: fullermd@over-yonder.net-20181110235932-unqq2qvxnp8mpjlz
Merge RANDR and Layout support.

This adjusts internal data structures defining our display layout to be
more flexible.  When build with RANDR support (default) and the X server
supports the extension, the structures are built with knowledge of the
invididual monitors composing the desktop and how they're laid out.  The
various zoom'ing functions now zoom just on the monitor they're on;
.x*zoom functions will zoom across the entire Screen.

This makes multi-monitor setups work much more fluidly, especially when
they're of differing resolutions or otherwise don't add up to an even
rectangular output.

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
option(USE_RPLAY  "Enable librplay sound support"      OFF)
14
14
option(USE_SREGEX "Use regex from libc"                ON )
15
15
option(USE_EWMH   "Support some Extended Window Manager Hints"  ON )
 
16
option(USE_XRANDR "Enable Xrandr support"              ON )
16
17
 
17
18
 
18
19
 
120
121
else()
121
122
        message(FATAL_ERROR "USE_SREGEX=OFF no longer supported.")
122
123
endif(USE_SREGEX)
 
124
 
 
125
 
 
126
# Is Xrandr of a suitable version available?
 
127
if(USE_XRANDR)
 
128
        if(NOT X11_Xrandr_FOUND)
 
129
                message(FATAL_ERROR "Couldn't find Xrandr libs")
 
130
        endif(NOT X11_Xrandr_FOUND)
 
131
 
 
132
        # We need XRRGetMonitors()
 
133
        set(OLD_CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES})
 
134
        set(OLD_CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES})
 
135
        set(CMAKE_REQUIRED_INCLUDES  ${X11_Xrandr_INCLUDE_PATH})
 
136
        set(CMAKE_REQUIRED_LIBRARIES ${X11_Xrandr_LIB})
 
137
        check_symbol_exists(XRRGetMonitors "X11/extensions/Xrandr.h" HAVE_XRRGETMONITORS)
 
138
        set(CMAKE_REQUIRED_INCLUDES ${OLD_CMAKE_REQUIRED_INCLUDES})
 
139
        set(CMAKE_REQUIRED_LIBRARIES ${OLD_CMAKE_REQUIRED_LIBRARIES})
 
140
 
 
141
        if(NOT HAVE_XRRGETMONITORS)
 
142
               message(FATAL_ERROR "Xrandr lib does not implement XRRGetMonitors, Xrandr 1.5 needed")
 
143
        endif(NOT HAVE_XRRGETMONITORS)
 
144
 
 
145
        # Got it
 
146
        include_directories(${X11_Xrandr_INCLUDE_PATH})
 
147
        list(APPEND CTWMLIBS ${X11_Xrandr_LIB})
 
148
        list(APPEND CTWMSRC xrandr.c)
 
149
        message(STATUS "Enabling Xrandr support: ${X11_Xrandr_LIB}")
 
150
else()
 
151
        message(STATUS "Disabling Xrandr support.")
 
152
endif(USE_XRANDR)