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

Client using local scaling can fail to resize (especially with a maximized window) #1903

Open
marc-legendre opened this issue Sep 30, 2024 · 2 comments
Labels

Comments

@marc-legendre
Copy link

Hi there!

I stumbled upon an issue where a client using local scaling can fail to resize when the window resizes. This happens in very specific conditions, for example when starting with a maximized window, then resizing it, then maximizing it again.

This happens since 0ff0844 (first released in 1.3.0)

Reproduction

This is easy to reproduce with the VNC app:

  • open the VNC app
  • maximize the window
  • connect
  • resize window
    • the viewer resizes correctly
  • maximize the window again
    • the viewer does not resize

Here is a screencast demonstrating the issue, using vnc.html from master (047531e), with Chromium (but this is not browser-specific).

Screencast.2024-09-30.11.40.32.webm

Misc. details

I have not completely understood the issue, but I can share some observations / intuitions

  • the client resize happens only if !_clientHasExpectedSize()
  • but _expectedClientWidth and _expectedClientHeight never change when I resize the window.
  • thus if the new window size happens to be the same as the initial size, the client won't resize
  • this is why the issue is easily triggered with a maximized window
  • this is also why it rarely happens otherwise, and even then it is not even noticeable
@marc-legendre
Copy link
Author

marc-legendre commented Sep 30, 2024

I don't understand everything in RFB, but I am wondering if maybe _handleResize() should call _saveExpectedClientSize() like _resize() does ?

diff --git i/core/rfb.js w/core/rfb.js
index 0007bed..2758a1e 100644
--- i/core/rfb.js
+++ w/core/rfb.js
@@ -730,6 +730,7 @@ export default class RFB extends EventTargetMixin {
         window.requestAnimationFrame(() => {
             this._updateClip();
             this._updateScale();
+            this._saveExpectedClientSize();
         });
 
         if (this._resizeSession) {

Indeed, both call _updateClip() and _updateScale(), but only _resize calls _saveExpectedClientSize(), and it feels like _handleResize should.

(note: this patch makes the issue disappear)

@CendioOssman
Copy link
Member

Thanks for your bug report! I can reproduce the issue here as well.

I think we didn't fully consider all scenarios in #1617, and we need to reevaluate the design here.

@samhed, can you have a look?

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

No branches or pull requests

2 participants