-
Notifications
You must be signed in to change notification settings - Fork 886
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ensure that FreeTube always opens on a display that is currently attached #2205
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code lgtm but i dont have a second screen so i will leave testing to the others
I am sorry but this is beyond my technical/coding skills. If there is a compiled version available with this fix I am happy to test it on my dual monitor setup but as it stands this is too deep for me. |
@MM502 you can download the compiled version from my fork, i've told it to build this branch. The artifacts are here: https://github.com/absidue/FreeTube/actions/runs/2354670497 |
@absidue do you know how i can reproduce the issue for myself because FT right now seems to be doing the same as your build to me. FT always seems to open correctly for me doesn't matter if the screen is connected or disconnected. |
@efb4f5ff-1298-471a-8973-3d47447115dc I think this might only be a problem on Windows, which is why you can't replicate it. |
@absidue So i've just took an Win10 machine and a display to test this. Weird enough i couldnt reproduce the issue on the normal FT install but i did get the issue when i had installed your build. Im not sure if im doing anything wrong. Probably just going to wait on the others to report. When opening the application it opened in my second monitor. Closed the application. Disconnected the monitor and opened the application. But it didnt open. Connected my display again and i still didnt see the application. Had to go into task manager to close FT. After that i could open it again |
@absidue i want to give this another try could u provide me some testcases? |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
This PR is stale because it has been open 28 days with no activity. Remove stale label or comment or this will be closed in 14 days. |
I deleted my AppData folder and then re-installed v0.17.1 and the problem has gone away. There is now a new settings.db file and I am getting the following error message: I don't know if this error is related to the issue or if it relates to my history not importing properly after re-intalling. |
This PR is stale because it has been open 28 days with no activity. Remove stale label or comment or this will be closed in 14 days. |
This PR is stale because it has been open 28 days with no activity. Remove stale label or comment or this will be closed in 14 days. |
@absidue I have a second monitor now so I'll be able to test it, you'll need to rebase/merge development in this branch first |
1eab4c8
to
bf77dca
Compare
Conflicts have been resolved. A maintainer will review the pull request shortly. |
FreeTube seems to not be opening when i remove the display. So I think I'll approve the other PR |
I believe the issue is mainly for if the setup is a display below another display which is why u couldnt reproduce it. |
Ah okay. The setup i used was with a laptop and an external display that was hanging above the laptop. Edit: i shared a txt document in IRC a while back with my test results. Just want to mention it to u, maybe its some useful info. |
Is this PR still up for consideration or should I close it in favour of the other one? |
The other pr seems to work better (for me at least) so I think I'd favor the other one. We should probably wait for @efb4f5ff-1298-471a-8973-3d47447115dc to try the other one when they have time since they have two monitors too before deciding 🙂 |
help needed #3008 (comment) |
Ensure that FreeTube always opens on a display that is currently attached
Pull Request Type
Related issue
closes #1938
Description
This pull request fixes the issues with FreeTube being positioned on disconnected displays when started.
If the saved bounds are on a display that is connected then the window will be positioned at the saved bounds.
Alternatively if the display is disconnected the window will be placed on the nearest display to the saved bounds at the same percentage offset from the top left of the screen, this allows it to work even if the displays have different resolutions.
Finally when FreeTube is opened for the first time after the update, the offsets won't be stored in the database. As this would cause issues if the display is disconnected FreeTube falls back to just setting the window size and leaving the positioning up to the operating system, which should always place it on a connected display.
Testing (for code that is not small enough to be easily understandable)
I tested this multiple times by disconnecting my second display after closing FreeTube and checking that FreeTube was always visible. Important to note that if the dev tools are open in a second window they need to be closed before closing the main FreeTube window as FreeTube only saves the window position if there is a single window open at the time of closing.
see:
FreeTube/src/main/index.js
Lines 306 to 309 in 1eab4c8
Desktop (please complete the following information):