Workaround render glitches on new MacBooks.

For unknown reason large windows have bad render glitches in High Sierra.
Forcing of OpenGL composition (by adding a fake child QOpenGLWidget) fixes it.
This commit is contained in:
John Preston 2017-10-16 17:16:01 +03:00
parent 5b190c5098
commit 508fa14385
3 changed files with 5 additions and 1 deletions

View File

@ -129,7 +129,6 @@ Messenger::Messenger() : QObject()
QMimeDatabase().mimeTypeForName(qsl("text/plain"));
_window = std::make_unique<MainWindow>();
_window->createWinId();
_window->init();
auto currentGeometry = _window->geometry();

View File

@ -216,6 +216,8 @@ MainWindow::Private::~Private() {
MainWindow::MainWindow()
: _private(std::make_unique<Private>(this)) {
auto forceOpenGL = std::make_unique<QOpenGLWidget>(this);
trayImg = st::macTrayIcon.instance(QColor(0, 0, 0, 180), dbisOne);
trayImgSel = st::macTrayIcon.instance(QColor(255, 255, 255), dbisOne);

View File

@ -135,6 +135,9 @@ void MainWindow::updateWindowIcon() {
}
void MainWindow::init() {
Expects(!windowHandle());
createWinId();
initHook();
updateWindowIcon();