From a70adf1567f3bf20d73e1c40c32fcf07b1ba132e Mon Sep 17 00:00:00 2001 From: Jonathan Riddell Date: Tue, 5 Apr 2016 14:16:21 +0100 Subject: [PATCH 1/8] Update version number for 5.6.2 GIT_SILENT --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6e792df132..372d270529 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ project(KWIN) -set(PROJECT_VERSION "5.6.1") +set(PROJECT_VERSION "5.6.2") set(PROJECT_VERSION_MAJOR 5) cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR) From 57649ee854439e8dc3e45cab9b9565445f5063c7 Mon Sep 17 00:00:00 2001 From: l10n daemon script Date: Sat, 9 Apr 2016 12:58:52 +0000 Subject: [PATCH 2/8] SVN_SILENT made messages (.desktop file) --- kwin.notifyrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kwin.notifyrc b/kwin.notifyrc index f5a62c3d8e..9cb19a11fd 100644 --- a/kwin.notifyrc +++ b/kwin.notifyrc @@ -9,7 +9,7 @@ Comment[ca]=Gestor de finestres KWin Comment[ca@valencia]=Gestor de finestres KWin Comment[cs]=Správce oken KWin Comment[da]=KWin vindueshåndtering -Comment[de]=KWin-Fenstermanager +Comment[de]=KWin-Fensterverwaltung Comment[el]=Διαχειριστής παραθύρων Kwin Comment[en_GB]=KWin Window Manager Comment[es]=Gestor de ventanas KWin From ca73e65ac18a1aee304828010628cb6f0f7f07ef Mon Sep 17 00:00:00 2001 From: l10n daemon script Date: Mon, 11 Apr 2016 13:10:20 +0000 Subject: [PATCH 3/8] SVN_SILENT made messages (.desktop file) --- backends/drm/drm.json | 4 +++- backends/fbdev/fbdev.json | 4 +++- backends/hwcomposer/hwcomposer.json | 4 +++- backends/virtual/virtual.json | 4 +++- backends/wayland/wayland.json | 4 +++- backends/x11/x11.json | 4 +++- effects/morphingpopups/package/metadata.desktop | 2 ++ kcmkwin/kwincompositing/kcmkwineffects.desktop | 1 + 8 files changed, 21 insertions(+), 6 deletions(-) diff --git a/backends/drm/drm.json b/backends/drm/drm.json index e8afcc5f0e..7a32c81270 100644 --- a/backends/drm/drm.json +++ b/backends/drm/drm.json @@ -29,6 +29,7 @@ "Description[uk]": "Обробляти через вузол DRM.", "Description[x-test]": "xxRender through drm node.xx", "Description[zh_CN]": "通过 drm 结点渲染。", + "Description[zh_TW]": "透過 drm 節點成像。", "Id": "KWinWaylandDrmBackend", "Name": "drm", "Name[ca@valencia]": "DRM", @@ -58,7 +59,8 @@ "Name[sv]": "DRM", "Name[uk]": "drm", "Name[x-test]": "xxdrmxx", - "Name[zh_CN]": "drm" + "Name[zh_CN]": "drm", + "Name[zh_TW]": "drm" }, "input": false } \ No newline at end of file diff --git a/backends/fbdev/fbdev.json b/backends/fbdev/fbdev.json index bfd0825b7a..7a3305314d 100644 --- a/backends/fbdev/fbdev.json +++ b/backends/fbdev/fbdev.json @@ -29,6 +29,7 @@ "Description[uk]": "Обробляти до буфера кадрів.", "Description[x-test]": "xxRender to framebuffer.xx", "Description[zh_CN]": "渲染到帧缓冲。", + "Description[zh_TW]": "成像至影格緩衝區。", "Id": "KWinWaylandFbdevBackend", "Name": "framebuffer", "Name[ca@valencia]": "Framebuffer", @@ -58,7 +59,8 @@ "Name[sv]": "rambuffer", "Name[uk]": "framebuffer", "Name[x-test]": "xxframebufferxx", - "Name[zh_CN]": "framebuffer" + "Name[zh_CN]": "framebuffer", + "Name[zh_TW]": "影格緩衝區(framebuffer)" }, "input": false } \ No newline at end of file diff --git a/backends/hwcomposer/hwcomposer.json b/backends/hwcomposer/hwcomposer.json index 3c21a78c96..f7d9bbde9b 100644 --- a/backends/hwcomposer/hwcomposer.json +++ b/backends/hwcomposer/hwcomposer.json @@ -27,6 +27,7 @@ "Description[uk]": "Обробляти за допомогою апаратного засобу композиції через libhybris.", "Description[x-test]": "xxRender through hwcomposer through libhybris.xx", "Description[zh_CN]": "使用 libhybris 通过 hwcomposer 渲染。", + "Description[zh_TW]": "透過 libhybris 成像到 hwcomposer。", "Id": "KWinWaylandHwcomposerBackend", "Name": "hwcomposer", "Name[ca@valencia]": "hwcomposer", @@ -56,7 +57,8 @@ "Name[sv]": "hårdvarusammansättare", "Name[uk]": "hwcomposer", "Name[x-test]": "xxhwcomposerxx", - "Name[zh_CN]": "hwcomposer" + "Name[zh_CN]": "hwcomposer", + "Name[zh_TW]": "hwcomposer" }, "input": false } \ No newline at end of file diff --git a/backends/virtual/virtual.json b/backends/virtual/virtual.json index ee3804febd..f95063bfeb 100644 --- a/backends/virtual/virtual.json +++ b/backends/virtual/virtual.json @@ -29,6 +29,7 @@ "Description[uk]": "Обробляти до віртуального буфера кадрів.", "Description[x-test]": "xxRender to a virtual framebuffer.xx", "Description[zh_CN]": "渲染到虚拟帧缓冲。", + "Description[zh_TW]": "成像到虛擬影格緩衝區。", "Id": "KWinWaylandVirtualBackend", "Name": "virtual", "Name[ca@valencia]": "Virtual", @@ -57,7 +58,8 @@ "Name[sv]": "virtuell", "Name[uk]": "virtual", "Name[x-test]": "xxvirtualxx", - "Name[zh_CN]": "virtual" + "Name[zh_CN]": "virtual", + "Name[zh_TW]": "虛擬" }, "input": true } \ No newline at end of file diff --git a/backends/wayland/wayland.json b/backends/wayland/wayland.json index 86da5cd5ed..2115802e07 100644 --- a/backends/wayland/wayland.json +++ b/backends/wayland/wayland.json @@ -27,6 +27,7 @@ "Description[uk]": "Обробляти у вкладене вікно запущеного засобу композиції Wayland.", "Description[x-test]": "xxRender to a nested window on running Wayland compositor.xx", "Description[zh_CN]": "渲染到 Wayland 混成器上的嵌套窗口中", + "Description[zh_TW]": "成像到執行中的 Wayland 的巢狀視窗。", "Id": "KWinWaylandWaylandBackend", "Name": "wayland", "Name[ca@valencia]": "Wayland", @@ -56,7 +57,8 @@ "Name[sv]": "Wayland", "Name[uk]": "wayland", "Name[x-test]": "xxwaylandxx", - "Name[zh_CN]": "wayland" + "Name[zh_CN]": "wayland", + "Name[zh_TW]": "wayland" }, "input": true } \ No newline at end of file diff --git a/backends/x11/x11.json b/backends/x11/x11.json index 4b55be2391..2d5b461296 100644 --- a/backends/x11/x11.json +++ b/backends/x11/x11.json @@ -27,6 +27,7 @@ "Description[uk]": "Обробляти у вкладене вікно системи керування вікнами X11.", "Description[x-test]": "xxRender to a nested window on X11 windowing system.xx", "Description[zh_CN]": "渲染到 X11 窗口系统上的嵌套窗口中", + "Description[zh_TW]": "成像到 X11 視窗系統的巢狀視窗。", "Id": "KWinWaylandX11Backend", "Name": "x11", "Name[ast]": "x11", @@ -58,7 +59,8 @@ "Name[sv]": "X11", "Name[uk]": "x11", "Name[x-test]": "xxx11xx", - "Name[zh_CN]": "x11" + "Name[zh_CN]": "x11", + "Name[zh_TW]": "x11" }, "input": true } \ No newline at end of file diff --git a/effects/morphingpopups/package/metadata.desktop b/effects/morphingpopups/package/metadata.desktop index 3957eecb89..b9db9a2a98 100644 --- a/effects/morphingpopups/package/metadata.desktop +++ b/effects/morphingpopups/package/metadata.desktop @@ -23,6 +23,7 @@ Comment[sv]=Övertona animering när verktygstips eller underrättelser ändrar Comment[uk]=Анімація зі зміною освітленості під час зміни геометрії панелей підказок і сповіщень Comment[x-test]=xxCross fade animation when Tooltips or Notifications change their geometryxx Comment[zh_CN]=在工具提示或者通知大小变化时交叉淡入淡出的动画 +Comment[zh_TW]=當工具提示或通知變更位置時交錯的淡出動畫 Encoding=UTF-8 Icon=preferences-system-windows-effect-morphingpopups Name=Morphing popups @@ -49,6 +50,7 @@ Name[sv]=Föränderliga meddelanderutor Name[uk]=Аморфні контекстні панелі Name[x-test]=xxMorphing popupsxx Name[zh_CN]=变形气泡通知 +Name[zh_TW]=交錯彈出視窗 Type=Service X-KDE-ParentApp= X-KDE-PluginInfo-Author=Marco Martin diff --git a/kcmkwin/kwincompositing/kcmkwineffects.desktop b/kcmkwin/kwincompositing/kcmkwineffects.desktop index eb5ecccb2c..550546d1ba 100644 --- a/kcmkwin/kwincompositing/kcmkwineffects.desktop +++ b/kcmkwin/kwincompositing/kcmkwineffects.desktop @@ -131,3 +131,4 @@ X-KDE-Keywords[sv]=kwin,fönster,hanterare,sammansättning,effekt,3D-effekter,Op X-KDE-Keywords[uk]=kwin,window,manager,compositing,effect,3D effects,2D effects,OpenGL,XRender,video settings,graphical effects,desktop effects,animations,various animations,window management effects,window switching effect,desktop switching effect,animations,animation speed,desktop animations,drivers,driver settings,rendering,render,invert effect,looking glass effect,magnifier effect,snap helper effect,track mouse effect,zoom effect,blur effect,explosion effect,fade effect,fade desktop effect,fall apart effect,glide effect,highlight window effect,login effect,logout effect,magic lamp effect,minimize animation effect,mouse mark effect,scale in effect,screenshot effect,sheet effect,slide effect,sliding popups effect,taskbar thumbnails effect,thumbnail aside effect,translucency,translucency effect,transparency,window geometry effect,wobbly windows effect,startup feedback effect,dialog parent effect,dim inactive effect,dim screen effect,slide back effect,eye candy,candy,show FPS effect,show paint effect,box switch effect,cover switch effect,desktop cube effect,desktop cube animation effect,desktop grid effect,flip switch effect,outline effect,present windows effect,resize window effect,вікно,керування вікнами,менеджер вікон,композитне відтворення,ефект,просторовий,плоский,параметри відео,графічні ефекти,анімації,анімація,перемикання вікон,швидкість анімації,драйвери,параметри драйверів,показ,відтворення,інвертування,інверсія,збільшувальне скло,збільшення,прилипання,шлейф за вказівником,шлейф,масштабування,масштаб,зміна розмірів,розмивання,панель,вибух,ефекти вибуху,згасання,поява,ковзання,підсвічування,підсвічування вікон,вихід,магічна лампа,чарівна лампа,джин,аркуші,стос,знімок екрана,мініатюри панелі задач,мініатюри,прозорість,ефект прозорості,желе,желейні вікна,супровід запуску,стрибунець,притлумлення,сірість,прикраси,показ частоти,малювання,обкладинки,стрибання,контур,поточні вікна,зміна розмірів X-KDE-Keywords[x-test]=xxkwinxx,xxwindowxx,xxmanagerxx,xxcompositingxx,xxeffectxx,xx3D effectsxx,xx2D effectsxx,xxOpenGLxx,xxXRenderxx,xxvideo settingsxx,xxgraphical effectsxx,xxdesktop effectsxx,xxanimationsxx,xxvarious animationsxx,xxwindow management effectsxx,xxwindow switching effectxx,xxdesktop switching effectxx,xxanimationsxx,xxanimation speedxx,xxdesktop animationsxx,xxdriversxx,xxdriver settingsxx,xxrenderingxx,xxrenderxx,xxinvert effectxx,xxlooking glass effectxx,xxmagnifier effectxx,xxsnap helper effectxx,xxtrack mouse effectxx,xxzoom effectxx,xxblur effectxx,xxexplosion effectxx,xxfade effectxx,xxfade desktop effectxx,xxfall apart effectxx,xxglide effectxx,xxhighlight window effectxx,xxlogin effectxx,xxlogout effectxx,xxmagic lamp effectxx,xxminimize animation effectxx,xxmouse mark effectxx,xxscale in effectxx,xxscreenshot effectxx,xxsheet effectxx,xxslide effectxx,xxsliding popups effectxx,xxtaskbar thumbnails effectxx,xxthumbnail aside effectxx,xxtranslucencyxx,xxtranslucency effectxx,xxtransparencyxx,xxwindow geometry effectxx,xxwobbly windows effectxx,xxstartup feedback effectxx,xxdialog parent effectxx,xxdim inactive effectxx,xxdim screen effectxx,xxslide back effectxx,xxeye candyxx,xxcandyxx,xxshow FPS effectxx,xxshow paint effectxx,xxbox switch effectxx,xxcover switch effectxx,xxdesktop cube effectxx,xxdesktop cube animation effectxx,xxdesktop grid effectxx,xxflip switch effectxx,xxoutline effectxx,xxpresent windows effectxx,xxresize window effectxx X-KDE-Keywords[zh_CN]=kwin,window,manager,compositing,effect,3D effects,2D effects,OpenGL,XRender,video settings,graphical effects,desktop effects,animations,various animations,window management effects,window switching effect,desktop switching effect,animations,animation speed,desktop animations,drivers,driver settings,rendering,render,invert effect,looking glass effect,magnifier effect,snap helper effect,track mouse effect,zoom effect,blur effect,explosion effect,fade effect,fade desktop effect,fall apart effect,glide effect,highlight window effect,login effect,logout effect,magic lamp effect,minimize animation effect,mouse mark effect,scale in effect,screenshot effect,sheet effect,slide effect,sliding popups effect,taskbar thumbnails effect,thumbnail aside effect,translucency,translucency effect,transparency,window geometry effect,wobbly windows effect,startup feedback effect,dialog parent effect,dim inactive effect,dim screen effect,slide back effect,eye candy,candy,show FPS effect,show paint effect,box switch effect,cover switch effect,desktop cube effect,desktop cube animation effect,desktop grid effect,flip switch effect,outline effect,present windows effect,resize window effect,窗口,管理,混成,特效,3D 特效,2D 特效,视频设置,图形特效,桌面特效,动画,窗口管理特效,窗口切换特效,桌面切换特效,动画速度,桌面动画,驱动,去掉设置,渲染,反色,放大镜特效,鼠标跟踪,缩放特效,模糊特效,爆炸特效,渐变特效,破碎特效,滑动特效,高亮窗口,登录特效,注销特效,神灯特效,最小化动画,鼠标标记,截屏,飘落,滑动弹出窗口,任务栏缩略图,缩略图置边,透明特效,摇摆窗口,启动反馈特效,黯淡对话框特效,黯淡屏幕特效,视觉效果,显示 FPS 特效,显示绘制区域特效,盒状切换特效,封面切换特效,桌面立方体特效,桌面立方体动画特效,翻转切换特效,边框特效,展示窗口特效,调整窗口大小特效 +X-KDE-Keywords[zh_TW]=kwin,window,manager,compositing,effect,3D effects,2D effects,OpenGL,XRender,video settings,graphical effects,desktop effects,animations,various animations,window management effects,window switching effect,desktop switching effect,animations,animation speed,desktop animations,drivers,driver settings,rendering,render,invert effect,looking glass effect,magnifier effect,snap helper effect,track mouse effect,zoom effect,blur effect,explosion effect,fade effect,fade desktop effect,fall apart effect,glide effect,highlight window effect,login effect,logout effect,magic lamp effect,minimize animation effect,mouse mark effect,scale in effect,screenshot effect,sheet effect,slide effect,sliding popups effect,taskbar thumbnails effect,thumbnail aside effect,translucency,translucency effect,transparency,window geometry effect,wobbly windows effect,startup feedback effect,dialog parent effect,dim inactive effect,dim screen effect,slide back effect,eye candy,candy,show FPS effect,show paint effect,box switch effect,cover switch effect,desktop cube effect,desktop cube animation effect,desktop grid effect,flip switch effect,outline effect,present windows effect,resize window effect From 0df4406c2cf8df56f90a7a006eb911775a120886 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Mon, 11 Apr 2016 09:42:22 +0200 Subject: [PATCH 4/8] Fix crash on repainting an invalid sizes decoration Summary: If a window has an invalid size the decoration also has an invalid size. This results in the texture used by the SceneOpenGLDecorationRenderer to be invalid and being reset to null. Of course we shouldn't try to use this texture to render to. The change comes with a test case to simulate the situation. We cannot simulate it with Wayland clients as the geometry can never be empty. Thus we create an X11 client, resize it to an empty size and unmap it. This is the first integration test case which creates an X11 Client! It's also a test case which needs the OpenGL compositor. This will most likely not work on build.kde.org yet - we need to see what to do about it. Will need adjustments to get it at least skip on build.kde.org. BUG: 361551 FIXED-IN: 5.6.3 Reviewers: #plasma Subscribers: plasma-devel Projects: #plasma Differential Revision: https://phabricator.kde.org/D1383 --- autotests/wayland/CMakeLists.txt | 9 + autotests/wayland/dont_crash_empty_deco.cpp | 221 ++++++++++++++++++++ client.h | 2 +- scene_opengl.cpp | 5 + 4 files changed, 236 insertions(+), 1 deletion(-) create mode 100644 autotests/wayland/dont_crash_empty_deco.cpp diff --git a/autotests/wayland/CMakeLists.txt b/autotests/wayland/CMakeLists.txt index d46f6dff88..9c6d5a4536 100644 --- a/autotests/wayland/CMakeLists.txt +++ b/autotests/wayland/CMakeLists.txt @@ -125,3 +125,12 @@ add_executable(testTransientPlacmenet ${testTransientPlacmenet_SRCS}) target_link_libraries( testTransientPlacmenet kwin Qt5::Test) add_test(kwin-testTransientPlacmenet testTransientPlacmenet) ecm_mark_as_test(testTransientPlacmenet) + +######################################################## +# Dont Crash Empty Deco Test +######################################################## +set( testDontCrashEmptyDeco_SRCS dont_crash_empty_deco.cpp kwin_wayland_test.cpp ) +add_executable(testDontCrashEmptyDeco ${testDontCrashEmptyDeco_SRCS}) +target_link_libraries( testDontCrashEmptyDeco kwin Qt5::Test) +add_test(kwin-testDontCrashEmptyDeco testDontCrashEmptyDeco) +ecm_mark_as_test(testDontCrashEmptyDeco) diff --git a/autotests/wayland/dont_crash_empty_deco.cpp b/autotests/wayland/dont_crash_empty_deco.cpp new file mode 100644 index 0000000000..1b74bf8785 --- /dev/null +++ b/autotests/wayland/dont_crash_empty_deco.cpp @@ -0,0 +1,221 @@ +/******************************************************************** +KWin - the KDE window manager +This file is part of the KDE project. + +Copyright (C) 2016 Martin Gräßlin + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*********************************************************************/ +#include "kwin_wayland_test.h" +#include "abstract_backend.h" +#include "client.h" +#include "cursor.h" +#include "screenedge.h" +#include "screens.h" +#include "wayland_server.h" +#include "workspace.h" +#include "shell_client.h" +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include + +namespace KWin +{ + +static const QString s_socketName = QStringLiteral("wayland_test_kwin_dont_crash_empty_decoration-0"); + +class DontCrashEmptyDecorationTest : public QObject +{ + Q_OBJECT +private Q_SLOTS: + void initTestCase(); + void init(); + void cleanup(); + void testBug361551(); + +private: + KWayland::Client::ConnectionThread *m_connection = nullptr; + KWayland::Client::Compositor *m_compositor = nullptr; + KWayland::Client::ServerSideDecorationManager *m_deco = nullptr; + KWayland::Client::Seat *m_seat = nullptr; + KWayland::Client::ShmPool *m_shm = nullptr; + KWayland::Client::Shell *m_shell = nullptr; + KWayland::Client::EventQueue *m_queue = nullptr; + QThread *m_thread = nullptr; +}; + +void DontCrashEmptyDecorationTest::initTestCase() +{ + qRegisterMetaType(); + qRegisterMetaType(); + QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); + QVERIFY(workspaceCreatedSpy.isValid()); + waylandServer()->backend()->setInitialWindowSize(QSize(1280, 1024)); + QMetaObject::invokeMethod(waylandServer()->backend(), "setOutputCount", Qt::DirectConnection, Q_ARG(int, 2)); + waylandServer()->init(s_socketName.toLocal8Bit()); + + // this test needs to enforce OpenGL compositing to get into the crashy condition + qputenv("KWIN_COMPOSE", QByteArrayLiteral("O2")); + kwinApp()->start(); + QVERIFY(workspaceCreatedSpy.wait()); + QCOMPARE(screens()->count(), 2); + QCOMPARE(screens()->geometry(0), QRect(0, 0, 1280, 1024)); + QCOMPARE(screens()->geometry(1), QRect(1280, 0, 1280, 1024)); + setenv("QT_QPA_PLATFORM", "wayland", true); + waylandServer()->initWorkspace(); +} + +void DontCrashEmptyDecorationTest::init() +{ + using namespace KWayland::Client; + // setup connection + m_connection = new ConnectionThread; + QSignalSpy connectedSpy(m_connection, &ConnectionThread::connected); + QVERIFY(connectedSpy.isValid()); + m_connection->setSocketName(s_socketName); + + m_thread = new QThread(this); + m_connection->moveToThread(m_thread); + m_thread->start(); + + m_connection->initConnection(); + QVERIFY(connectedSpy.wait()); + + m_queue = new EventQueue(this); + QVERIFY(!m_queue->isValid()); + m_queue->setup(m_connection); + QVERIFY(m_queue->isValid()); + + Registry registry; + registry.setEventQueue(m_queue); + QSignalSpy compositorSpy(®istry, &Registry::compositorAnnounced); + QSignalSpy shmSpy(®istry, &Registry::shmAnnounced); + QSignalSpy shellSpy(®istry, &Registry::shellAnnounced); + QSignalSpy seatSpy(®istry, &Registry::seatAnnounced); + QSignalSpy decorationSpy(®istry, &Registry::serverSideDecorationManagerAnnounced); + QSignalSpy allAnnounced(®istry, &Registry::interfacesAnnounced); + QVERIFY(allAnnounced.isValid()); + QVERIFY(shmSpy.isValid()); + QVERIFY(shellSpy.isValid()); + QVERIFY(compositorSpy.isValid()); + QVERIFY(seatSpy.isValid()); + QVERIFY(decorationSpy.isValid()); + registry.create(m_connection->display()); + QVERIFY(registry.isValid()); + registry.setup(); + QVERIFY(allAnnounced.wait()); + QVERIFY(!compositorSpy.isEmpty()); + QVERIFY(!shmSpy.isEmpty()); + QVERIFY(!shellSpy.isEmpty()); + QVERIFY(!seatSpy.isEmpty()); + QVERIFY(!decorationSpy.isEmpty()); + + m_compositor = registry.createCompositor(compositorSpy.first().first().value(), compositorSpy.first().last().value(), this); + QVERIFY(m_compositor->isValid()); + m_shm = registry.createShmPool(shmSpy.first().first().value(), shmSpy.first().last().value(), this); + QVERIFY(m_shm->isValid()); + m_shell = registry.createShell(shellSpy.first().first().value(), shellSpy.first().last().value(), this); + QVERIFY(m_shell->isValid()); + m_seat = registry.createSeat(seatSpy.first().first().value(), seatSpy.first().last().value(), this); + QVERIFY(m_seat->isValid()); + m_deco = registry.createServerSideDecorationManager(decorationSpy.first().first().value(), decorationSpy.first().last().value()); + QVERIFY(m_deco->isValid()); + QSignalSpy hasPointerSpy(m_seat, &Seat::hasPointerChanged); + QVERIFY(hasPointerSpy.isValid()); + QVERIFY(hasPointerSpy.wait()); + + screens()->setCurrent(0); + Cursor::setPos(QPoint(640, 512)); +} + +void DontCrashEmptyDecorationTest::cleanup() +{ + delete m_compositor; + m_compositor = nullptr; + delete m_deco; + m_deco = nullptr; + delete m_seat; + m_seat = nullptr; + delete m_shm; + m_shm = nullptr; + delete m_shell; + m_shell = nullptr; + delete m_queue; + m_queue = nullptr; + if (m_thread) { + m_connection->deleteLater(); + m_thread->quit(); + m_thread->wait(); + delete m_thread; + m_thread = nullptr; + m_connection = nullptr; + } +} + +void DontCrashEmptyDecorationTest::testBug361551() +{ + // this test verifies that resizing an X11 window to an invalid size does not result in crash on unmap + // when the DecorationRenderer gets copied to the Deleted + // there a repaint is scheduled and the resulting texture is invalid if the window size is invalid + + // create an xcb window + xcb_connection_t *c = xcb_connect(nullptr, nullptr); + QVERIFY(!xcb_connection_has_error(c)); + + xcb_window_t w = xcb_generate_id(c); + xcb_create_window(c, XCB_COPY_FROM_PARENT, w, rootWindow(), 0, 0, 10, 10, 0, XCB_WINDOW_CLASS_INPUT_OUTPUT, XCB_COPY_FROM_PARENT, 0, nullptr); + xcb_map_window(c, w); + xcb_flush(c); + + // we should get a client for it + QSignalSpy windowCreatedSpy(workspace(), &Workspace::clientAdded); + QVERIFY(windowCreatedSpy.isValid()); + QVERIFY(windowCreatedSpy.wait()); + Client *client = windowCreatedSpy.first().first().value(); + QVERIFY(client); + QCOMPARE(client->window(), w); + QVERIFY(client->isDecorated()); + + // let's set a stupid geometry + client->setGeometry(0, 0, 0, 0); + QCOMPARE(client->geometry(), QRect(0, 0, 0, 0)); + + // and destroy the window again + xcb_unmap_window(c, w); + xcb_destroy_window(c, w); + xcb_flush(c); + xcb_disconnect(c); + + QSignalSpy windowClosedSpy(client, &Client::windowClosed); + QVERIFY(windowClosedSpy.isValid()); + QVERIFY(windowClosedSpy.wait()); +} + +} + +WAYLANDTEST_MAIN(KWin::DontCrashEmptyDecorationTest) +#include "dont_crash_empty_deco.moc" diff --git a/client.h b/client.h index 697b6418bf..7a28b547ba 100644 --- a/client.h +++ b/client.h @@ -61,7 +61,7 @@ enum class Predicate { InputIdMatch }; -class Client +class KWIN_EXPORT Client : public AbstractClient { Q_OBJECT diff --git a/scene_opengl.cpp b/scene_opengl.cpp index c81c2b8905..cb43b4819d 100644 --- a/scene_opengl.cpp +++ b/scene_opengl.cpp @@ -2451,6 +2451,11 @@ void SceneOpenGLDecorationRenderer::render() resetImageSizesDirty(); } + if (!m_texture) { + // for invalid sizes we get no texture, see BUG 361551 + return; + } + QRect left, top, right, bottom; client()->client()->layoutDecorationRects(left, top, right, bottom); From df2c26e3d9a2c3e95e0bd3def290c564ff62a278 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Thu, 14 Apr 2016 08:51:16 +0200 Subject: [PATCH 5/8] Only start Xwayland server if Compositor created a Scene So far if the Scene creation failed kwin_wayland went into a shutdown, but didn't succeed because the thread to start Xwayland was already running: it froze. This change introduces a new signal in Compositor: sceneCreated. The startup of Xwayland is bound to this signal. If it gets fired KWin can startup Xwayland. If it does not get fired, KWin terminates correctly. --- composite.cpp | 1 + composite.h | 1 + main_wayland.cpp | 5 +++-- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/composite.cpp b/composite.cpp index dab48f4caf..66ac47f320 100644 --- a/composite.cpp +++ b/composite.cpp @@ -278,6 +278,7 @@ void Compositor::slotCompositingOptionsInitialized() } return; } + emit sceneCreated(); if (Workspace::self()) { startupWithWorkspace(); diff --git a/composite.h b/composite.h index fc0ddd5288..50134cb18f 100644 --- a/composite.h +++ b/composite.h @@ -186,6 +186,7 @@ public Q_SLOTS: Q_SIGNALS: void compositingToggled(bool active); void aboutToDestroy(); + void sceneCreated(); protected: void timerEvent(QTimerEvent *te); diff --git a/main_wayland.cpp b/main_wayland.cpp index c9ee426150..6bcbe182ae 100644 --- a/main_wayland.cpp +++ b/main_wayland.cpp @@ -18,6 +18,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . *********************************************************************/ #include "main_wayland.h" +#include "composite.h" #include "workspace.h" #include // kwin @@ -152,8 +153,7 @@ void ApplicationWayland::continueStartupWithScreens() return; } createCompositor(); - - startXwaylandServer(); + connect(Compositor::self(), &Compositor::sceneCreated, this, &ApplicationWayland::startXwaylandServer); } void ApplicationWayland::continueStartupWithX() @@ -280,6 +280,7 @@ void ApplicationWayland::createX11Connection() void ApplicationWayland::startXwaylandServer() { + disconnect(Compositor::self(), &Compositor::sceneCreated, this, &ApplicationWayland::startXwaylandServer); int pipeFds[2]; if (pipe(pipeFds) != 0) { std::cerr << "FATAL ERROR failed to create pipe to start Xwayland " << std::endl; From 380c5e0bd84f116e97dd8ace704f95e92b6d735a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Thu, 14 Apr 2016 10:29:27 +0200 Subject: [PATCH 6/8] [autotests] Only start Xwayland if compositor created a scene Same as df2c26e3d9a2c3e95e0bd3def290c564ff62a278 for WaylandTestApplication. --- autotests/wayland/kwin_wayland_test.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/autotests/wayland/kwin_wayland_test.cpp b/autotests/wayland/kwin_wayland_test.cpp index 76b1b9a866..2206a00f1d 100644 --- a/autotests/wayland/kwin_wayland_test.cpp +++ b/autotests/wayland/kwin_wayland_test.cpp @@ -19,6 +19,7 @@ along with this program. If not, see . *********************************************************************/ #include "kwin_wayland_test.h" #include "../../abstract_backend.h" +#include "../../composite.h" #include "../../effects.h" #include "../../wayland_server.h" #include "../../workspace.h" @@ -111,8 +112,7 @@ void WaylandTestApplication::continueStartupWithScreens() waylandServer()->initOutputs(); createCompositor(); - - startXwaylandServer(); + connect(Compositor::self(), &Compositor::sceneCreated, this, &WaylandTestApplication::startXwaylandServer); } void WaylandTestApplication::continueStartupWithX() @@ -189,6 +189,7 @@ void WaylandTestApplication::createX11Connection() void WaylandTestApplication::startXwaylandServer() { + disconnect(Compositor::self(), &Compositor::sceneCreated, this, &WaylandTestApplication::startXwaylandServer); int pipeFds[2]; if (pipe(pipeFds) != 0) { std::cerr << "FATAL ERROR failed to create pipe to start Xwayland " << std::endl; From 8b2e032f96a7ef59c4d4a38f6dcab1af9d39f29c Mon Sep 17 00:00:00 2001 From: Jonathan Riddell Date: Tue, 19 Apr 2016 11:51:12 +0100 Subject: [PATCH 7/8] Update version number for 5.6.3 GIT_SILENT --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 372d270529..1921cec58a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ project(KWIN) -set(PROJECT_VERSION "5.6.2") +set(PROJECT_VERSION "5.6.3") set(PROJECT_VERSION_MAJOR 5) cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR) From 6d60f01ad96abae030d3f9aa43349c8e479f0014 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Tue, 26 Apr 2016 12:47:02 +0200 Subject: [PATCH 8/8] Skip DontCrashEmptyDecorationTest if we don't have a /dev/dri/card0 device Without the /dev/dri/card0 mesa fails to initialize egl and the test fails. In order to silence the failure till the system provides the device file, we better skip the test. A nullptr crash in that case is fixed in WaylandServer tear-down. --- autotests/wayland/dont_crash_empty_deco.cpp | 3 +++ wayland_server.cpp | 8 +++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/autotests/wayland/dont_crash_empty_deco.cpp b/autotests/wayland/dont_crash_empty_deco.cpp index 1b74bf8785..7ae4a2e1f2 100644 --- a/autotests/wayland/dont_crash_empty_deco.cpp +++ b/autotests/wayland/dont_crash_empty_deco.cpp @@ -70,6 +70,9 @@ private: void DontCrashEmptyDecorationTest::initTestCase() { + if (!QFile::exists(QStringLiteral("/dev/dri/card0"))) { + QSKIP("Needs a dri device"); + } qRegisterMetaType(); qRegisterMetaType(); QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); diff --git a/wayland_server.cpp b/wayland_server.cpp index 8d205c5912..939cf0ab47 100644 --- a/wayland_server.cpp +++ b/wayland_server.cpp @@ -97,9 +97,11 @@ void WaylandServer::terminateClientConnections() { destroyInternalConnection(); destroyInputMethodConnection(); - const auto connections = m_display->connections(); - for (auto it = connections.begin(); it != connections.end(); ++it) { - (*it)->destroy(); + if (m_display) { + const auto connections = m_display->connections(); + for (auto it = connections.begin(); it != connections.end(); ++it) { + (*it)->destroy(); + } } }