Skip to content

fix #6119: respect previously maximized state when clicking tray to restore window #6751

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ellisonch
Copy link

@ellisonch ellisonch commented Jan 18, 2024

First time contributor checklist:

Contributor checklist:

  • My contribution is not related to translations.
  • My commits are in nice logical chunks with good commit messages
  • My changes are rebased on the latest main branch
  • A yarn ready run passes successfully (more about tests here)
  • My changes are ready to be shipped to users

Description

Fixes #6119. If the system tray is clicked, it will restore a minimized window, respecting the previous maximized state. Before this patch, it would clobber the previously maximized state.

I added an automated test that failed, and with my new changes, now passes.

Tested on Windows 10 only.

@jamiebuilds-signal jamiebuilds-signal self-assigned this Jan 18, 2024
@jamiebuilds-signal jamiebuilds-signal self-requested a review January 18, 2024 17:27
@ellisonch
Copy link
Author

Is there anything additional needed to merge this patch? The bug is still happening, and this change fixes the bug. It also includes an automated test reproducing, and verifying the change works to fix it.

@mkurz
Copy link

mkurz commented Apr 8, 2025

There is a fix in electron v35.1.4 which for me fixes this bug:

  • Fixed a bug that could cause some maximized windows on Linux to report an incorrect window state. #46464 (Also in 34, 36)

You should check again after #7263 was merged and released.

@ellisonch
Copy link
Author

There is a fix in electron v35.1.4 which for me fixes this bug:

* Fixed a bug that could cause some maximized windows on Linux to report an incorrect window state. [#46464](https://github.com/electron/electron/pull/46464) (Also in [34](https://github.com/electron/electron/pull/46462), [36](https://github.com/electron/electron/pull/46463))

You should check again after #7263 was merged and released.

Not fixed in 7.50.0. I don't know if that includes the patch you mentioned, nor do I know how to figure that out.

@mkurz
Copy link

mkurz commented Apr 12, 2025

7.50.0 does include the patch: https://github.com/signalapp/Signal-Desktop/blob/v7.50.0/package.json#L296

However, I can not - and also never could before - reproduce your issue. But I am on Linux anyway.

@ellisonch
Copy link
Author

7.50.0 does include the patch: https://github.com/signalapp/Signal-Desktop/blob/v7.50.0/package.json#L296

However, I can not - and also never could before - reproduce your issue. But I am on Linux anyway.

All I can say is the automated test that I wrote and included in this diff fails before my patch:

System tray service: rendering the tray
    1) should remember its maximized state upon restore


  0 passing (193ms)
  1 failing

  1) SystemTrayService
       should remember its maximized state upon restore:

      AssertionError: expected false to be true
      + expected - actual

      -false
      +true

      at Context.<anonymous> (ts\test-node\app\SystemTrayService_test.js:230:24)
      at process.processImmediate (node:internal/timers:476:21)

and succeeds after:

System tray service: rendering the tray
    √ should remember its maximized state upon restore (130ms)


  1 passing (183ms)

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.

minimizing to system tray causes window to forget it was maximized
3 participants