From 2c30d9a9b144ba3737e04d1780a5684b1a5e53ef Mon Sep 17 00:00:00 2001 From: Roberto Alsina Date: Sat, 1 Feb 2020 13:46:05 -0300 Subject: [PATCH] Basic replication implemented --- main.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/main.py b/main.py index 801e491..5ea57cc 100644 --- a/main.py +++ b/main.py @@ -169,6 +169,23 @@ class Window(QObject): mon = self.ui.screenCombo.currentText() replicate = self.ui.replicaOf.currentText() print(f"Making {mon} a replica of {replicate}") + if replicate == 'None': + print('TODO: make things non-replicas') + return + mon = self.xrandr_info[mon] + replicate = self.xrandr_info[replicate] + + # Making a replica implies: + # Set the same position + mon["pos_x"] = replicate["pos_x"] + mon["pos_y"] = replicate["pos_y"] + + # Set the same mode if possible + if replicate["current_mode"] in mon["modes"]: + mon["current_mode"] = replicate["current_mode"] + else: + print("TODO: replicas when the modes don't match") + mon['item'].update_visuals(mon) def do_reset(self): for n in self.xrandr_info: