mirror of
https://github.com/ralsina/xrandroll.git
synced 2024-11-24 03:52:22 +00:00
Fix mode application
This commit is contained in:
parent
dce8545ed3
commit
008605b983
@ -285,7 +285,7 @@ class Window(QObject):
|
||||
# Show modes
|
||||
self.ui.modes.clear()
|
||||
monitor = self.screen.monitors[name]
|
||||
for name, mode in monitor.modes.items():
|
||||
for _, mode in monitor.modes.items():
|
||||
self.ui.modes.addItem(str(mode))
|
||||
|
||||
mode = monitor.get_current_mode()
|
||||
|
@ -121,7 +121,10 @@ class Monitor:
|
||||
return None
|
||||
|
||||
def get_current_mode(self):
|
||||
return self.modes[self.get_current_mode_name()]
|
||||
for k, v in self.modes.items():
|
||||
if v.current:
|
||||
return v
|
||||
return None
|
||||
|
||||
def set_current_mode(self, mode_name):
|
||||
for k, v in self.modes.items():
|
||||
|
@ -41,6 +41,7 @@ class Screen:
|
||||
mode = mon.get_current_mode()
|
||||
cli.append(f"--pos {int(mon.pos_x)}x{int(mon.pos_y)}")
|
||||
cli.append(f"--mode {mode.res_x}x{mode.res_y}")
|
||||
cli.append(f"--rate {mode.frequency}")
|
||||
mod_x, mod_y = mode.res_x, mode.res_y
|
||||
if mon.orientation in ("left", "right"):
|
||||
mod_x, mod_y = mod_y, mod_x
|
||||
|
Loading…
Reference in New Issue
Block a user