Skip to content

Conversation

@sebthom
Copy link
Member

@sebthom sebthom commented Dec 2, 2025

Fixes #1445


if (!"complete".equals(safeEvaluate(browser, "return document.readyState"))) { //$NON-NLS-1$ //$NON-NLS-2$
UI.getDisplay().timerExec(200, () -> updateBrowserSize(browser));
UI.getDisplay().timerExec(50, () -> updateBrowserSize(browser));
Copy link
Contributor

Choose a reason for hiding this comment

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

I think that until we solve #1396, lowering this will increase the exceptions, so I would leave this for later. I think most likelz the other changes are enough. What do you think?

Copy link
Member Author

Choose a reason for hiding this comment

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

In the case where I see the resize flicker it only gets considerably improved if I reduce the value to 50ms or lower.

Copy link
Member Author

Choose a reason for hiding this comment

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

I can try to address the SWTException issue as part of this PR too.

Copy link
Member Author

Choose a reason for hiding this comment

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

I added a second commit that should allow faster reschedules of updateBrowserSize without throwing the SWTExceptions

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for addressing the exceptions. I think that even though the code will not throw the SWTException, if it happens, the dialog will not have the proper size, which not good from the user point of view. I will try to put aside some time till the end of the week to implement the solution I suggested #1396.

Copy link
Member Author

Choose a reason for hiding this comment

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

Well, I cannot reproduce the exception. But if it occurs a new resize attempt will be done 20ms later so this should result in a correct size.

updateBrowserSize(browser, 1);
}

private void updateBrowserSize(final Browser browser, final int attempt) {
Copy link
Contributor

Choose a reason for hiding this comment

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

@sebthom , can you rebase your PR? Now that I think I have solved the problem with safeEvaluate returning exceptions, I think you can go back to your original attempt which was much simpler.

Copy link
Contributor

@rubenporras rubenporras left a comment

Choose a reason for hiding this comment

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

See last comment.

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.

Hover resize is irritating

2 participants