Apply scaling to virtual monitor reported size#439
Conversation
|
This is related to #436. |
|
If I understood the problem correctly, this issue is more than just rounding up, as the geometry is not handled with logical coordinates while I believe it should. But I may be wrong. |
|
b0741f3 to
20e5a00
Compare
3563477 to
af58696
Compare
leolost2605
left a comment
There was a problem hiding this comment.
Hi sorry that a review took so long but this LGTM and I can confirm it fixes the issue. One little comment though :)
06bbfa3 to
0677bc3
Compare
leolost2605
left a comment
There was a problem hiding this comment.
Two more nits and this LGTM :)
| * @param dimension The monitor dimension to scale (width or height) by the current `scale` factor | ||
| * @return the dimension scaled then rounded up and converted back to int | ||
| */ | ||
| private int scaled (int dimension) { |
There was a problem hiding this comment.
Method names should usually be imperative and I think in this case it makes sense to say that we are using the current scale so IMO something like apply_current_scale would be more fitting 🤷
This fixes an issue where you could not apply a layout where a monitor on the left or on top of another monitor has scaling over 100%, because the configuration would contain gaps and the following error would be raised:

This is because the screen origin is at its top-left. When scaling is applied, the monitor area is smaller, which creates gaps on its right and bottom sides that were not took into account.
This PR resize the monitor area when scaling is modified, logically and visually, so the monitor can be adjacent. Moreover, the user can now see what the real area of the monitor will be.
I did not found an existing issue reporting this, but it could related to #435.