macOS and Windows present mirrored monitors as a single virtual monitor,
but X11 exposes this scenario as two distinct monitors with identical
coordinates. This messes up our logic, and is likely confusing for the
user. So instead we'll ignore any monitors that have identical
coordinates to any already seen monitors.
Fix some indentation issues and make sure everything* uses CamelCase.
* MonitorArrangement is left as snake_case in order to pretend it is an
independent FLTK widget class.
Refresh MonitorArrangement on configuration change
MonitorArrangement (in the options dialog) never changes when the system
monitor configuration changes. Therefore, the user can get into a state
where the reality doesn't match what is shown (when a monitor is
added/removed, resolution or position changed etc).
All these changes triggers an event in FLTK
(FL_SCREEN_CONFIGURATION_CHANGED). This commit adds an event handler in
MonitorArrangement and refreshes the widget whenever that event occurs.
Because Fl_Handler does not have a void*-argument (and we must be able
to access the widget from our handler callback) a static set of
instances have been added, which all will receive the events.
It might be useful to have more information about a monitor when
configuring its settings in the Options menu. Therefore, this commit
adds support for showing additional information about a monitor
(resolution and platform-specific name).
The user might not always want to use all monitors when in fullscreen
mode, but instead only a few. This commit adds support for configuring
selected monitors from command line, in the config file and graphically
in the options menu.
Because it might be hard to guarantee the consistency of monitor
identifiers coming from third-parties (for example FLTK), it has been
decided to use our own numerical identifier. This identifier is based on
the monitor's positions. The mapping between this identifier and the
indices used by FLTK is done by MonitorIndicesParameter.