Skip to content

refactor: use InvalidateLayout() not DeprecatedLayoutImmediately()#41899

Closed
ckerr wants to merge 1 commit intomainfrom
refactor/use-InvalidateLayout-not-DeprecatedLayoutImmediately
Closed

refactor: use InvalidateLayout() not DeprecatedLayoutImmediately()#41899
ckerr wants to merge 1 commit intomainfrom
refactor/use-InvalidateLayout-not-DeprecatedLayoutImmediately

Conversation

@ckerr
Copy link
Member

@ckerr ckerr commented Apr 19, 2024

Description of Change

Replace our calls to the deprecated API DeprecatedLayoutImmediately() with InvalidateLayout() instead.

It looks like all of the occurrences were just to trigger a new draw & didn't necessarily rely on it happening immediately, so InvalidateLayout() is the call preferred by upstream.

Xref: https://crbug.com/1121681

Xref: https://chromium-review.googlesource.com/c/chromium/src/+/5242027

Checklist

Release Notes

Notes: none

@ckerr ckerr added semver/patch backwards-compatible bug fixes no-backport labels Apr 19, 2024
@electron-cation electron-cation bot added the new-pr 🌱 PR opened recently label Apr 19, 2024
@ckerr ckerr marked this pull request as draft April 19, 2024 04:03
@ckerr
Copy link
Member Author

ckerr commented Apr 19, 2024

Pasting CI failures here as breadcrumbs.

In order of likely to unlikely, these CI failures may be that the tests were coded to assume synchronous operations, or that this PR really is introducing new bugs, or maybe they're all CI flakes 😜

not ok 456 BrowserWindow module "useContentSize" option make window created with content size when used
  expected [ 120, +0 ] to deeply equal [ 400, 400 ]
  AssertionError: expected [ 120, +0 ] to deeply equal [ 400, 400 ]
      at Context.<anonymous> (electron\spec\api-browser-window-spec.ts:2928:35)
      at processImmediate (node:internal/timers:478:21)
ok 457 BrowserWindow module "useContentSize" option make window created with window size when not used
not ok 458 BrowserWindow module "useContentSize" option works for a frameless window
  expected [ +0, +0 ] to deeply equal [ 400, 400 ]
  AssertionError: expected [ +0, +0 ] to deeply equal [ 400, 400 ]
      at Context.<anonymous> (electron\spec\api-browser-window-spec.ts:2948:35)
      at processImmediate (node:internal/timers:478:21)
not ok 459 BrowserWindow module "titleBarStyle" option creates browser window with hidden title bar
  expected [ +0, +0 ] to deeply equal [ 400, 400 ]
  AssertionError: expected [ +0, +0 ] to deeply equal [ 400, 400 ]
      at Context.<anonymous> (electron\spec\api-browser-window-spec.ts:3005:35)
      at processImmediate (node:internal/timers:478:21)
ok 460 BrowserWindow module "titleBarStyle" option creates browser window with hidden inset title bar # SKIP -
[4212:0419/032926.452:ERROR:surface_manager.cc(470)] Old/orphaned temporary reference to SurfaceId(FrameSinkId[](308, 3), LocalSurfaceId(5, 1, 869C...))
not ok 461 BrowserWindow module "titleBarStyle" option sets Window Control Overlay with hidden title bar
  Timeout of 30000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (C:\projects\src\electron\spec\api-browser-window-spec.ts)
  Error: Timeout of 30000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (C:\projects\src\electron\spec\api-browser-window-spec.ts)
      at listOnTimeout (node:internal/timers:573:17)
      at processTimers (node:internal/timers:514:7)
ok 462 BrowserWindow module "titleBarStyle" option sets Window Control Overlay with hidden inset title bar # SKIP -
ok 463 BrowserWindow module "titleBarStyle" option when an invalid titleBarStyle is initially set does not crash changing minimizability 
ok 464 BrowserWindow module "titleBarStyle" option when an invalid titleBarStyle is initially set does not crash changing maximizability
not ok 465 BrowserWindow module "titleBarOverlay" option sets Window Control Overlay with title bar height of 40
  Timeout of 30000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (C:\projects\src\electron\spec\api-browser-window-spec.ts)
  Error: Timeout of 30000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (C:\projects\src\electron\spec\api-browser-window-spec.ts)
      at listOnTimeout (node:internal/timers:573:17)
      at processTimers (node:internal/timers:514:7)
ok 466 BrowserWindow module BrowserWindow.setTitlebarOverlay does not crash when an invalid titleBarStyle was initially set
(node:2588) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 error listeners added to [IpcMainImpl]. Use emitter.setMaxListeners() to increase limit
not ok 467 BrowserWindow module BrowserWindow.setTitlebarOverlay correctly updates the height of the overlay
  Timeout of 30000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (C:\projects\src\electron\spec\api-browser-window-spec.ts)
  Error: Timeout of 30000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (C:\projects\src\electron\spec\api-browser-window-spec.ts)
      at listOnTimeout (node:internal/timers:573:17)
      at processTimers (node:internal/timers:514:7)
ok 468 BrowserWindow module "enableLargerThanScreen" option can move the window out of screen # SKIP -
ok 469 BrowserWindow module "enableLargerThanScreen" option cannot move the window behind menu bar # SKIP -

@electron-cation electron-cation bot removed the new-pr 🌱 PR opened recently label Apr 20, 2024
@codebytere
Copy link
Member

@ckerr do you still want to work on this or can we close it for now?

@ckerr ckerr closed this Mar 16, 2025
@ckerr ckerr deleted the refactor/use-InvalidateLayout-not-DeprecatedLayoutImmediately branch March 16, 2025 19:09
@ckerr
Copy link
Member Author

ckerr commented Mar 16, 2025

This is still something we need to do; but since I'm not working on it right now, there's no point in keeping this old draft floating around

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

Labels

no-backport semver/patch backwards-compatible bug fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants