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

Sfdk: Set GUI/LastNormalWindowPosition on setVideoMode #550

Merged
merged 3 commits into from Feb 3, 2023
Merged

Conversation

vigejolla
Copy link
Member

VirtualBox 7.0 no longer uses GUI/LastGuestSizeHint, so we need to set both in order to make sure window size is correct

With failure propagation enabled the checkpoint would not be reached in
case of failure and so the functor would not be called. It must have
been enabled by mistake.
Failure handling is explicit in the fixed part of execution. The
optional part, given the use of a checkpoint, is meant to complete
despite of errors. Failure propagation must have been enabled by mistake
here.
Copy link
Member

@martyone martyone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Error handling and some nitpicks yet.

{
BatchComposer composer = BatchComposer::createBatch("setLastNormalWindowPosition");
fetchExtraData("GUI/LastNormalWindowPosition", Sdk::instance(), [=, batch = composer.batch()](QString data, bool ok) {
if (!ok)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's fix error reporting now. We need

*allOk &= ok;

prior to this line and then { *allOk = false; return; } instead of just return in assertions.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was left out on purpose. Even if this part of setVideoMode fails, the others might be enough, depending on VirtualBox version.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I guess you assume it would cancel the other parths. That's not the case here. It would just indicate that not all went as planned to the user. So I would prefer to be very specific about the two scenarios we expect here, branch for old and new version of vbox we currently know about and be verbose in other cases.

Note: When I tried with vbox 6.1.36r152435, the GUI/LastNormalWindowPosition property is set for my emulators, so this should not fail normally. Also when I tried with nonexisting property, it still returned zero, just the message is "No value set!". Older emulators will get reinstalled this time, because we are touching the emulator package, so our emulators should have that property set after upgrade.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I guess you assume it would cancel the other parths. That's not the case here. It would just indicate that not all went as planned to the user. So I would prefer to be very specific about the two scenarios we expect here, branch for old and new version of vbox we currently know about and be verbose in other cases.

You are again right. I wonder how I could think that, when the code is right in front of me?

Note: When I tried with vbox 6.1.36r152435, the GUI/LastNormalWindowPosition property is set for my emulators, so this should not fail normally. Also when I tried with nonexisting property, it still returned zero, just the message is "No value set!". Older emulators will get reinstalled this time, because we are touching the emulator package, so our emulators should have that property set after upgrade.

Thanks for testing!

src/libs/sfdk/vboxvirtualmachine.cpp Outdated Show resolved Hide resolved
src/libs/sfdk/vboxvirtualmachine.cpp Outdated Show resolved Hide resolved
@vigejolla vigejolla force-pushed the jb60004 branch 2 times, most recently from 155ab4e to a0a289c Compare February 3, 2023 07:58
Copy link
Member

@martyone martyone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice to fix the misplaced & in lambda argument list and wrong indentation of that line :)

VirtualBox 7.0 no longer uses GUI/LastGuestSizeHint, so we need to set
both in order to make sure window size is correct
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants