Skip to content
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

[Bug] Syncplay opens on disconnected monitors, becomes unusable #504

Closed
Zefferis opened this issue Feb 10, 2022 · 11 comments
Closed

[Bug] Syncplay opens on disconnected monitors, becomes unusable #504

Zefferis opened this issue Feb 10, 2022 · 11 comments

Comments

@Zefferis
Copy link

Describe the bug
When the Syncplay window is opened then closed within a secondary monitor; when re-opened the application attempts to open in the same monitor/location.

If the 2nd monitor is disconnected from the system, a newly opened syncplay window is no longer usable.
Syncplay window gains functionality when the monitor is re-added.

To Reproduce
Steps to reproduce the behavior:

  1. Connect a secondary monitor.
  2. Run/open Syncplay from Configurations Window
  3. Move the Syncplay Window to the 2nd monitor.
  4. Close Syncplay
  5. Disconnect Monitor
  6. Open Syncplay

Expected behavior
Syncplay Window should open in the active monitor.

Version and platform:

  • OS: Windows 10
  • Version: Syncplay 1.7.0 Development Snapshot 1 - Portable

Additional context
This has been tested by my friends as well, all testers have been using Windows 10 on the same version.

P.S. Thanks so much for the program! Donated earlier <3

@Et0h
Copy link
Contributor

Et0h commented Feb 10, 2022

Does launching Syncplay with the --clear-gui-data command line switch fix the issue?

@Zefferis
Copy link
Author

It works!

I didn't realize that the site itself would have the CLI Commands - totally forgot that was part of Syncplay.


I have noticed something now that I can do a bit more experimenting with the --clear-gui-data command.

The Configuration Window always appears on the main monitor, regardless of where or how it is closed.
The Syncplay Client opens and remembers where it was last used/closed leading to potential GUI Issues.

For the users of Syncplay who are not familiar with CLI;
Could an option be added to the Syncplay Configuration Window to "Clear Client GUI Data" or "Restore Client GUI" ?

image

Which could start the client with cleared GUI Data or restart the Syncplay exe using the --clear-gui-data flag for the user?

@Et0h
Copy link
Contributor

Et0h commented Feb 11, 2022

I think it'd probably be better to fix the bug than to add a whole new UI element which people wouldn't necessarily know when to use. I don't have a second monitor on my main PC so it is difficult for me to debug.

If someone could test to see if the following change fixes it then that'd be great:

Replace the line in gui.py which is self.move(settings.value("pos", QPoint(200, 200))) with:

        movePos = settings.value("pos", QPoint(200, 200))
        windowGeometry = QtWidgets.QApplication.desktop().availableGeometry(self)
        posIsOnScreen = windowGeometry.contains(QtCore.QRect(movePos.x(), movePos.y(), 1, 1))
        if not posIsOnScreen:
            movePos = QPoint(200,200)
        self.move(movePos)

@Zefferis
Copy link
Author

This is gonna sound a bit dumb but -

How to I build this project so I can make those changes and test it?

I've downloaded the repo, but I'm a 100% Python beginner 😓

Et0h added a commit that referenced this issue Feb 12, 2022
@Et0h
Copy link
Contributor

Et0h commented Feb 12, 2022

@Zefferis It's a bit tricky, so I've built if for you: https://github.com/Syncplay/syncplay/actions/runs/1833515590 - you can download the Syncplay-1.7.0-Setup.exe version or the Syncplay_1.7.0_Portable version.

If you ever want to learn Python and run Syncplay through it then you can check out https://syncplay.pl/about/development/ for instructions.

@Zefferis
Copy link
Author

It works!

@Et0h
Copy link
Contributor

Et0h commented Feb 12, 2022

It works!

That's great. In addition to not crashing, does it still save the position correctly when the second monitor is actually still connected?

@Zefferis
Copy link
Author

Zefferis commented Feb 12, 2022

That's great. In addition to not crashing, does it still save the position correctly when the second monitor is actually still connected?

No, it seems that if the client is used on the main monitor and closed it's position is saved.

If it is moved to a secondary monitor and closed, it will always re-appear on the main monitor when opened again.

It currently does not save the position on the 2nd monitor even when the 2nd monitor available.


Closed in main monitor = Saved Position.
Closed in 2nd monitor = Always appears on main monitor.

@Et0h
Copy link
Contributor

Et0h commented Feb 24, 2022

@Zefferis Can you please test my most recent update to #504 and let me know if it manages to fix the new bug while also not reintroducing the original bug.

@Zefferis
Copy link
Author

@Et0h

When Multiple Monitors are Active:

  • Syncplay Client Opens and Closes on the last known monitor (expected behavior) (PROGRESS 🎊 )

When Last Known Monitor is Disconnected:

  • Syncplay Client attempts to open on the missing monitor (previous behavior)
  • Syncplay Client appears on the monitor when re-connected (previous behavior) ;

CLI --clear-gui-data is still needed in this situation


The position is now saved on the extended monitor, but is not reset when that monitor is no longer available

1 part of the 2 part bug is now fixed 💪

@Et0h
Copy link
Contributor

Et0h commented Mar 4, 2022

Thanks for testing this. If it causes the same problem with the previous behaviour then I'll revert the change and just go with the first fix. If someone with a second wants to come up with something which allows multiple monitor to save without causing problems on disconnection they are free to make a PR in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants