polygon
polygon copied to clipboard
Move Window to next Monitor/Maximize/Almost Maximize
I just wanted to reach out and say I almost have moving a window to the next monitor working. I have the window moving to the next monitor but need to fix the positioning and then write previous monitor.
I have also added Maximize and Almost Maximize.
I will submit a pull request when I am finished.
@thesobercoder I actually have a question. If the next monitor is not the same orientation how should sizing the window work and where should it be positioned? Currently I have it maintaining the same top and left position and will have it resize the window if it does not fit within the window.
@shaqaruden Thanks so much for helping me out with this. To answer your question, it is actually a tricky one because we have to consider two things -
- The next monitor can be smaller than the current one (this can be tackled easily by always calculating the size in ratio of the monitor size)
- The next monitor can be, as you mentioned, in a different orientation.
The way I think Rectangle does it, is by first calculating the size of the window (again in ratio of the destination monitor) and then place it in equal distance from both top/bottom and left/right. I think that should give us the desired effect. I'm open to other ideas. Let's keep chatting.
@shaqaruden Thanks so much for helping me out with this. To answer your question, it is actually a tricky one because we have to consider two things -
* The next monitor can be smaller than the current one (this can be tackled easily by always calculating the size in ratio of the monitor size) * The next monitor can be, as you mentioned, in a different orientation.
The way I think Rectangle does it, is by first calculating the size of the window (again in ratio of the destination monitor) and then place it in equal distance from both top/bottom and left/right. I think that should give us the desired effect. I'm open to other ideas. Let's keep chatting.
So if I understand you correctly, lets say I place a window in the last fourth of a monitor then move it to another monitor it should maintain its relative position of the last fourth?
I'm going to create the PR now with what I have but leave it in a WIP state
@shaqaruden Thanks so much for helping me out with this. To answer your question, it is actually a tricky one because we have to consider two things -
* The next monitor can be smaller than the current one (this can be tackled easily by always calculating the size in ratio of the monitor size) * The next monitor can be, as you mentioned, in a different orientation.
The way I think Rectangle does it, is by first calculating the size of the window (again in ratio of the destination monitor) and then place it in equal distance from both top/bottom and left/right. I think that should give us the desired effect. I'm open to other ideas. Let's keep chatting.
So if I understand you correctly, lets say I place a window in the last fourth of a monitor then move it to another monitor it should maintain its relative position of the last fourth?
Not really. The new size should dictate how the window will be positioned. Please remember that we are prescribing what, we think, is the best position on the next monitor. Like I said before, the position should always be center of the monitor based on the new size. This should work perfectly in most cases, I believe.