Closed felix-andreas closed 4 years ago
@ryonakano I have implemented your suggestion to use properties instead of plain attributes. Just out of curiosity, (apart from that they are read only now) what is the advantage to use properties here?
Because properties are not allow for out
-method arguments, I had to use the value holding _real_width
and _real_height
for the
get_current_mode_size (out _real_width, out _real_height)
method.
Is this best practice? Or would would it be better to use intermediate variables:
int tmp_width, tmp_height;
virtual_monitor.get_current_mode_size (out tmp_width, out tmp_height)
real_width = tmp_width;
real_height = tmp_height;
The one reason I suggested to use properties here is to make these values read-only. And my bad, my suggestion might be wrong. I think we can use intermediate variables or left them public
instead.
Ok, I see. Still, thanks for the suggestion!
Maybe someone with more vala knowledge could assist on finding the most elegant solution?
Currently the monitor widgets are not properly centered if one of the monitors is rotated. This makes it difficult to adjust the monitor configurations as the monitor controls get somtimes rendered outside of the canvas.
Using the attributes
real_width
andreal_height
from theDisplayWidget
instead ofget_current_mode_size
of theVirtualMonitor
fixes this problem.Before:
After: