mattermost / desktop

Mattermost Desktop application for Windows, Mac and Linux
Apache License 2.0
2.03k stars 829 forks source link

MM-60233 - fix issue in kde of focus after minimize #3157

Closed pvev closed 3 weeks ago

pvev commented 1 month ago

Summary

MM-60233: Fix window minimizing issue on KDE/KWin environments. The app window was immediately being focus after being minimized, and it caused it to restore instead of stay minimized. This happened because the onFocus event was being triggered after minimizing, and then the actions within the onFocus handler was causing the window to re obtain the focus.

This PR resolves this by modifying the onFocus event handler by checking if the application was running on KDE/KWin (plasma) and if the window is also minimized. If both of the conditions are present, then the handler will return early and will not execute further actions avoiding the window to obtain focus unwanted.

Ticket Link

https://mattermost.atlassian.net/browse/MM-60233 Closes #3130

Checklist

Device Information

This PR was tested on: Kubuntu: Operating System: Kubuntu 24.04 KDE Plasma Version: 5.27.11 KDE Frameworks Version: 5.115.0 Qt Version: 5.15.13 Kernel Version: 6.8.0-45-generic (64-bit) Graphics Platform: X11 Processors: 2 Memory: 1.9 GiB of RAM Graphics Processor: virgl Manufacturer: Parallels International GmbH. Product Name: Parallels ARM Virtual Machine System Version: 0.1

Screenshots

Before:

https://github.com/user-attachments/assets/fde8432e-894c-47fd-b88a-eb7827303ea2

After:

https://github.com/user-attachments/assets/7931d933-99c8-46d0-a7e8-32a5a74df4c4

Release Note

NONE
github-actions[bot] commented 3 weeks ago

Here are the test results below:

Test Summary for Linux on commit 5199db9ff7e4c02230d0d39e45a3a7dd2afc1dbb

New failed tests found on Linux:

Test Summary for macOS on commit 5199db9ff7e4c02230d0d39e45a3a7dd2afc1dbb

New failed tests found on macOS:

Test Summary for Windows on commit 5199db9ff7e4c02230d0d39e45a3a7dd2afc1dbb

All stable tests passed on Windows.