Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions src/plwm.pl
Original file line number Diff line number Diff line change
Expand Up @@ -1648,9 +1648,16 @@
% Update geometry if it changed
global_key_value(monitor_geom, Output, PrevGeom),
(PrevGeom \= Geom ->
global_key_newvalue(monitor_geom, Output, Geom),
format(string(Msg), "Monitor \"~s\" geometry reconfigured", [Output]),
writeln(Msg)
(nb_getval(monitor_geom, AMonGeom), gen_assoc(OldMon, AMonGeom, Geom) ->
% If a previous monitor has this geom, this one became a mirror, unmanage it
delete_monitor(Output),
format(string(Msg), "Monitor \"~s\" is a mirror to \"~s\", unmanaging it", [Output, OldMon]),
writeln(Msg)
;
global_key_newvalue(monitor_geom, Output, Geom),
format(string(Msg), "Monitor \"~s\" geometry reconfigured", [Output]),
writeln(Msg)
)
; true)

% Add new monitor
Expand Down Expand Up @@ -2040,7 +2047,7 @@
init_monitor(Mon, Geom) :-
% A monitor with this geometry is already managed, don't register mirror
nb_getval(monitor_geom, AMonGeom), gen_assoc(OldMon, AMonGeom, Geom) ->
format(string(Msg), "Monitor \"~s\" has same geometry as \"~s\", ignoring it", [Mon, OldMon]),
format(string(Msg), "Monitor \"~s\" is a mirror to \"~s\", ignoring it", [Mon, OldMon]),
writeln(Msg)
;

Expand Down