From ff3aced099bf81fb623f970d6a2d9aba050b602c Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Thu, 30 Jun 2016 12:53:22 +0100 Subject: [PATCH 1/7] Update version number for 5.7.0 GIT_SILENT --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6559a0c988..02870271a9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ project(KWIN) -set(PROJECT_VERSION "5.6.95") +set(PROJECT_VERSION "5.7.0") set(PROJECT_VERSION_MAJOR 5) cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR) From ec764e32b68452d536148fe95c6f79cb23acad22 Mon Sep 17 00:00:00 2001 From: l10n daemon script Date: Thu, 30 Jun 2016 13:06:15 +0000 Subject: [PATCH 2/7] SVN_SILENT made messages (.desktop file) - always resolve ours In case of conflict in i18n, keep the version of the branch "ours" To resolve a particular conflict, "git checkout --ours path/to/file.desktop" --- effects/morphingpopups/package/metadata.desktop | 2 ++ scripts/videowall/metadata.desktop | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/effects/morphingpopups/package/metadata.desktop b/effects/morphingpopups/package/metadata.desktop index 39005ef125..273b3ddb8d 100644 --- a/effects/morphingpopups/package/metadata.desktop +++ b/effects/morphingpopups/package/metadata.desktop @@ -14,6 +14,7 @@ Comment[nn]=Krysstoningsanimasjon når hjelpebobler eller varslingar endrar form Comment[pl]=Animacja zanikania przy zmianie geometrii wskazówek lub powiadomień Comment[pt]=Animar o desvanecimento quando as dicas ou notificações mudarem de tamanho Comment[pt_BR]=Animar a transição suave quando as dicas ou notificações mudarem de tamanho +Comment[ru]=При изменении формы всплывающих подсказок или уведомлений они плавно растягиваются или сжимаются Comment[sk]=Prelínacia animácia pri tooltipoch alebo notifikáciách pri zmene ich geometrie Comment[sl]=Animacija navzkrižnega pojemanja ob spremembi geometrije orodnih namigov in obvestil Comment[sr]=Анимација претапања када облачићи или обавештења мењају геометрију @@ -41,6 +42,7 @@ Name[nn]=Formendring for sprettoppvindauge Name[pl]=Morfing elementów wysuwnych Name[pt]=Mensagens com mudança de forma Name[pt_BR]=Mensagens com mudança de forma +Name[ru]=Анимация преобразования всплывающих окон Name[sk]=Vysúvať vyskakovacie okná Name[sl]=Prehajajoča pojavna okna Name[sr]=Претапајући искакачи diff --git a/scripts/videowall/metadata.desktop b/scripts/videowall/metadata.desktop index 5e7a275274..a8a991568e 100644 --- a/scripts/videowall/metadata.desktop +++ b/scripts/videowall/metadata.desktop @@ -77,7 +77,7 @@ Comment[nn]=Filmframsyning i fullskjermsmodus over alle tilgjengelege skjermar Comment[pl]=Rozciąga pełnoekranowy odtwarzacz filmów na wszystkie podłączone ekrany, tworząc ścianę wideo Comment[pt]=Espalha o leitor de vídeo em todos os ecrãs ligados para criar um painel de vídeo Comment[pt_BR]=Espalha o reprodutor de vídeo em tela inteira sobre todas as telas ligadas para criar um painel de vídeo -Comment[ru]=Поверх всех прикреплённых экранов открывается видео проигрыватель для создания видео стены +Comment[ru]=Для создания видеостены вывод видеопроигрывателя распределяется по всем подключённым экранам Comment[sk]=Roztiahne na celú obrazovku video prehrávač cez všetky pripojené obrazovky na vytvorenie video steny Comment[sl]=Celozaslonski predvajalnik videov bo razprostrt prek vseh priklopljenih zaslonov in tako ustvaril video zid Comment[sr]=Видео плејер преко целог екрана бива проширен на све прикључене екране, стварајући видео зид From 62d09fad123d9aab5afcff0f27d109ef7c6c18ba Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Wed, 6 Jul 2016 13:08:58 +0100 Subject: [PATCH 3/7] Fix shadow rendering calculations BUG: 365097 Reviewers: #plasma Subscribers: kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D2100 --- scene_opengl.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scene_opengl.cpp b/scene_opengl.cpp index 239a585cc5..7d81eab213 100644 --- a/scene_opengl.cpp +++ b/scene_opengl.cpp @@ -2280,7 +2280,7 @@ void SceneOpenGLShadow::buildQuads() const int width = qMax(topLeft.width(), bottomLeft.width()) + qMax(top.width(), bottom.width()) + qMax(topRight.width(), bottomRight.width()); - const int height = qMax(topLeft.height(), bottomLeft.height()) + + const int height = qMax(topLeft.height(), topRight.height()) + qMax(left.height(), right.height()) + qMax(bottomLeft.height(), bottomRight.height()); @@ -2387,7 +2387,8 @@ bool SceneOpenGLShadow::prepareBackend() const int width = qMax(topLeft.width(), bottomLeft.width()) + qMax(top.width(), bottom.width()) + qMax(topRight.width(), bottomRight.width()); - const int height = qMax(topLeft.height(), bottomLeft.height()) + + + const int height = qMax(topRight.height(), topLeft.height()) + qMax(left.height(), right.height()) + qMax(bottomLeft.height(), bottomRight.height()); From 66174846f171947149b4b26f9ed6b4b536b347e1 Mon Sep 17 00:00:00 2001 From: Jonathan Riddell Date: Tue, 12 Jul 2016 10:32:27 +0100 Subject: [PATCH 4/7] Update version number for 5.7.1 GIT_SILENT --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 02870271a9..39824a69a3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ project(KWIN) -set(PROJECT_VERSION "5.7.0") +set(PROJECT_VERSION "5.7.1") set(PROJECT_VERSION_MAJOR 5) cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR) From aaf8ce16dfb258a48ea25209b6747f5d9f5a85b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Mon, 11 Jul 2016 10:53:04 +0200 Subject: [PATCH 5/7] [platforms/fbdev] Properly detect a BGR image format Summary: If the format of the framebuffer is BGR we cannot create an RGB image format from it - the rendering is incorrect. Unfortunately QImage does not support a BGR image format. To solve this problem we still use an RGB image format but on rendering the front buffer is rgbSwapped to convert the RGB image to a BGR image. BUG: 365243 FIXED-IN: 5.7.2 Test Plan: Tested on a neon kvm Reviewers: #kwin, #plasma_on_wayland Subscribers: plasma-devel, kwin Tags: #plasma_on_wayland, #kwin Differential Revision: https://phabricator.kde.org/D2134 --- plugins/platforms/fbdev/fb_backend.cpp | 16 +++++++++++----- plugins/platforms/fbdev/fb_backend.h | 9 +++++++++ .../fbdev/scene_qpainter_fb_backend.cpp | 2 +- 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/plugins/platforms/fbdev/fb_backend.cpp b/plugins/platforms/fbdev/fb_backend.cpp index fc7ed42c78..370ad43da1 100644 --- a/plugins/platforms/fbdev/fb_backend.cpp +++ b/plugins/platforms/fbdev/fb_backend.cpp @@ -92,6 +92,7 @@ void FramebufferBackend::openFrameBuffer() } m_fd = fd; queryScreenInfo(); + initImageFormat(); setReady(true); emit screensQueried(); } @@ -153,9 +154,14 @@ void FramebufferBackend::unmap() } QImage::Format FramebufferBackend::imageFormat() const +{ + return m_imageFormat; +} + +void FramebufferBackend::initImageFormat() { if (m_fd < 0) { - return QImage::Format_Invalid; + return; } qCDebug(KWIN_FB) << "Bits Per Pixel: " << m_bitsPerPixel; @@ -178,7 +184,7 @@ QImage::Format FramebufferBackend::imageFormat() const m_green.offset == 8 && m_red.offset == 16) { qCDebug(KWIN_FB) << "Framebuffer format is RGB32"; - return QImage::Format_RGB32; + m_imageFormat = QImage::Format_RGB32; } else if (m_bitsPerPixel == 24 && m_red.length == 8 && m_green.length == 8 && @@ -187,7 +193,8 @@ QImage::Format FramebufferBackend::imageFormat() const m_green.offset == 8 && m_red.offset == 16) { qCDebug(KWIN_FB) << "Framebuffer Format is RGB888"; - return QImage::Format_RGB888; + m_bgr = true; + m_imageFormat = QImage::Format_RGB888; } else if (m_bitsPerPixel == 16 && m_red.length == 5 && m_green.length == 6 && @@ -196,10 +203,9 @@ QImage::Format FramebufferBackend::imageFormat() const m_green.offset == 5 && m_red.offset == 11) { qCDebug(KWIN_FB) << "Framebuffer Format is RGB16"; - return QImage::Format_RGB16; + m_imageFormat = QImage::Format_RGB16; } qCWarning(KWIN_FB) << "Framebuffer format is unknown"; - return QImage::Format_Invalid; } } diff --git a/plugins/platforms/fbdev/fb_backend.h b/plugins/platforms/fbdev/fb_backend.h index 7aee7eefc8..e888994722 100644 --- a/plugins/platforms/fbdev/fb_backend.h +++ b/plugins/platforms/fbdev/fb_backend.h @@ -71,10 +71,17 @@ public: return m_bitsPerPixel; } QImage::Format imageFormat() const; + /** + * @returns whether the imageFormat is BGR instead of RGB. + **/ + bool isBGR() const { + return m_bgr; + } private: void openFrameBuffer(); bool queryScreenInfo(); + void initImageFormat(); QSize m_resolution; QSize m_physicalSize; QByteArray m_id; @@ -91,6 +98,8 @@ private: quint32 m_bufferLength = 0; int m_bytesPerLine = 0; void *m_memory = nullptr; + QImage::Format m_imageFormat = QImage::Format_Invalid; + bool m_bgr = false; }; } diff --git a/plugins/platforms/fbdev/scene_qpainter_fb_backend.cpp b/plugins/platforms/fbdev/scene_qpainter_fb_backend.cpp index 732d5f31fe..ec311586c9 100644 --- a/plugins/platforms/fbdev/scene_qpainter_fb_backend.cpp +++ b/plugins/platforms/fbdev/scene_qpainter_fb_backend.cpp @@ -79,7 +79,7 @@ void FramebufferQPainterBackend::present(int mask, const QRegion &damage) return; } QPainter p(&m_backBuffer); - p.drawImage(QPoint(0, 0), m_renderBuffer); + p.drawImage(QPoint(0, 0), m_backend->isBGR() ? m_renderBuffer.rgbSwapped() : m_renderBuffer); } bool FramebufferQPainterBackend::usesOverlayWindow() const From cd9a0afafa56bd251ef48022b82dd2c037e4f3ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Mon, 11 Jul 2016 11:26:03 +0200 Subject: [PATCH 6/7] [platforms/drm] Properly handle case that mapping the blank buffer fails Summary: If it's not possible to create a buffer to blank the output, KWin won't be able to render to the output. In that case the output should not be added to the list of outputs. To support this DrmOutput::blank and DrmOutput::init return bool to indicate whether they succeeded. DrmBackend handles this situation and doesn't add the output to the list of outputs if init failed. If after init there are no outputs KWin is in a state where it won't be functional. Thus the platform emits the initFailed signal to terminate. BUG: 365242 FIXED-IN: 5.7.2 Test Plan: No hardware to reproduce the condition Reviewers: #kwin, #plasma_on_wayland Subscribers: plasma-devel, kwin Tags: #plasma_on_wayland, #kwin Differential Revision: https://phabricator.kde.org/D2135 --- plugins/platforms/drm/drm_backend.cpp | 15 +++++++++++++-- plugins/platforms/drm/drm_output.cpp | 16 +++++++++++----- plugins/platforms/drm/drm_output.h | 4 ++-- 3 files changed, 26 insertions(+), 9 deletions(-) diff --git a/plugins/platforms/drm/drm_backend.cpp b/plugins/platforms/drm/drm_backend.cpp index c15f3f4f44..fd0240f80b 100644 --- a/plugins/platforms/drm/drm_backend.cpp +++ b/plugins/platforms/drm/drm_backend.cpp @@ -237,6 +237,11 @@ void DrmBackend::openDrm() ); m_drmId = device->sysNum(); queryResources(); + if (m_outputs.isEmpty()) { + qCWarning(KWIN_DRM) << "No outputs, cannot render, will terminate now"; + emit initFailed(); + return; + } // setup udevMonitor if (m_udevMonitor) { @@ -315,7 +320,11 @@ void DrmBackend::queryResources() drmOutput->m_mode = connector->modes[0]; } drmOutput->m_connector = connector->connector_id; - drmOutput->init(connector.data()); + if (!drmOutput->init(connector.data())) { + qCWarning(KWIN_DRM) << "Failed to create output for connector " << connector->connector_id; + delete drmOutput; + continue; + } qCDebug(KWIN_DRM) << "Found new output with uuid" << drmOutput->uuid(); connectedOutputs << drmOutput; } @@ -339,7 +348,9 @@ void DrmBackend::queryResources() } m_outputs = connectedOutputs; readOutputsConfiguration(); - emit screensQueried(); + if (!m_outputs.isEmpty()) { + emit screensQueried(); + } } void DrmBackend::readOutputsConfiguration() diff --git a/plugins/platforms/drm/drm_output.cpp b/plugins/platforms/drm/drm_output.cpp index 31f563d6be..69b1ed6c41 100644 --- a/plugins/platforms/drm/drm_output.cpp +++ b/plugins/platforms/drm/drm_output.cpp @@ -180,13 +180,15 @@ static DrmOutput::DpmsMode fromWaylandDpmsMode(KWayland::Server::OutputInterface } } -void DrmOutput::init(drmModeConnector *connector) +bool DrmOutput::init(drmModeConnector *connector) { initEdid(connector); initDpms(connector); initUuid(); m_savedCrtc.reset(drmModeGetCrtc(m_backend->fd(), m_crtcId)); - blank(); + if (!blank()) { + return false; + } setDpms(DpmsMode::On); if (!m_waylandOutput.isNull()) { delete m_waylandOutput.data(); @@ -287,6 +289,7 @@ void DrmOutput::init(drmModeConnector *connector) m_waylandOutput->create(); qCDebug(KWIN_DRM) << "Created OutputDevice"; m_waylandOutputDevice->create(); + return true; } void DrmOutput::initUuid() @@ -318,14 +321,17 @@ bool DrmOutput::isCurrentMode(const drmModeModeInfo *mode) const && qstrcmp(mode->name, m_mode.name) == 0; } -void DrmOutput::blank() +bool DrmOutput::blank() { if (!m_blackBuffer) { m_blackBuffer = m_backend->createBuffer(size()); - m_blackBuffer->map(); + if (!m_blackBuffer->map()) { + cleanupBlackBuffer(); + return false; + } m_blackBuffer->image()->fill(Qt::black); } - setMode(m_blackBuffer); + return setMode(m_blackBuffer); } bool DrmOutput::setMode(DrmBuffer *buffer) diff --git a/plugins/platforms/drm/drm_output.h b/plugins/platforms/drm/drm_output.h index e021f60017..628bb5da95 100644 --- a/plugins/platforms/drm/drm_output.h +++ b/plugins/platforms/drm/drm_output.h @@ -61,9 +61,9 @@ public: void moveCursor(const QPoint &globalPos); bool present(DrmBuffer *buffer); void pageFlipped(); - void init(drmModeConnector *connector); + bool init(drmModeConnector *connector); void restoreSaved(); - void blank(); + bool blank(); /** * This sets the changes and tests them against the DRM output From 56c2e158ee4e8f78aed45d2aa41562961ec28d26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Mon, 11 Jul 2016 14:34:24 +0200 Subject: [PATCH 7/7] Call QCoreApplication::exit instead of stdlib exit to terminate if platform fails Summary: We need to properly tear down the application - this can be achieved through QCoreApplication::exit. Otherwise there is a chance that the cleanup handling crashes. Reviewers: #kwin, #plasma_on_wayland Subscribers: plasma-devel, kwin Tags: #plasma_on_wayland, #kwin Differential Revision: https://phabricator.kde.org/D2136 --- main_wayland.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main_wayland.cpp b/main_wayland.cpp index 6f74ba392f..ecb649bc03 100644 --- a/main_wayland.cpp +++ b/main_wayland.cpp @@ -135,7 +135,7 @@ void ApplicationWayland::createBackend() connect(platform(), &Platform::initFailed, this, [] () { std::cerr << "FATAL ERROR: backend failed to initialize, exiting now" << std::endl; - ::exit(1); + QCoreApplication::exit(1); } ); platform()->init();