2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Add workaround for macOS leaveEvent() bugs.

On macOS sometimes when mouse leaves the window we don't receive leaveEvent()
calls in the nested widgets, like buttons, only for the window itself.
This commit is contained in:
John Preston
2017-11-21 14:27:37 +04:00
parent d93c1ccbaa
commit 44e94bfbf5
9 changed files with 66 additions and 4 deletions

View File

@@ -261,6 +261,14 @@ void MainWindow::resizeEvent(QResizeEvent *e) {
updateControlsGeometry();
}
rpl::producer<> MainWindow::leaveEvents() const {
return _leaveEvents.events();
}
void MainWindow::leaveEvent(QEvent *e) {
_leaveEvents.fire({});
}
void MainWindow::updateControlsGeometry() {
auto bodyTop = 0;
auto bodyWidth = width();