From f3431040f74a902c0a308aa9eb2bfdf37eb4855e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Fri, 24 Jul 2015 15:16:35 +0200 Subject: LGPL v3 license change for Qt Wayland Compositor Change-Id: I84ed248b471464214d935352768f300d4b90dec3 --- src/compositor/wayland_wrapper/qwlcompositor.cpp | 50 +++++++++---------- src/compositor/wayland_wrapper/qwlcompositor_p.h | 50 +++++++++---------- src/compositor/wayland_wrapper/qwldatadevice.cpp | 50 +++++++++---------- src/compositor/wayland_wrapper/qwldatadevice_p.h | 50 +++++++++---------- .../wayland_wrapper/qwldatadevicemanager.cpp | 50 +++++++++---------- .../wayland_wrapper/qwldatadevicemanager_p.h | 50 +++++++++---------- src/compositor/wayland_wrapper/qwldataoffer.cpp | 50 +++++++++---------- src/compositor/wayland_wrapper/qwldataoffer_p.h | 50 +++++++++---------- src/compositor/wayland_wrapper/qwldatasource.cpp | 50 +++++++++---------- src/compositor/wayland_wrapper/qwldatasource_p.h | 50 +++++++++---------- src/compositor/wayland_wrapper/qwldisplay.cpp | 56 ++++++++++------------ src/compositor/wayland_wrapper/qwldisplay_p.h | 50 +++++++++---------- .../wayland_wrapper/qwlextendedsurface.cpp | 50 +++++++++---------- .../wayland_wrapper/qwlextendedsurface_p.h | 50 +++++++++---------- src/compositor/wayland_wrapper/qwlinputdevice.cpp | 50 +++++++++---------- src/compositor/wayland_wrapper/qwlinputdevice_p.h | 50 +++++++++---------- src/compositor/wayland_wrapper/qwlinputmethod.cpp | 50 +++++++++---------- src/compositor/wayland_wrapper/qwlinputmethod_p.h | 50 +++++++++---------- .../wayland_wrapper/qwlinputmethodcontext.cpp | 50 +++++++++---------- .../wayland_wrapper/qwlinputmethodcontext_p.h | 50 +++++++++---------- src/compositor/wayland_wrapper/qwlinputpanel.cpp | 50 +++++++++---------- src/compositor/wayland_wrapper/qwlinputpanel_p.h | 50 +++++++++---------- .../wayland_wrapper/qwlinputpanelsurface.cpp | 50 +++++++++---------- .../wayland_wrapper/qwlinputpanelsurface_p.h | 50 +++++++++---------- src/compositor/wayland_wrapper/qwlkeyboard.cpp | 50 +++++++++---------- src/compositor/wayland_wrapper/qwlkeyboard_p.h | 50 +++++++++---------- src/compositor/wayland_wrapper/qwllistener.cpp | 25 +++++----- src/compositor/wayland_wrapper/qwllistener_p.h | 25 +++++----- src/compositor/wayland_wrapper/qwloutput.cpp | 50 +++++++++---------- src/compositor/wayland_wrapper/qwloutput_p.h | 50 +++++++++---------- src/compositor/wayland_wrapper/qwlpointer.cpp | 50 +++++++++---------- src/compositor/wayland_wrapper/qwlpointer_p.h | 50 +++++++++---------- src/compositor/wayland_wrapper/qwlqtkey.cpp | 50 +++++++++---------- src/compositor/wayland_wrapper/qwlqtkey_p.h | 50 +++++++++---------- src/compositor/wayland_wrapper/qwlqttouch.cpp | 50 +++++++++---------- src/compositor/wayland_wrapper/qwlqttouch_p.h | 50 +++++++++---------- src/compositor/wayland_wrapper/qwlregion.cpp | 50 +++++++++---------- src/compositor/wayland_wrapper/qwlregion_p.h | 50 +++++++++---------- src/compositor/wayland_wrapper/qwlshellsurface.cpp | 50 +++++++++---------- src/compositor/wayland_wrapper/qwlshellsurface_p.h | 50 +++++++++---------- src/compositor/wayland_wrapper/qwlsubsurface.cpp | 50 +++++++++---------- src/compositor/wayland_wrapper/qwlsubsurface_p.h | 50 +++++++++---------- src/compositor/wayland_wrapper/qwlsurface.cpp | 50 +++++++++---------- src/compositor/wayland_wrapper/qwlsurface_p.h | 50 +++++++++---------- .../wayland_wrapper/qwlsurfacebuffer.cpp | 50 +++++++++---------- .../wayland_wrapper/qwlsurfacebuffer_p.h | 50 +++++++++---------- src/compositor/wayland_wrapper/qwltextinput.cpp | 50 +++++++++---------- src/compositor/wayland_wrapper/qwltextinput_p.h | 50 +++++++++---------- .../wayland_wrapper/qwltextinputmanager.cpp | 56 ++++++++++------------ .../wayland_wrapper/qwltextinputmanager_p.h | 50 +++++++++---------- src/compositor/wayland_wrapper/qwltouch.cpp | 50 +++++++++---------- src/compositor/wayland_wrapper/qwltouch_p.h | 50 +++++++++---------- 52 files changed, 1184 insertions(+), 1378 deletions(-) (limited to 'src/compositor/wayland_wrapper') diff --git a/src/compositor/wayland_wrapper/qwlcompositor.cpp b/src/compositor/wayland_wrapper/qwlcompositor.cpp index f8c8bdc1f..fd9720728 100644 --- a/src/compositor/wayland_wrapper/qwlcompositor.cpp +++ b/src/compositor/wayland_wrapper/qwlcompositor.cpp @@ -4,36 +4,32 @@ ** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** -** This file is part of the Qt Compositor. +** This file is part of the QtWaylandCompositor module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. ** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. ** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/src/compositor/wayland_wrapper/qwlcompositor_p.h b/src/compositor/wayland_wrapper/qwlcompositor_p.h index 7360e7dca..9875a03bf 100644 --- a/src/compositor/wayland_wrapper/qwlcompositor_p.h +++ b/src/compositor/wayland_wrapper/qwlcompositor_p.h @@ -4,36 +4,32 @@ ** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** -** This file is part of the Qt Compositor. +** This file is part of the QtWaylandCompositor module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. ** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. ** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/src/compositor/wayland_wrapper/qwldatadevice.cpp b/src/compositor/wayland_wrapper/qwldatadevice.cpp index d97592bd7..8c28dfeb7 100644 --- a/src/compositor/wayland_wrapper/qwldatadevice.cpp +++ b/src/compositor/wayland_wrapper/qwldatadevice.cpp @@ -3,36 +3,32 @@ ** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** -** This file is part of the Qt Compositor. +** This file is part of the QtWaylandCompositor module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. ** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. ** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/src/compositor/wayland_wrapper/qwldatadevice_p.h b/src/compositor/wayland_wrapper/qwldatadevice_p.h index 6be177dec..051e1eb3e 100644 --- a/src/compositor/wayland_wrapper/qwldatadevice_p.h +++ b/src/compositor/wayland_wrapper/qwldatadevice_p.h @@ -3,36 +3,32 @@ ** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** -** This file is part of the Qt Compositor. +** This file is part of the QtWaylandCompositor module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. ** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. ** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/src/compositor/wayland_wrapper/qwldatadevicemanager.cpp b/src/compositor/wayland_wrapper/qwldatadevicemanager.cpp index 2fe7ff4d7..feb97e4af 100644 --- a/src/compositor/wayland_wrapper/qwldatadevicemanager.cpp +++ b/src/compositor/wayland_wrapper/qwldatadevicemanager.cpp @@ -3,36 +3,32 @@ ** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** -** This file is part of the Qt Compositor. +** This file is part of the QtWaylandCompositor module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. ** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. ** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/src/compositor/wayland_wrapper/qwldatadevicemanager_p.h b/src/compositor/wayland_wrapper/qwldatadevicemanager_p.h index 988066fc5..76d80a56a 100644 --- a/src/compositor/wayland_wrapper/qwldatadevicemanager_p.h +++ b/src/compositor/wayland_wrapper/qwldatadevicemanager_p.h @@ -3,36 +3,32 @@ ** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** -** This file is part of the Qt Compositor. +** This file is part of the QtWaylandCompositor module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. ** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. ** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/src/compositor/wayland_wrapper/qwldataoffer.cpp b/src/compositor/wayland_wrapper/qwldataoffer.cpp index 028e0bf86..c654b8a2f 100644 --- a/src/compositor/wayland_wrapper/qwldataoffer.cpp +++ b/src/compositor/wayland_wrapper/qwldataoffer.cpp @@ -3,36 +3,32 @@ ** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** -** This file is part of the Qt Compositor. +** This file is part of the QtWaylandCompositor module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. ** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. ** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/src/compositor/wayland_wrapper/qwldataoffer_p.h b/src/compositor/wayland_wrapper/qwldataoffer_p.h index 8d4cd1256..58400075e 100644 --- a/src/compositor/wayland_wrapper/qwldataoffer_p.h +++ b/src/compositor/wayland_wrapper/qwldataoffer_p.h @@ -3,36 +3,32 @@ ** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** -** This file is part of the Qt Compositor. +** This file is part of the QtWaylandCompositor module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. ** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. ** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/src/compositor/wayland_wrapper/qwldatasource.cpp b/src/compositor/wayland_wrapper/qwldatasource.cpp index 0350ff649..552fda3a5 100644 --- a/src/compositor/wayland_wrapper/qwldatasource.cpp +++ b/src/compositor/wayland_wrapper/qwldatasource.cpp @@ -3,36 +3,32 @@ ** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** -** This file is part of the Qt Compositor. +** This file is part of the QtWaylandCompositor module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. ** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. ** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/src/compositor/wayland_wrapper/qwldatasource_p.h b/src/compositor/wayland_wrapper/qwldatasource_p.h index 1ddad3634..c183f0fe9 100644 --- a/src/compositor/wayland_wrapper/qwldatasource_p.h +++ b/src/compositor/wayland_wrapper/qwldatasource_p.h @@ -3,36 +3,32 @@ ** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** -** This file is part of the Qt Compositor. +** This file is part of the QtWaylandCompositor module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. ** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. ** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/src/compositor/wayland_wrapper/qwldisplay.cpp b/src/compositor/wayland_wrapper/qwldisplay.cpp index fafde3f73..47279cca0 100644 --- a/src/compositor/wayland_wrapper/qwldisplay.cpp +++ b/src/compositor/wayland_wrapper/qwldisplay.cpp @@ -3,36 +3,32 @@ ** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** -** This file is part of the Qt Compositor. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** This file is part of the QtWaylandCompositor module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/src/compositor/wayland_wrapper/qwldisplay_p.h b/src/compositor/wayland_wrapper/qwldisplay_p.h index 6ba66f951..9409316ea 100644 --- a/src/compositor/wayland_wrapper/qwldisplay_p.h +++ b/src/compositor/wayland_wrapper/qwldisplay_p.h @@ -3,36 +3,32 @@ ** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** -** This file is part of the Qt Compositor. +** This file is part of the QtWaylandCompositor module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. ** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. ** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/src/compositor/wayland_wrapper/qwlextendedsurface.cpp b/src/compositor/wayland_wrapper/qwlextendedsurface.cpp index 50cc5bb7e..8b06cb182 100644 --- a/src/compositor/wayland_wrapper/qwlextendedsurface.cpp +++ b/src/compositor/wayland_wrapper/qwlextendedsurface.cpp @@ -3,36 +3,32 @@ ** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** -** This file is part of the Qt Compositor. +** This file is part of the QtWaylandCompositor module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. ** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. ** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/src/compositor/wayland_wrapper/qwlextendedsurface_p.h b/src/compositor/wayland_wrapper/qwlextendedsurface_p.h index 8af6232a6..524a4d6e8 100644 --- a/src/compositor/wayland_wrapper/qwlextendedsurface_p.h +++ b/src/compositor/wayland_wrapper/qwlextendedsurface_p.h @@ -3,36 +3,32 @@ ** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** -** This file is part of the Qt Compositor. +** This file is part of the QtWaylandCompositor module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. ** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. ** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/src/compositor/wayland_wrapper/qwlinputdevice.cpp b/src/compositor/wayland_wrapper/qwlinputdevice.cpp index ea127ee74..479df4d56 100644 --- a/src/compositor/wayland_wrapper/qwlinputdevice.cpp +++ b/src/compositor/wayland_wrapper/qwlinputdevice.cpp @@ -3,36 +3,32 @@ ** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** -** This file is part of the Qt Compositor. +** This file is part of the QtWaylandCompositor module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. ** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. ** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/src/compositor/wayland_wrapper/qwlinputdevice_p.h b/src/compositor/wayland_wrapper/qwlinputdevice_p.h index 8444eaa50..a0d65cdeb 100644 --- a/src/compositor/wayland_wrapper/qwlinputdevice_p.h +++ b/src/compositor/wayland_wrapper/qwlinputdevice_p.h @@ -3,36 +3,32 @@ ** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** -** This file is part of the Qt Compositor. +** This file is part of the QtWaylandCompositor module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. ** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. ** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/src/compositor/wayland_wrapper/qwlinputmethod.cpp b/src/compositor/wayland_wrapper/qwlinputmethod.cpp index 5bafe7894..f17008f65 100644 --- a/src/compositor/wayland_wrapper/qwlinputmethod.cpp +++ b/src/compositor/wayland_wrapper/qwlinputmethod.cpp @@ -3,36 +3,32 @@ ** Copyright (C) 2013 Klarälvdalens Datakonsult AB (KDAB). ** Contact: http://www.qt.io/licensing/ ** -** This file is part of the Qt Compositor. +** This file is part of the QtWaylandCompositor module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. ** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. ** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/src/compositor/wayland_wrapper/qwlinputmethod_p.h b/src/compositor/wayland_wrapper/qwlinputmethod_p.h index f2df5c8ab..473810474 100644 --- a/src/compositor/wayland_wrapper/qwlinputmethod_p.h +++ b/src/compositor/wayland_wrapper/qwlinputmethod_p.h @@ -3,36 +3,32 @@ ** Copyright (C) 2013 Klarälvdalens Datakonsult AB (KDAB). ** Contact: http://www.qt.io/licensing/ ** -** This file is part of the Qt Compositor. +** This file is part of the QtWaylandCompositor module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. ** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. ** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/src/compositor/wayland_wrapper/qwlinputmethodcontext.cpp b/src/compositor/wayland_wrapper/qwlinputmethodcontext.cpp index caf75b2ae..6421d5e76 100644 --- a/src/compositor/wayland_wrapper/qwlinputmethodcontext.cpp +++ b/src/compositor/wayland_wrapper/qwlinputmethodcontext.cpp @@ -3,36 +3,32 @@ ** Copyright (C) 2013 Klarälvdalens Datakonsult AB (KDAB). ** Contact: http://www.qt.io/licensing/ ** -** This file is part of the Qt Compositor. +** This file is part of the QtWaylandCompositor module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. ** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. ** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/src/compositor/wayland_wrapper/qwlinputmethodcontext_p.h b/src/compositor/wayland_wrapper/qwlinputmethodcontext_p.h index a766d63d6..8853d40bb 100644 --- a/src/compositor/wayland_wrapper/qwlinputmethodcontext_p.h +++ b/src/compositor/wayland_wrapper/qwlinputmethodcontext_p.h @@ -3,36 +3,32 @@ ** Copyright (C) 2013 Klarälvdalens Datakonsult AB (KDAB). ** Contact: http://www.qt.io/licensing/ ** -** This file is part of the Qt Compositor. +** This file is part of the QtWaylandCompositor module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. ** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. ** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/src/compositor/wayland_wrapper/qwlinputpanel.cpp b/src/compositor/wayland_wrapper/qwlinputpanel.cpp index 2f11a9b3f..65befd41c 100644 --- a/src/compositor/wayland_wrapper/qwlinputpanel.cpp +++ b/src/compositor/wayland_wrapper/qwlinputpanel.cpp @@ -3,36 +3,32 @@ ** Copyright (C) 2013 Klarälvdalens Datakonsult AB (KDAB). ** Contact: http://www.qt.io/licensing/ ** -** This file is part of the Qt Compositor. +** This file is part of the QtWaylandCompositor module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. ** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. ** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/src/compositor/wayland_wrapper/qwlinputpanel_p.h b/src/compositor/wayland_wrapper/qwlinputpanel_p.h index a475da37c..f9dc49370 100644 --- a/src/compositor/wayland_wrapper/qwlinputpanel_p.h +++ b/src/compositor/wayland_wrapper/qwlinputpanel_p.h @@ -3,36 +3,32 @@ ** Copyright (C) 2013 Klarälvdalens Datakonsult AB (KDAB). ** Contact: http://www.qt.io/licensing/ ** -** This file is part of the Qt Compositor. +** This file is part of the QtWaylandCompositor module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. ** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. ** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/src/compositor/wayland_wrapper/qwlinputpanelsurface.cpp b/src/compositor/wayland_wrapper/qwlinputpanelsurface.cpp index fdaf895ef..a72afa2b3 100644 --- a/src/compositor/wayland_wrapper/qwlinputpanelsurface.cpp +++ b/src/compositor/wayland_wrapper/qwlinputpanelsurface.cpp @@ -4,36 +4,32 @@ ** Copyright (C) 2013 Klarälvdalens Datakonsult AB (KDAB). ** Contact: http://www.qt.io/licensing/ ** -** This file is part of the Qt Compositor. +** This file is part of the QtWaylandCompositor module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. ** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. ** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/src/compositor/wayland_wrapper/qwlinputpanelsurface_p.h b/src/compositor/wayland_wrapper/qwlinputpanelsurface_p.h index 621ce135c..0591832fb 100644 --- a/src/compositor/wayland_wrapper/qwlinputpanelsurface_p.h +++ b/src/compositor/wayland_wrapper/qwlinputpanelsurface_p.h @@ -4,36 +4,32 @@ ** Copyright (C) 2013 Klarälvdalens Datakonsult AB (KDAB). ** Contact: http://www.qt.io/licensing/ ** -** This file is part of the Qt Compositor. +** This file is part of the QtWaylandCompositor module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. ** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. ** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/src/compositor/wayland_wrapper/qwlkeyboard.cpp b/src/compositor/wayland_wrapper/qwlkeyboard.cpp index bcee40fb4..8a76cbb40 100644 --- a/src/compositor/wayland_wrapper/qwlkeyboard.cpp +++ b/src/compositor/wayland_wrapper/qwlkeyboard.cpp @@ -4,36 +4,32 @@ ** Copyright (C) 2013 Klarälvdalens Datakonsult AB (KDAB). ** Contact: http://www.qt.io/licensing/ ** -** This file is part of the Qt Compositor. +** This file is part of the QtWaylandCompositor module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. ** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. ** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/src/compositor/wayland_wrapper/qwlkeyboard_p.h b/src/compositor/wayland_wrapper/qwlkeyboard_p.h index d394aad1b..62fc157a2 100644 --- a/src/compositor/wayland_wrapper/qwlkeyboard_p.h +++ b/src/compositor/wayland_wrapper/qwlkeyboard_p.h @@ -4,36 +4,32 @@ ** Copyright (C) 2013 Klarälvdalens Datakonsult AB (KDAB). ** Contact: http://www.qt.io/licensing/ ** -** This file is part of the Qt Compositor. +** This file is part of the QtWaylandCompositor module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. ** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. ** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/src/compositor/wayland_wrapper/qwllistener.cpp b/src/compositor/wayland_wrapper/qwllistener.cpp index 5a3c0e576..3099cc108 100644 --- a/src/compositor/wayland_wrapper/qwllistener.cpp +++ b/src/compositor/wayland_wrapper/qwllistener.cpp @@ -3,9 +3,9 @@ ** Copyright (C) 2014 Jolla Ltd, author: ** Contact: http://www.qt.io/licensing/ ** -** This file is part of the plugins of the Qt Toolkit. +** This file is part of the QtWaylandCompositor module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL21$ +** $QT_BEGIN_LICENSE:LGPL3$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the @@ -16,16 +16,19 @@ ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. ** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/src/compositor/wayland_wrapper/qwllistener_p.h b/src/compositor/wayland_wrapper/qwllistener_p.h index addc9a1fb..8ecab6f7f 100644 --- a/src/compositor/wayland_wrapper/qwllistener_p.h +++ b/src/compositor/wayland_wrapper/qwllistener_p.h @@ -3,9 +3,9 @@ ** Copyright (C) 2014 Jolla Ltd, author: ** Contact: http://www.qt.io/licensing/ ** -** This file is part of the plugins of the Qt Toolkit. +** This file is part of the QtWaylandCompositor module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL21$ +** $QT_BEGIN_LICENSE:LGPL3$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the @@ -16,16 +16,19 @@ ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. ** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/src/compositor/wayland_wrapper/qwloutput.cpp b/src/compositor/wayland_wrapper/qwloutput.cpp index 0cbe166e2..5973aa496 100644 --- a/src/compositor/wayland_wrapper/qwloutput.cpp +++ b/src/compositor/wayland_wrapper/qwloutput.cpp @@ -4,36 +4,32 @@ ** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** -** This file is part of the Qt Compositor. +** This file is part of the QtWaylandCompositor module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. ** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. ** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/src/compositor/wayland_wrapper/qwloutput_p.h b/src/compositor/wayland_wrapper/qwloutput_p.h index b85081e80..c7c7249e0 100644 --- a/src/compositor/wayland_wrapper/qwloutput_p.h +++ b/src/compositor/wayland_wrapper/qwloutput_p.h @@ -4,36 +4,32 @@ ** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** -** This file is part of the Qt Compositor. +** This file is part of the QtWaylandCompositor module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. ** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. ** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/src/compositor/wayland_wrapper/qwlpointer.cpp b/src/compositor/wayland_wrapper/qwlpointer.cpp index 10c2d1037..d587157b9 100644 --- a/src/compositor/wayland_wrapper/qwlpointer.cpp +++ b/src/compositor/wayland_wrapper/qwlpointer.cpp @@ -4,36 +4,32 @@ ** Copyright (C) 2013 Klarälvdalens Datakonsult AB (KDAB). ** Contact: http://www.qt.io/licensing/ ** -** This file is part of the Qt Compositor. +** This file is part of the QtWaylandCompositor module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. ** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. ** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/src/compositor/wayland_wrapper/qwlpointer_p.h b/src/compositor/wayland_wrapper/qwlpointer_p.h index db2932d04..96642ba7f 100644 --- a/src/compositor/wayland_wrapper/qwlpointer_p.h +++ b/src/compositor/wayland_wrapper/qwlpointer_p.h @@ -4,36 +4,32 @@ ** Copyright (C) 2013 Klarälvdalens Datakonsult AB (KDAB). ** Contact: http://www.qt.io/licensing/ ** -** This file is part of the Qt Compositor. +** This file is part of the QtWaylandCompositor module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. ** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. ** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/src/compositor/wayland_wrapper/qwlqtkey.cpp b/src/compositor/wayland_wrapper/qwlqtkey.cpp index 1eb6c2f1b..34506e6fb 100644 --- a/src/compositor/wayland_wrapper/qwlqtkey.cpp +++ b/src/compositor/wayland_wrapper/qwlqtkey.cpp @@ -3,36 +3,32 @@ ** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** -** This file is part of the Qt Compositor. +** This file is part of the QtWaylandCompositor module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. ** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. ** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/src/compositor/wayland_wrapper/qwlqtkey_p.h b/src/compositor/wayland_wrapper/qwlqtkey_p.h index 2b10c8f71..76cf6c310 100644 --- a/src/compositor/wayland_wrapper/qwlqtkey_p.h +++ b/src/compositor/wayland_wrapper/qwlqtkey_p.h @@ -3,36 +3,32 @@ ** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** -** This file is part of the Qt Compositor. +** This file is part of the QtWaylandCompositor module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. ** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. ** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/src/compositor/wayland_wrapper/qwlqttouch.cpp b/src/compositor/wayland_wrapper/qwlqttouch.cpp index 9d4dfdcdd..aa9492428 100644 --- a/src/compositor/wayland_wrapper/qwlqttouch.cpp +++ b/src/compositor/wayland_wrapper/qwlqttouch.cpp @@ -3,36 +3,32 @@ ** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** -** This file is part of the Qt Compositor. +** This file is part of the QtWaylandCompositor module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. ** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. ** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/src/compositor/wayland_wrapper/qwlqttouch_p.h b/src/compositor/wayland_wrapper/qwlqttouch_p.h index e5215def6..e9d42f7e3 100644 --- a/src/compositor/wayland_wrapper/qwlqttouch_p.h +++ b/src/compositor/wayland_wrapper/qwlqttouch_p.h @@ -3,36 +3,32 @@ ** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** -** This file is part of the Qt Compositor. +** This file is part of the QtWaylandCompositor module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. ** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. ** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/src/compositor/wayland_wrapper/qwlregion.cpp b/src/compositor/wayland_wrapper/qwlregion.cpp index 03829df9a..14a749afb 100644 --- a/src/compositor/wayland_wrapper/qwlregion.cpp +++ b/src/compositor/wayland_wrapper/qwlregion.cpp @@ -3,36 +3,32 @@ ** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** -** This file is part of the Qt Compositor. +** This file is part of the QtWaylandCompositor module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. ** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. ** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/src/compositor/wayland_wrapper/qwlregion_p.h b/src/compositor/wayland_wrapper/qwlregion_p.h index 7fc92f071..2ea0f8f15 100644 --- a/src/compositor/wayland_wrapper/qwlregion_p.h +++ b/src/compositor/wayland_wrapper/qwlregion_p.h @@ -3,36 +3,32 @@ ** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** -** This file is part of the Qt Compositor. +** This file is part of the QtWaylandCompositor module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. ** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. ** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/src/compositor/wayland_wrapper/qwlshellsurface.cpp b/src/compositor/wayland_wrapper/qwlshellsurface.cpp index b2725462b..51b585831 100644 --- a/src/compositor/wayland_wrapper/qwlshellsurface.cpp +++ b/src/compositor/wayland_wrapper/qwlshellsurface.cpp @@ -4,36 +4,32 @@ ** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** -** This file is part of the Qt Compositor. +** This file is part of the QtWaylandCompositor module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. ** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. ** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/src/compositor/wayland_wrapper/qwlshellsurface_p.h b/src/compositor/wayland_wrapper/qwlshellsurface_p.h index 672606229..dbcc56f51 100644 --- a/src/compositor/wayland_wrapper/qwlshellsurface_p.h +++ b/src/compositor/wayland_wrapper/qwlshellsurface_p.h @@ -3,36 +3,32 @@ ** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** -** This file is part of the Qt Compositor. +** This file is part of the QtWaylandCompositor module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. ** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. ** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/src/compositor/wayland_wrapper/qwlsubsurface.cpp b/src/compositor/wayland_wrapper/qwlsubsurface.cpp index afc6d1825..3f47f95fe 100644 --- a/src/compositor/wayland_wrapper/qwlsubsurface.cpp +++ b/src/compositor/wayland_wrapper/qwlsubsurface.cpp @@ -3,36 +3,32 @@ ** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** -** This file is part of the Qt Compositor. +** This file is part of the QtWaylandCompositor module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. ** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. ** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/src/compositor/wayland_wrapper/qwlsubsurface_p.h b/src/compositor/wayland_wrapper/qwlsubsurface_p.h index 0357b1e0e..27c2bc172 100644 --- a/src/compositor/wayland_wrapper/qwlsubsurface_p.h +++ b/src/compositor/wayland_wrapper/qwlsubsurface_p.h @@ -3,36 +3,32 @@ ** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** -** This file is part of the Qt Compositor. +** This file is part of the QtWaylandCompositor module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. ** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. ** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/src/compositor/wayland_wrapper/qwlsurface.cpp b/src/compositor/wayland_wrapper/qwlsurface.cpp index 9b3789087..4c9d46e20 100644 --- a/src/compositor/wayland_wrapper/qwlsurface.cpp +++ b/src/compositor/wayland_wrapper/qwlsurface.cpp @@ -3,36 +3,32 @@ ** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** -** This file is part of the Qt Compositor. +** This file is part of the QtWaylandCompositor module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. ** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. ** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/src/compositor/wayland_wrapper/qwlsurface_p.h b/src/compositor/wayland_wrapper/qwlsurface_p.h index d08fb4cd6..793c6d906 100644 --- a/src/compositor/wayland_wrapper/qwlsurface_p.h +++ b/src/compositor/wayland_wrapper/qwlsurface_p.h @@ -3,36 +3,32 @@ ** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** -** This file is part of the Qt Compositor. +** This file is part of the QtWaylandCompositor module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. ** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. ** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/src/compositor/wayland_wrapper/qwlsurfacebuffer.cpp b/src/compositor/wayland_wrapper/qwlsurfacebuffer.cpp index 066ffd15b..cbb2fb0f3 100644 --- a/src/compositor/wayland_wrapper/qwlsurfacebuffer.cpp +++ b/src/compositor/wayland_wrapper/qwlsurfacebuffer.cpp @@ -3,36 +3,32 @@ ** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** -** This file is part of the Qt Compositor. +** This file is part of the QtWaylandCompositor module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. ** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. ** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/src/compositor/wayland_wrapper/qwlsurfacebuffer_p.h b/src/compositor/wayland_wrapper/qwlsurfacebuffer_p.h index 580e71d0b..7003e9360 100644 --- a/src/compositor/wayland_wrapper/qwlsurfacebuffer_p.h +++ b/src/compositor/wayland_wrapper/qwlsurfacebuffer_p.h @@ -3,36 +3,32 @@ ** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** -** This file is part of the Qt Compositor. +** This file is part of the QtWaylandCompositor module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. ** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. ** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/src/compositor/wayland_wrapper/qwltextinput.cpp b/src/compositor/wayland_wrapper/qwltextinput.cpp index 992ca0dc5..af5771d7a 100644 --- a/src/compositor/wayland_wrapper/qwltextinput.cpp +++ b/src/compositor/wayland_wrapper/qwltextinput.cpp @@ -3,36 +3,32 @@ ** Copyright (C) 2013 Klarälvdalens Datakonsult AB (KDAB). ** Contact: http://www.qt.io/licensing/ ** -** This file is part of the Qt Compositor. +** This file is part of the QtWaylandCompositor module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. ** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. ** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/src/compositor/wayland_wrapper/qwltextinput_p.h b/src/compositor/wayland_wrapper/qwltextinput_p.h index 2618e296a..9d6f75247 100644 --- a/src/compositor/wayland_wrapper/qwltextinput_p.h +++ b/src/compositor/wayland_wrapper/qwltextinput_p.h @@ -3,36 +3,32 @@ ** Copyright (C) 2013 Klarälvdalens Datakonsult AB (KDAB). ** Contact: http://www.qt.io/licensing/ ** -** This file is part of the Qt Compositor. +** This file is part of the QtWaylandCompositor module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. ** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. ** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/src/compositor/wayland_wrapper/qwltextinputmanager.cpp b/src/compositor/wayland_wrapper/qwltextinputmanager.cpp index ce16f01c9..1daa8cb7b 100644 --- a/src/compositor/wayland_wrapper/qwltextinputmanager.cpp +++ b/src/compositor/wayland_wrapper/qwltextinputmanager.cpp @@ -3,36 +3,32 @@ ** Copyright (C) 2013 Klarälvdalens Datakonsult AB (KDAB). ** Contact: http://www.qt.io/licensing/ ** -** This file is part of the Qt Compositor. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** This file is part of the QtWaylandCompositor module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/src/compositor/wayland_wrapper/qwltextinputmanager_p.h b/src/compositor/wayland_wrapper/qwltextinputmanager_p.h index 049929c0c..ae883af50 100644 --- a/src/compositor/wayland_wrapper/qwltextinputmanager_p.h +++ b/src/compositor/wayland_wrapper/qwltextinputmanager_p.h @@ -3,36 +3,32 @@ ** Copyright (C) 2013 Klarälvdalens Datakonsult AB (KDAB). ** Contact: http://www.qt.io/licensing/ ** -** This file is part of the Qt Compositor. +** This file is part of the QtWaylandCompositor module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. ** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. ** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/src/compositor/wayland_wrapper/qwltouch.cpp b/src/compositor/wayland_wrapper/qwltouch.cpp index d15988940..b5a17c1a6 100644 --- a/src/compositor/wayland_wrapper/qwltouch.cpp +++ b/src/compositor/wayland_wrapper/qwltouch.cpp @@ -4,36 +4,32 @@ ** Copyright (C) 2013 Klarälvdalens Datakonsult AB (KDAB). ** Contact: http://www.qt.io/licensing/ ** -** This file is part of the Qt Compositor. +** This file is part of the QtWaylandCompositor module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. ** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. ** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/src/compositor/wayland_wrapper/qwltouch_p.h b/src/compositor/wayland_wrapper/qwltouch_p.h index 403cc3b4e..f3b7d5ee6 100644 --- a/src/compositor/wayland_wrapper/qwltouch_p.h +++ b/src/compositor/wayland_wrapper/qwltouch_p.h @@ -4,36 +4,32 @@ ** Copyright (C) 2013 Klarälvdalens Datakonsult AB (KDAB). ** Contact: http://www.qt.io/licensing/ ** -** This file is part of the Qt Compositor. +** This file is part of the QtWaylandCompositor module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. ** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. ** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. ** ** $QT_END_LICENSE$ ** -- cgit v1.2.3 From 964eb66e37dbbb9ff6736c3b40e8fcc76d1b8d61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Wed, 29 Jul 2015 13:48:26 +0200 Subject: Move surface management to outputs Change-Id: I427e576a4e0834d6266af2670f7ff47e078153d4 --- src/compositor/wayland_wrapper/qwlcompositor.cpp | 15 ++----- src/compositor/wayland_wrapper/qwlcompositor_p.h | 4 +- src/compositor/wayland_wrapper/qwloutput.cpp | 50 ++++++++++++++++++++++++ src/compositor/wayland_wrapper/qwloutput_p.h | 8 ++++ src/compositor/wayland_wrapper/qwlsurface.cpp | 18 ++++++++- src/compositor/wayland_wrapper/qwlsurface_p.h | 1 + 6 files changed, 80 insertions(+), 16 deletions(-) (limited to 'src/compositor/wayland_wrapper') diff --git a/src/compositor/wayland_wrapper/qwlcompositor.cpp b/src/compositor/wayland_wrapper/qwlcompositor.cpp index fd9720728..3d0ebdbb7 100644 --- a/src/compositor/wayland_wrapper/qwlcompositor.cpp +++ b/src/compositor/wayland_wrapper/qwlcompositor.cpp @@ -246,14 +246,6 @@ Compositor::~Compositor() delete m_display; } -void Compositor::sendFrameCallbacks(QList visibleSurfaces) -{ - foreach (QWaylandSurface *surface, visibleSurfaces) { - surface->handle()->sendFrameCallback(); - } - wl_display_flush_clients(m_display->handle()); -} - uint Compositor::currentTimeMsecs() const { return m_timer.elapsed(); @@ -320,7 +312,7 @@ void Compositor::processWaylandEvents() void Compositor::destroySurface(Surface *surface) { - m_surfaces.removeOne(surface); + surface->removeFromOutput(); waylandCompositor()->surfaceAboutToBeDestroyed(surface->waylandSurface()); @@ -347,8 +339,9 @@ void Compositor::cleanupGraphicsResources() void Compositor::compositor_create_surface(Resource *resource, uint32_t id) { QWaylandSurface *surface = new QWaylandSurface(resource->client(), id, resource->version(), m_qt_compositor); - m_surfaces << surface->handle(); - surface->handle()->addToOutput(primaryOutput()->handle()); + + primaryOutput()->addSurface(surface); + //BUG: This may not be an on-screen window surface though m_qt_compositor->surfaceCreated(surface); } diff --git a/src/compositor/wayland_wrapper/qwlcompositor_p.h b/src/compositor/wayland_wrapper/qwlcompositor_p.h index 9875a03bf..9621c37bf 100644 --- a/src/compositor/wayland_wrapper/qwlcompositor_p.h +++ b/src/compositor/wayland_wrapper/qwlcompositor_p.h @@ -90,6 +90,7 @@ public: ~Compositor(); void init(); + void sendFrameCallbacks(QList visibleSurfaces); InputDevice *defaultInputDevice(); @@ -121,8 +122,6 @@ public: void initializeDefaultInputDevice(); void initializeWindowManagerProtocol(); - QList surfaces() const { return m_surfaces; } - QWaylandCompositor *waylandCompositor() const { return m_qt_compositor; } struct wl_display *wl_display() const { return m_display->handle(); } @@ -188,7 +187,6 @@ protected: DataDeviceManager *m_data_device_manager; QElapsedTimer m_timer; - QList m_surfaces; QSet m_destroyed_surfaces; /* Render state */ diff --git a/src/compositor/wayland_wrapper/qwloutput.cpp b/src/compositor/wayland_wrapper/qwloutput.cpp index 5973aa496..1a80ab033 100644 --- a/src/compositor/wayland_wrapper/qwloutput.cpp +++ b/src/compositor/wayland_wrapper/qwloutput.cpp @@ -45,6 +45,9 @@ #include #include +#include +#include + QT_BEGIN_NAMESPACE namespace QtWayland { @@ -262,6 +265,53 @@ void Output::sendGeometryInfo() } } + +void Output::frameStarted() +{ + foreach (QWaylandSurface *surface, m_surfaces) + surface->handle()->frameStarted(); +} + +void Output::sendFrameCallbacks(QList visibleSurfaces) +{ + foreach (QWaylandSurface *surface, visibleSurfaces) { + surface->handle()->sendFrameCallback(); + } + wl_display_flush_clients(m_compositor->wl_display()); +} + +QList Output::surfacesForClient(QWaylandClient *client) const +{ + QList result; + + foreach (QWaylandSurface *surface, m_surfaces) { + if (surface->client() == client) + result.append(result); + } + + return result; +} + +void Output::addSurface(QWaylandSurface *surface) +{ + if (m_surfaces.contains(surface)) + return; + + m_surfaces.append(surface); + + surface->handle()->addToOutput(this); +} + +void Output::removeSurface(QWaylandSurface *surface) +{ + if (!m_surfaces.contains(surface)) + return; + + m_surfaces.removeOne(surface); + + surface->handle()->removeFromOutput(this); +} + } // namespace Wayland QT_END_NAMESPACE diff --git a/src/compositor/wayland_wrapper/qwloutput_p.h b/src/compositor/wayland_wrapper/qwloutput_p.h index c7c7249e0..ee6a34262 100644 --- a/src/compositor/wayland_wrapper/qwloutput_p.h +++ b/src/compositor/wayland_wrapper/qwloutput_p.h @@ -98,6 +98,14 @@ public: int scaleFactor() const { return m_scaleFactor; } void setScaleFactor(int scale); + void frameStarted(); + void sendFrameCallbacks(QList visibleSurfaces); + + QList surfaces() const { return m_surfaces; } + QList surfacesForClient(QWaylandClient *client) const; + void addSurface(QWaylandSurface *surface); + void removeSurface(QWaylandSurface *surface); + QWindow *window() const { return m_window; } OutputResource *outputForClient(struct wl_client *client) const; diff --git a/src/compositor/wayland_wrapper/qwlsurface.cpp b/src/compositor/wayland_wrapper/qwlsurface.cpp index 4c9d46e20..297a69132 100644 --- a/src/compositor/wayland_wrapper/qwlsurface.cpp +++ b/src/compositor/wayland_wrapper/qwlsurface.cpp @@ -135,6 +135,7 @@ Surface::Surface(struct wl_client *client, uint32_t id, int version, QWaylandCom Surface::~Surface() { + removeFromOutput(); delete m_subSurface; m_bufferRef = QWaylandBufferRef(); @@ -317,6 +318,8 @@ void Surface::addToOutput(Output *output) m_outputs.append(output); + output->addSurface(waylandSurface()); + QWaylandSurfaceEnterEvent event(output->waylandOutput()); QCoreApplication::sendEvent(waylandSurface(), &event); @@ -333,11 +336,15 @@ void Surface::removeFromOutput(Output *output) if (!output) return; + if (!m_outputs.contains(output)) + return; + m_outputs.removeOne(output); - if (m_outputs.size() == 0) - m_mainOutput = m_compositor->primaryOutput()->handle(); + if (m_mainOutput == output) + setMainOutput(Q_NULLPTR); + output->removeSurface(waylandSurface()); QWaylandSurfaceLeaveEvent event(output->waylandOutput()); QCoreApplication::sendEvent(waylandSurface(), &event); @@ -349,6 +356,13 @@ void Surface::removeFromOutput(Output *output) } } +void Surface::removeFromOutput() +{ + Q_FOREACH (Output *output, m_outputs) { + removeFromOutput(output); + } +} + /*! * Sets the backbuffer for this surface. The back buffer is not yet on * screen and will become live during the next swapBuffers(). diff --git a/src/compositor/wayland_wrapper/qwlsurface_p.h b/src/compositor/wayland_wrapper/qwlsurface_p.h index 793c6d906..210d07e02 100644 --- a/src/compositor/wayland_wrapper/qwlsurface_p.h +++ b/src/compositor/wayland_wrapper/qwlsurface_p.h @@ -126,6 +126,7 @@ public: void addToOutput(Output *output); void removeFromOutput(Output *output); + void removeFromOutput(); QString className() const { return m_className; } void setClassName(const QString &className); -- cgit v1.2.3 From 0e1bd0256ed13c3385f36b06b3589524060b03c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Wed, 29 Jul 2015 13:49:23 +0200 Subject: Make QWaylandOutput::handle const Change-Id: I880cb15e056de4f6f5dcf97ea570d7bfb625c294 --- src/compositor/wayland_wrapper/qwlcompositor_p.h | 1 - 1 file changed, 1 deletion(-) (limited to 'src/compositor/wayland_wrapper') diff --git a/src/compositor/wayland_wrapper/qwlcompositor_p.h b/src/compositor/wayland_wrapper/qwlcompositor_p.h index 9621c37bf..0228caaa2 100644 --- a/src/compositor/wayland_wrapper/qwlcompositor_p.h +++ b/src/compositor/wayland_wrapper/qwlcompositor_p.h @@ -70,7 +70,6 @@ class Surface; class SurfaceBuffer; class InputDevice; class DataDeviceManager; -class OutputGlobal; class SurfaceExtensionGlobal; class SubSurfaceExtensionGlobal; class TouchExtensionGlobal; -- cgit v1.2.3 From 7c65f7e9618a104b1304ec1a7a1cf7ee31527c87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Wed, 29 Jul 2015 13:50:15 +0200 Subject: Add createSurface factory function on QWaylandCompositor This simplifies subclassing the compositor getting Change-Id: I392b84febae62df042b23fa806360bc068bf984f --- src/compositor/wayland_wrapper/qwlcompositor.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/compositor/wayland_wrapper') diff --git a/src/compositor/wayland_wrapper/qwlcompositor.cpp b/src/compositor/wayland_wrapper/qwlcompositor.cpp index 3d0ebdbb7..879d02e07 100644 --- a/src/compositor/wayland_wrapper/qwlcompositor.cpp +++ b/src/compositor/wayland_wrapper/qwlcompositor.cpp @@ -338,11 +338,9 @@ void Compositor::cleanupGraphicsResources() void Compositor::compositor_create_surface(Resource *resource, uint32_t id) { - QWaylandSurface *surface = new QWaylandSurface(resource->client(), id, resource->version(), m_qt_compositor); - + QWaylandClient *client = QWaylandClient::fromWlClient(resource->client()); + QWaylandSurface *surface = m_qt_compositor->createSurface(client, id, resource->version()); primaryOutput()->addSurface(surface); - - //BUG: This may not be an on-screen window surface though m_qt_compositor->surfaceCreated(surface); } -- cgit v1.2.3 From 42c1bf3208e75b131aac2923da397de054cbbe13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Wed, 29 Jul 2015 13:51:25 +0200 Subject: Make QWaylandCompositor inherit QObject And remove the constructor arguments, and just having parent as a constructor argument. This requires QWaylandCompositor to have a create semantic familiar from QWindow and QOpenGLContext. On create the native wayland socket is created and initialized. Also the virtual functions surfaceCreated and surfaceAboutToBeDestroyed have been converted to signals, removing the need to subclass QWaylandCompositor Examples have been changed to avoid having two super classes inheriting QObject. This is done by either making the QWindow subclass a member or making the QWaylandCompositor a member. Change-Id: I317d37e2adca15bfe4e1904e20ab0d83943b2d45 --- src/compositor/wayland_wrapper/qwlcompositor.cpp | 17 +++++++++++------ src/compositor/wayland_wrapper/qwlcompositor_p.h | 3 ++- 2 files changed, 13 insertions(+), 7 deletions(-) (limited to 'src/compositor/wayland_wrapper') diff --git a/src/compositor/wayland_wrapper/qwlcompositor.cpp b/src/compositor/wayland_wrapper/qwlcompositor.cpp index 879d02e07..d59d7ff3d 100644 --- a/src/compositor/wayland_wrapper/qwlcompositor.cpp +++ b/src/compositor/wayland_wrapper/qwlcompositor.cpp @@ -155,8 +155,8 @@ Compositor *Compositor::instance() return compositor; } -Compositor::Compositor(QWaylandCompositor *qt_compositor, QWaylandCompositor::ExtensionFlags extensions) - : m_extensions(extensions) +Compositor::Compositor(QWaylandCompositor *qt_compositor) + : m_extensions(QWaylandCompositor::DefaultExtensions) , m_display(new Display) , m_current_frame(0) , m_last_queued_buf(-1) @@ -176,6 +176,7 @@ Compositor::Compositor(QWaylandCompositor *qt_compositor, QWaylandCompositor::Ex , m_inputPanel() , m_eventHandler(new WindowSystemEventHandler(this)) , m_retainSelection(false) + , m_initialized(false) { m_timer.start(); compositor = this; @@ -200,9 +201,11 @@ void Compositor::init() foreach (wl_shm_format format, formats) wl_display_add_shm_format(m_display->handle(), format); - if (wl_display_add_socket(m_display->handle(), m_qt_compositor->socketName())) { - fprintf(stderr, "Fatal: Failed to open server socket\n"); - exit(EXIT_FAILURE); + const char *socketName = 0; + if (m_socket_name.size()) + socketName = m_socket_name.constData(); + if (wl_display_add_socket(m_display->handle(), socketName)) { + qFatal("Fatal: Failed to open server socket\n"); } m_loop = wl_display_get_event_loop(m_display->handle()); @@ -224,6 +227,8 @@ void Compositor::init() initializeHardwareIntegration(); initializeExtensions(); initializeDefaultInputDevice(); + + m_initialized = true; } Compositor::~Compositor() @@ -341,7 +346,7 @@ void Compositor::compositor_create_surface(Resource *resource, uint32_t id) QWaylandClient *client = QWaylandClient::fromWlClient(resource->client()); QWaylandSurface *surface = m_qt_compositor->createSurface(client, id, resource->version()); primaryOutput()->addSurface(surface); - m_qt_compositor->surfaceCreated(surface); + emit m_qt_compositor->surfaceCreated(surface); } void Compositor::compositor_create_region(Resource *resource, uint32_t id) diff --git a/src/compositor/wayland_wrapper/qwlcompositor_p.h b/src/compositor/wayland_wrapper/qwlcompositor_p.h index 0228caaa2..1eee9dc45 100644 --- a/src/compositor/wayland_wrapper/qwlcompositor_p.h +++ b/src/compositor/wayland_wrapper/qwlcompositor_p.h @@ -85,7 +85,7 @@ class Q_COMPOSITOR_EXPORT Compositor : public QObject, public QtWaylandServer::w Q_OBJECT public: - Compositor(QWaylandCompositor *qt_compositor, QWaylandCompositor::ExtensionFlags extensions); + Compositor(QWaylandCompositor *qt_compositor); ~Compositor(); void init(); @@ -220,6 +220,7 @@ protected: uint32_t version, uint32_t id); bool m_retainSelection; + bool m_initialized; friend class QT_PREPEND_NAMESPACE(QWaylandCompositor); friend class QT_PREPEND_NAMESPACE(QWaylandClient); -- cgit v1.2.3 From 6ec46c91e128073794d527910090d735cfeba073 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Fri, 2 Jan 2015 12:43:40 +0100 Subject: Make QWaylandCompositor::primaryOutput a Q_PROPERTY Change-Id: I2a5c9556549fa3dbc4ad8b399a32266acbcc712b --- src/compositor/wayland_wrapper/qwlcompositor.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/compositor/wayland_wrapper') diff --git a/src/compositor/wayland_wrapper/qwlcompositor.cpp b/src/compositor/wayland_wrapper/qwlcompositor.cpp index d59d7ff3d..6316aac24 100644 --- a/src/compositor/wayland_wrapper/qwlcompositor.cpp +++ b/src/compositor/wayland_wrapper/qwlcompositor.cpp @@ -305,6 +305,7 @@ void Compositor::setPrimaryOutput(QWaylandOutput *output) m_outputs.removeAt(i); m_outputs.prepend(output); + emit m_qt_compositor->primaryOutputChanged(); } void Compositor::processWaylandEvents() -- cgit v1.2.3 From 5d36c263ec9d3e5f95cf098d3f72b135089deeb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Wed, 29 Jul 2015 13:52:59 +0200 Subject: Add a shellView property on QWaylandSurface Change-Id: I68d05698b3caed11ccec39ef06ac5f912d782cf2 --- src/compositor/wayland_wrapper/qwlshellsurface.cpp | 1 + src/compositor/wayland_wrapper/qwlshellsurface_p.h | 1 + src/compositor/wayland_wrapper/qwlsurface.cpp | 13 +++++++++++++ src/compositor/wayland_wrapper/qwlsurface_p.h | 5 +++++ 4 files changed, 20 insertions(+) (limited to 'src/compositor/wayland_wrapper') diff --git a/src/compositor/wayland_wrapper/qwlshellsurface.cpp b/src/compositor/wayland_wrapper/qwlshellsurface.cpp index 51b585831..c20917f66 100644 --- a/src/compositor/wayland_wrapper/qwlshellsurface.cpp +++ b/src/compositor/wayland_wrapper/qwlshellsurface.cpp @@ -98,6 +98,7 @@ ShellSurface::ShellSurface(Shell *shell, wl_client *client, uint32_t id, Surface m_view = surface->compositor()->waylandCompositor()->createView(surface->waylandSurface()); connect(surface->waylandSurface(), &QWaylandSurface::configure, this, &ShellSurface::configure); connect(surface->waylandSurface(), &QWaylandSurface::mapped, this, &ShellSurface::mapped); + surface->setShellSurface(this); } ShellSurface::~ShellSurface() diff --git a/src/compositor/wayland_wrapper/qwlshellsurface_p.h b/src/compositor/wayland_wrapper/qwlshellsurface_p.h index dbcc56f51..2d6d1687f 100644 --- a/src/compositor/wayland_wrapper/qwlshellsurface_p.h +++ b/src/compositor/wayland_wrapper/qwlshellsurface_p.h @@ -98,6 +98,7 @@ public: void requestSize(const QSize &size); void ping(uint32_t serial); + QWaylandSurfaceView *view() { return m_view; } protected: bool runOperation(QWaylandSurfaceOp *op) Q_DECL_OVERRIDE; diff --git a/src/compositor/wayland_wrapper/qwlsurface.cpp b/src/compositor/wayland_wrapper/qwlsurface.cpp index 297a69132..3d87764d9 100644 --- a/src/compositor/wayland_wrapper/qwlsurface.cpp +++ b/src/compositor/wayland_wrapper/qwlsurface.cpp @@ -43,6 +43,7 @@ #include "qwlregion_p.h" #include "qwlsubsurface_p.h" #include "qwlsurfacebuffer_p.h" +#include "qwlshellsurface_p.h" #include "qwaylandsurfaceview.h" #include "qwaylandoutput.h" @@ -251,6 +252,18 @@ QPoint Surface::lastMousePos() const return m_lastLocalMousePos; } +void Surface::setShellSurface(ShellSurface *shellSurface) +{ + m_shellSurface = shellSurface; + if (m_shellSurface) + emit m_waylandSurface->shellViewCreated(); +} + +ShellSurface *Surface::shellSurface() const +{ + return m_shellSurface; +} + void Surface::setExtendedSurface(ExtendedSurface *extendedSurface) { m_extendedSurface = extendedSurface; diff --git a/src/compositor/wayland_wrapper/qwlsurface_p.h b/src/compositor/wayland_wrapper/qwlsurface_p.h index 210d07e02..af1770a4e 100644 --- a/src/compositor/wayland_wrapper/qwlsurface_p.h +++ b/src/compositor/wayland_wrapper/qwlsurface_p.h @@ -67,6 +67,7 @@ namespace QtWayland { class Compositor; class Buffer; +class ShellSurface; class ExtendedSurface; class InputPanelSurface; class SubSurface; @@ -108,6 +109,9 @@ public: QPoint lastMousePos() const; + void setShellSurface(ShellSurface *shellSurface); + ShellSurface *shellSurface() const; + void setExtendedSurface(ExtendedSurface *extendedSurface); ExtendedSurface *extendedSurface() const; @@ -203,6 +207,7 @@ protected: QList m_pendingFrameCallbacks; QList m_frameCallbacks; + ShellSurface *m_shellSurface; ExtendedSurface *m_extendedSurface; SubSurface *m_subSurface; InputPanelSurface *m_inputPanelSurface; -- cgit v1.2.3 From dc2ef3ae7435593284906e7cc32d69d97deaaf45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Mon, 5 Jan 2015 13:43:42 +0100 Subject: Initialize shellsurface pointer Change-Id: I05bac886146be66a82dcb5f7a3e57bb5eba1d65c --- src/compositor/wayland_wrapper/qwlsurface.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/compositor/wayland_wrapper') diff --git a/src/compositor/wayland_wrapper/qwlsurface.cpp b/src/compositor/wayland_wrapper/qwlsurface.cpp index 3d87764d9..78aa44d51 100644 --- a/src/compositor/wayland_wrapper/qwlsurface.cpp +++ b/src/compositor/wayland_wrapper/qwlsurface.cpp @@ -115,6 +115,7 @@ Surface::Surface(struct wl_client *client, uint32_t id, int version, QWaylandCom , m_buffer(0) , m_surfaceMapped(false) , m_attacher(0) + , m_shellSurface(0) , m_extendedSurface(0) , m_subSurface(0) , m_inputPanelSurface(0) -- cgit v1.2.3 From 71ddf5f5b8611463d4ab824219b9dfa41c45c616 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Wed, 29 Jul 2015 14:33:54 +0200 Subject: Make the attach offset available through a signal on QWaylandSurface This can then be picked up by ie. the shell_surface which can adjusts its view accordingly Change-Id: Iee3efa243c59b259834e599312d687401528e9c4 --- src/compositor/wayland_wrapper/qwlshellsurface.cpp | 9 ++++++++- src/compositor/wayland_wrapper/qwlshellsurface_p.h | 1 + src/compositor/wayland_wrapper/qwlsurface.cpp | 3 +++ 3 files changed, 12 insertions(+), 1 deletion(-) (limited to 'src/compositor/wayland_wrapper') diff --git a/src/compositor/wayland_wrapper/qwlshellsurface.cpp b/src/compositor/wayland_wrapper/qwlshellsurface.cpp index c20917f66..59301d795 100644 --- a/src/compositor/wayland_wrapper/qwlshellsurface.cpp +++ b/src/compositor/wayland_wrapper/qwlshellsurface.cpp @@ -98,6 +98,7 @@ ShellSurface::ShellSurface(Shell *shell, wl_client *client, uint32_t id, Surface m_view = surface->compositor()->waylandCompositor()->createView(surface->waylandSurface()); connect(surface->waylandSurface(), &QWaylandSurface::configure, this, &ShellSurface::configure); connect(surface->waylandSurface(), &QWaylandSurface::mapped, this, &ShellSurface::mapped); + connect(surface->waylandSurface(), &QWaylandSurface::offsetForNextFrame, this, &ShellSurface::adjustOffset); surface->setShellSurface(this); } @@ -183,6 +184,13 @@ void ShellSurface::mapped() } } +void ShellSurface::adjustOffset(const QPoint &p) +{ + QPointF offset(p); + QPointF pos = m_view->pos(); + m_view->setPos(pos + offset); +} + void ShellSurface::requestSize(const QSize &size) { send_configure(WL_SHELL_SURFACE_RESIZE_BOTTOM_RIGHT, size.width(), size.height()); @@ -223,7 +231,6 @@ void ShellSurface::shell_surface_resize(Resource *resource, { Q_UNUSED(resource); Q_UNUSED(time); - Q_UNUSED(edges); if (m_moveGrabber || m_resizeGrabber) { qDebug() << "invalid state2"; diff --git a/src/compositor/wayland_wrapper/qwlshellsurface_p.h b/src/compositor/wayland_wrapper/qwlshellsurface_p.h index 2d6d1687f..033a8f971 100644 --- a/src/compositor/wayland_wrapper/qwlshellsurface_p.h +++ b/src/compositor/wayland_wrapper/qwlshellsurface_p.h @@ -104,6 +104,7 @@ protected: private Q_SLOTS: void mapped(); + void adjustOffset(const QPoint &p); private: Shell *m_shell; diff --git a/src/compositor/wayland_wrapper/qwlsurface.cpp b/src/compositor/wayland_wrapper/qwlsurface.cpp index 78aa44d51..03edbc1dc 100644 --- a/src/compositor/wayland_wrapper/qwlsurface.cpp +++ b/src/compositor/wayland_wrapper/qwlsurface.cpp @@ -523,6 +523,9 @@ void Surface::surface_commit(Resource *) emit m_waylandSurface->configure(m_bufferRef); if (m_roleHandler) m_roleHandler->configure(m_pending.offset.x(), m_pending.offset.y()); + + if (!m_pending.offset.isNull()) + emit m_waylandSurface->offsetForNextFrame(m_pending.offset); } m_pending.buffer = 0; -- cgit v1.2.3 From 6181c91c9718532ac0ccf1566c10953d6a6c69d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Wed, 29 Jul 2015 14:34:49 +0200 Subject: Make it possible for QWaylandSurfaceItem to children of arbitrary items The main problem is that the position of the QWaylandSurfaceItem is changed through the position of the views setPos function. However, it might be that we don't want the surface position to map it directly. Rename QWaylandSurfaceView::setPos to setRequestedPos Then let the compositors choose what to do with this position Change-Id: I43c74baad688d2f3e49ca091bbf436c718e81318 --- src/compositor/wayland_wrapper/qwldatadevice.cpp | 2 +- src/compositor/wayland_wrapper/qwlinputdevice.cpp | 2 +- src/compositor/wayland_wrapper/qwlqttouch.cpp | 2 +- src/compositor/wayland_wrapper/qwlshellsurface.cpp | 20 ++++++++++---------- src/compositor/wayland_wrapper/qwlsubsurface.cpp | 2 +- 5 files changed, 14 insertions(+), 14 deletions(-) (limited to 'src/compositor/wayland_wrapper') diff --git a/src/compositor/wayland_wrapper/qwldatadevice.cpp b/src/compositor/wayland_wrapper/qwldatadevice.cpp index 8c28dfeb7..2e694ca27 100644 --- a/src/compositor/wayland_wrapper/qwldatadevice.cpp +++ b/src/compositor/wayland_wrapper/qwldatadevice.cpp @@ -140,7 +140,7 @@ void DataDevice::focus() void DataDevice::motion(uint32_t time) { if (m_dragIcon) { - m_dragIcon->setPos(m_pointer->currentPosition()); + m_dragIcon->setRequestedPosition(m_pointer->currentPosition()); } if (m_dragFocusResource && m_dragFocus) { diff --git a/src/compositor/wayland_wrapper/qwlinputdevice.cpp b/src/compositor/wayland_wrapper/qwlinputdevice.cpp index 479df4d56..13bbdf872 100644 --- a/src/compositor/wayland_wrapper/qwlinputdevice.cpp +++ b/src/compositor/wayland_wrapper/qwlinputdevice.cpp @@ -276,7 +276,7 @@ void InputDevice::sendFullTouchEvent(QTouchEvent *event) return; const int pointCount = points.count(); - QPointF pos = mouseFocus()->pos(); + QPointF pos = mouseFocus()->requestedPosition(); for (int i = 0; i < pointCount; ++i) { const QTouchEvent::TouchPoint &tp(points.at(i)); // Convert the local pos in the compositor window to surface-relative. diff --git a/src/compositor/wayland_wrapper/qwlqttouch.cpp b/src/compositor/wayland_wrapper/qwlqttouch.cpp index aa9492428..b99ff776b 100644 --- a/src/compositor/wayland_wrapper/qwlqttouch.cpp +++ b/src/compositor/wayland_wrapper/qwlqttouch.cpp @@ -71,7 +71,7 @@ bool TouchExtensionGlobal::postTouchEvent(QTouchEvent *event, QWaylandSurfaceVie if (!pointCount) return false; - QPointF surfacePos = view->pos(); + QPointF surfacePos = view->requestedPosition(); wl_client *surfaceClient = view->surface()->handle()->resource()->client(); uint32_t time = m_compositor->currentTimeMsecs(); const int rescount = m_resources.count(); diff --git a/src/compositor/wayland_wrapper/qwlshellsurface.cpp b/src/compositor/wayland_wrapper/qwlshellsurface.cpp index 59301d795..efa211013 100644 --- a/src/compositor/wayland_wrapper/qwlshellsurface.cpp +++ b/src/compositor/wayland_wrapper/qwlshellsurface.cpp @@ -127,14 +127,14 @@ void ShellSurface::adjustPosInResize() int bottomLeftX = m_resizeGrabber->point.x() + m_resizeGrabber->width; int bottomLeftY = m_resizeGrabber->point.y() + m_resizeGrabber->height; - qreal x = m_view->pos().x(); - qreal y = m_view->pos().y(); + qreal x = m_view->requestedPosition().x(); + qreal y = m_view->requestedPosition().y(); if (m_resizeGrabber->resize_edges & WL_SHELL_SURFACE_RESIZE_TOP) y = bottomLeftY - m_view->surface()->size().height(); if (m_resizeGrabber->resize_edges & WL_SHELL_SURFACE_RESIZE_LEFT) x = bottomLeftX - m_view->surface()->size().width(); QPointF newPos(x,y); - m_view->setPos(newPos); + m_view->setRequestedPosition(newPos); } void ShellSurface::resetResizeGrabber() @@ -187,8 +187,8 @@ void ShellSurface::mapped() void ShellSurface::adjustOffset(const QPoint &p) { QPointF offset(p); - QPointF pos = m_view->pos(); - m_view->setPos(pos + offset); + QPointF pos = m_view->requestedPosition(); + m_view->setRequestedPosition(pos + offset); } void ShellSurface::requestSize(const QSize &size) @@ -219,7 +219,7 @@ void ShellSurface::shell_surface_move(Resource *resource, InputDevice *input_device = InputDevice::fromSeatResource(input_device_super); Pointer *pointer = input_device->pointerDevice(); - m_moveGrabber = new ShellSurfaceMoveGrabber(this, pointer->position() - m_view->pos()); + m_moveGrabber = new ShellSurfaceMoveGrabber(this, pointer->position() - m_view->requestedPosition()); pointer->startGrab(m_moveGrabber); } @@ -309,7 +309,7 @@ void ShellSurface::shell_surface_set_fullscreen(Resource *resource, } QSize outputSize = output->geometry().size(); - m_view->setPos(output->geometry().topLeft()); + m_view->setRequestedPosition(output->geometry().topLeft()); send_configure(resize_bottom_right, outputSize.width(), outputSize.height()); m_surface->setVisibility(QWindow::FullScreen); @@ -357,7 +357,7 @@ void ShellSurface::shell_surface_set_maximized(Resource *resource, } QSize outputSize = output->availableGeometry().size(); - m_view->setPos(output->availableGeometry().topLeft()); + m_view->setRequestedPosition(output->availableGeometry().topLeft()); send_configure(resize_bottom_right, outputSize.width(), outputSize.height()); m_surface->setVisibility(QWindow::Maximized); @@ -454,11 +454,11 @@ void ShellSurfaceMoveGrabber::motion(uint32_t time) Q_UNUSED(time); QPointF pos(m_pointer->position() - m_offset); - shell_surface->m_view->setPos(pos); + shell_surface->m_view->setRequestedPosition(pos); if (shell_surface->m_surface->transientParent()) { QWaylandSurfaceView *view = shell_surface->m_surface->transientParent()->waylandSurface()->views().first(); if (view) - shell_surface->setOffset(pos - view->pos()); + shell_surface->setOffset(pos - view->requestedPosition()); } } diff --git a/src/compositor/wayland_wrapper/qwlsubsurface.cpp b/src/compositor/wayland_wrapper/qwlsubsurface.cpp index 3f47f95fe..beffee403 100644 --- a/src/compositor/wayland_wrapper/qwlsubsurface.cpp +++ b/src/compositor/wayland_wrapper/qwlsubsurface.cpp @@ -99,7 +99,7 @@ void SubSurface::setSubSurface(SubSurface *subSurface, int x, int y) subSurface->setParent(this); } foreach (QWaylandSurfaceView *view, subSurface->m_surface->waylandSurface()->views()) - view->setPos(QPointF(x,y)); + view->setRequestedPosition(QPointF(x,y)); } void SubSurface::removeSubSurface(SubSurface *subSurfaces) -- cgit v1.2.3 From e946c76e74762081d6c407e2ca23ec04c422bdfe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Fri, 9 Jan 2015 13:33:44 +0100 Subject: Deprecate the cursor change request and make it a signal Change-Id: Icafab695071259e2112e9742ba46a19c1dc74586 --- src/compositor/wayland_wrapper/qwlpointer.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/compositor/wayland_wrapper') diff --git a/src/compositor/wayland_wrapper/qwlpointer.cpp b/src/compositor/wayland_wrapper/qwlpointer.cpp index d587157b9..27887ba54 100644 --- a/src/compositor/wayland_wrapper/qwlpointer.cpp +++ b/src/compositor/wayland_wrapper/qwlpointer.cpp @@ -308,19 +308,27 @@ void Pointer::button(uint32_t time, Qt::MouseButton button, uint32_t state) setFocus(m_current, m_currentPoint); } +static void requestCursorSurface(QWaylandCompositor *compositor, QWaylandSurface *surface, int32_t hotspot_x, int hotspot_y) +{ +#if QT_DEPRECATED_SINCE(5, 5) + compositor->setCursorSurface(surface, hotspot_x, hotspot_y); +#endif + compositor->currentCurserSurfaceRequest(surface, hotspot_x, hotspot_y); +} + void Pointer::pointer_set_cursor(wl_pointer::Resource *resource, uint32_t serial, wl_resource *surface, int32_t hotspot_x, int32_t hotspot_y) { Q_UNUSED(resource); Q_UNUSED(serial); if (!surface) { - m_compositor->waylandCompositor()->setCursorSurface(NULL, 0, 0); + requestCursorSurface(m_compositor->waylandCompositor(), Q_NULLPTR, 0, 0); return; } Surface *s = Surface::fromResource(surface); s->setCursorSurface(true); - m_compositor->waylandCompositor()->setCursorSurface(s->waylandSurface(), hotspot_x, hotspot_y); + requestCursorSurface(m_compositor->waylandCompositor(), s->waylandSurface(), hotspot_x, hotspot_y); } PointerGrabber::~PointerGrabber() -- cgit v1.2.3 From 0a7ae4374e9b3c0128388e5b68075f6f06347c71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Wed, 29 Jul 2015 14:38:18 +0200 Subject: Make it possible to set a QWaylandSurface on the QWaylandSurfaceView This will allow us to use QWaylandSurfaceItem from within QML Change-Id: I6ecfbf3a5de5f5a748a6a85295b9741316fef976 --- src/compositor/wayland_wrapper/qwldatadevice.cpp | 2 +- src/compositor/wayland_wrapper/qwlshellsurface.cpp | 2 +- src/compositor/wayland_wrapper/qwlsurface.cpp | 1 + src/compositor/wayland_wrapper/qwlsurface_p.h | 2 ++ 4 files changed, 5 insertions(+), 2 deletions(-) (limited to 'src/compositor/wayland_wrapper') diff --git a/src/compositor/wayland_wrapper/qwldatadevice.cpp b/src/compositor/wayland_wrapper/qwldatadevice.cpp index 2e694ca27..73a93a8c8 100644 --- a/src/compositor/wayland_wrapper/qwldatadevice.cpp +++ b/src/compositor/wayland_wrapper/qwldatadevice.cpp @@ -182,7 +182,7 @@ void DataDevice::data_device_start_drag(Resource *resource, struct ::wl_resource m_dragClient = resource->client(); m_dragDataSource = source != 0 ? DataSource::fromResource(source) : 0; - m_dragIcon = icon != 0 ? m_compositor->waylandCompositor()->createView(Surface::fromResource(icon)->waylandSurface()) : 0; + m_dragIcon = icon != 0 ? m_compositor->waylandCompositor()->createSurfaceView(Surface::fromResource(icon)->waylandSurface()) : 0; Q_EMIT m_inputDevice->dragHandle()->iconChanged(); m_inputDevice->pointerDevice()->setFocus(0, QPointF()); diff --git a/src/compositor/wayland_wrapper/qwlshellsurface.cpp b/src/compositor/wayland_wrapper/qwlshellsurface.cpp index efa211013..bc75ab4c3 100644 --- a/src/compositor/wayland_wrapper/qwlshellsurface.cpp +++ b/src/compositor/wayland_wrapper/qwlshellsurface.cpp @@ -95,7 +95,7 @@ ShellSurface::ShellSurface(Shell *shell, wl_client *client, uint32_t id, Surface , m_popupGrabber(0) , m_popupSerial() { - m_view = surface->compositor()->waylandCompositor()->createView(surface->waylandSurface()); + m_view = surface->compositor()->waylandCompositor()->createSurfaceView(surface->waylandSurface()); connect(surface->waylandSurface(), &QWaylandSurface::configure, this, &ShellSurface::configure); connect(surface->waylandSurface(), &QWaylandSurface::mapped, this, &ShellSurface::mapped); connect(surface->waylandSurface(), &QWaylandSurface::offsetForNextFrame, this, &ShellSurface::adjustOffset); diff --git a/src/compositor/wayland_wrapper/qwlsurface.cpp b/src/compositor/wayland_wrapper/qwlsurface.cpp index 03edbc1dc..d8f80b0f4 100644 --- a/src/compositor/wayland_wrapper/qwlsurface.cpp +++ b/src/compositor/wayland_wrapper/qwlsurface.cpp @@ -453,6 +453,7 @@ Qt::ScreenOrientation Surface::contentOrientation() const return m_contentOrientation; } + void Surface::surface_destroy_resource(Resource *) { if (m_extendedSurface) { diff --git a/src/compositor/wayland_wrapper/qwlsurface_p.h b/src/compositor/wayland_wrapper/qwlsurface_p.h index af1770a4e..32c6ecf66 100644 --- a/src/compositor/wayland_wrapper/qwlsurface_p.h +++ b/src/compositor/wayland_wrapper/qwlsurface_p.h @@ -234,6 +234,8 @@ protected: void setBackBuffer(SurfaceBuffer *buffer); SurfaceBuffer *createSurfaceBuffer(struct ::wl_resource *buffer); + QList views; + friend class QWaylandSurface; friend class RoleBase; }; -- cgit v1.2.3 From 29abd3025107113665109976355f8845c1c896e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Tue, 20 Jan 2015 13:41:21 +0100 Subject: Put the pointers current view and current possition into a separate class This also, if the current mouse coordinate ends on the boundary of the surface, then subtract 0.01 from the mouse coordinate. This is to work around Qt's mouse event propogation which is QRectF::contains which is including the boundary, and Wayland which uses a strict contains. We cant just discard events since Qt handles also enter/leave and clicking state etc. Change-Id: I919651232a5027b9fe0cb15b6838d3b1fee682df --- src/compositor/wayland_wrapper/qwlpointer.cpp | 25 ++++++-------- src/compositor/wayland_wrapper/qwlpointer_p.h | 49 +++++++++++++++++++++++++-- 2 files changed, 58 insertions(+), 16 deletions(-) (limited to 'src/compositor/wayland_wrapper') diff --git a/src/compositor/wayland_wrapper/qwlpointer.cpp b/src/compositor/wayland_wrapper/qwlpointer.cpp index 27887ba54..1d80fd4ff 100644 --- a/src/compositor/wayland_wrapper/qwlpointer.cpp +++ b/src/compositor/wayland_wrapper/qwlpointer.cpp @@ -91,8 +91,6 @@ Pointer::Pointer(Compositor *compositor, InputDevice *seat) , m_position(100, 100) , m_focus() , m_focusResource() - , m_current() - , m_currentPoint() , m_buttonCount() { connect(&m_focusDestroyListener, &WlListener::fired, this, &Pointer::focusDestroyed); @@ -141,7 +139,7 @@ void Pointer::startGrab(PointerGrabber *grab) m_grab = grab; grab->m_pointer = this; - if (m_current) + if (m_currentPosition.view()) grab->focus(); } @@ -153,8 +151,7 @@ void Pointer::endGrab() void Pointer::setCurrent(QWaylandSurfaceView *surface, const QPointF &point) { - m_current = surface; - m_currentPoint = point; + m_currentPosition.setCurrent(surface, point); } bool Pointer::buttonPressed() const @@ -189,7 +186,7 @@ QWaylandSurfaceView *Pointer::focusSurface() const QWaylandSurfaceView *Pointer::current() const { - return m_current; + return m_currentPosition.view(); } QPointF Pointer::position() const @@ -199,7 +196,7 @@ QPointF Pointer::position() const QPointF Pointer::currentPosition() const { - return m_currentPoint; + return m_currentPosition.position(); } QtWaylandServer::wl_pointer::Resource *Pointer::focusResource() const @@ -222,8 +219,7 @@ void Pointer::setMouseFocus(QWaylandSurfaceView *surface, const QPointF &localPo { m_position = globalPos; - m_current = surface; - m_currentPoint = localPos; + m_currentPosition.setCurrent(surface, localPos); m_grab->focus(); } @@ -265,7 +261,8 @@ void Pointer::sendMouseMoveEvent(const QPointF &localPos, const QPointF &globalP uint32_t time = m_compositor->currentTimeMsecs(); m_position = globalPos; - m_currentPoint = localPos; + + m_currentPosition.updatePosition(localPos); m_grab->motion(time); } @@ -286,15 +283,15 @@ void Pointer::focus() if (buttonPressed()) return; - setFocus(m_current, m_currentPoint); + setFocus(m_currentPosition.view(), m_currentPosition.position()); } void Pointer::motion(uint32_t time) { if (m_focusResource) send_motion(m_focusResource->handle, time, - wl_fixed_from_double(m_currentPoint.x()), - wl_fixed_from_double(m_currentPoint.y())); + wl_fixed_from_double(m_currentPosition.x()), + wl_fixed_from_double(m_currentPosition.y())); } @@ -305,7 +302,7 @@ void Pointer::button(uint32_t time, Qt::MouseButton button, uint32_t state) } if (!buttonPressed() && state == WL_POINTER_BUTTON_STATE_RELEASED) - setFocus(m_current, m_currentPoint); + setFocus(m_currentPosition.view(), m_currentPosition.position()); } static void requestCursorSurface(QWaylandCompositor *compositor, QWaylandSurface *surface, int32_t hotspot_x, int hotspot_y) diff --git a/src/compositor/wayland_wrapper/qwlpointer_p.h b/src/compositor/wayland_wrapper/qwlpointer_p.h index 96642ba7f..c92350970 100644 --- a/src/compositor/wayland_wrapper/qwlpointer_p.h +++ b/src/compositor/wayland_wrapper/qwlpointer_p.h @@ -45,6 +45,8 @@ #include #include +#include +#include #include @@ -72,6 +74,50 @@ public: Pointer *m_pointer; }; +class CurrentPosition +{ +public: + CurrentPosition() + : m_view(Q_NULLPTR) + {} + + void updatePosition(const QPointF &position) + { + Q_ASSERT(m_view || position.isNull()); + m_point = position; + //we adjust if the mouse position is on the edge + //to work around Qt's event propogation + if (position.isNull()) + return; + if (m_view->surface()) { + QSizeF size(m_view->surface()->size()); + if (m_point.x() == size.width()) + m_point.rx() -= 0.01; + + if (m_point.y() == size.height()) + m_point.ry() -= 0.01; + } + } + + QPointF position() const { return m_point; } + qreal x() const { return m_point.x(); } + qreal y() const { return m_point.y(); } + + void setView(QWaylandSurfaceView *view) { m_view = view; } + QWaylandSurfaceView *view() const { return m_view; } + + void setCurrent(QWaylandSurfaceView *view, const QPointF &position) + { + QPointF toSet = view || position.isNull() ? position : QPointF(); + setView(view); + updatePosition(toSet); + } + +private: + QWaylandSurfaceView *m_view; + QPointF m_point; +}; + class Q_COMPOSITOR_EXPORT Pointer : public QObject, public QtWaylandServer::wl_pointer, public PointerGrabber { public: @@ -129,8 +175,7 @@ private: QWaylandSurfaceView *m_focus; Resource *m_focusResource; - QWaylandSurfaceView *m_current; - QPointF m_currentPoint; + CurrentPosition m_currentPosition; int m_buttonCount; -- cgit v1.2.3 From 0c093c9682ba6dc850365354863911e8d2ca9994 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Tue, 20 Jan 2015 13:38:45 +0100 Subject: QWaylandInput add a sendMouseEnter and sendMouseLeave Change-Id: I713c9ab2f0edaa4346ff021764de6a23201bbf68 --- src/compositor/wayland_wrapper/qwlinputdevice.cpp | 10 ++++++++++ src/compositor/wayland_wrapper/qwlinputdevice_p.h | 2 ++ src/compositor/wayland_wrapper/qwlpointer.cpp | 19 +++++++++++++++++++ src/compositor/wayland_wrapper/qwlpointer_p.h | 2 ++ 4 files changed, 33 insertions(+) (limited to 'src/compositor/wayland_wrapper') diff --git a/src/compositor/wayland_wrapper/qwlinputdevice.cpp b/src/compositor/wayland_wrapper/qwlinputdevice.cpp index 13bbdf872..5986b66ba 100644 --- a/src/compositor/wayland_wrapper/qwlinputdevice.cpp +++ b/src/compositor/wayland_wrapper/qwlinputdevice.cpp @@ -191,6 +191,16 @@ void InputDevice::sendMouseWheelEvent(Qt::Orientation orientation, int delta) pointerDevice()->sendMouseWheelEvent(orientation, delta); } +void InputDevice::sendMouseEnterEvent(QWaylandSurfaceView *view, const QPointF &localPos) +{ + pointerDevice()->sendMouseEnterEvent(view, localPos); +} + +void InputDevice::sendMouseLeaveEvent(QWaylandSurfaceView *view) +{ + pointerDevice()->sendMouseLeaveEvent(view); +} + void InputDevice::sendTouchPointEvent(int id, double x, double y, Qt::TouchPointState state) { if (m_touch.isNull()) { diff --git a/src/compositor/wayland_wrapper/qwlinputdevice_p.h b/src/compositor/wayland_wrapper/qwlinputdevice_p.h index a0d65cdeb..b6637eaa2 100644 --- a/src/compositor/wayland_wrapper/qwlinputdevice_p.h +++ b/src/compositor/wayland_wrapper/qwlinputdevice_p.h @@ -82,6 +82,8 @@ public: void sendMouseMoveEvent(const QPointF &localPos, const QPointF &globalPos = QPointF()); void sendMouseMoveEvent(QWaylandSurfaceView *surface, const QPointF &localPos, const QPointF &globalPos = QPointF()); void sendMouseWheelEvent(Qt::Orientation orientation, int delta); + void sendMouseEnterEvent(QWaylandSurfaceView *view, const QPointF &localPos); + void sendMouseLeaveEvent(QWaylandSurfaceView *view); void sendTouchPointEvent(int id, double x, double y, Qt::TouchPointState state); void sendTouchFrameEvent(); diff --git a/src/compositor/wayland_wrapper/qwlpointer.cpp b/src/compositor/wayland_wrapper/qwlpointer.cpp index 1d80fd4ff..ac2392100 100644 --- a/src/compositor/wayland_wrapper/qwlpointer.cpp +++ b/src/compositor/wayland_wrapper/qwlpointer.cpp @@ -278,6 +278,25 @@ void Pointer::sendMouseWheelEvent(Qt::Orientation orientation, int delta) send_axis(m_focusResource->handle, time, axis, wl_fixed_from_int(-delta / 12)); } +void Pointer::sendMouseEnterEvent(QWaylandSurfaceView *view, const QPointF &localPos) +{ + if (view == m_currentPosition.view()) { + qWarning("Possible input state error. Want to send enter event for the current input surface"); + } + + setMouseFocus(view, localPos, QPointF()); +} + +void Pointer::sendMouseLeaveEvent(QWaylandSurfaceView *view) +{ + if (view != m_currentPosition.view()) { + qWarning("Possible input state error. Want to send leave event for not current surface"); + return; + } + + setMouseFocus(Q_NULLPTR, QPointF(), QPointF()); +} + void Pointer::focus() { if (buttonPressed()) diff --git a/src/compositor/wayland_wrapper/qwlpointer_p.h b/src/compositor/wayland_wrapper/qwlpointer_p.h index c92350970..6eec25906 100644 --- a/src/compositor/wayland_wrapper/qwlpointer_p.h +++ b/src/compositor/wayland_wrapper/qwlpointer_p.h @@ -141,6 +141,8 @@ public: void sendMouseReleaseEvent(Qt::MouseButton button, const QPointF &localPos, const QPointF &globalPos); void sendMouseMoveEvent(const QPointF &localPos, const QPointF &globalPos); void sendMouseWheelEvent(Qt::Orientation orientation, int delta); + void sendMouseEnterEvent(QWaylandSurfaceView *view, const QPointF &localPos); + void sendMouseLeaveEvent(QWaylandSurfaceView *view); QWaylandSurfaceView *focusSurface() const; QWaylandSurfaceView *current() const; -- cgit v1.2.3 From 7bdffe9e34c7cd071551bfe07a50811f4c7160d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Wed, 21 Jan 2015 10:07:25 +0100 Subject: QWaylandOutput send mode and geometry correctly Change-Id: I3be8394ad25958f29d4fccc09472355f1560b4ea --- src/compositor/wayland_wrapper/qwloutput.cpp | 41 ++++++++++++++++++++++++++++ src/compositor/wayland_wrapper/qwloutput_p.h | 6 ++++ 2 files changed, 47 insertions(+) (limited to 'src/compositor/wayland_wrapper') diff --git a/src/compositor/wayland_wrapper/qwloutput.cpp b/src/compositor/wayland_wrapper/qwloutput.cpp index 1a80ab033..1ff52ad5f 100644 --- a/src/compositor/wayland_wrapper/qwloutput.cpp +++ b/src/compositor/wayland_wrapper/qwloutput.cpp @@ -109,6 +109,7 @@ Output::Output(Compositor *compositor, QWindow *window) , m_subpixel(QWaylandOutput::SubpixelUnknown) , m_transform(QWaylandOutput::TransformNormal) , m_scaleFactor(1) + , m_sizeFollowsWindow(true) { m_mode.size = window ? window->size() : QSize(); m_mode.refreshRate = 60; @@ -175,6 +176,26 @@ QRect Output::geometry() const return QRect(m_position, m_mode.size); } +bool Output::sizeFollowsWindow() const +{ + return m_sizeFollowsWindow; +} + +void Output::setSizeFollowsWindow(bool follow) +{ + if (follow != m_sizeFollowsWindow) { + if (follow) { + QObject::connect(m_window, &QWindow::widthChanged, m_output, &QWaylandOutput::setWidth); + QObject::connect(m_window, &QWindow::heightChanged, m_output, &QWaylandOutput::setHeight); + } else { + QObject::disconnect(m_window, &QWindow::widthChanged, m_output, &QWaylandOutput::setWidth); + QObject::disconnect(m_window, &QWindow::heightChanged, m_output, &QWaylandOutput::setHeight); + } + m_sizeFollowsWindow = follow; + m_output->sizeFollowsWindowChanged(); + } +} + void Output::setGeometry(const QRect &geometry) { if (m_position == geometry.topLeft() && m_mode.size == geometry.size()) @@ -197,6 +218,26 @@ void Output::setGeometry(const QRect &geometry) } } +void Output::setWidth(int newWidth) +{ + if (m_mode.size.width() == newWidth) + return; + + QSize s = m_mode.size; + s.setWidth(newWidth); + setGeometry(QRect(m_position, s)); +} + +void Output::setHeight(int newHeight) +{ + if (m_mode.size.height() == newHeight) + return; + + QSize s = m_mode.size; + s.setHeight(newHeight); + setGeometry(QRect(m_position, s)); +} + void Output::setAvailableGeometry(const QRect &availableGeometry) { m_availableGeometry = availableGeometry; diff --git a/src/compositor/wayland_wrapper/qwloutput_p.h b/src/compositor/wayland_wrapper/qwloutput_p.h index ee6a34262..18c3801a5 100644 --- a/src/compositor/wayland_wrapper/qwloutput_p.h +++ b/src/compositor/wayland_wrapper/qwloutput_p.h @@ -79,6 +79,11 @@ public: QRect geometry() const; void setGeometry(const QRect &geometry); + void setWidth(int newWidth); + void setHeight(int newHeight); + + bool sizeFollowsWindow() const; + void setSizeFollowsWindow(bool follow); QWaylandOutput::Mode mode() const { return m_mode; } void setMode(const QWaylandOutput::Mode &mode); @@ -131,6 +136,7 @@ private: QWaylandOutput::Transform m_transform; int m_scaleFactor; QList m_surfaces; + bool m_sizeFollowsWindow; void sendGeometryInfo(); }; -- cgit v1.2.3 From b25b9856ad61e455fc3c51afc746692ab848ced4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Wed, 21 Jan 2015 12:04:34 +0100 Subject: Remove releaseSurfaces function from QWayland::Surface Change-Id: I3e5ed3233f74c98bffd7064d70d076ecaa129d7e --- src/compositor/wayland_wrapper/qwlcompositor.cpp | 1 - src/compositor/wayland_wrapper/qwlsurface.cpp | 5 ----- src/compositor/wayland_wrapper/qwlsurface_p.h | 1 - 3 files changed, 7 deletions(-) (limited to 'src/compositor/wayland_wrapper') diff --git a/src/compositor/wayland_wrapper/qwlcompositor.cpp b/src/compositor/wayland_wrapper/qwlcompositor.cpp index 6316aac24..98f5aa1d4 100644 --- a/src/compositor/wayland_wrapper/qwlcompositor.cpp +++ b/src/compositor/wayland_wrapper/qwlcompositor.cpp @@ -322,7 +322,6 @@ void Compositor::destroySurface(Surface *surface) waylandCompositor()->surfaceAboutToBeDestroyed(surface->waylandSurface()); - surface->releaseSurfaces(); m_destroyed_surfaces << surface->waylandSurface(); } diff --git a/src/compositor/wayland_wrapper/qwlsurface.cpp b/src/compositor/wayland_wrapper/qwlsurface.cpp index d8f80b0f4..8f94f97cc 100644 --- a/src/compositor/wayland_wrapper/qwlsurface.cpp +++ b/src/compositor/wayland_wrapper/qwlsurface.cpp @@ -168,11 +168,6 @@ void Surface::setTransientOffset(qreal x, qreal y) m_transientOffset.setY(y); } -void Surface::releaseSurfaces() -{ - -} - Surface *Surface::fromResource(struct ::wl_resource *resource) { return static_cast(Resource::fromResource(resource)->surface_object); diff --git a/src/compositor/wayland_wrapper/qwlsurface_p.h b/src/compositor/wayland_wrapper/qwlsurface_p.h index 32c6ecf66..127ff3576 100644 --- a/src/compositor/wayland_wrapper/qwlsurface_p.h +++ b/src/compositor/wayland_wrapper/qwlsurface_p.h @@ -149,7 +149,6 @@ public: bool isCursorSurface() const { return m_isCursorSurface; } void setCursorSurface(bool isCursor) { m_isCursorSurface = isCursor; } - void releaseSurfaces(); void frameStarted(); void addUnmapLock(QWaylandUnmapLock *l); -- cgit v1.2.3 From 6c9c54587c6cd1059d5de652d06e248456832ab6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Fri, 13 Feb 2015 14:12:58 +0100 Subject: Reset when the mousefocus surface is destoryed Change-Id: Ibc50d08b4aace996d9f0eec5c6083b1255ae1723 --- src/compositor/wayland_wrapper/qwlpointer.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/compositor/wayland_wrapper') diff --git a/src/compositor/wayland_wrapper/qwlpointer.cpp b/src/compositor/wayland_wrapper/qwlpointer.cpp index ac2392100..fe67bd1f0 100644 --- a/src/compositor/wayland_wrapper/qwlpointer.cpp +++ b/src/compositor/wayland_wrapper/qwlpointer.cpp @@ -131,7 +131,9 @@ void Pointer::focusDestroyed(void *data) m_focus = 0; m_focusResource = 0; + m_buttonCount = 0; setMouseFocus(0, QPointF(), QPointF()); + endGrab(); } void Pointer::startGrab(PointerGrabber *grab) @@ -290,7 +292,6 @@ void Pointer::sendMouseEnterEvent(QWaylandSurfaceView *view, const QPointF &loca void Pointer::sendMouseLeaveEvent(QWaylandSurfaceView *view) { if (view != m_currentPosition.view()) { - qWarning("Possible input state error. Want to send leave event for not current surface"); return; } -- cgit v1.2.3 From a327ca8d8a1f6e0a44a3aa6bd4dac716911c434e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Wed, 29 Jul 2015 14:58:54 +0200 Subject: Move the texture ownership from the QWaylandSurface to the respective QWaylandSurfaceView. For all GL applications this will have no significant impact, but will cause a memory regression for shm surfaces with multiple views. This is done to simplify the creation and destruction of textures, especially in multi-threaded environments. Also the same patch removes the y_inverted property and replaces it with a origin property. Its done in the same patch as a lot of the code was overlapping. Change-Id: I4bce50c614c9ac3ba0580e0560339476eac03433 --- src/compositor/wayland_wrapper/qwlsurface.cpp | 56 ++---- src/compositor/wayland_wrapper/qwlsurface_p.h | 12 +- .../wayland_wrapper/qwlsurfacebuffer.cpp | 219 ++++++--------------- .../wayland_wrapper/qwlsurfacebuffer_p.h | 64 +----- 4 files changed, 92 insertions(+), 259 deletions(-) (limited to 'src/compositor/wayland_wrapper') diff --git a/src/compositor/wayland_wrapper/qwlsurface.cpp b/src/compositor/wayland_wrapper/qwlsurface.cpp index 8f94f97cc..9ac0293ab 100644 --- a/src/compositor/wayland_wrapper/qwlsurface.cpp +++ b/src/compositor/wayland_wrapper/qwlsurface.cpp @@ -47,6 +47,8 @@ #include "qwaylandsurfaceview.h" #include "qwaylandoutput.h" +#include "qwaylandsurface_p.h" + #include #include #include @@ -114,7 +116,6 @@ Surface::Surface(struct wl_client *client, uint32_t id, int version, QWaylandCom , m_mainOutput(0) , m_buffer(0) , m_surfaceMapped(false) - , m_attacher(0) , m_shellSurface(0) , m_extendedSurface(0) , m_subSurface(0) @@ -173,25 +174,6 @@ Surface *Surface::fromResource(struct ::wl_resource *resource) return static_cast(Resource::fromResource(resource)->surface_object); } -QWaylandSurface::Type Surface::type() const -{ - if (m_buffer && m_buffer->waylandBufferHandle()) { - if (m_buffer->isShmBuffer()) { - return QWaylandSurface::Shm; - } else { - return QWaylandSurface::Texture; - } - } - return QWaylandSurface::Invalid; -} - -bool Surface::isYInverted() const -{ - if (m_buffer) - return m_buffer->isYInverted(); - return false; -} - bool Surface::mapped() const { return !m_unmapLocks.isEmpty() || (m_buffer && bool(m_buffer->waylandBufferHandle())); @@ -379,9 +361,10 @@ void Surface::removeFromOutput() * The backbuffer represents the current state of the surface for the * purpose of GUI-thread accessible properties such as size and visibility. */ -void Surface::setBackBuffer(SurfaceBuffer *buffer) +void Surface::setBackBuffer(SurfaceBuffer *buffer, const QRegion &damage) { m_buffer = buffer; + m_bufferRef = QWaylandBufferRef(m_buffer); if (m_buffer) { bool valid = m_buffer->waylandBufferHandle() != 0; @@ -393,7 +376,16 @@ void Surface::setBackBuffer(SurfaceBuffer *buffer) } else { m_compositor->resetInputDevice(this); } - m_damage = QRegion(); + m_damage = damage; + + QWaylandSurfacePrivate *priv = QWaylandSurfacePrivate::get(waylandSurface()); + for (int i = 0; i < priv->views.size(); i++) { + priv->views.at(i)->attach(m_bufferRef); + } + + emit m_waylandSurface->configure(m_bufferRef.hasBuffer()); + if (!m_pending.offset.isNull()) + emit m_waylandSurface->offsetForNextFrame(m_pending.offset); } void Surface::setMapped(bool mapped) @@ -502,26 +494,8 @@ void Surface::surface_set_input_region(Resource *, struct wl_resource *region) void Surface::surface_commit(Resource *) { - m_damage = m_pending.damage; - if (m_pending.buffer || m_pending.newlyAttached) { - setBackBuffer(m_pending.buffer); - m_bufferRef = QWaylandBufferRef(m_buffer); - - if (m_attacher) { - if (m_bufferRef) { - m_attacher->attach(m_bufferRef); - } else if (!mapped()) { - setSize(QSize()); - m_attacher->unmap(); - } - } - emit m_waylandSurface->configure(m_bufferRef); - if (m_roleHandler) - m_roleHandler->configure(m_pending.offset.x(), m_pending.offset.y()); - - if (!m_pending.offset.isNull()) - emit m_waylandSurface->offsetForNextFrame(m_pending.offset); + setBackBuffer(m_pending.buffer, m_pending.damage); } m_pending.buffer = 0; diff --git a/src/compositor/wayland_wrapper/qwlsurface_p.h b/src/compositor/wayland_wrapper/qwlsurface_p.h index 127ff3576..2ba1b1428 100644 --- a/src/compositor/wayland_wrapper/qwlsurface_p.h +++ b/src/compositor/wayland_wrapper/qwlsurface_p.h @@ -89,9 +89,6 @@ public: static Surface *fromResource(struct ::wl_resource *resource); - QWaylandSurface::Type type() const; - bool isYInverted() const; - bool mapped() const; using QtWaylandServer::wl_surface::resource; @@ -161,6 +158,9 @@ public: Qt::ScreenOrientation contentOrientation() const; + QWaylandSurface::Origin origin() const { return m_buffer ? m_buffer->origin() : QWaylandSurface::OriginTopLeft; } + + QWaylandBufferRef currentBufferRef() const { return m_bufferRef; } protected: void surface_destroy_resource(Resource *resource) Q_DECL_OVERRIDE; @@ -189,7 +189,6 @@ protected: SurfaceBuffer *m_buffer; QWaylandBufferRef m_bufferRef; bool m_surfaceMapped; - QWaylandBufferAttacher *m_attacher; QVector m_unmapLocks; struct { @@ -230,10 +229,9 @@ protected: const SurfaceRole *m_role; RoleBase *m_roleHandler; - void setBackBuffer(SurfaceBuffer *buffer); - SurfaceBuffer *createSurfaceBuffer(struct ::wl_resource *buffer); + void setBackBuffer(SurfaceBuffer *buffer, const QRegion &damage); - QList views; + SurfaceBuffer *createSurfaceBuffer(struct ::wl_resource *buffer); friend class QWaylandSurface; friend class RoleBase; diff --git a/src/compositor/wayland_wrapper/qwlsurfacebuffer.cpp b/src/compositor/wayland_wrapper/qwlsurfacebuffer.cpp index cbb2fb0f3..225b49f4f 100644 --- a/src/compositor/wayland_wrapper/qwlsurfacebuffer.cpp +++ b/src/compositor/wayland_wrapper/qwlsurfacebuffer.cpp @@ -62,14 +62,8 @@ SurfaceBuffer::SurfaceBuffer(Surface *surface) , m_surface_has_buffer(false) , m_destroyed(false) , m_is_displayed(false) - , m_texture(0) - , m_is_shm_resolved(false) - , m_shmBuffer(0) - , m_isSizeResolved(false) - , m_size() , m_used(false) , m_destroyIfUnused(false) - , m_image(0) { } @@ -82,17 +76,11 @@ SurfaceBuffer::~SurfaceBuffer() void SurfaceBuffer::initialize(struct ::wl_resource *buffer) { m_buffer = buffer; - m_texture = 0; m_committed = false; m_is_registered_for_buffer = true; m_surface_has_buffer = true; m_is_displayed = false; m_destroyed = false; - m_handle = 0; - m_is_shm_resolved = false; - m_shmBuffer = 0; - m_isSizeResolved = false; - m_size = QSize(); m_destroy_listener.surfaceBuffer = this; m_destroy_listener.listener.notify = destroy_listener_callback; if (buffer) @@ -101,58 +89,14 @@ void SurfaceBuffer::initialize(struct ::wl_resource *buffer) void SurfaceBuffer::destructBufferState() { - destroyTexture(); if (m_buffer) { sendRelease(); - - if (m_handle) { - if (m_shmBuffer) { - delete static_cast(m_handle); -#ifdef QT_COMPOSITOR_WAYLAND_GL - } else { - ClientBufferIntegration *hwIntegration = m_compositor->clientBufferIntegration(); - hwIntegration->unlockNativeBuffer(m_handle); -#endif - } - } wl_list_remove(&m_destroy_listener.listener.link); } m_buffer = 0; - m_handle = 0; m_committed = false; m_is_registered_for_buffer = false; m_is_displayed = false; - m_image = QImage(); -} - -QSize SurfaceBuffer::size() const -{ - if (!m_isSizeResolved) { - if (isShmBuffer()) { - m_size = QSize(wl_shm_buffer_get_width(m_shmBuffer), wl_shm_buffer_get_height(m_shmBuffer)); -#ifdef QT_COMPOSITOR_WAYLAND_GL - } else { - ClientBufferIntegration *hwIntegration = m_compositor->clientBufferIntegration(); - m_size = hwIntegration->bufferSize(m_buffer); -#endif - } - } - - return m_size; -} - -bool SurfaceBuffer::isShmBuffer() const -{ - if (!m_is_shm_resolved) { -#if (WAYLAND_VERSION_MAJOR >= 1) && (WAYLAND_VERSION_MINOR >= 2) - m_shmBuffer = wl_shm_buffer_get(m_buffer); -#else - if (wl_buffer_is_shm(static_cast(m_buffer->data))) - m_shmBuffer = static_cast(m_buffer->data); -#endif - m_is_shm_resolved = true; - } - return m_shmBuffer != 0; } void SurfaceBuffer::sendRelease() @@ -173,74 +117,6 @@ void SurfaceBuffer::setDisplayed() m_is_displayed = true; } -void SurfaceBuffer::destroyTexture() -{ -#ifdef QT_COMPOSITOR_WAYLAND_GL - if (m_texture) { - Q_ASSERT(QOpenGLContext::currentContext()); - ClientBufferIntegration *hwIntegration = m_compositor->clientBufferIntegration(); - if (hwIntegration->textureForBuffer(m_buffer) == 0) - glDeleteTextures(1, &m_texture); - else - hwIntegration->destroyTextureForBuffer(m_buffer); - m_texture = 0; - } -#endif -} - -void SurfaceBuffer::handleAboutToBeDisplayed() -{ - qDebug() << Q_FUNC_INFO; -} - -void SurfaceBuffer::handleDisplayed() -{ - qDebug() << Q_FUNC_INFO; -} - -void *SurfaceBuffer::handle() const -{ - if (!m_buffer) - return 0; - - if (!m_handle) { - SurfaceBuffer *that = const_cast(this); - if (isShmBuffer()) { - const uchar *data = static_cast(wl_shm_buffer_get_data(m_shmBuffer)); - int stride = wl_shm_buffer_get_stride(m_shmBuffer); - int width = wl_shm_buffer_get_width(m_shmBuffer); - int height = wl_shm_buffer_get_height(m_shmBuffer); - QImage *image = new QImage(data,width,height,stride, QImage::Format_ARGB32_Premultiplied); - that->m_handle = image; -#ifdef QT_COMPOSITOR_WAYLAND_GL - } else { - ClientBufferIntegration *clientBufferIntegration = m_compositor->clientBufferIntegration(); - that->m_handle = clientBufferIntegration->lockNativeBuffer(m_buffer); -#endif - } - } - return m_handle; -} - -QImage SurfaceBuffer::image() -{ - /* This api may be available on non-shm buffer. But be sure about it's format. */ - if (!m_buffer || !isShmBuffer()) - return QImage(); - - if (m_image.isNull()) - { - const uchar *data = static_cast(wl_shm_buffer_get_data(m_shmBuffer)); - int stride = wl_shm_buffer_get_stride(m_shmBuffer); - int width = wl_shm_buffer_get_width(m_shmBuffer); - int height = wl_shm_buffer_get_height(m_shmBuffer); - QImage::Format format = QWaylandShmFormatHelper::fromWaylandShmFormat(wl_shm_format(wl_shm_buffer_get_format(m_shmBuffer))); - m_image = QImage(data, width, height, stride, format); - } - - return m_image; -} - void SurfaceBuffer::destroy_listener_callback(wl_listener *listener, void *data) { Q_UNUSED(data); @@ -254,39 +130,6 @@ void SurfaceBuffer::destroy_listener_callback(wl_listener *listener, void *data) d->m_buffer = 0; } -void SurfaceBuffer::createTexture() -{ - destroyTexture(); - - ClientBufferIntegration *hwIntegration = m_compositor->clientBufferIntegration(); -#ifdef QT_COMPOSITOR_WAYLAND_GL - if (!m_texture) - m_texture = hwIntegration->textureForBuffer(m_buffer); - if (!m_texture) - glGenTextures(1, &m_texture); - glBindTexture(GL_TEXTURE_2D, m_texture); - hwIntegration->bindTextureToBuffer(m_buffer); -#else - Q_UNUSED(hwIntegration); -#endif -} - -bool SurfaceBuffer::isYInverted() const -{ - bool ret = false; - static bool negateReturn = qgetenv("QT_COMPOSITOR_NEGATE_INVERTED_Y").toInt(); - ClientBufferIntegration *clientBufferIntegration = m_compositor->clientBufferIntegration(); - -#ifdef QT_COMPOSITOR_WAYLAND_GL - if (clientBufferIntegration && waylandBufferHandle() && !isShmBuffer()) { - ret = clientBufferIntegration->isYInverted(waylandBufferHandle()); - } else -#endif - ret = true; - - return ret != negateReturn; -} - void SurfaceBuffer::ref() { m_used = m_refCount.ref(); @@ -311,6 +154,68 @@ void SurfaceBuffer::destroyIfUnused() delete this; } +QSize SurfaceBuffer::size() const +{ + if (wl_shm_buffer *shmBuffer = wl_shm_buffer_get(m_buffer)) { + int width = wl_shm_buffer_get_width(shmBuffer); + int height = wl_shm_buffer_get_height(shmBuffer); + return QSize(width, height); + } + if (ClientBufferIntegration *integration = m_compositor->clientBufferIntegration()) { + return integration->bufferSize(m_buffer); + } + + return QSize(); +} + +QWaylandSurface::Origin SurfaceBuffer::origin() const +{ + if (isShm()) { + return QWaylandSurface::OriginTopLeft; + } + + if (ClientBufferIntegration *integration = m_compositor->clientBufferIntegration()) { + return integration->origin(m_buffer); + } + return QWaylandSurface::OriginTopLeft; +} + +QImage SurfaceBuffer::image() const +{ + if (wl_shm_buffer *shmBuffer = wl_shm_buffer_get(m_buffer)) { + int width = wl_shm_buffer_get_width(shmBuffer); + int height = wl_shm_buffer_get_height(shmBuffer); + int bytesPerLine = wl_shm_buffer_get_stride(shmBuffer); + uchar *data = static_cast(wl_shm_buffer_get_data(shmBuffer)); + return QImage(data, width, height, bytesPerLine, QImage::Format_ARGB32_Premultiplied); + } + + return QImage(); +} + +void SurfaceBuffer::bindToTexture() const +{ + Q_ASSERT(m_compositor); + if (isShm()) { + QImage image = this->image(); + if (image.hasAlphaChannel()) { + if (image.format() != QImage::Format_RGBA8888) { + image = image.convertToFormat(QImage::Format_RGBA8888); + } + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, image.width(), image.height(), 0, GL_RGBA, GL_UNSIGNED_BYTE, image.constBits()); + } else { + if (image.format() != QImage::Format_RGBX8888) { + image = image.convertToFormat(QImage::Format_RGBX8888); + } + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, image.width(), image.height(), 0, GL_RGB, GL_UNSIGNED_BYTE, image.constBits()); + } + } else { + if (QtWayland::ClientBufferIntegration *clientInt = m_compositor->clientBufferIntegration()) { + clientInt->bindTextureToBuffer(m_buffer); + } + } +} + } QT_END_NAMESPACE diff --git a/src/compositor/wayland_wrapper/qwlsurfacebuffer_p.h b/src/compositor/wayland_wrapper/qwlsurfacebuffer_p.h index 7003e9360..8eecfa73f 100644 --- a/src/compositor/wayland_wrapper/qwlsurfacebuffer_p.h +++ b/src/compositor/wayland_wrapper/qwlsurfacebuffer_p.h @@ -42,6 +42,8 @@ #include #include +#include + #include QT_BEGIN_NAMESPACE @@ -70,11 +72,6 @@ public: void initialize(struct ::wl_resource *bufferResource); void destructBufferState(); - QSize size() const; - - bool isShmBuffer() const; - bool isYInverted() const; - inline bool isRegisteredWithBuffer() const { return m_is_registered_for_buffer; } void sendRelease(); @@ -86,29 +83,19 @@ public: inline void setCommitted() { m_committed = true; } inline bool isDisplayed() const { return m_is_displayed; } - inline bool textureCreated() const { return m_texture; } - bool isDestroyed() { return m_destroyed; } - void createTexture(); -#ifdef QT_COMPOSITOR_WAYLAND_GL - inline GLuint texture() const; -#else - inline uint texture() const; -#endif - - void destroyTexture(); - inline struct ::wl_resource *waylandBufferHandle() const { return m_buffer; } - void handleAboutToBeDisplayed(); - void handleDisplayed(); - - void bufferWasDestroyed(); void setDestroyIfUnused(bool destroy); - void *handle() const; - QImage image(); + QSize size() const; + QWaylandSurface::Origin origin() const; + bool isShm() const { return wl_shm_buffer_get(m_buffer); } + + QImage image() const; + void bindToTexture() const; + private: void ref(); void deref(); @@ -124,47 +111,16 @@ private: bool m_destroyed; bool m_is_displayed; -#ifdef QT_COMPOSITOR_WAYLAND_GL - GLuint m_texture; -#else - uint m_texture; -#endif - void *m_handle; - mutable bool m_is_shm_resolved; - -#if (WAYLAND_VERSION_MAJOR >= 1) && (WAYLAND_VERSION_MINOR >= 2) - mutable struct ::wl_shm_buffer *m_shmBuffer; -#else - mutable struct ::wl_buffer *m_shmBuffer; -#endif - - mutable bool m_isSizeResolved; - mutable QSize m_size; + QAtomicInt m_refCount; bool m_used; bool m_destroyIfUnused; - QImage m_image; - static void destroy_listener_callback(wl_listener *listener, void *data); friend class ::QWaylandBufferRef; }; -#ifdef QT_COMPOSITOR_WAYLAND_GL -GLuint SurfaceBuffer::texture() const -{ - if (m_buffer) - return m_texture; - return 0; -} -#else -uint SurfaceBuffer::texture() const -{ - return 0; -} -#endif - } QT_END_NAMESPACE -- cgit v1.2.3 From ab6980d57609b1e4bdb164d3413faa2f7cb7e1e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Thu, 30 Jul 2015 12:05:12 +0200 Subject: Move the output from QWaylandSurface to the QWaylandSurfaceView and add a property called primaryOutput on the QWaylandSurface. Also add some bookkeeping in QtWayland::Output so it knows what surfaces and views it currently holds, sending the enter and leave events automatically. Change-Id: Ib6efbc6f8157657fb4451b751bba1cb5345b7906 --- src/compositor/wayland_wrapper/qwlcompositor.cpp | 12 +++- src/compositor/wayland_wrapper/qwlcompositor_p.h | 4 ++ src/compositor/wayland_wrapper/qwloutput.cpp | 75 +++++++++++++++----- src/compositor/wayland_wrapper/qwloutput_p.h | 25 +++++-- src/compositor/wayland_wrapper/qwlsurface.cpp | 90 ++++++------------------ src/compositor/wayland_wrapper/qwlsurface_p.h | 15 ++-- 6 files changed, 120 insertions(+), 101 deletions(-) (limited to 'src/compositor/wayland_wrapper') diff --git a/src/compositor/wayland_wrapper/qwlcompositor.cpp b/src/compositor/wayland_wrapper/qwlcompositor.cpp index 98f5aa1d4..22573b1a2 100644 --- a/src/compositor/wayland_wrapper/qwlcompositor.cpp +++ b/src/compositor/wayland_wrapper/qwlcompositor.cpp @@ -318,8 +318,6 @@ void Compositor::processWaylandEvents() void Compositor::destroySurface(Surface *surface) { - surface->removeFromOutput(); - waylandCompositor()->surfaceAboutToBeDestroyed(surface->waylandSurface()); m_destroyed_surfaces << surface->waylandSurface(); @@ -335,6 +333,12 @@ void Compositor::resetInputDevice(Surface *surface) } } +void Compositor::unregisterSurface(QWaylandSurface *surface) +{ + if (!m_all_surfaces.removeOne(surface)) + qWarning("%s Unexpected state. Cant find registered surface\n", Q_FUNC_INFO); +} + void Compositor::cleanupGraphicsResources() { qDeleteAll(m_destroyed_surfaces); @@ -345,7 +349,9 @@ void Compositor::compositor_create_surface(Resource *resource, uint32_t id) { QWaylandClient *client = QWaylandClient::fromWlClient(resource->client()); QWaylandSurface *surface = m_qt_compositor->createSurface(client, id, resource->version()); - primaryOutput()->addSurface(surface); + m_all_surfaces.append(surface); + if (primaryOutput()) + surface->setPrimaryOutput(primaryOutput()); emit m_qt_compositor->surfaceCreated(surface); } diff --git a/src/compositor/wayland_wrapper/qwlcompositor_p.h b/src/compositor/wayland_wrapper/qwlcompositor_p.h index 1eee9dc45..a9d7f99f9 100644 --- a/src/compositor/wayland_wrapper/qwlcompositor_p.h +++ b/src/compositor/wayland_wrapper/qwlcompositor_p.h @@ -157,6 +157,8 @@ public: static void bindGlobal(wl_client *client, void *data, uint32_t version, uint32_t id); void resetInputDevice(Surface *surface); + void unregisterSurface(QWaylandSurface *surface); + public slots: void cleanupGraphicsResources(); @@ -183,6 +185,8 @@ protected: /* Output */ QList m_outputs; + QList m_all_surfaces; + DataDeviceManager *m_data_device_manager; QElapsedTimer m_timer; diff --git a/src/compositor/wayland_wrapper/qwloutput.cpp b/src/compositor/wayland_wrapper/qwloutput.cpp index 1ff52ad5f..32a42b74e 100644 --- a/src/compositor/wayland_wrapper/qwloutput.cpp +++ b/src/compositor/wayland_wrapper/qwloutput.cpp @@ -47,6 +47,7 @@ #include #include +#include QT_BEGIN_NAMESPACE @@ -309,14 +310,22 @@ void Output::sendGeometryInfo() void Output::frameStarted() { - foreach (QWaylandSurface *surface, m_surfaces) - surface->handle()->frameStarted(); + for (int i = 0; i < m_surfaceViews.size(); i++) { + SurfaceViewMapper &surfacemapper = m_surfaceViews[i]; + if (surfacemapper.surface && (!surfacemapper.surface->primaryOutput() + || surfacemapper.surface->primaryOutput()->handle() == this)) + surfacemapper.surface->handle()->frameStarted(); + } } -void Output::sendFrameCallbacks(QList visibleSurfaces) +void Output::sendFrameCallbacks() { - foreach (QWaylandSurface *surface, visibleSurfaces) { - surface->handle()->sendFrameCallback(); + for (int i = 0; i < m_surfaceViews.size(); i++) { + const SurfaceViewMapper &surfacemapper = m_surfaceViews.at(i); + if (surfacemapper.surface && surfacemapper.surface->isMapped() + && (!surfacemapper.surface->primaryOutput() + || surfacemapper.surface->primaryOutput()->handle() == this)) + surfacemapper.surface->handle()->sendFrameCallback(); } wl_display_flush_clients(m_compositor->wl_display()); } @@ -325,32 +334,64 @@ QList Output::surfacesForClient(QWaylandClient *client) const { QList result; - foreach (QWaylandSurface *surface, m_surfaces) { - if (surface->client() == client) + for (int i = 0; i < m_surfaceViews.size(); i ++) { + if (m_surfaceViews.at(i).surface + && m_surfaceViews.at(i).surface->client() == client) result.append(result); } return result; } -void Output::addSurface(QWaylandSurface *surface) +void Output::addView(QWaylandSurfaceView *view) { - if (m_surfaces.contains(surface)) - return; + addView(view, view->surface()); +} - m_surfaces.append(surface); +void Output::addView(QWaylandSurfaceView *view, QWaylandSurface *surface) +{ + for (int i = 0; i < m_surfaceViews.size(); i++) { + if (surface == m_surfaceViews.at(i).surface) { + if (!m_surfaceViews.at(i).views.contains(view)) { + m_surfaceViews[i].views.append(view); + } + return; + } + } - surface->handle()->addToOutput(this); + SurfaceViewMapper surfaceViewMapper; + surfaceViewMapper.surface = surface; + surfaceViewMapper.views.append(view); + m_surfaceViews.append(surfaceViewMapper); + if (surface) + surface->enter(waylandOutput()); } -void Output::removeSurface(QWaylandSurface *surface) +void Output::removeView(QWaylandSurfaceView *view) { - if (!m_surfaces.contains(surface)) - return; + removeView(view, view->surface()); +} - m_surfaces.removeOne(surface); +void Output::removeView(QWaylandSurfaceView *view, QWaylandSurface *surface) +{ + for (int i = 0; i < m_surfaceViews.size(); i++) { + if (surface == m_surfaceViews.at(i).surface) { + bool removed = m_surfaceViews[i].views.removeOne(view); + if (m_surfaceViews.at(i).views.isEmpty() && removed) { + m_surfaceViews.remove(i); + if (surface) + surface->leave(waylandOutput()); + } + return; + } + } + qWarning("%s Could not find view %p for surface %p to remove. Possible invalid state", Q_FUNC_INFO, view, surface); +} - surface->handle()->removeFromOutput(this); +void Output::updateSurfaceForView(QWaylandSurfaceView *view, QWaylandSurface *newSurface, QWaylandSurface *oldSurface) +{ + removeView(view, oldSurface); + addView(view, newSurface); } } // namespace Wayland diff --git a/src/compositor/wayland_wrapper/qwloutput_p.h b/src/compositor/wayland_wrapper/qwloutput_p.h index 18c3801a5..30052c3b3 100644 --- a/src/compositor/wayland_wrapper/qwloutput_p.h +++ b/src/compositor/wayland_wrapper/qwloutput_p.h @@ -42,6 +42,7 @@ #include #include +#include #include #include @@ -54,6 +55,17 @@ namespace QtWayland { class Compositor; +struct SurfaceViewMapper +{ + SurfaceViewMapper() + : surface(0) + , views() + {} + + QWaylandSurface *surface; + QVector views; +}; + struct OutputResource : public QtWaylandServer::wl_output::Resource { OutputResource() {} @@ -104,12 +116,15 @@ public: void setScaleFactor(int scale); void frameStarted(); - void sendFrameCallbacks(QList visibleSurfaces); + void sendFrameCallbacks(); - QList surfaces() const { return m_surfaces; } QList surfacesForClient(QWaylandClient *client) const; - void addSurface(QWaylandSurface *surface); - void removeSurface(QWaylandSurface *surface); + + void addView(QWaylandSurfaceView *view); + void addView(QWaylandSurfaceView *view, QWaylandSurface *surface); + void removeView(QWaylandSurfaceView *view); + void removeView(QWaylandSurfaceView *view, QWaylandSurface *surface); + void updateSurfaceForView(QWaylandSurfaceView *view, QWaylandSurface *newSurface, QWaylandSurface *oldSurface); QWindow *window() const { return m_window; } @@ -120,6 +135,7 @@ public: void output_bind_resource(Resource *resource) Q_DECL_OVERRIDE; Resource *output_allocate() Q_DECL_OVERRIDE { return new OutputResource; } + const QVector surfaceMappers() const { return m_surfaceViews; } private: friend class QT_PREPEND_NAMESPACE(QWaylandOutput); @@ -131,6 +147,7 @@ private: QPoint m_position; QWaylandOutput::Mode m_mode; QRect m_availableGeometry; + QVector m_surfaceViews; QSize m_physicalSize; QWaylandOutput::Subpixel m_subpixel; QWaylandOutput::Transform m_transform; diff --git a/src/compositor/wayland_wrapper/qwlsurface.cpp b/src/compositor/wayland_wrapper/qwlsurface.cpp index 9ac0293ab..375a0f054 100644 --- a/src/compositor/wayland_wrapper/qwlsurface.cpp +++ b/src/compositor/wayland_wrapper/qwlsurface.cpp @@ -37,6 +37,9 @@ #include "qwlsurface_p.h" #include "qwaylandsurface.h" +#include "qwaylandsurface_p.h" +#include "qwaylandsurfaceview_p.h" +#include "qwaylandoutput.h" #include "qwlcompositor_p.h" #include "qwlinputdevice_p.h" #include "qwlextendedsurface_p.h" @@ -113,7 +116,7 @@ Surface::Surface(struct wl_client *client, uint32_t id, int version, QWaylandCom : QtWaylandServer::wl_surface(client, id, version) , m_compositor(compositor->handle()) , m_waylandSurface(surface) - , m_mainOutput(0) + , m_primaryOutput(0) , m_buffer(0) , m_surfaceMapped(false) , m_shellSurface(0) @@ -279,79 +282,21 @@ Compositor *Surface::compositor() const return m_compositor; } -Output *Surface::mainOutput() const -{ - if (!m_mainOutput) - return m_compositor->primaryOutput()->handle(); - return m_mainOutput; -} - -void Surface::setMainOutput(Output *output) -{ - m_mainOutput = output; -} - -QList Surface::outputs() const -{ - return m_outputs; -} - -void Surface::addToOutput(Output *output) -{ - if (!output) - return; - - if (!m_mainOutput) - m_mainOutput = output; - - if (m_outputs.contains(output)) - return; - - m_outputs.append(output); - - output->addSurface(waylandSurface()); - - QWaylandSurfaceEnterEvent event(output->waylandOutput()); - QCoreApplication::sendEvent(waylandSurface(), &event); - - // Send surface enter event - Q_FOREACH (Resource *resource, resourceMap().values()) { - QList outputs = output->resourceMap().values(); - for (int i = 0; i < outputs.size(); i++) - send_enter(resource->handle, outputs.at(i)->handle); - } -} - -void Surface::removeFromOutput(Output *output) +void Surface::setPrimaryOutput(Output *output) { - if (!output) - return; - - if (!m_outputs.contains(output)) + if (m_primaryOutput == output) return; - m_outputs.removeOne(output); - - if (m_mainOutput == output) - setMainOutput(Q_NULLPTR); + QWaylandOutput *new_output = output ? output->waylandOutput() : Q_NULLPTR; + QWaylandOutput *old_output = m_primaryOutput ? m_primaryOutput->waylandOutput() : Q_NULLPTR; + m_primaryOutput = output; - output->removeSurface(waylandSurface()); - QWaylandSurfaceLeaveEvent event(output->waylandOutput()); - QCoreApplication::sendEvent(waylandSurface(), &event); - - // Send surface leave event - Q_FOREACH (Resource *resource, resourceMap().values()) { - QList outputs = output->resourceMap().values(); - for (int i = 0; i < outputs.size(); i++) - send_leave(resource->handle, outputs.at(i)->handle); - } + waylandSurface()->primaryOutputChanged(new_output, old_output); } -void Surface::removeFromOutput() +Output *Surface::primaryOutput() const { - Q_FOREACH (Output *output, m_outputs) { - removeFromOutput(output); - } + return m_primaryOutput; } /*! @@ -440,6 +385,12 @@ Qt::ScreenOrientation Surface::contentOrientation() const return m_contentOrientation; } +void Surface::notifyViewsAboutDestruction() +{ + foreach (QWaylandSurfaceView *view, m_waylandSurface->views()) { + QWaylandSurfaceViewPrivate::get(view)->markSurfaceAsDestroyed(m_waylandSurface); + } +} void Surface::surface_destroy_resource(Resource *) { @@ -448,6 +399,8 @@ void Surface::surface_destroy_resource(Resource *) m_extendedSurface = 0; } + notifyViewsAboutDestruction(); + m_destroyed = true; m_waylandSurface->destroy(); emit m_waylandSurface->surfaceDestroyed(); @@ -512,6 +465,9 @@ void Surface::surface_commit(Resource *) m_inputRegion = m_pending.inputRegion.intersected(QRect(QPoint(), m_size)); emit m_waylandSurface->redraw(); + + if (primaryOutput()) + primaryOutput()->waylandOutput()->update(); } void Surface::surface_set_buffer_transform(Resource *resource, int32_t orientation) diff --git a/src/compositor/wayland_wrapper/qwlsurface_p.h b/src/compositor/wayland_wrapper/qwlsurface_p.h index 2ba1b1428..b7299d2b4 100644 --- a/src/compositor/wayland_wrapper/qwlsurface_p.h +++ b/src/compositor/wayland_wrapper/qwlsurface_p.h @@ -120,14 +120,8 @@ public: Compositor *compositor() const; - Output *mainOutput() const; - void setMainOutput(Output *output); - - QList outputs() const; - - void addToOutput(Output *output); - void removeFromOutput(Output *output); - void removeFromOutput(); + Output *primaryOutput() const; + void setPrimaryOutput(Output *output); QString className() const { return m_className; } void setClassName(const QString &className); @@ -161,6 +155,8 @@ public: QWaylandSurface::Origin origin() const { return m_buffer ? m_buffer->origin() : QWaylandSurface::OriginTopLeft; } QWaylandBufferRef currentBufferRef() const { return m_bufferRef; } + + void notifyViewsAboutDestruction(); protected: void surface_destroy_resource(Resource *resource) Q_DECL_OVERRIDE; @@ -182,8 +178,7 @@ protected: Compositor *m_compositor; QWaylandSurface *m_waylandSurface; - Output *m_mainOutput; - QList m_outputs; + Output *m_primaryOutput; QRegion m_damage; SurfaceBuffer *m_buffer; -- cgit v1.2.3 From fcd376a4ffb4a2efc8352ce1777e9f869e4e5206 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Thu, 30 Jul 2015 12:06:24 +0200 Subject: Introducing QWaylandOutputSpace Its purpose is to make it possible to have multiscreen environments, and also multiple multioutput environments It is also an abstraction to make it clear that outputs are arranged in a 2d space Change-Id: I418509996a03b2ca1a12aec9c9e25e143a15a10f --- src/compositor/wayland_wrapper/qwlcompositor.cpp | 59 ++++++++++------------ src/compositor/wayland_wrapper/qwlcompositor_p.h | 11 ++-- src/compositor/wayland_wrapper/qwldatadevice.cpp | 7 ++- src/compositor/wayland_wrapper/qwldatadevice_p.h | 3 ++ src/compositor/wayland_wrapper/qwlinputdevice.cpp | 11 ++++ src/compositor/wayland_wrapper/qwlinputdevice_p.h | 4 ++ src/compositor/wayland_wrapper/qwloutput.cpp | 42 ++++++++------- src/compositor/wayland_wrapper/qwloutput_p.h | 17 ++++--- src/compositor/wayland_wrapper/qwlshellsurface.cpp | 4 +- 9 files changed, 88 insertions(+), 70 deletions(-) (limited to 'src/compositor/wayland_wrapper') diff --git a/src/compositor/wayland_wrapper/qwlcompositor.cpp b/src/compositor/wayland_wrapper/qwlcompositor.cpp index 22573b1a2..e58c6e999 100644 --- a/src/compositor/wayland_wrapper/qwlcompositor.cpp +++ b/src/compositor/wayland_wrapper/qwlcompositor.cpp @@ -178,6 +178,7 @@ Compositor::Compositor(QWaylandCompositor *qt_compositor) , m_retainSelection(false) , m_initialized(false) { + m_outputSpaces.append(new QWaylandOutputSpace(qt_compositor)); m_timer.start(); compositor = this; @@ -237,7 +238,7 @@ Compositor::~Compositor() qWarning("QWaylandCompositor::cleanupGraphicsResources() must be called manually"); qDeleteAll(m_clients); - qDeleteAll(m_outputs); + qDeleteAll(m_outputSpaces); delete m_surfaceExtension; delete m_subSurfaceExtension; @@ -256,56 +257,50 @@ uint Compositor::currentTimeMsecs() const return m_timer.elapsed(); } -QList Compositor::outputs() const -{ - return m_outputs; -} - QWaylandOutput *Compositor::output(QWindow *window) const { - Q_FOREACH (QWaylandOutput *output, m_outputs) { - if (output->window() == window) + foreach (QWaylandOutputSpace *outputSpace, m_outputSpaces) { + QWaylandOutput *output = outputSpace->output(window); + if (output) return output; } return Q_NULLPTR; } -void Compositor::addOutput(QWaylandOutput *output) +QWaylandOutput *Compositor::primaryOutput() const { - Q_ASSERT(output->handle()); - - if (m_outputs.contains(output)) - return; - - m_outputs.append(output); + return primaryOutputSpace()->primaryOutput(); } -void Compositor::removeOutput(QWaylandOutput *output) +QWaylandOutputSpace *Compositor::primaryOutputSpace() const { - Q_ASSERT(output->handle()); - - m_outputs.removeOne(output); + Q_ASSERT(!m_outputSpaces.isEmpty()); + return m_outputSpaces.first(); } -QWaylandOutput *Compositor::primaryOutput() const +void Compositor::setPrimaryOutputSpace(QWaylandOutputSpace *outputSpace) { - if (m_outputs.size() == 0) - return Q_NULLPTR; - return m_outputs.at(0); + Q_ASSERT(!m_outputSpaces.isEmpty()); + if (m_outputSpaces.first() == outputSpace) + return; + if (m_outputSpaces.removeOne(outputSpace)) { + m_outputSpaces.prepend(outputSpace); + waylandCompositor()->primaryOutputSpaceChanged(); + } } -void Compositor::setPrimaryOutput(QWaylandOutput *output) +void Compositor::addOutputSpace(QWaylandOutputSpace *outputSpace) { - Q_ASSERT(output->handle()); - - int i = m_outputs.indexOf(output); - if (i <= 0) - return; + Q_ASSERT(!m_outputSpaces.contains(outputSpace)); + m_outputSpaces.append(outputSpace); + waylandCompositor()->outputSpacesChanged(); +} - m_outputs.removeAt(i); - m_outputs.prepend(output); - emit m_qt_compositor->primaryOutputChanged(); +void Compositor::removeOutputSpace(QWaylandOutputSpace *outputSpace) +{ + if (m_outputSpaces.removeOne(outputSpace)) + waylandCompositor()->outputSpacesChanged(); } void Compositor::processWaylandEvents() diff --git a/src/compositor/wayland_wrapper/qwlcompositor_p.h b/src/compositor/wayland_wrapper/qwlcompositor_p.h index a9d7f99f9..304cb94f7 100644 --- a/src/compositor/wayland_wrapper/qwlcompositor_p.h +++ b/src/compositor/wayland_wrapper/qwlcompositor_p.h @@ -105,14 +105,13 @@ public: uint currentTimeMsecs() const; - QList outputs() const; QWaylandOutput *output(QWindow *window) const; - void addOutput(QWaylandOutput *output); - void removeOutput(QWaylandOutput *output); - QWaylandOutput *primaryOutput() const; - void setPrimaryOutput(QWaylandOutput *output); + QWaylandOutputSpace *primaryOutputSpace() const; + void setPrimaryOutputSpace(QWaylandOutputSpace *outputSpace); + void addOutputSpace(QWaylandOutputSpace *outputSpace); + void removeOutputSpace(QWaylandOutputSpace *outputSpace); ClientBufferIntegration *clientBufferIntegration() const; ServerBufferIntegration *serverBufferIntegration() const; @@ -183,7 +182,7 @@ protected: QList m_inputDevices; /* Output */ - QList m_outputs; + QList m_outputSpaces; QList m_all_surfaces; diff --git a/src/compositor/wayland_wrapper/qwldatadevice.cpp b/src/compositor/wayland_wrapper/qwldatadevice.cpp index 73a93a8c8..c3a059f74 100644 --- a/src/compositor/wayland_wrapper/qwldatadevice.cpp +++ b/src/compositor/wayland_wrapper/qwldatadevice.cpp @@ -131,10 +131,10 @@ void DataDevice::sourceDestroyed(DataSource *source) void DataDevice::focus() { - QWaylandSurfaceView *focus = m_compositor->waylandCompositor()->pickView(m_pointer->currentPosition()); + QWaylandSurfaceView *focus = outputSpace()->pickView(m_pointer->currentPosition()); if (focus != m_dragFocus) - setDragFocus(focus, m_compositor->waylandCompositor()->mapToView(focus, m_pointer->currentPosition())); + setDragFocus(focus, outputSpace()->mapToView(focus, m_pointer->currentPosition())); } void DataDevice::motion(uint32_t time) @@ -144,8 +144,7 @@ void DataDevice::motion(uint32_t time) } if (m_dragFocusResource && m_dragFocus) { - const QPointF &surfacePoint = m_compositor->waylandCompositor()->mapToView(m_dragFocus, m_pointer->currentPosition()); - qDebug() << Q_FUNC_INFO << m_pointer->currentPosition() << surfacePoint; + const QPointF &surfacePoint = outputSpace()->mapToView(m_dragFocus, m_pointer->currentPosition()); send_motion(m_dragFocusResource->handle, time, wl_fixed_from_double(surfacePoint.x()), wl_fixed_from_double(surfacePoint.y())); } diff --git a/src/compositor/wayland_wrapper/qwldatadevice_p.h b/src/compositor/wayland_wrapper/qwldatadevice_p.h index 051e1eb3e..59a9d2b27 100644 --- a/src/compositor/wayland_wrapper/qwldatadevice_p.h +++ b/src/compositor/wayland_wrapper/qwldatadevice_p.h @@ -38,7 +38,9 @@ #define WLDATADEVICE_H #include +#include #include +#include QT_BEGIN_NAMESPACE @@ -72,6 +74,7 @@ protected: void data_device_set_selection(Resource *resource, struct ::wl_resource *source, uint32_t serial) Q_DECL_OVERRIDE; private: + QWaylandOutputSpace *outputSpace() const { return m_inputDevice->handle()->outputSpace(); } Compositor *m_compositor; InputDevice *m_inputDevice; diff --git a/src/compositor/wayland_wrapper/qwlinputdevice.cpp b/src/compositor/wayland_wrapper/qwlinputdevice.cpp index 5986b66ba..a4af463f7 100644 --- a/src/compositor/wayland_wrapper/qwlinputdevice.cpp +++ b/src/compositor/wayland_wrapper/qwlinputdevice.cpp @@ -60,6 +60,7 @@ InputDevice::InputDevice(QWaylandInputDevice *handle, Compositor *compositor, QW , m_handle(handle) , m_dragHandle(new QWaylandDrag(this)) , m_compositor(compositor) + , m_outputSpace(compositor->primaryOutputSpace()) , m_capabilities(caps) , m_pointer(m_capabilities & QWaylandInputDevice::Pointer ? new Pointer(m_compositor, this) : 0) , m_keyboard(m_capabilities & QWaylandInputDevice::Keyboard ? new Keyboard(m_compositor, this) : 0) @@ -366,6 +367,16 @@ const DataDevice *InputDevice::dataDevice() const return m_data_device.data(); } +QWaylandOutputSpace *InputDevice::outputSpace() const +{ + return m_outputSpace; +} + +void InputDevice::setOutputSpace(QWaylandOutputSpace *outputSpace) +{ + m_outputSpace = outputSpace; +} + } QT_END_NAMESPACE diff --git a/src/compositor/wayland_wrapper/qwlinputdevice_p.h b/src/compositor/wayland_wrapper/qwlinputdevice_p.h index b6637eaa2..da59dd208 100644 --- a/src/compositor/wayland_wrapper/qwlinputdevice_p.h +++ b/src/compositor/wayland_wrapper/qwlinputdevice_p.h @@ -103,6 +103,9 @@ public: void clientRequestedDataDevice(DataDeviceManager *dndSelection, struct wl_client *client, uint32_t id); const DataDevice *dataDevice() const; + QWaylandOutputSpace *outputSpace() const; + void setOutputSpace(QWaylandOutputSpace *outputSpace); + Compositor *compositor() const; QWaylandInputDevice *handle() const; QWaylandDrag *dragHandle() const; @@ -128,6 +131,7 @@ private: QWaylandInputDevice *m_handle; QScopedPointer m_dragHandle; Compositor *m_compositor; + QWaylandOutputSpace *m_outputSpace; QWaylandInputDevice::CapabilityFlags m_capabilities; QScopedPointer m_pointer; diff --git a/src/compositor/wayland_wrapper/qwloutput.cpp b/src/compositor/wayland_wrapper/qwloutput.cpp index 32a42b74e..76acfb2b5 100644 --- a/src/compositor/wayland_wrapper/qwloutput.cpp +++ b/src/compositor/wayland_wrapper/qwloutput.cpp @@ -99,11 +99,11 @@ static QtWaylandServer::wl_output::transform toWlTransform(const QWaylandOutput: return QtWaylandServer::wl_output::transform_normal; } -Output::Output(Compositor *compositor, QWindow *window) - : QtWaylandServer::wl_output(compositor->wl_display(), 2) - , m_compositor(compositor) +Output::Output(QWaylandOutput *output, QWaylandOutputSpace *outputSpace, QWindow *window) + : QtWaylandServer::wl_output(outputSpace->compositor()->waylandDisplay(), 2) , m_window(window) - , m_output(Q_NULLPTR) + , m_output(output) + , m_outputSpace(Q_NULLPTR) , m_position(QPoint()) , m_availableGeometry(QRect()) , m_physicalSize(QSize()) @@ -114,6 +114,7 @@ Output::Output(Compositor *compositor, QWindow *window) { m_mode.size = window ? window->size() : QSize(); m_mode.refreshRate = 60; + setOutputSpace(outputSpace, false); qRegisterMetaType("WaylandOutput::Mode"); } @@ -289,6 +290,24 @@ void Output::setScaleFactor(int scale) } } +void Output::setOutputSpace(QWaylandOutputSpace *outputSpace, bool setOutputSpace) +{ + if (m_outputSpace == outputSpace) + return; + + if (m_outputSpace) { + m_outputSpace->removeOutput(waylandOutput()); + } + + m_outputSpace = outputSpace; + + if (outputSpace && setOutputSpace) { + outputSpace->addOutput(waylandOutput()); + } + + waylandOutput()->outputSpaceChanged(); +} + OutputResource *Output::outputForClient(wl_client *client) const { return static_cast(resourceMap().value(client)); @@ -327,20 +346,7 @@ void Output::sendFrameCallbacks() || surfacemapper.surface->primaryOutput()->handle() == this)) surfacemapper.surface->handle()->sendFrameCallback(); } - wl_display_flush_clients(m_compositor->wl_display()); -} - -QList Output::surfacesForClient(QWaylandClient *client) const -{ - QList result; - - for (int i = 0; i < m_surfaceViews.size(); i ++) { - if (m_surfaceViews.at(i).surface - && m_surfaceViews.at(i).surface->client() == client) - result.append(result); - } - - return result; + wl_display_flush_clients(compositor()->waylandDisplay()); } void Output::addView(QWaylandSurfaceView *view) diff --git a/src/compositor/wayland_wrapper/qwloutput_p.h b/src/compositor/wayland_wrapper/qwloutput_p.h index 30052c3b3..917240c1f 100644 --- a/src/compositor/wayland_wrapper/qwloutput_p.h +++ b/src/compositor/wayland_wrapper/qwloutput_p.h @@ -44,6 +44,8 @@ #include #include +#include + #include #include @@ -74,11 +76,11 @@ struct OutputResource : public QtWaylandServer::wl_output::Resource class Output : public QtWaylandServer::wl_output { public: - explicit Output(Compositor *compositor, QWindow *window = 0); + Output(QWaylandOutput *output, QWaylandOutputSpace *outputSpace, QWindow *window); - Compositor *compositor() const { return m_compositor; } + QWaylandCompositor *compositor() const { return m_outputSpace->compositor(); } - QWaylandOutput *output() const { return m_output; } + QWaylandOutput *waylandOutput() const { return m_output; } QString manufacturer() const { return m_manufacturer; } void setManufacturer(const QString &manufacturer); @@ -115,11 +117,12 @@ public: int scaleFactor() const { return m_scaleFactor; } void setScaleFactor(int scale); + void setOutputSpace(QWaylandOutputSpace *outputSpace, bool setOutputSpace); + QWaylandOutputSpace *outputSpace() const { return m_outputSpace; } + void frameStarted(); void sendFrameCallbacks(); - QList surfacesForClient(QWaylandClient *client) const; - void addView(QWaylandSurfaceView *view); void addView(QWaylandSurfaceView *view, QWaylandSurface *surface); void removeView(QWaylandSurfaceView *view); @@ -130,8 +133,6 @@ public: OutputResource *outputForClient(struct wl_client *client) const; - QWaylandOutput *waylandOutput() const { return m_output; } - void output_bind_resource(Resource *resource) Q_DECL_OVERRIDE; Resource *output_allocate() Q_DECL_OVERRIDE { return new OutputResource; } @@ -139,9 +140,9 @@ public: private: friend class QT_PREPEND_NAMESPACE(QWaylandOutput); - Compositor *m_compositor; QWindow *m_window; QWaylandOutput *m_output; + QWaylandOutputSpace *m_outputSpace; QString m_manufacturer; QString m_model; QPoint m_position; diff --git a/src/compositor/wayland_wrapper/qwlshellsurface.cpp b/src/compositor/wayland_wrapper/qwlshellsurface.cpp index bc75ab4c3..2fe666442 100644 --- a/src/compositor/wayland_wrapper/qwlshellsurface.cpp +++ b/src/compositor/wayland_wrapper/qwlshellsurface.cpp @@ -295,7 +295,7 @@ void ShellSurface::shell_surface_set_fullscreen(Resource *resource, : Q_NULLPTR; if (!output) { // Look for an output that can contain this surface - Q_FOREACH (QWaylandOutput *curOutput, m_surface->compositor()->outputs()) { + Q_FOREACH (QWaylandOutput *curOutput, m_surface->compositor()->primaryOutputSpace()->outputs()) { if (curOutput->geometry().size().width() >= m_surface->size().width() && curOutput->geometry().size().height() >= m_surface->size().height()) { output = curOutput; @@ -343,7 +343,7 @@ void ShellSurface::shell_surface_set_maximized(Resource *resource, : Q_NULLPTR; if (!output) { // Look for an output that can contain this surface - Q_FOREACH (QWaylandOutput *curOutput, m_surface->compositor()->outputs()) { + Q_FOREACH (QWaylandOutput *curOutput, m_surface->compositor()->primaryOutputSpace()->outputs()) { if (curOutput->geometry().size().width() >= m_surface->size().width() && curOutput->geometry().size().height() >= m_surface->size().height()) { output = curOutput; -- cgit v1.2.3 From b980ca33c94c62a714a55a73835af6735a3b8a11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Wed, 25 Mar 2015 09:04:17 +0100 Subject: Default shell surface view to the primaryOutput of the surface Change-Id: Ifeaafadb7d90256e282891047364b6fa9a95d66a --- src/compositor/wayland_wrapper/qwlshellsurface.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/compositor/wayland_wrapper') diff --git a/src/compositor/wayland_wrapper/qwlshellsurface.cpp b/src/compositor/wayland_wrapper/qwlshellsurface.cpp index 2fe666442..09316358b 100644 --- a/src/compositor/wayland_wrapper/qwlshellsurface.cpp +++ b/src/compositor/wayland_wrapper/qwlshellsurface.cpp @@ -96,6 +96,7 @@ ShellSurface::ShellSurface(Shell *shell, wl_client *client, uint32_t id, Surface , m_popupSerial() { m_view = surface->compositor()->waylandCompositor()->createSurfaceView(surface->waylandSurface()); + m_view->setOutput(surface->waylandSurface()->primaryOutput()); connect(surface->waylandSurface(), &QWaylandSurface::configure, this, &ShellSurface::configure); connect(surface->waylandSurface(), &QWaylandSurface::mapped, this, &ShellSurface::mapped); connect(surface->waylandSurface(), &QWaylandSurface::offsetForNextFrame, this, &ShellSurface::adjustOffset); -- cgit v1.2.3 From 6de8c7a17b9b0a565bcb274399c57b365d50542d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Wed, 25 Mar 2015 09:04:34 +0100 Subject: Allow CurrentPosition to not having a current view QWindowCompositor isn't to causious about mouse grabbing, and segfaults if resizing stops when mouse cursor is outside of the window Change-Id: I227df4d63e41f18024776c7d6e2e5de19ee48fbc --- src/compositor/wayland_wrapper/qwlpointer_p.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/compositor/wayland_wrapper') diff --git a/src/compositor/wayland_wrapper/qwlpointer_p.h b/src/compositor/wayland_wrapper/qwlpointer_p.h index 6eec25906..5fe1fc99e 100644 --- a/src/compositor/wayland_wrapper/qwlpointer_p.h +++ b/src/compositor/wayland_wrapper/qwlpointer_p.h @@ -83,11 +83,10 @@ public: void updatePosition(const QPointF &position) { - Q_ASSERT(m_view || position.isNull()); m_point = position; //we adjust if the mouse position is on the edge //to work around Qt's event propogation - if (position.isNull()) + if (!m_view || position.isNull()) return; if (m_view->surface()) { QSizeF size(m_view->surface()->size()); -- cgit v1.2.3 From ce58545b220a49354533a27ef79cdbc8d50186cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Thu, 30 Jul 2015 14:53:35 +0200 Subject: Rework how we manage extensions Change-Id: If2cbf096e7419bc1bda007d5167ce39d1a5d50ae --- src/compositor/wayland_wrapper/qwlcompositor.cpp | 63 +-- src/compositor/wayland_wrapper/qwlcompositor_p.h | 19 - .../wayland_wrapper/qwlextendedsurface.cpp | 197 -------- .../wayland_wrapper/qwlextendedsurface_p.h | 128 ----- src/compositor/wayland_wrapper/qwlinputdevice.cpp | 6 +- src/compositor/wayland_wrapper/qwlinputmethod.cpp | 18 +- src/compositor/wayland_wrapper/qwlinputpanel.cpp | 123 ----- src/compositor/wayland_wrapper/qwlinputpanel_p.h | 90 ---- .../wayland_wrapper/qwlinputpanelsurface.cpp | 87 ---- .../wayland_wrapper/qwlinputpanelsurface_p.h | 83 --- src/compositor/wayland_wrapper/qwloutput.cpp | 1 - src/compositor/wayland_wrapper/qwloutput_p.h | 4 +- src/compositor/wayland_wrapper/qwlpointer.cpp | 3 - src/compositor/wayland_wrapper/qwlqtkey.cpp | 77 --- src/compositor/wayland_wrapper/qwlqtkey_p.h | 69 --- src/compositor/wayland_wrapper/qwlqttouch.cpp | 157 ------ src/compositor/wayland_wrapper/qwlqttouch_p.h | 78 --- src/compositor/wayland_wrapper/qwlshellsurface.cpp | 562 --------------------- src/compositor/wayland_wrapper/qwlshellsurface_p.h | 225 --------- src/compositor/wayland_wrapper/qwlsubsurface_p.h | 129 ----- src/compositor/wayland_wrapper/qwlsurface.cpp | 31 -- src/compositor/wayland_wrapper/qwlsurface_p.h | 8 - src/compositor/wayland_wrapper/qwltextinput.cpp | 201 -------- src/compositor/wayland_wrapper/qwltextinput_p.h | 93 ---- .../wayland_wrapper/qwltextinputmanager.cpp | 63 --- .../wayland_wrapper/qwltextinputmanager_p.h | 65 --- src/compositor/wayland_wrapper/wayland_wrapper.pri | 23 - 27 files changed, 36 insertions(+), 2567 deletions(-) delete mode 100644 src/compositor/wayland_wrapper/qwlextendedsurface.cpp delete mode 100644 src/compositor/wayland_wrapper/qwlextendedsurface_p.h delete mode 100644 src/compositor/wayland_wrapper/qwlinputpanel.cpp delete mode 100644 src/compositor/wayland_wrapper/qwlinputpanel_p.h delete mode 100644 src/compositor/wayland_wrapper/qwlinputpanelsurface.cpp delete mode 100644 src/compositor/wayland_wrapper/qwlinputpanelsurface_p.h delete mode 100644 src/compositor/wayland_wrapper/qwlqtkey.cpp delete mode 100644 src/compositor/wayland_wrapper/qwlqtkey_p.h delete mode 100644 src/compositor/wayland_wrapper/qwlqttouch.cpp delete mode 100644 src/compositor/wayland_wrapper/qwlqttouch_p.h delete mode 100644 src/compositor/wayland_wrapper/qwlshellsurface.cpp delete mode 100644 src/compositor/wayland_wrapper/qwlshellsurface_p.h delete mode 100644 src/compositor/wayland_wrapper/qwlsubsurface_p.h delete mode 100644 src/compositor/wayland_wrapper/qwltextinput.cpp delete mode 100644 src/compositor/wayland_wrapper/qwltextinput_p.h delete mode 100644 src/compositor/wayland_wrapper/qwltextinputmanager.cpp delete mode 100644 src/compositor/wayland_wrapper/qwltextinputmanager_p.h (limited to 'src/compositor/wayland_wrapper') diff --git a/src/compositor/wayland_wrapper/qwlcompositor.cpp b/src/compositor/wayland_wrapper/qwlcompositor.cpp index e58c6e999..2de42fc2d 100644 --- a/src/compositor/wayland_wrapper/qwlcompositor.cpp +++ b/src/compositor/wayland_wrapper/qwlcompositor.cpp @@ -51,11 +51,10 @@ #include "qwlqttouch_p.h" #include "qwlqtkey_p.h" #include "qwlinputdevice_p.h" -#include "qwlinputpanel_p.h" #include "qwlregion_p.h" #include "qwlpointer_p.h" #include "qwltextinputmanager_p.h" -#include "qwaylandglobalinterface.h" +#include #include "qwaylandsurfaceview.h" #include "qwaylandshmformathelper.h" #include "qwaylandoutput.h" @@ -90,7 +89,7 @@ #include "hardware_integration/qwlclientbufferintegration_p.h" #include "hardware_integration/qwlserverbufferintegration_p.h" #endif -#include "windowmanagerprotocol/waylandwindowmanagerintegration_p.h" +#include "extensions/qwaylandwindowmanagerextension.h" #include "hardware_integration/qwlclientbufferintegrationfactory_p.h" #include "hardware_integration/qwlserverbufferintegrationfactory_p.h" @@ -167,13 +166,6 @@ Compositor::Compositor(QWaylandCompositor *qt_compositor) , m_client_buffer_integration(0) , m_server_buffer_integration(0) #endif - , m_windowManagerIntegration(0) - , m_surfaceExtension(0) - , m_subSurfaceExtension(0) - , m_touchExtension(0) - , m_qtkeyExtension(0) - , m_textInputManager() - , m_inputPanel() , m_eventHandler(new WindowSystemEventHandler(this)) , m_retainSelection(false) , m_initialized(false) @@ -240,11 +232,6 @@ Compositor::~Compositor() qDeleteAll(m_outputSpaces); - delete m_surfaceExtension; - delete m_subSurfaceExtension; - delete m_touchExtension; - delete m_qtkeyExtension; - removeInputDevice(m_default_wayland_input_device); delete m_default_wayland_input_device; delete m_data_device_manager; @@ -361,8 +348,9 @@ void Compositor::destroyClient(QWaylandClient *client) if (!client) return; - if (m_windowManagerIntegration) - m_windowManagerIntegration->sendQuitMessage(client->client()); + WindowManagerServerIntegration *wmExtension = static_cast(waylandCompositor()->extension(QtWaylandServer::qt_windowmanager::name())); + if (wmExtension) + wmExtension->sendQuitMessage(client->client()); wl_client_destroy(client->client()); } @@ -404,20 +392,23 @@ void Compositor::initializeHardwareIntegration() void Compositor::initializeExtensions() { if (m_extensions & QWaylandCompositor::SurfaceExtension) - m_surfaceExtension = new SurfaceExtensionGlobal(this); + new SurfaceExtensionGlobal(this); if (m_extensions & QWaylandCompositor::SubSurfaceExtension) - m_subSurfaceExtension = new SubSurfaceExtensionGlobal(this); + new SubSurfaceExtensionGlobal(waylandCompositor()); if (m_extensions & QWaylandCompositor::TouchExtension) - m_touchExtension = new TouchExtensionGlobal(this); + new TouchExtensionGlobal(this); if (m_extensions & QWaylandCompositor::QtKeyExtension) - m_qtkeyExtension = new QtKeyExtensionGlobal(this); + new QtKeyExtensionGlobal(this); if (m_extensions & QWaylandCompositor::TextInputExtension) { - m_textInputManager.reset(new TextInputManager(this)); - m_inputPanel.reset(new InputPanel(this)); + new TextInputManager(this); + new QWaylandInputPanel(waylandCompositor()); } if (m_extensions & QWaylandCompositor::WindowManagerExtension) { - m_windowManagerIntegration = new WindowManagerServerIntegration(m_qt_compositor, this); - m_windowManagerIntegration->initialize(m_display); + WindowManagerServerIntegration *wmint = new WindowManagerServerIntegration(m_qt_compositor, this); + wmint->initialize(m_display); + } + if (m_extensions & QWaylandCompositor::DefaultShellExtension) { + new Shell(waylandCompositor()); } } @@ -434,8 +425,9 @@ QList Compositor::clients() const void Compositor::setClientFullScreenHint(bool value) { - if (m_windowManagerIntegration) - m_windowManagerIntegration->setShowIsFullScreen(value); + WindowManagerServerIntegration *wmExtension = static_cast(waylandCompositor()->extension(QtWaylandServer::qt_windowmanager::name())); + if (wmExtension) + wmExtension->setShowIsFullScreen(value); } QWaylandCompositor::ExtensionFlags Compositor::extensions() const @@ -449,17 +441,6 @@ InputDevice* Compositor::defaultInputDevice() return m_inputDevices.last()->handle(); } -void Compositor::configureTouchExtension(int flags) -{ - if (m_touchExtension) - m_touchExtension->setFlags(flags); -} - -InputPanel *Compositor::inputPanel() const -{ - return m_inputPanel.data(); -} - DataDeviceManager *Compositor::dataDeviceManager() const { return m_data_device_manager; @@ -505,12 +486,6 @@ void Compositor::sendDragEndEvent() // Drag::instance()->dragEnd(); } -void Compositor::bindGlobal(wl_client *client, void *data, uint32_t version, uint32_t id) -{ - QWaylandGlobalInterface *iface = static_cast(data); - iface->bind(client, qMin(iface->version(), version), id); -}; - void Compositor::loadClientBufferIntegration() { #ifdef QT_COMPOSITOR_WAYLAND_GL diff --git a/src/compositor/wayland_wrapper/qwlcompositor_p.h b/src/compositor/wayland_wrapper/qwlcompositor_p.h index 304cb94f7..0862477e4 100644 --- a/src/compositor/wayland_wrapper/qwlcompositor_p.h +++ b/src/compositor/wayland_wrapper/qwlcompositor_p.h @@ -71,7 +71,6 @@ class SurfaceBuffer; class InputDevice; class DataDeviceManager; class SurfaceExtensionGlobal; -class SubSurfaceExtensionGlobal; class TouchExtensionGlobal; class QtKeyExtensionGlobal; class TextInputManager; @@ -129,17 +128,10 @@ public: QList clients() const; - WindowManagerServerIntegration *windowManagerIntegration() const { return m_windowManagerIntegration; } - void setClientFullScreenHint(bool value); QWaylandCompositor::ExtensionFlags extensions() const; - TouchExtensionGlobal *touchExtension() { return m_touchExtension; } - void configureTouchExtension(int flags); - - QtKeyExtensionGlobal *qtkeyExtension() { return m_qtkeyExtension; } - InputPanel *inputPanel() const; DataDeviceManager *dataDeviceManager() const; @@ -153,7 +145,6 @@ public: void overrideSelection(const QMimeData *data); void feedRetainedSelectionData(QMimeData *data); - static void bindGlobal(wl_client *client, void *data, uint32_t version, uint32_t id); void resetInputDevice(Surface *surface); void unregisterSurface(QWaylandSurface *surface); @@ -207,16 +198,6 @@ protected: QScopedPointer m_server_buffer_integration; #endif - //extensions - WindowManagerServerIntegration *m_windowManagerIntegration; - - SurfaceExtensionGlobal *m_surfaceExtension; - SubSurfaceExtensionGlobal *m_subSurfaceExtension; - TouchExtensionGlobal *m_touchExtension; - QtKeyExtensionGlobal *m_qtkeyExtension; - QScopedPointer m_textInputManager; - QScopedPointer m_inputPanel; - QList m_globals; QScopedPointer m_eventHandler; static void bind_func(struct wl_client *client, void *data, diff --git a/src/compositor/wayland_wrapper/qwlextendedsurface.cpp b/src/compositor/wayland_wrapper/qwlextendedsurface.cpp deleted file mode 100644 index 8b06cb182..000000000 --- a/src/compositor/wayland_wrapper/qwlextendedsurface.cpp +++ /dev/null @@ -1,197 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the QtWaylandCompositor module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPLv3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qwlextendedsurface_p.h" - -#include "qwlcompositor_p.h" -#include "qwlsurface_p.h" - -QT_BEGIN_NAMESPACE - -namespace QtWayland { - -SurfaceExtensionGlobal::SurfaceExtensionGlobal(Compositor *compositor) - : QtWaylandServer::qt_surface_extension(compositor->wl_display(), 1) -{ -} - -void SurfaceExtensionGlobal::surface_extension_get_extended_surface(Resource *resource, - uint32_t id, - struct wl_resource *surface_resource) -{ - Surface *surface = Surface::fromResource(surface_resource); - new ExtendedSurface(resource->client(),id, wl_resource_get_version(resource->handle), surface); -} - -ExtendedSurface::ExtendedSurface(struct wl_client *client, uint32_t id, int version, Surface *surface) - : QWaylandSurfaceInterface(surface->waylandSurface()) - , QtWaylandServer::qt_extended_surface(client, id, version) - , m_surface(surface) - , m_windowFlags(0) -{ - Q_ASSERT(surface->extendedSurface() == 0); - surface->setExtendedSurface(this); -} - -ExtendedSurface::~ExtendedSurface() -{ - if (m_surface) - m_surface->setExtendedSurface(0); -} - -void ExtendedSurface::sendGenericProperty(const QString &name, const QVariant &variant) -{ - QByteArray byteValue; - QDataStream ds(&byteValue, QIODevice::WriteOnly); - ds << variant; - send_set_generic_property(name, byteValue); - -} - -void ExtendedSurface::setVisibility(QWindow::Visibility visibility) -{ - // If this change came from the client, we shouldn't update it - send_onscreen_visibility(visibility); -} - -void ExtendedSurface::setParentSurface(Surface *surface) -{ - m_surface = surface; -} - -bool ExtendedSurface::runOperation(QWaylandSurfaceOp *op) -{ - switch (op->type()) { - case QWaylandSurfaceOp::Close: - send_close(); - return true; - case QWaylandSurfaceOp::SetVisibility: - setVisibility(static_cast(op)->visibility()); - return true; - default: - break; - } - return false; -} - -void ExtendedSurface::extended_surface_update_generic_property(Resource *resource, - const QString &name, - struct wl_array *value) -{ - Q_UNUSED(resource); - QVariant variantValue; - QByteArray byteValue((const char*)value->data, value->size); - QDataStream ds(&byteValue, QIODevice::ReadOnly); - ds >> variantValue; - setWindowProperty(name,variantValue,false); -} - -Qt::ScreenOrientations ExtendedSurface::contentOrientationMask() const -{ - return m_contentOrientationMask; -} - -void ExtendedSurface::extended_surface_set_content_orientation_mask(Resource *resource, int32_t orientation) -{ - Q_UNUSED(resource); - Qt::ScreenOrientations mask = 0; - if (orientation & QT_EXTENDED_SURFACE_ORIENTATION_PORTRAITORIENTATION) - mask |= Qt::PortraitOrientation; - if (orientation & QT_EXTENDED_SURFACE_ORIENTATION_LANDSCAPEORIENTATION) - mask |= Qt::LandscapeOrientation; - if (orientation & QT_EXTENDED_SURFACE_ORIENTATION_INVERTEDPORTRAITORIENTATION) - mask |= Qt::InvertedPortraitOrientation; - if (orientation & QT_EXTENDED_SURFACE_ORIENTATION_INVERTEDLANDSCAPEORIENTATION) - mask |= Qt::InvertedLandscapeOrientation; - if (orientation & QT_EXTENDED_SURFACE_ORIENTATION_PRIMARYORIENTATION) - mask |= Qt::PrimaryOrientation; - - Qt::ScreenOrientations oldMask = m_contentOrientationMask; - m_contentOrientationMask = mask; - - if (m_surface && mask != oldMask) - emit m_surface->waylandSurface()->orientationUpdateMaskChanged(); -} - -QVariantMap ExtendedSurface::windowProperties() const -{ - return m_windowProperties; -} - -QVariant ExtendedSurface::windowProperty(const QString &propertyName) const -{ - QVariantMap props = m_windowProperties; - return props.value(propertyName); -} - -void ExtendedSurface::setWindowProperty(const QString &name, const QVariant &value, bool writeUpdateToClient) -{ - m_windowProperties.insert(name, value); - m_surface->waylandSurface()->windowPropertyChanged(name,value); - if (writeUpdateToClient) - sendGenericProperty(name, value); -} - -void ExtendedSurface::extended_surface_set_window_flags(Resource *resource, int32_t flags) -{ - Q_UNUSED(resource); - QWaylandSurface::WindowFlags windowFlags(flags); - if (!m_surface || windowFlags == m_windowFlags) - return; - m_windowFlags = windowFlags; - emit m_surface->waylandSurface()->windowFlagsChanged(windowFlags); -} - -void ExtendedSurface::extended_surface_destroy_resource(Resource *) -{ - delete this; -} - -void ExtendedSurface::extended_surface_raise(Resource *) -{ - if (m_surface) - emit m_surface->waylandSurface()->raiseRequested(); -} - -void ExtendedSurface::extended_surface_lower(Resource *) -{ - if (m_surface) - emit m_surface->waylandSurface()->lowerRequested(); -} - -} - -QT_END_NAMESPACE diff --git a/src/compositor/wayland_wrapper/qwlextendedsurface_p.h b/src/compositor/wayland_wrapper/qwlextendedsurface_p.h deleted file mode 100644 index 524a4d6e8..000000000 --- a/src/compositor/wayland_wrapper/qwlextendedsurface_p.h +++ /dev/null @@ -1,128 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the QtWaylandCompositor module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPLv3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef WLEXTENDEDSURFACE_H -#define WLEXTENDEDSURFACE_H - -#include - -#include -#include -#include -#include - -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class QWaylandSurface; - -namespace QtWayland { - -class Compositor; - -class SurfaceExtensionGlobal : public QtWaylandServer::qt_surface_extension -{ -public: - SurfaceExtensionGlobal(Compositor *compositor); - -private: - void surface_extension_get_extended_surface(Resource *resource, - uint32_t id, - struct wl_resource *surface); - -}; - -class ExtendedSurface : public QWaylandSurfaceInterface, public QtWaylandServer::qt_extended_surface -{ -public: - ExtendedSurface(struct wl_client *client, uint32_t id, int version, Surface *surface); - ~ExtendedSurface(); - - void sendGenericProperty(const QString &name, const QVariant &variant); - - void setVisibility(QWindow::Visibility visibility); - - void setSubSurface(ExtendedSurface *subSurface,int x, int y); - void removeSubSurface(ExtendedSurface *subSurfaces); - ExtendedSurface *parent() const; - void setParent(ExtendedSurface *parent); - QLinkedList subSurfaces() const; - void setParentSurface(Surface *s); - - Qt::ScreenOrientations contentOrientationMask() const; - - QWaylandSurface::WindowFlags windowFlags() const { return m_windowFlags; } - - QVariantMap windowProperties() const; - QVariant windowProperty(const QString &propertyName) const; - void setWindowProperty(const QString &name, const QVariant &value, bool writeUpdateToClient = true); - -protected: - bool runOperation(QWaylandSurfaceOp *op) Q_DECL_OVERRIDE; - -private: - Surface *m_surface; - - Qt::ScreenOrientations m_contentOrientationMask; - - QWaylandSurface::WindowFlags m_windowFlags; - - QByteArray m_authenticationToken; - QVariantMap m_windowProperties; - - void extended_surface_update_generic_property(Resource *resource, - const QString &name, - struct wl_array *value) Q_DECL_OVERRIDE; - - void extended_surface_set_content_orientation_mask(Resource *resource, - int32_t orientation) Q_DECL_OVERRIDE; - - void extended_surface_set_window_flags(Resource *resource, - int32_t flags) Q_DECL_OVERRIDE; - - void extended_surface_destroy_resource(Resource *) Q_DECL_OVERRIDE; - void extended_surface_raise(Resource *) Q_DECL_OVERRIDE; - void extended_surface_lower(Resource *) Q_DECL_OVERRIDE; -}; - -} - -QT_END_NAMESPACE - -#endif // WLEXTENDEDSURFACE_H diff --git a/src/compositor/wayland_wrapper/qwlinputdevice.cpp b/src/compositor/wayland_wrapper/qwlinputdevice.cpp index a4af463f7..2e1720a9f 100644 --- a/src/compositor/wayland_wrapper/qwlinputdevice.cpp +++ b/src/compositor/wayland_wrapper/qwlinputdevice.cpp @@ -247,7 +247,7 @@ void InputDevice::sendFullKeyEvent(QKeyEvent *event) return; } - QtKeyExtensionGlobal *ext = m_compositor->qtkeyExtension(); + QtKeyExtensionGlobal *ext = QtKeyExtensionGlobal::get(m_compositor->waylandCompositor()); if (ext && ext->postQtKeyEvent(event, keyboardFocus())) return; @@ -261,7 +261,7 @@ void InputDevice::sendFullKeyEvent(QKeyEvent *event) void InputDevice::sendFullKeyEvent(Surface *surface, QKeyEvent *event) { - QtKeyExtensionGlobal *ext = m_compositor->qtkeyExtension(); + QtKeyExtensionGlobal *ext = QtKeyExtensionGlobal::get(m_compositor->waylandCompositor()); if (ext) ext->postQtKeyEvent(event, surface); } @@ -278,7 +278,7 @@ void InputDevice::sendFullTouchEvent(QTouchEvent *event) return; } - TouchExtensionGlobal *ext = m_compositor->touchExtension(); + TouchExtensionGlobal *ext = TouchExtensionGlobal::get(m_compositor->waylandCompositor()); if (ext && ext->postTouchEvent(event, mouseFocus())) return; diff --git a/src/compositor/wayland_wrapper/qwlinputmethod.cpp b/src/compositor/wayland_wrapper/qwlinputmethod.cpp index f17008f65..187c4e13d 100644 --- a/src/compositor/wayland_wrapper/qwlinputmethod.cpp +++ b/src/compositor/wayland_wrapper/qwlinputmethod.cpp @@ -78,9 +78,12 @@ void InputMethod::activate(TextInput *textInput) send_activate(m_resource->handle, m_context->resource()->handle); - m_compositor->inputPanel()->setFocus(textInput->focus()); - m_compositor->inputPanel()->setCursorRectangle(textInput->cursorRectangle()); - m_compositor->inputPanel()->setInputPanelVisible(textInput->inputPanelVisible()); + QWaylandInputPanelPrivate *panel = QWaylandInputPanelPrivate::get(m_compositor->waylandCompositor()); + if (panel) { + panel->setFocus(textInput->focus()); + panel->setCursorRectangle(textInput->cursorRectangle()); + panel->setInputPanelVisible(textInput->inputPanelVisible()); + } } void InputMethod::deactivate() @@ -94,9 +97,12 @@ void InputMethod::deactivate() m_textInput = 0; m_context = 0; - m_compositor->inputPanel()->setFocus(0); - m_compositor->inputPanel()->setCursorRectangle(QRect()); - m_compositor->inputPanel()->setInputPanelVisible(false); + QWaylandInputPanelPrivate *panel = QWaylandInputPanelPrivate::get(m_compositor->waylandCompositor()); + if (panel) { + panel->setFocus(0); + panel->setCursorRectangle(QRect()); + panel->setInputPanelVisible(false); + } } void InputMethod::focusChanged(Surface *surface) diff --git a/src/compositor/wayland_wrapper/qwlinputpanel.cpp b/src/compositor/wayland_wrapper/qwlinputpanel.cpp deleted file mode 100644 index 65befd41c..000000000 --- a/src/compositor/wayland_wrapper/qwlinputpanel.cpp +++ /dev/null @@ -1,123 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Klarälvdalens Datakonsult AB (KDAB). -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the QtWaylandCompositor module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPLv3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qwlinputpanel_p.h" - -#include - -#include "qwlcompositor_p.h" -#include "qwlinputdevice_p.h" -#include "qwlinputmethod_p.h" -#include "qwlinputpanelsurface_p.h" -#include "qwlsurface_p.h" -#include "qwltextinput_p.h" - -QT_BEGIN_NAMESPACE - -namespace QtWayland { - -InputPanel::InputPanel(Compositor *compositor) - : QtWaylandServer::wl_input_panel(compositor->wl_display(), 1) - , m_compositor(compositor) - , m_handle(new QWaylandInputPanel(this)) - , m_focus() - , m_inputPanelVisible(false) - , m_cursorRectangle() -{ -} - -InputPanel::~InputPanel() -{ -} - -QWaylandInputPanel *InputPanel::handle() const -{ - return m_handle.data(); -} - -Surface *InputPanel::focus() const -{ - return m_focus; -} - -void InputPanel::setFocus(Surface *focus) -{ - if (m_focus == focus) - return; - - m_focus = focus; - - Q_EMIT handle()->focusChanged(); -} - -bool InputPanel::inputPanelVisible() const -{ - return m_inputPanelVisible; -} - -void InputPanel::setInputPanelVisible(bool inputPanelVisible) -{ - if (m_inputPanelVisible == inputPanelVisible) - return; - - m_inputPanelVisible = inputPanelVisible; - - Q_EMIT handle()->visibleChanged(); -} - -QRect InputPanel::cursorRectangle() const -{ - return m_cursorRectangle; -} - -void InputPanel::setCursorRectangle(const QRect &cursorRectangle) -{ - if (m_cursorRectangle == cursorRectangle) - return; - - m_cursorRectangle = cursorRectangle; - - Q_EMIT handle()->cursorRectangleChanged(); -} - -void InputPanel::input_panel_get_input_panel_surface(Resource *resource, uint32_t id, wl_resource *surface) -{ - new InputPanelSurface(resource->client(), id, Surface::fromResource(surface)); -} - -} // namespace QtWayland - -QT_END_NAMESPACE diff --git a/src/compositor/wayland_wrapper/qwlinputpanel_p.h b/src/compositor/wayland_wrapper/qwlinputpanel_p.h deleted file mode 100644 index f9dc49370..000000000 --- a/src/compositor/wayland_wrapper/qwlinputpanel_p.h +++ /dev/null @@ -1,90 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Klarälvdalens Datakonsult AB (KDAB). -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the QtWaylandCompositor module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPLv3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QTWAYLAND_QWLINPUTPANEL_P_H -#define QTWAYLAND_QWLINPUTPANEL_P_H - -#include - -#include - -#include -#include - -QT_BEGIN_NAMESPACE - -class QWaylandInputPanel; - -namespace QtWayland { - -class Compositor; -class Surface; -class TextInput; - -class Q_COMPOSITOR_EXPORT InputPanel : public QtWaylandServer::wl_input_panel -{ -public: - InputPanel(Compositor *compositor); - ~InputPanel(); - - QWaylandInputPanel *handle() const; - - Surface *focus() const; - void setFocus(Surface *focus); - - bool inputPanelVisible() const; - void setInputPanelVisible(bool inputPanelVisible); - - QRect cursorRectangle() const; - void setCursorRectangle(const QRect &cursorRectangle); - -protected: - void input_panel_get_input_panel_surface(Resource *resource, uint32_t id, struct ::wl_resource *surface) Q_DECL_OVERRIDE; - -private: - Compositor *m_compositor; - QScopedPointer m_handle; - - Surface *m_focus; - bool m_inputPanelVisible; - QRect m_cursorRectangle; -}; - -} // namespace QtWayland - -QT_END_NAMESPACE - -#endif // QTWAYLAND_QWLINPUTPANEL_P_H diff --git a/src/compositor/wayland_wrapper/qwlinputpanelsurface.cpp b/src/compositor/wayland_wrapper/qwlinputpanelsurface.cpp deleted file mode 100644 index a72afa2b3..000000000 --- a/src/compositor/wayland_wrapper/qwlinputpanelsurface.cpp +++ /dev/null @@ -1,87 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 Pier Luigi Fiorini -** Copyright (C) 2013 Klarälvdalens Datakonsult AB (KDAB). -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the QtWaylandCompositor module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPLv3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qwlinputpanelsurface_p.h" - -#include "qwloutput_p.h" -#include "qwlsurface_p.h" - -QT_BEGIN_NAMESPACE - -namespace QtWayland { - -InputPanelSurface::InputPanelSurface(wl_client *client, int id, Surface *surface) - : QtWaylandServer::wl_input_panel_surface(client, id, 1) - , m_surface(surface) - , m_type(Invalid) - , m_output(0) - , m_position() -{ - surface->setInputPanelSurface(this); -} - -InputPanelSurface::Type InputPanelSurface::type() const -{ - return m_type; -} - -Output *InputPanelSurface::output() const -{ - return m_output; -} - -QtWaylandServer::wl_input_panel_surface::position InputPanelSurface::position() const -{ - return m_position; -} - -void InputPanelSurface::input_panel_surface_set_overlay_panel(Resource *) -{ - m_type = OverlayPanel; -} - -void InputPanelSurface::input_panel_surface_set_toplevel(Resource *, wl_resource *output_resource, uint32_t position) -{ - m_type = Toplevel; - OutputResource *output = static_cast(Output::Resource::fromResource(output_resource)); - m_output = static_cast(output->output_object); - m_position = static_cast(position); -} - -QT_END_NAMESPACE - -} // namespace QtWayland diff --git a/src/compositor/wayland_wrapper/qwlinputpanelsurface_p.h b/src/compositor/wayland_wrapper/qwlinputpanelsurface_p.h deleted file mode 100644 index 0591832fb..000000000 --- a/src/compositor/wayland_wrapper/qwlinputpanelsurface_p.h +++ /dev/null @@ -1,83 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 Pier Luigi Fiorini -** Copyright (C) 2013 Klarälvdalens Datakonsult AB (KDAB). -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the QtWaylandCompositor module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPLv3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QTWAYLAND_QWLINPUTPANELSURFACE_P_H -#define QTWAYLAND_QWLINPUTPANELSURFACE_P_H - -#include - -QT_BEGIN_NAMESPACE - -namespace QtWayland { - -class Output; -class Surface; - -class InputPanelSurface : public QtWaylandServer::wl_input_panel_surface -{ -public: - enum Type { - Invalid, - Toplevel, - OverlayPanel - }; - - InputPanelSurface(struct ::wl_client *client, int id, Surface *surface); - - Type type() const; - - Output *output() const; - wl_input_panel_surface::position position() const; - -protected: - void input_panel_surface_set_overlay_panel(Resource *resource) Q_DECL_OVERRIDE; - void input_panel_surface_set_toplevel(Resource *resource, wl_resource *output_resource, uint32_t position) Q_DECL_OVERRIDE; - -private: - Surface *m_surface; - - Type m_type; - - Output *m_output; - wl_input_panel_surface::position m_position; -}; - -} // namespace QtWayland - -QT_END_NAMESPACE - -#endif // QTWAYLAND_QWLINPUTPANELSURFACE_P_H diff --git a/src/compositor/wayland_wrapper/qwloutput.cpp b/src/compositor/wayland_wrapper/qwloutput.cpp index 76acfb2b5..813e6e0d8 100644 --- a/src/compositor/wayland_wrapper/qwloutput.cpp +++ b/src/compositor/wayland_wrapper/qwloutput.cpp @@ -36,7 +36,6 @@ ****************************************************************************/ #include "qwloutput_p.h" - #include "qwlcompositor_p.h" #include "qwlsurface_p.h" diff --git a/src/compositor/wayland_wrapper/qwloutput_p.h b/src/compositor/wayland_wrapper/qwloutput_p.h index 917240c1f..974f5a789 100644 --- a/src/compositor/wayland_wrapper/qwloutput_p.h +++ b/src/compositor/wayland_wrapper/qwloutput_p.h @@ -68,9 +68,9 @@ struct SurfaceViewMapper QVector views; }; -struct OutputResource : public QtWaylandServer::wl_output::Resource +//Just for naming convenience +class OutputResource : public QtWaylandServer::wl_output::Resource { - OutputResource() {} }; class Output : public QtWaylandServer::wl_output diff --git a/src/compositor/wayland_wrapper/qwlpointer.cpp b/src/compositor/wayland_wrapper/qwlpointer.cpp index fe67bd1f0..389964fa2 100644 --- a/src/compositor/wayland_wrapper/qwlpointer.cpp +++ b/src/compositor/wayland_wrapper/qwlpointer.cpp @@ -327,9 +327,6 @@ void Pointer::button(uint32_t time, Qt::MouseButton button, uint32_t state) static void requestCursorSurface(QWaylandCompositor *compositor, QWaylandSurface *surface, int32_t hotspot_x, int hotspot_y) { -#if QT_DEPRECATED_SINCE(5, 5) - compositor->setCursorSurface(surface, hotspot_x, hotspot_y); -#endif compositor->currentCurserSurfaceRequest(surface, hotspot_x, hotspot_y); } diff --git a/src/compositor/wayland_wrapper/qwlqtkey.cpp b/src/compositor/wayland_wrapper/qwlqtkey.cpp deleted file mode 100644 index 34506e6fb..000000000 --- a/src/compositor/wayland_wrapper/qwlqtkey.cpp +++ /dev/null @@ -1,77 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the QtWaylandCompositor module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPLv3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qwlqtkey_p.h" -#include "qwlsurface_p.h" -#include -#include - -QT_BEGIN_NAMESPACE - -namespace QtWayland { - -QtKeyExtensionGlobal::QtKeyExtensionGlobal(Compositor *compositor) - : QtWaylandServer::qt_key_extension(compositor->wl_display(), 2) - , m_compositor(compositor) -{ -} - -bool QtKeyExtensionGlobal::postQtKeyEvent(QKeyEvent *event, Surface *surface) -{ - uint32_t time = m_compositor->currentTimeMsecs(); - - Resource *target = surface ? resourceMap().value(surface->resource()->client()) : 0; - - if (target) { - send_qtkey(target->handle, - surface ? surface->resource()->handle : 0, - time, event->type(), event->key(), event->modifiers(), - event->nativeScanCode(), - event->nativeVirtualKey(), - event->nativeModifiers(), - event->text(), - event->isAutoRepeat(), - event->count()); - - return true; - } - - return false; -} - -} - -QT_END_NAMESPACE diff --git a/src/compositor/wayland_wrapper/qwlqtkey_p.h b/src/compositor/wayland_wrapper/qwlqtkey_p.h deleted file mode 100644 index 76cf6c310..000000000 --- a/src/compositor/wayland_wrapper/qwlqtkey_p.h +++ /dev/null @@ -1,69 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the QtWaylandCompositor module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPLv3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef WLQTKEY_H -#define WLQTKEY_H - -#include - -#include "wayland-util.h" - -#include - -QT_BEGIN_NAMESPACE - -class Compositor; -class Surface; -class QKeyEvent; - -namespace QtWayland { - -class QtKeyExtensionGlobal : public QtWaylandServer::qt_key_extension -{ -public: - QtKeyExtensionGlobal(Compositor *compositor); - - bool postQtKeyEvent(QKeyEvent *event, Surface *surface); - -private: - Compositor *m_compositor; -}; - -} - -QT_END_NAMESPACE - -#endif // WLQTKEY_H diff --git a/src/compositor/wayland_wrapper/qwlqttouch.cpp b/src/compositor/wayland_wrapper/qwlqttouch.cpp deleted file mode 100644 index b99ff776b..000000000 --- a/src/compositor/wayland_wrapper/qwlqttouch.cpp +++ /dev/null @@ -1,157 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the QtWaylandCompositor module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPLv3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qwlqttouch_p.h" -#include "qwlsurface_p.h" -#include "qwaylandsurfaceview.h" -#include -#include - -QT_BEGIN_NAMESPACE - -namespace QtWayland { - -static const int maxRawPos = 24; - -TouchExtensionGlobal::TouchExtensionGlobal(Compositor *compositor) - : QtWaylandServer::qt_touch_extension(compositor->wl_display(), 1) - , m_compositor(compositor) - , m_flags(0) - , m_resources() - , m_posData(maxRawPos * 2) -{ -} - -TouchExtensionGlobal::~TouchExtensionGlobal() -{ -} - -static inline int toFixed(qreal f) -{ - return int(f * 10000); -} - -bool TouchExtensionGlobal::postTouchEvent(QTouchEvent *event, QWaylandSurfaceView *view) -{ - const QList points = event->touchPoints(); - const int pointCount = points.count(); - if (!pointCount) - return false; - - QPointF surfacePos = view->requestedPosition(); - wl_client *surfaceClient = view->surface()->handle()->resource()->client(); - uint32_t time = m_compositor->currentTimeMsecs(); - const int rescount = m_resources.count(); - - for (int res = 0; res < rescount; ++res) { - Resource *target = m_resources.at(res); - if (target->client() != surfaceClient) - continue; - - // We will use no touch_frame type of event, to reduce the number of - // events flowing through the wire. Instead, the number of points sent is - // included in the touch point events. - int sentPointCount = 0; - for (int i = 0; i < pointCount; ++i) { - if (points.at(i).state() != Qt::TouchPointStationary) - ++sentPointCount; - } - - for (int i = 0; i < pointCount; ++i) { - const QTouchEvent::TouchPoint &tp(points.at(i)); - // Stationary points are never sent. They are cached on client side. - if (tp.state() == Qt::TouchPointStationary) - continue; - - uint32_t id = tp.id(); - uint32_t state = (tp.state() & 0xFFFF) | (sentPointCount << 16); - uint32_t flags = (tp.flags() & 0xFFFF) | (int(event->device()->capabilities()) << 16); - - QPointF p = tp.pos() - surfacePos; // surface-relative - int x = toFixed(p.x()); - int y = toFixed(p.y()); - int nx = toFixed(tp.normalizedPos().x()); - int ny = toFixed(tp.normalizedPos().y()); - int w = toFixed(tp.rect().width()); - int h = toFixed(tp.rect().height()); - int vx = toFixed(tp.velocity().x()); - int vy = toFixed(tp.velocity().y()); - uint32_t pressure = uint32_t(tp.pressure() * 255); - - QByteArray rawData; - QVector rawPosList = tp.rawScreenPositions(); - int rawPosCount = rawPosList.count(); - if (rawPosCount) { - rawPosCount = qMin(maxRawPos, rawPosCount); - QVector::iterator iter = m_posData.begin(); - for (int rpi = 0; rpi < rawPosCount; ++rpi) { - const QPointF &rawPos(rawPosList.at(rpi)); - // This will stay in screen coordinates for performance - // reasons, clients using this data will presumably know - // what they are doing. - *iter++ = static_cast(rawPos.x()); - *iter++ = static_cast(rawPos.y()); - } - rawData = QByteArray::fromRawData(reinterpret_cast(m_posData.constData()), sizeof(float) * rawPosCount * 2); - } - - send_touch(target->handle, - time, id, state, - x, y, nx, ny, w, h, - pressure, vx, vy, - flags, rawData); - } - - return true; - } - - return false; -} - -void TouchExtensionGlobal::touch_extension_bind_resource(Resource *resource) -{ - m_resources.append(resource); - send_configure(resource->handle, m_flags); -} - -void TouchExtensionGlobal::touch_extension_destroy_resource(Resource *resource) -{ - m_resources.removeOne(resource); -} - -} - -QT_END_NAMESPACE diff --git a/src/compositor/wayland_wrapper/qwlqttouch_p.h b/src/compositor/wayland_wrapper/qwlqttouch_p.h deleted file mode 100644 index e9d42f7e3..000000000 --- a/src/compositor/wayland_wrapper/qwlqttouch_p.h +++ /dev/null @@ -1,78 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the QtWaylandCompositor module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPLv3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef WLTOUCH_H -#define WLTOUCH_H - -#include -#include -#include "wayland-util.h" - -QT_BEGIN_NAMESPACE - -class Compositor; -class Surface; -class QTouchEvent; -class QWaylandSurfaceView; - -namespace QtWayland { - -class TouchExtensionGlobal : public QtWaylandServer::qt_touch_extension -{ -public: - TouchExtensionGlobal(Compositor *compositor); - ~TouchExtensionGlobal(); - - bool postTouchEvent(QTouchEvent *event, QWaylandSurfaceView *view); - - void setFlags(int flags) { m_flags = flags; } - -protected: - void touch_extension_bind_resource(Resource *resource) Q_DECL_OVERRIDE; - void touch_extension_destroy_resource(Resource *resource) Q_DECL_OVERRIDE; - -private: - Compositor *m_compositor; - int m_flags; - QList m_resources; - QVector m_posData; -}; - -} - -QT_END_NAMESPACE - -#endif // WLTOUCH_H diff --git a/src/compositor/wayland_wrapper/qwlshellsurface.cpp b/src/compositor/wayland_wrapper/qwlshellsurface.cpp deleted file mode 100644 index 09316358b..000000000 --- a/src/compositor/wayland_wrapper/qwlshellsurface.cpp +++ /dev/null @@ -1,562 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 Pier Luigi Fiorini -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the QtWaylandCompositor module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPLv3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qwlshellsurface_p.h" - -#include "qwlcompositor_p.h" -#include "qwlsurface_p.h" -#include "qwloutput_p.h" -#include "qwlinputdevice_p.h" -#include "qwlsubsurface_p.h" -#include "qwlpointer_p.h" -#include "qwlextendedsurface_p.h" - -#include "qwaylandoutput.h" -#include "qwaylandsurfaceview.h" - -#include -#include - -QT_BEGIN_NAMESPACE - -namespace QtWayland { - -Shell::Shell() -{ -} - -const wl_interface *Shell::interface() const -{ - return &wl_shell_interface; -} - -void Shell::bind(struct wl_client *client, uint32_t version, uint32_t id) -{ - add(client, id, version); -} - -ShellSurfacePopupGrabber *Shell::getPopupGrabber(InputDevice *input) -{ - if (!m_popupGrabber.contains(input)) - m_popupGrabber.insert(input, new ShellSurfacePopupGrabber(input)); - - return m_popupGrabber.value(input); -} - -void Shell::shell_get_shell_surface(Resource *resource, uint32_t id, struct ::wl_resource *surface_res) -{ - Surface *surface = Surface::fromResource(surface_res); - new ShellSurface(this, resource->client(), id, surface); -} - - - -ShellSurface::ShellSurface(Shell *shell, wl_client *client, uint32_t id, Surface *surface) - : QWaylandSurfaceInterface(surface->waylandSurface()) - , wl_shell_surface(client, id, 1) - , m_shell(shell) - , m_surface(surface) - , m_resizeGrabber(0) - , m_moveGrabber(0) - , m_popupGrabber(0) - , m_popupSerial() -{ - m_view = surface->compositor()->waylandCompositor()->createSurfaceView(surface->waylandSurface()); - m_view->setOutput(surface->waylandSurface()->primaryOutput()); - connect(surface->waylandSurface(), &QWaylandSurface::configure, this, &ShellSurface::configure); - connect(surface->waylandSurface(), &QWaylandSurface::mapped, this, &ShellSurface::mapped); - connect(surface->waylandSurface(), &QWaylandSurface::offsetForNextFrame, this, &ShellSurface::adjustOffset); - surface->setShellSurface(this); -} - -ShellSurface::~ShellSurface() -{ - delete m_view; -} - -void ShellSurface::sendConfigure(uint32_t edges, int32_t width, int32_t height) -{ - send_configure(edges, width, height); -} - -void ShellSurface::ping(uint32_t serial) -{ - m_pings.insert(serial); - send_ping(serial); -} - -void ShellSurface::adjustPosInResize() -{ - if (m_surface->transientParent()) - return; - if (!m_resizeGrabber || !(m_resizeGrabber->resize_edges & WL_SHELL_SURFACE_RESIZE_TOP_LEFT)) - return; - - int bottomLeftX = m_resizeGrabber->point.x() + m_resizeGrabber->width; - int bottomLeftY = m_resizeGrabber->point.y() + m_resizeGrabber->height; - qreal x = m_view->requestedPosition().x(); - qreal y = m_view->requestedPosition().y(); - if (m_resizeGrabber->resize_edges & WL_SHELL_SURFACE_RESIZE_TOP) - y = bottomLeftY - m_view->surface()->size().height(); - if (m_resizeGrabber->resize_edges & WL_SHELL_SURFACE_RESIZE_LEFT) - x = bottomLeftX - m_view->surface()->size().width(); - QPointF newPos(x,y); - m_view->setRequestedPosition(newPos); -} - -void ShellSurface::resetResizeGrabber() -{ - m_resizeGrabber = 0; -} - -void ShellSurface::resetMoveGrabber() -{ - m_moveGrabber = 0; -} - -void ShellSurface::setOffset(const QPointF &offset) -{ - m_surface->setTransientOffset(offset.x(), offset.y()); -} - -void ShellSurface::configure(bool hasBuffer) -{ - m_surface->setMapped(hasBuffer); -} - -bool ShellSurface::runOperation(QWaylandSurfaceOp *op) -{ - switch (op->type()) { - case QWaylandSurfaceOp::Ping: - ping(static_cast(op)->serial()); - return true; - case QWaylandSurfaceOp::Resize: - requestSize(static_cast(op)->size()); - return true; - default: - break; - } - return false; -} - -void ShellSurface::mapped() -{ - if (m_surface->waylandSurface()->windowType() == QWaylandSurface::Popup) { - if (m_surface->mapped() && m_popupGrabber->grabSerial() == m_popupSerial) { - m_popupGrabber->addPopup(this); - } else { - send_popup_done(); - m_popupGrabber->setClient(0); - } - } -} - -void ShellSurface::adjustOffset(const QPoint &p) -{ - QPointF offset(p); - QPointF pos = m_view->requestedPosition(); - m_view->setRequestedPosition(pos + offset); -} - -void ShellSurface::requestSize(const QSize &size) -{ - send_configure(WL_SHELL_SURFACE_RESIZE_BOTTOM_RIGHT, size.width(), size.height()); -} - -void ShellSurface::shell_surface_destroy_resource(Resource *) -{ - if (m_popupGrabber) - m_popupGrabber->removePopup(this); - - delete this; -} - -void ShellSurface::shell_surface_move(Resource *resource, - struct wl_resource *input_device_super, - uint32_t time) -{ - Q_UNUSED(resource); - Q_UNUSED(time); - - if (m_resizeGrabber || m_moveGrabber) { - qDebug() << "invalid state"; - return; - } - - InputDevice *input_device = InputDevice::fromSeatResource(input_device_super); - Pointer *pointer = input_device->pointerDevice(); - - m_moveGrabber = new ShellSurfaceMoveGrabber(this, pointer->position() - m_view->requestedPosition()); - - pointer->startGrab(m_moveGrabber); -} - -void ShellSurface::shell_surface_resize(Resource *resource, - struct wl_resource *input_device_super, - uint32_t time, - uint32_t edges) -{ - Q_UNUSED(resource); - Q_UNUSED(time); - - if (m_moveGrabber || m_resizeGrabber) { - qDebug() << "invalid state2"; - return; - } - - m_resizeGrabber = new ShellSurfaceResizeGrabber(this); - - InputDevice *input_device = InputDevice::fromSeatResource(input_device_super); - Pointer *pointer = input_device->pointerDevice(); - - m_resizeGrabber->point = pointer->position(); - m_resizeGrabber->resize_edges = static_cast(edges); - m_resizeGrabber->width = m_view->surface()->size().width(); - m_resizeGrabber->height = m_view->surface()->size().height(); - - pointer->startGrab(m_resizeGrabber); -} - -void ShellSurface::shell_surface_set_toplevel(Resource *resource) -{ - Q_UNUSED(resource); - m_surface->setTransientParent(0); - m_surface->setTransientOffset(0, 0); - - setSurfaceType(QWaylandSurface::Toplevel); - - m_surface->setVisibility(QWindow::Windowed); -} - -void ShellSurface::shell_surface_set_transient(Resource *resource, - struct wl_resource *parent_surface_resource, - int x, - int y, - uint32_t flags) -{ - - Q_UNUSED(resource); - Q_UNUSED(flags); - Surface *parent_surface = Surface::fromResource(parent_surface_resource); - m_surface->setTransientParent(parent_surface); - m_surface->setTransientOffset(x, y); - if (flags & WL_SHELL_SURFACE_TRANSIENT_INACTIVE) - m_surface->setTransientInactive(true); - - setSurfaceType(QWaylandSurface::Transient); - - m_surface->setVisibility(QWindow::AutomaticVisibility); -} - -void ShellSurface::shell_surface_set_fullscreen(Resource *resource, - uint32_t method, - uint32_t framerate, - struct wl_resource *output_resource) -{ - Q_UNUSED(resource); - Q_UNUSED(method); - Q_UNUSED(framerate); - - QWaylandOutput *output = output_resource - ? QWaylandOutput::fromResource(output_resource) - : Q_NULLPTR; - if (!output) { - // Look for an output that can contain this surface - Q_FOREACH (QWaylandOutput *curOutput, m_surface->compositor()->primaryOutputSpace()->outputs()) { - if (curOutput->geometry().size().width() >= m_surface->size().width() && - curOutput->geometry().size().height() >= m_surface->size().height()) { - output = curOutput; - break; - } - } - } - if (!output) { - qWarning() << "Unable to resize surface full screen, cannot determine output"; - return; - } - QSize outputSize = output->geometry().size(); - - m_view->setRequestedPosition(output->geometry().topLeft()); - send_configure(resize_bottom_right, outputSize.width(), outputSize.height()); - - m_surface->setVisibility(QWindow::FullScreen); -} - -void ShellSurface::shell_surface_set_popup(Resource *resource, wl_resource *input_device, uint32_t serial, wl_resource *parent, int32_t x, int32_t y, uint32_t flags) -{ - Q_UNUSED(resource); - Q_UNUSED(input_device); - Q_UNUSED(flags); - - InputDevice *input = InputDevice::fromSeatResource(input_device); - m_popupGrabber = m_shell->getPopupGrabber(input); - - m_popupSerial = serial; - m_surface->setTransientParent(Surface::fromResource(parent)); - m_surface->setTransientOffset(x, y); - - setSurfaceType(QWaylandSurface::Popup); - - m_surface->setVisibility(QWindow::AutomaticVisibility); -} - -void ShellSurface::shell_surface_set_maximized(Resource *resource, - struct wl_resource *output_resource) -{ - Q_UNUSED(resource); - - QWaylandOutput *output = output_resource - ? QWaylandOutput::fromResource(output_resource) - : Q_NULLPTR; - if (!output) { - // Look for an output that can contain this surface - Q_FOREACH (QWaylandOutput *curOutput, m_surface->compositor()->primaryOutputSpace()->outputs()) { - if (curOutput->geometry().size().width() >= m_surface->size().width() && - curOutput->geometry().size().height() >= m_surface->size().height()) { - output = curOutput; - break; - } - } - } - if (!output) { - qWarning() << "Unable to maximize surface, cannot determine output"; - return; - } - QSize outputSize = output->availableGeometry().size(); - - m_view->setRequestedPosition(output->availableGeometry().topLeft()); - send_configure(resize_bottom_right, outputSize.width(), outputSize.height()); - - m_surface->setVisibility(QWindow::Maximized); -} - -void ShellSurface::shell_surface_pong(Resource *resource, - uint32_t serial) -{ - Q_UNUSED(resource); - if (m_pings.remove(serial)) - emit m_surface->waylandSurface()->pong(); - else - qWarning("Received an unexpected pong!"); -} - -void ShellSurface::shell_surface_set_title(Resource *resource, - const QString &title) -{ - Q_UNUSED(resource); - m_surface->setTitle(title); -} - -void ShellSurface::shell_surface_set_class(Resource *resource, - const QString &className) -{ - Q_UNUSED(resource); - m_surface->setClassName(className); -} - -ShellSurfaceGrabber::ShellSurfaceGrabber(ShellSurface *shellSurface) - : PointerGrabber() - , shell_surface(shellSurface) -{ -} - -ShellSurfaceGrabber::~ShellSurfaceGrabber() -{ -} - -ShellSurfaceResizeGrabber::ShellSurfaceResizeGrabber(ShellSurface *shellSurface) - : ShellSurfaceGrabber(shellSurface) -{ -} - -void ShellSurfaceResizeGrabber::focus() -{ -} - -void ShellSurfaceResizeGrabber::motion(uint32_t time) -{ - Q_UNUSED(time); - - int width_delta = point.x() - m_pointer->position().x(); - int height_delta = point.y() - m_pointer->position().y(); - - int new_height = height; - if (resize_edges & WL_SHELL_SURFACE_RESIZE_TOP) - new_height = qMax(new_height + height_delta, 1); - else if (resize_edges & WL_SHELL_SURFACE_RESIZE_BOTTOM) - new_height = qMax(new_height - height_delta, 1); - - int new_width = width; - if (resize_edges & WL_SHELL_SURFACE_RESIZE_LEFT) - new_width = qMax(new_width + width_delta, 1); - else if (resize_edges & WL_SHELL_SURFACE_RESIZE_RIGHT) - new_width = qMax(new_width - width_delta, 1); - - shell_surface->sendConfigure(resize_edges, new_width, new_height); -} - -void ShellSurfaceResizeGrabber::button(uint32_t time, Qt::MouseButton button, uint32_t state) -{ - Q_UNUSED(time) - - if (button == Qt::LeftButton && !state) { - m_pointer->endGrab(); - shell_surface->resetResizeGrabber(); - delete this; - } -} - -ShellSurfaceMoveGrabber::ShellSurfaceMoveGrabber(ShellSurface *shellSurface, const QPointF &offset) - : ShellSurfaceGrabber(shellSurface) - , m_offset(offset) -{ -} - -void ShellSurfaceMoveGrabber::focus() -{ -} - -void ShellSurfaceMoveGrabber::motion(uint32_t time) -{ - Q_UNUSED(time); - - QPointF pos(m_pointer->position() - m_offset); - shell_surface->m_view->setRequestedPosition(pos); - if (shell_surface->m_surface->transientParent()) { - QWaylandSurfaceView *view = shell_surface->m_surface->transientParent()->waylandSurface()->views().first(); - if (view) - shell_surface->setOffset(pos - view->requestedPosition()); - } - -} - -void ShellSurfaceMoveGrabber::button(uint32_t time, Qt::MouseButton button, uint32_t state) -{ - Q_UNUSED(time) - - if (button == Qt::LeftButton && !state) { - m_pointer->setFocus(0, QPointF()); - m_pointer->endGrab(); - shell_surface->resetMoveGrabber(); - delete this; - } -} - -ShellSurfacePopupGrabber::ShellSurfacePopupGrabber(InputDevice *inputDevice) - : PointerGrabber() - , m_inputDevice(inputDevice) - , m_client(0) - , m_surfaces() - , m_initialUp(false) -{ -} - -uint32_t ShellSurfacePopupGrabber::grabSerial() const -{ - return m_inputDevice->pointerDevice()->grabSerial(); -} - -struct ::wl_client *ShellSurfacePopupGrabber::client() const -{ - return m_client; -} - -void ShellSurfacePopupGrabber::setClient(struct ::wl_client *client) -{ - m_client = client; -} - -void ShellSurfacePopupGrabber::addPopup(ShellSurface *surface) -{ - if (m_surfaces.isEmpty()) { - m_client = surface->resource()->client(); - - if (m_inputDevice->pointerDevice()->buttonPressed()) - m_initialUp = false; - - m_surfaces.append(surface); - m_inputDevice->pointerDevice()->startGrab(this); - } else { - m_surfaces.append(surface); - } -} - -void ShellSurfacePopupGrabber::removePopup(ShellSurface *surface) -{ - if (m_surfaces.isEmpty()) - return; - - m_surfaces.removeOne(surface); - if (m_surfaces.isEmpty()) - m_inputDevice->pointerDevice()->endGrab(); -} - -void ShellSurfacePopupGrabber::focus() -{ - if (m_pointer->current() && m_pointer->current()->surface()->handle()->resource()->client() == m_client) - m_pointer->setFocus(m_pointer->current(), m_pointer->currentPosition()); - else - m_pointer->setFocus(0, QPointF()); -} - -void ShellSurfacePopupGrabber::motion(uint32_t time) -{ - m_pointer->motion(time); -} - -void ShellSurfacePopupGrabber::button(uint32_t time, Qt::MouseButton button, uint32_t state) -{ - if (m_pointer->focusResource()) { - m_pointer->sendButton(time, button, state); - } else if (state == QtWaylandServer::wl_pointer::button_state_pressed && - (m_initialUp || time - m_pointer->grabTime() > 500) && - m_pointer->currentGrab() == this) { - m_pointer->endGrab(); - Q_FOREACH (ShellSurface *surface, m_surfaces) { - surface->send_popup_done(); - } - m_surfaces.clear(); - } - - if (state == QtWaylandServer::wl_pointer::button_state_released) - m_initialUp = true; -} - - -} - -QT_END_NAMESPACE diff --git a/src/compositor/wayland_wrapper/qwlshellsurface_p.h b/src/compositor/wayland_wrapper/qwlshellsurface_p.h deleted file mode 100644 index 033a8f971..000000000 --- a/src/compositor/wayland_wrapper/qwlshellsurface_p.h +++ /dev/null @@ -1,225 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the QtWaylandCompositor module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPLv3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef WLSHELLSURFACE_H -#define WLSHELLSURFACE_H - -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include - -QT_BEGIN_NAMESPACE - -class QWaylandSurfaceView; - -namespace QtWayland { - -class Compositor; -class Surface; -class ShellSurface; -class ShellSurfaceResizeGrabber; -class ShellSurfaceMoveGrabber; -class ShellSurfacePopupGrabber; - -class Shell : public QWaylandGlobalInterface, public QtWaylandServer::wl_shell -{ -public: - Shell(); - - const wl_interface *interface() const Q_DECL_OVERRIDE; - - void bind(struct wl_client *client, uint32_t version, uint32_t id) Q_DECL_OVERRIDE; - - ShellSurfacePopupGrabber* getPopupGrabber(InputDevice *input); - -private: - void shell_get_shell_surface(Resource *resource, uint32_t id, struct ::wl_resource *surface) Q_DECL_OVERRIDE; - - QHash m_popupGrabber; -}; - -class Q_COMPOSITOR_EXPORT ShellSurface : public QObject, public QWaylandSurfaceInterface, public QtWaylandServer::wl_shell_surface -{ -public: - ShellSurface(Shell *shell, struct wl_client *client, uint32_t id, Surface *surface); - ~ShellSurface(); - void sendConfigure(uint32_t edges, int32_t width, int32_t height); - - void adjustPosInResize(); - void resetResizeGrabber(); - void resetMoveGrabber(); - - void setOffset(const QPointF &offset); - - void configure(bool hasBuffer); - - void requestSize(const QSize &size); - void ping(uint32_t serial); - - QWaylandSurfaceView *view() { return m_view; } -protected: - bool runOperation(QWaylandSurfaceOp *op) Q_DECL_OVERRIDE; - -private Q_SLOTS: - void mapped(); - void adjustOffset(const QPoint &p); - -private: - Shell *m_shell; - Surface *m_surface; - QWaylandSurfaceView *m_view; - - ShellSurfaceResizeGrabber *m_resizeGrabber; - ShellSurfaceMoveGrabber *m_moveGrabber; - ShellSurfacePopupGrabber *m_popupGrabber; - - uint32_t m_popupSerial; - - QSet m_pings; - - void shell_surface_destroy_resource(Resource *resource) Q_DECL_OVERRIDE; - - void shell_surface_move(Resource *resource, - struct wl_resource *input_device_super, - uint32_t time) Q_DECL_OVERRIDE; - void shell_surface_resize(Resource *resource, - struct wl_resource *input_device, - uint32_t time, - uint32_t edges) Q_DECL_OVERRIDE; - void shell_surface_set_toplevel(Resource *resource) Q_DECL_OVERRIDE; - void shell_surface_set_transient(Resource *resource, - struct wl_resource *parent_surface_resource, - int x, - int y, - uint32_t flags) Q_DECL_OVERRIDE; - void shell_surface_set_fullscreen(Resource *resource, - uint32_t method, - uint32_t framerate, - struct wl_resource *output_resource) Q_DECL_OVERRIDE; - void shell_surface_set_popup(Resource *resource, - struct wl_resource *input_device, - uint32_t time, - struct wl_resource *parent, - int32_t x, - int32_t y, - uint32_t flags) Q_DECL_OVERRIDE; - void shell_surface_set_maximized(Resource *resource, - struct wl_resource *output_resource) Q_DECL_OVERRIDE; - void shell_surface_pong(Resource *resource, - uint32_t serial) Q_DECL_OVERRIDE; - void shell_surface_set_title(Resource *resource, - const QString &title) Q_DECL_OVERRIDE; - void shell_surface_set_class(Resource *resource, - const QString &class_) Q_DECL_OVERRIDE; - - friend class ShellSurfaceMoveGrabber; -}; - -class ShellSurfaceGrabber : public PointerGrabber -{ -public: - ShellSurfaceGrabber(ShellSurface *shellSurface); - ~ShellSurfaceGrabber(); - - ShellSurface *shell_surface; -}; - -class ShellSurfaceResizeGrabber : public ShellSurfaceGrabber -{ -public: - ShellSurfaceResizeGrabber(ShellSurface *shellSurface); - - QPointF point; - enum wl_shell_surface_resize resize_edges; - int32_t width; - int32_t height; - - void focus() Q_DECL_OVERRIDE; - void motion(uint32_t time) Q_DECL_OVERRIDE; - void button(uint32_t time, Qt::MouseButton button, uint32_t state) Q_DECL_OVERRIDE; -}; - -class ShellSurfaceMoveGrabber : public ShellSurfaceGrabber -{ -public: - ShellSurfaceMoveGrabber(ShellSurface *shellSurface, const QPointF &offset); - - void focus() Q_DECL_OVERRIDE; - void motion(uint32_t time) Q_DECL_OVERRIDE; - void button(uint32_t time, Qt::MouseButton button, uint32_t state) Q_DECL_OVERRIDE; - -private: - QPointF m_offset; -}; - -class ShellSurfacePopupGrabber : public PointerGrabber -{ -public: - ShellSurfacePopupGrabber(InputDevice *inputDevice); - - uint32_t grabSerial() const; - - struct ::wl_client *client() const; - void setClient(struct ::wl_client *client); - - void addPopup(ShellSurface *surface); - void removePopup(ShellSurface *surface); - - void focus() Q_DECL_OVERRIDE; - void motion(uint32_t time) Q_DECL_OVERRIDE; - void button(uint32_t time, Qt::MouseButton button, uint32_t state) Q_DECL_OVERRIDE; - -private: - InputDevice *m_inputDevice; - struct ::wl_client *m_client; - QList m_surfaces; - bool m_initialUp; -}; - -} - -QT_END_NAMESPACE - -#endif // WLSHELLSURFACE_H diff --git a/src/compositor/wayland_wrapper/qwlsubsurface_p.h b/src/compositor/wayland_wrapper/qwlsubsurface_p.h deleted file mode 100644 index 27c2bc172..000000000 --- a/src/compositor/wayland_wrapper/qwlsubsurface_p.h +++ /dev/null @@ -1,129 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the QtWaylandCompositor module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPLv3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef WLSUBSURFACE_H -#define WLSUBSURFACE_H - -#include - -#include - -#include - -QT_BEGIN_NAMESPACE - -class Compositor; -class QWaylandSurface; - -namespace QtWayland { - -class SubSurfaceExtensionGlobal -{ -public: - SubSurfaceExtensionGlobal(Compositor *compositor); - -private: - Compositor *m_compositor; - - static void bind_func(struct wl_client *client, void *data, - uint32_t version, uint32_t id); - static void get_sub_surface_aware_surface(struct wl_client *client, - struct wl_resource *sub_surface_extension_resource, - uint32_t id, - struct wl_resource *surface_resource); - - static const struct qt_sub_surface_extension_interface sub_surface_extension_interface; -}; - -class SubSurface -{ -public: - SubSurface(struct wl_client *client, uint32_t id, Surface *surface); - ~SubSurface(); - - void setSubSurface(SubSurface *subSurface, int x, int y); - void removeSubSurface(SubSurface *subSurfaces); - - SubSurface *parent() const; - void setParent(SubSurface *parent); - - QLinkedList subSurfaces() const; - - Surface *surface() const; - QWaylandSurface *waylandSurface() const; - -private: - void parentDestroyed(); - struct wl_resource *m_sub_surface_resource; - Surface *m_surface; - - SubSurface *m_parent; - QLinkedList m_sub_surfaces; - - static void attach_sub_surface(struct wl_client *client, - struct wl_resource *sub_surface_parent_resource, - struct wl_resource *sub_surface_child_resource, - int32_t x, - int32_t y); - static void move_sub_surface(struct wl_client *client, - struct wl_resource *sub_surface_parent_resource, - struct wl_resource *sub_surface_child_resource, - int32_t x, - int32_t y); - static void raise(struct wl_client *client, - struct wl_resource *sub_surface_parent_resource, - struct wl_resource *sub_surface_child_resource); - static void lower(struct wl_client *client, - struct wl_resource *sub_surface_parent_resource, - struct wl_resource *sub_surface_child_resource); - static const struct qt_sub_surface_interface sub_surface_interface; -}; - -inline Surface *SubSurface::surface() const -{ - return m_surface; -} - -inline QWaylandSurface *SubSurface::waylandSurface() const -{ - return m_surface->waylandSurface(); -} - -} - -QT_END_NAMESPACE - -#endif // WLSUBSURFACE_H diff --git a/src/compositor/wayland_wrapper/qwlsurface.cpp b/src/compositor/wayland_wrapper/qwlsurface.cpp index 375a0f054..498d9f23a 100644 --- a/src/compositor/wayland_wrapper/qwlsurface.cpp +++ b/src/compositor/wayland_wrapper/qwlsurface.cpp @@ -119,8 +119,6 @@ Surface::Surface(struct wl_client *client, uint32_t id, int version, QWaylandCom , m_primaryOutput(0) , m_buffer(0) , m_surfaceMapped(false) - , m_shellSurface(0) - , m_extendedSurface(0) , m_subSurface(0) , m_inputPanelSurface(0) , m_inputRegion(infiniteRegion()) @@ -233,30 +231,6 @@ QPoint Surface::lastMousePos() const return m_lastLocalMousePos; } -void Surface::setShellSurface(ShellSurface *shellSurface) -{ - m_shellSurface = shellSurface; - if (m_shellSurface) - emit m_waylandSurface->shellViewCreated(); -} - -ShellSurface *Surface::shellSurface() const -{ - return m_shellSurface; -} - -void Surface::setExtendedSurface(ExtendedSurface *extendedSurface) -{ - m_extendedSurface = extendedSurface; - if (m_extendedSurface) - emit m_waylandSurface->extendedSurfaceReady(); -} - -ExtendedSurface *Surface::extendedSurface() const -{ - return m_extendedSurface; -} - void Surface::setSubSurface(SubSurface *subSurface) { m_subSurface = subSurface; @@ -394,11 +368,6 @@ void Surface::notifyViewsAboutDestruction() void Surface::surface_destroy_resource(Resource *) { - if (m_extendedSurface) { - m_extendedSurface->setParentSurface(Q_NULLPTR); - m_extendedSurface = 0; - } - notifyViewsAboutDestruction(); m_destroyed = true; diff --git a/src/compositor/wayland_wrapper/qwlsurface_p.h b/src/compositor/wayland_wrapper/qwlsurface_p.h index b7299d2b4..e896c48a9 100644 --- a/src/compositor/wayland_wrapper/qwlsurface_p.h +++ b/src/compositor/wayland_wrapper/qwlsurface_p.h @@ -106,12 +106,6 @@ public: QPoint lastMousePos() const; - void setShellSurface(ShellSurface *shellSurface); - ShellSurface *shellSurface() const; - - void setExtendedSurface(ExtendedSurface *extendedSurface); - ExtendedSurface *extendedSurface() const; - void setSubSurface(SubSurface *subSurface); SubSurface *subSurface() const; @@ -200,8 +194,6 @@ protected: QList m_pendingFrameCallbacks; QList m_frameCallbacks; - ShellSurface *m_shellSurface; - ExtendedSurface *m_extendedSurface; SubSurface *m_subSurface; InputPanelSurface *m_inputPanelSurface; diff --git a/src/compositor/wayland_wrapper/qwltextinput.cpp b/src/compositor/wayland_wrapper/qwltextinput.cpp deleted file mode 100644 index af5771d7a..000000000 --- a/src/compositor/wayland_wrapper/qwltextinput.cpp +++ /dev/null @@ -1,201 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Klarälvdalens Datakonsult AB (KDAB). -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the QtWaylandCompositor module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPLv3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qwltextinput_p.h" - -#include "qwlcompositor_p.h" -#include "qwlinputdevice_p.h" -#include "qwlinputmethod_p.h" -#include "qwlinputmethodcontext_p.h" -#include "qwlinputpanel_p.h" -#include "qwlsurface_p.h" - -#include - -QT_BEGIN_NAMESPACE - -namespace QtWayland { - -TextInput::TextInput(Compositor *compositor, struct ::wl_client *client, int id) - : wl_text_input(client, id, 1) - , m_compositor(compositor) - , m_focus() - , m_inputPanelVisible() - , m_cursorRectangle() -{ -} - -Surface *TextInput::focus() const -{ - return m_focus; -} - -bool TextInput::inputPanelVisible() const -{ - return m_inputPanelVisible; -} - -QRect TextInput::cursorRectangle() const -{ - return m_cursorRectangle; -} - -void TextInput::deactivate(InputMethod *inputMethod) -{ - if (m_activeInputMethods.removeOne(inputMethod)) - inputMethod->deactivate(); - - if (m_activeInputMethods.isEmpty()) - send_leave(); -} - -void TextInput::text_input_destroy_resource(Resource *) -{ - Q_FOREACH (InputMethod *inputMethod, m_activeInputMethods) { - deactivate(inputMethod); - } - - delete this; -} - -void TextInput::text_input_activate(Resource *, wl_resource *seat, wl_resource *surface) -{ - Surface *oldSurface = m_focus; - m_focus = Surface::fromResource(surface); - - if (oldSurface != m_focus) - send_leave(); - - bool wasEmpty = m_activeInputMethods.isEmpty(); - - InputMethod *inputMethod = InputDevice::fromSeatResource(seat)->inputMethod(); - - if (!m_activeInputMethods.contains(inputMethod)) { - m_activeInputMethods.append(inputMethod); - inputMethod->activate(this); - } - - if (wasEmpty || oldSurface != m_focus) - send_enter(surface); -} - -void TextInput::text_input_deactivate(Resource *, wl_resource *seat) -{ - InputMethod *inputMethod = InputDevice::fromSeatResource(seat)->inputMethod(); - - deactivate(inputMethod); -} - -static bool isInputMethodBound(InputMethod *inputMethod) -{ - return inputMethod->isBound(); -} - -void TextInput::text_input_show_input_panel(Resource *) -{ - m_inputPanelVisible = true; - - if (std::find_if(m_activeInputMethods.cbegin(), m_activeInputMethods.cend(), isInputMethodBound) != m_activeInputMethods.cend()) - m_compositor->inputPanel()->setInputPanelVisible(true); -} - -void TextInput::text_input_hide_input_panel(Resource *) -{ - m_inputPanelVisible = false; - - if (std::find_if(m_activeInputMethods.cbegin(), m_activeInputMethods.cend(), isInputMethodBound) != m_activeInputMethods.cend()) - m_compositor->inputPanel()->setInputPanelVisible(false); -} - -void TextInput::text_input_set_cursor_rectangle(Resource *, int32_t x, int32_t y, int32_t width, int32_t height) -{ - m_cursorRectangle = QRect(x, y, width, height); - - if (!m_activeInputMethods.isEmpty()) - m_compositor->inputPanel()->setCursorRectangle(m_cursorRectangle); -} - -void TextInput::text_input_reset(Resource *) -{ - Q_FOREACH (InputMethod *inputMethod, m_activeInputMethods) { - if (inputMethod->context()) - inputMethod->context()->send_reset(); - } -} - -void TextInput::text_input_commit_state(Resource *, uint32_t serial) -{ - Q_FOREACH (InputMethod *inputMethod, m_activeInputMethods) { - if (inputMethod->context()) - inputMethod->context()->send_commit_state(serial); - } -} - -void TextInput::text_input_set_content_type(Resource *, uint32_t hint, uint32_t purpose) -{ - Q_FOREACH (InputMethod *inputMethod, m_activeInputMethods) { - if (inputMethod->context()) - inputMethod->context()->send_content_type(hint, purpose); - } -} - -void TextInput::text_input_set_preferred_language(Resource *, const QString &language) -{ - Q_FOREACH (InputMethod *inputMethod, m_activeInputMethods) { - if (inputMethod->context()) - inputMethod->context()->send_preferred_language(language); - } -} - -void TextInput::text_input_set_surrounding_text(Resource *, const QString &text, uint32_t cursor, uint32_t anchor) -{ - Q_FOREACH (InputMethod *inputMethod, m_activeInputMethods) { - if (inputMethod->context()) - inputMethod->context()->send_surrounding_text(text, cursor, anchor); - } -} - -void TextInput::text_input_invoke_action(Resource *, uint32_t button, uint32_t index) -{ - Q_FOREACH (InputMethod *inputMethod, m_activeInputMethods) { - if (inputMethod->context()) - inputMethod->context()->send_invoke_action(button, index); - } -} - -} // namespace QtWayland - -QT_END_NAMESPACE diff --git a/src/compositor/wayland_wrapper/qwltextinput_p.h b/src/compositor/wayland_wrapper/qwltextinput_p.h deleted file mode 100644 index 9d6f75247..000000000 --- a/src/compositor/wayland_wrapper/qwltextinput_p.h +++ /dev/null @@ -1,93 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Klarälvdalens Datakonsult AB (KDAB). -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the QtWaylandCompositor module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPLv3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QTWAYLAND_QWLTEXTINPUT_P_H -#define QTWAYLAND_QWLTEXTINPUT_P_H - -#include - -#include - -QT_BEGIN_NAMESPACE - -namespace QtWayland { - -class Compositor; -class InputMethod; -class Surface; - -class TextInput : public QtWaylandServer::wl_text_input -{ -public: - explicit TextInput(Compositor *compositor, struct ::wl_client *client, int id); - - Surface *focus() const; - - bool inputPanelVisible() const; - QRect cursorRectangle() const; - - void deactivate(InputMethod *inputMethod); - -protected: - void text_input_destroy_resource(Resource *resource) Q_DECL_OVERRIDE; - - void text_input_activate(Resource *resource, wl_resource *seat, wl_resource *surface) Q_DECL_OVERRIDE; - void text_input_deactivate(Resource *resource, wl_resource *seat) Q_DECL_OVERRIDE; - void text_input_show_input_panel(Resource *resource) Q_DECL_OVERRIDE; - void text_input_hide_input_panel(Resource *resource) Q_DECL_OVERRIDE; - void text_input_reset(Resource *resource) Q_DECL_OVERRIDE; - void text_input_commit_state(Resource *resource, uint32_t serial) Q_DECL_OVERRIDE; - void text_input_set_content_type(Resource *resource, uint32_t hint, uint32_t purpose) Q_DECL_OVERRIDE; - void text_input_set_cursor_rectangle(Resource *resource, int32_t x, int32_t y, int32_t width, int32_t height) Q_DECL_OVERRIDE; - void text_input_set_preferred_language(Resource *resource, const QString &language) Q_DECL_OVERRIDE; - void text_input_set_surrounding_text(Resource *resource, const QString &text, uint32_t cursor, uint32_t anchor) Q_DECL_OVERRIDE; - void text_input_invoke_action(Resource *resource, uint32_t button, uint32_t index) Q_DECL_OVERRIDE; - -private: - Compositor *m_compositor; - QList m_activeInputMethods; - Surface *m_focus; - - bool m_inputPanelVisible; - QRect m_cursorRectangle; - -}; - -} // namespace QtWayland - -QT_END_NAMESPACE - -#endif // QTWAYLAND_QWLTEXTINPUT_P_H diff --git a/src/compositor/wayland_wrapper/qwltextinputmanager.cpp b/src/compositor/wayland_wrapper/qwltextinputmanager.cpp deleted file mode 100644 index 1daa8cb7b..000000000 --- a/src/compositor/wayland_wrapper/qwltextinputmanager.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Klarälvdalens Datakonsult AB (KDAB). -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the QtWaylandCompositor module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPLv3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qwltextinputmanager_p.h" - -#include "qwlcompositor_p.h" -#include "qwltextinput_p.h" - -QT_BEGIN_NAMESPACE - -namespace QtWayland { - -TextInputManager::TextInputManager(Compositor *compositor) - : QtWaylandServer::wl_text_input_manager(compositor->wl_display(), 1) - , m_compositor(compositor) -{ -} - -TextInputManager::~TextInputManager() -{ -} - -void TextInputManager::text_input_manager_create_text_input(Resource *resource, uint32_t id) -{ - new TextInput(m_compositor, resource->client(), id); -} - -} // namespace QtWayland - -QT_END_NAMESPACE diff --git a/src/compositor/wayland_wrapper/qwltextinputmanager_p.h b/src/compositor/wayland_wrapper/qwltextinputmanager_p.h deleted file mode 100644 index ae883af50..000000000 --- a/src/compositor/wayland_wrapper/qwltextinputmanager_p.h +++ /dev/null @@ -1,65 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Klarälvdalens Datakonsult AB (KDAB). -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the QtWaylandCompositor module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPLv3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QTWAYLAND_QWLTEXTINPUTMANAGER_P_H -#define QTWAYLAND_QWLTEXTINPUTMANAGER_P_H - -#include - -QT_BEGIN_NAMESPACE - -namespace QtWayland { - -class Compositor; - -class TextInputManager : public QtWaylandServer::wl_text_input_manager -{ -public: - TextInputManager(Compositor *compositor); - ~TextInputManager(); - -protected: - void text_input_manager_create_text_input(Resource *resource, uint32_t id) Q_DECL_OVERRIDE; - -private: - Compositor *m_compositor; -}; - -} // namespace QtWayland - -QT_END_NAMESPACE - -#endif // QTWAYLAND_QWLTEXTINPUTMANAGER_P_H diff --git a/src/compositor/wayland_wrapper/wayland_wrapper.pri b/src/compositor/wayland_wrapper/wayland_wrapper.pri index eb66f6949..f7a630bd4 100644 --- a/src/compositor/wayland_wrapper/wayland_wrapper.pri +++ b/src/compositor/wayland_wrapper/wayland_wrapper.pri @@ -1,10 +1,5 @@ CONFIG += wayland-scanner WAYLANDSERVERSOURCES += \ - ../extensions/surface-extension.xml \ - ../extensions/sub-surface-extension.xml \ - ../extensions/touch-extension.xml \ - ../extensions/qtkey-extension.xml \ - ../extensions/windowmanager.xml \ ../3rdparty/protocol/wayland.xml \ ../3rdparty/protocol/input-method.xml \ ../3rdparty/protocol/text.xml @@ -16,24 +11,15 @@ HEADERS += \ wayland_wrapper/qwldataoffer_p.h \ wayland_wrapper/qwldatasource_p.h \ wayland_wrapper/qwldisplay_p.h \ - wayland_wrapper/qwlextendedsurface_p.h \ wayland_wrapper/qwlinputdevice_p.h \ wayland_wrapper/qwlinputmethod_p.h \ wayland_wrapper/qwlinputmethodcontext_p.h \ - wayland_wrapper/qwlinputpanel_p.h \ - wayland_wrapper/qwlinputpanelsurface_p.h \ wayland_wrapper/qwlkeyboard_p.h \ wayland_wrapper/qwloutput_p.h \ wayland_wrapper/qwlpointer_p.h \ - wayland_wrapper/qwlqtkey_p.h \ - wayland_wrapper/qwlqttouch_p.h \ wayland_wrapper/qwlregion_p.h \ - wayland_wrapper/qwlshellsurface_p.h \ - wayland_wrapper/qwlsubsurface_p.h \ wayland_wrapper/qwlsurface_p.h \ wayland_wrapper/qwlsurfacebuffer_p.h \ - wayland_wrapper/qwltextinput_p.h \ - wayland_wrapper/qwltextinputmanager_p.h \ wayland_wrapper/qwltouch_p.h \ wayland_wrapper/qwllistener_p.h \ ../shared/qwaylandxkb.h \ @@ -45,24 +31,15 @@ SOURCES += \ wayland_wrapper/qwldataoffer.cpp \ wayland_wrapper/qwldatasource.cpp \ wayland_wrapper/qwldisplay.cpp \ - wayland_wrapper/qwlextendedsurface.cpp \ wayland_wrapper/qwlinputdevice.cpp \ wayland_wrapper/qwlinputmethod.cpp \ wayland_wrapper/qwlinputmethodcontext.cpp \ - wayland_wrapper/qwlinputpanel.cpp \ - wayland_wrapper/qwlinputpanelsurface.cpp \ wayland_wrapper/qwlkeyboard.cpp \ wayland_wrapper/qwloutput.cpp \ wayland_wrapper/qwlpointer.cpp \ - wayland_wrapper/qwlqtkey.cpp \ - wayland_wrapper/qwlqttouch.cpp \ wayland_wrapper/qwlregion.cpp \ - wayland_wrapper/qwlshellsurface.cpp \ - wayland_wrapper/qwlsubsurface.cpp \ wayland_wrapper/qwlsurface.cpp \ wayland_wrapper/qwlsurfacebuffer.cpp \ - wayland_wrapper/qwltextinput.cpp \ - wayland_wrapper/qwltextinputmanager.cpp \ wayland_wrapper/qwltouch.cpp \ wayland_wrapper/qwllistener.cpp \ ../shared/qwaylandxkb.cpp \ -- cgit v1.2.3 From 8ea41bfe32de3b4dd4c15ec91c8925b1c6508c53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Thu, 30 Jul 2015 15:16:48 +0200 Subject: Public input apis Change-Id: I60ec2fd9f4afe54198d9c476b28f9f15a661e9ca --- src/compositor/wayland_wrapper/qwlcompositor.cpp | 32 +-- src/compositor/wayland_wrapper/qwlcompositor_p.h | 8 +- src/compositor/wayland_wrapper/qwldatadevice.cpp | 54 ++-- src/compositor/wayland_wrapper/qwldatadevice_p.h | 13 +- .../wayland_wrapper/qwldatadevicemanager.cpp | 10 +- src/compositor/wayland_wrapper/qwlinputdevice.cpp | 217 ++++++---------- src/compositor/wayland_wrapper/qwlinputdevice_p.h | 71 +++--- src/compositor/wayland_wrapper/qwlinputmethod.cpp | 10 +- src/compositor/wayland_wrapper/qwlinputmethod_p.h | 11 +- src/compositor/wayland_wrapper/qwlkeyboard.cpp | 103 ++++---- src/compositor/wayland_wrapper/qwlkeyboard_p.h | 71 ++---- src/compositor/wayland_wrapper/qwllistener.cpp | 65 ----- src/compositor/wayland_wrapper/qwllistener_p.h | 70 ------ src/compositor/wayland_wrapper/qwloutput_p.h | 1 + src/compositor/wayland_wrapper/qwlpointer.cpp | 273 +++++---------------- src/compositor/wayland_wrapper/qwlpointer_p.h | 105 ++++---- src/compositor/wayland_wrapper/qwlsurface.cpp | 3 +- src/compositor/wayland_wrapper/qwltouch.cpp | 136 +++++----- src/compositor/wayland_wrapper/qwltouch_p.h | 55 ++--- src/compositor/wayland_wrapper/wayland_wrapper.pri | 2 - 20 files changed, 426 insertions(+), 884 deletions(-) delete mode 100644 src/compositor/wayland_wrapper/qwllistener.cpp delete mode 100644 src/compositor/wayland_wrapper/qwllistener_p.h (limited to 'src/compositor/wayland_wrapper') diff --git a/src/compositor/wayland_wrapper/qwlcompositor.cpp b/src/compositor/wayland_wrapper/qwlcompositor.cpp index 2de42fc2d..0aef63671 100644 --- a/src/compositor/wayland_wrapper/qwlcompositor.cpp +++ b/src/compositor/wayland_wrapper/qwlcompositor.cpp @@ -305,16 +305,6 @@ void Compositor::destroySurface(Surface *surface) m_destroyed_surfaces << surface->waylandSurface(); } -void Compositor::resetInputDevice(Surface *surface) -{ - foreach (QWaylandInputDevice *dev, m_inputDevices) { - if (dev->keyboardFocus() == surface->waylandSurface()) - dev->setKeyboardFocus(0); - if (dev->mouseFocus() && dev->mouseFocus()->surface() == surface->waylandSurface()) - dev->setMouseFocus(0, QPointF(), QPointF()); - } -} - void Compositor::unregisterSurface(QWaylandSurface *surface) { if (!m_all_surfaces.removeOne(surface)) @@ -403,18 +393,15 @@ void Compositor::initializeExtensions() new TextInputManager(this); new QWaylandInputPanel(waylandCompositor()); } - if (m_extensions & QWaylandCompositor::WindowManagerExtension) { - WindowManagerServerIntegration *wmint = new WindowManagerServerIntegration(m_qt_compositor, this); - wmint->initialize(m_display); - } - if (m_extensions & QWaylandCompositor::DefaultShellExtension) { + if (m_extensions & QWaylandCompositor::WindowManagerExtension) + new QWaylandWindowManagerExtension(waylandCompositor()); + if (m_extensions & QWaylandCompositor::DefaultShellExtension) new Shell(waylandCompositor()); - } } void Compositor::initializeDefaultInputDevice() { - m_default_wayland_input_device = new QWaylandInputDevice(m_qt_compositor); + m_default_wayland_input_device = m_qt_compositor->createInputDevice(); registerInputDevice(m_default_wayland_input_device); } @@ -423,22 +410,15 @@ QList Compositor::clients() const return m_clients; } -void Compositor::setClientFullScreenHint(bool value) -{ - WindowManagerServerIntegration *wmExtension = static_cast(waylandCompositor()->extension(QtWaylandServer::qt_windowmanager::name())); - if (wmExtension) - wmExtension->setShowIsFullScreen(value); -} - QWaylandCompositor::ExtensionFlags Compositor::extensions() const { return m_extensions; } -InputDevice* Compositor::defaultInputDevice() +QWaylandInputDevice *Compositor::defaultInputDevice() { // The list gets prepended so that default is the last element - return m_inputDevices.last()->handle(); + return m_inputDevices.last(); } DataDeviceManager *Compositor::dataDeviceManager() const diff --git a/src/compositor/wayland_wrapper/qwlcompositor_p.h b/src/compositor/wayland_wrapper/qwlcompositor_p.h index 0862477e4..750807449 100644 --- a/src/compositor/wayland_wrapper/qwlcompositor_p.h +++ b/src/compositor/wayland_wrapper/qwlcompositor_p.h @@ -89,9 +89,7 @@ public: void init(); - void sendFrameCallbacks(QList visibleSurfaces); - - InputDevice *defaultInputDevice(); + QWaylandInputDevice *defaultInputDevice(); void registerInputDevice(QWaylandInputDevice *device); QList inputDevices() const { return m_inputDevices; } @@ -128,8 +126,6 @@ public: QList clients() const; - void setClientFullScreenHint(bool value); - QWaylandCompositor::ExtensionFlags extensions() const; InputPanel *inputPanel() const; @@ -145,8 +141,6 @@ public: void overrideSelection(const QMimeData *data); void feedRetainedSelectionData(QMimeData *data); - void resetInputDevice(Surface *surface); - void unregisterSurface(QWaylandSurface *surface); public slots: diff --git a/src/compositor/wayland_wrapper/qwldatadevice.cpp b/src/compositor/wayland_wrapper/qwldatadevice.cpp index c3a059f74..fd5c6d3ca 100644 --- a/src/compositor/wayland_wrapper/qwldatadevice.cpp +++ b/src/compositor/wayland_wrapper/qwldatadevice.cpp @@ -48,6 +48,7 @@ #include "qwaylanddrag.h" #include "qwaylandsurfaceview.h" +#include #include @@ -55,7 +56,7 @@ QT_BEGIN_NAMESPACE namespace QtWayland { -DataDevice::DataDevice(InputDevice *inputDevice) +DataDevice::DataDevice(QWaylandInputDevice *inputDevice) : wl_data_device() , m_compositor(inputDevice->compositor()) , m_inputDevice(inputDevice) @@ -68,12 +69,12 @@ DataDevice::DataDevice(InputDevice *inputDevice) { } -void DataDevice::setFocus(QtWaylandServer::wl_keyboard::Resource *focusResource) +void DataDevice::setFocus(QWaylandClient *focusClient) { - if (!focusResource) + if (!focusClient) return; - Resource *resource = resourceMap().value(focusResource->client()); + Resource *resource = resourceMap().value(focusClient->client()); if (!resource) return; @@ -103,7 +104,7 @@ void DataDevice::setDragFocus(QWaylandSurfaceView *focus, const QPointF &localPo if (!resource) return; - uint32_t serial = wl_display_next_serial(m_compositor->wl_display()); + uint32_t serial = wl_display_next_serial(m_compositor->waylandDisplay()); DataOffer *offer = m_dragDataSource ? new DataOffer(m_dragDataSource, resource) : 0; @@ -131,20 +132,20 @@ void DataDevice::sourceDestroyed(DataSource *source) void DataDevice::focus() { - QWaylandSurfaceView *focus = outputSpace()->pickView(m_pointer->currentPosition()); - - if (focus != m_dragFocus) - setDragFocus(focus, outputSpace()->mapToView(focus, m_pointer->currentPosition())); + QWaylandSurfaceView *focus = pointer->currentView(); + if (focus != m_dragFocus) { + setDragFocus(focus, pointer->currentLocalPosition()); + } } void DataDevice::motion(uint32_t time) { if (m_dragIcon) { - m_dragIcon->setRequestedPosition(m_pointer->currentPosition()); + m_dragIcon->setRequestedPosition(pointer->currentSpacePosition()); } if (m_dragFocusResource && m_dragFocus) { - const QPointF &surfacePoint = outputSpace()->mapToView(m_dragFocus, m_pointer->currentPosition()); + const QPointF &surfacePoint = outputSpace()->mapToView(m_dragFocus, pointer->currentSpacePosition()); send_motion(m_dragFocusResource->handle, time, wl_fixed_from_double(surfacePoint.x()), wl_fixed_from_double(surfacePoint.y())); } @@ -155,37 +156,36 @@ void DataDevice::button(uint32_t time, Qt::MouseButton button, uint32_t state) Q_UNUSED(time); if (m_dragFocusResource && - m_pointer->grabButton() == button && - state == Pointer::button_state_released) + pointer->grabButton() == button && + state == QWaylandPointerPrivate::button_state_released) send_drop(m_dragFocusResource->handle); - if (!m_pointer->buttonPressed() && - state == Pointer::button_state_released) { + if (!pointer->isButtonPressed() && + state == QWaylandPointerPrivate::button_state_released) { if (m_dragIcon) { m_dragIcon = 0; - Q_EMIT m_inputDevice->dragHandle()->iconChanged(); + Q_EMIT QWaylandInputDevicePrivate::get(m_inputDevice)->dragHandle()->iconChanged(); } setDragFocus(0, QPointF()); - m_pointer->endGrab(); + pointer->endGrab(); } } void DataDevice::data_device_start_drag(Resource *resource, struct ::wl_resource *source, struct ::wl_resource *origin, struct ::wl_resource *icon, uint32_t serial) { - if (m_inputDevice->pointerDevice()->grabSerial() == serial) { - if (!m_inputDevice->pointerDevice()->buttonPressed() || - m_inputDevice->pointerDevice()->focusSurface()->surface()->handle() != Surface::fromResource(origin)) + if (QWaylandInputDevicePrivate::get(m_inputDevice)->pointerDevice()->grabSerial() == serial) { + if (!QWaylandInputDevicePrivate::get(m_inputDevice)->pointerDevice()->isButtonPressed() || + QWaylandInputDevicePrivate::get(m_inputDevice)->pointerDevice()->currentView()->surface()->handle() != Surface::fromResource(origin)) return; m_dragClient = resource->client(); m_dragDataSource = source != 0 ? DataSource::fromResource(source) : 0; - m_dragIcon = icon != 0 ? m_compositor->waylandCompositor()->createSurfaceView(Surface::fromResource(icon)->waylandSurface()) : 0; - Q_EMIT m_inputDevice->dragHandle()->iconChanged(); + m_dragIcon = icon != 0 ? m_compositor->createSurfaceView(Surface::fromResource(icon)->waylandSurface()) : 0; + Q_EMIT QWaylandInputDevicePrivate::get(m_inputDevice)->dragHandle()->iconChanged(); - m_inputDevice->pointerDevice()->setFocus(0, QPointF()); - m_inputDevice->pointerDevice()->startGrab(this); + QWaylandInputDevicePrivate::get(m_inputDevice)->pointerDevice()->startGrab(this); } } @@ -199,12 +199,12 @@ void DataDevice::data_device_set_selection(Resource *, struct ::wl_resource *sou m_selectionSource->cancel(); m_selectionSource = dataSource; - m_compositor->dataDeviceManager()->setCurrentSelectionSource(m_selectionSource); + m_compositor->handle()->dataDeviceManager()->setCurrentSelectionSource(m_selectionSource); if (m_selectionSource) m_selectionSource->setDevice(this); - QtWaylandServer::wl_keyboard::Resource *focusResource = m_inputDevice->keyboardDevice()->focusResource(); - Resource *resource = focusResource ? resourceMap().value(focusResource->client()) : 0; + QWaylandClient *focusClient = m_inputDevice->keyboard()->focusClient(); + Resource *resource = focusClient ? resourceMap().value(focusClient->client()) : 0; if (resource && m_selectionSource) { DataOffer *offer = new DataOffer(m_selectionSource, resource); diff --git a/src/compositor/wayland_wrapper/qwldatadevice_p.h b/src/compositor/wayland_wrapper/qwldatadevice_p.h index 59a9d2b27..a2facc111 100644 --- a/src/compositor/wayland_wrapper/qwldatadevice_p.h +++ b/src/compositor/wayland_wrapper/qwldatadevice_p.h @@ -39,6 +39,7 @@ #include #include +#include #include #include @@ -53,12 +54,12 @@ class DataSource; class InputDevice; class Surface; -class DataDevice : public QtWaylandServer::wl_data_device, public PointerGrabber +class DataDevice : public QtWaylandServer::wl_data_device, public QWaylandPointerGrabber { public: - DataDevice(InputDevice *inputDevice); + DataDevice(QWaylandInputDevice *inputDevice); - void setFocus(QtWaylandServer::wl_keyboard::Resource *focusResource); + void setFocus(QWaylandClient *client); void setDragFocus(QWaylandSurfaceView *focus, const QPointF &localPosition); @@ -74,9 +75,9 @@ protected: void data_device_set_selection(Resource *resource, struct ::wl_resource *source, uint32_t serial) Q_DECL_OVERRIDE; private: - QWaylandOutputSpace *outputSpace() const { return m_inputDevice->handle()->outputSpace(); } - Compositor *m_compositor; - InputDevice *m_inputDevice; + QWaylandOutputSpace *outputSpace() const { return m_inputDevice->outputSpace(); } + QWaylandCompositor *m_compositor; + QWaylandInputDevice *m_inputDevice; DataSource *m_selectionSource; diff --git a/src/compositor/wayland_wrapper/qwldatadevicemanager.cpp b/src/compositor/wayland_wrapper/qwldatadevicemanager.cpp index feb97e4af..35bbf59f4 100644 --- a/src/compositor/wayland_wrapper/qwldatadevicemanager.cpp +++ b/src/compositor/wayland_wrapper/qwldatadevicemanager.cpp @@ -44,6 +44,8 @@ #include "qwlsurface_p.h" #include "qwaylandmimehelper.h" +#include + #include #include #include @@ -198,11 +200,11 @@ void DataDeviceManager::overrideSelection(const QMimeData &mimeData) m_compositorOwnsSelection = true; - InputDevice *dev = m_compositor->defaultInputDevice(); - Surface *focusSurface = dev->keyboardFocus(); + QWaylandInputDevice *dev = m_compositor->defaultInputDevice(); + QWaylandSurface *focusSurface = QWaylandInputDevicePrivate::get(dev)->keyboardFocus(); if (focusSurface) offerFromCompositorToClient( - dev->dataDevice()->resourceMap().value(focusSurface->resource()->client())->handle); + QWaylandInputDevicePrivate::get(dev)->dataDevice()->resourceMap().value(QWaylandSurfacePrivate::get(focusSurface)->resource()->client())->handle); } bool DataDeviceManager::offerFromCompositorToClient(wl_resource *clientDataDeviceResource) @@ -242,7 +244,7 @@ void DataDeviceManager::data_device_manager_create_data_source(Resource *resourc void DataDeviceManager::data_device_manager_get_data_device(Resource *resource, uint32_t id, struct ::wl_resource *seat) { - InputDevice *input_device = InputDevice::fromSeatResource(seat); + QWaylandInputDevicePrivate *input_device = QWaylandInputDevicePrivate::fromSeatResource(seat); input_device->clientRequestedDataDevice(this, resource->client(), id); } diff --git a/src/compositor/wayland_wrapper/qwlinputdevice.cpp b/src/compositor/wayland_wrapper/qwlinputdevice.cpp index 2e1720a9f..768050435 100644 --- a/src/compositor/wayland_wrapper/qwlinputdevice.cpp +++ b/src/compositor/wayland_wrapper/qwlinputdevice.cpp @@ -48,93 +48,79 @@ #include "qwlkeyboard_p.h" #include "qwltouch_p.h" #include "qwaylandsurfaceview.h" +#include #include QT_BEGIN_NAMESPACE -namespace QtWayland { - -InputDevice::InputDevice(QWaylandInputDevice *handle, Compositor *compositor, QWaylandInputDevice::CapabilityFlags caps) - : QtWaylandServer::wl_seat(compositor->wl_display(), 3) - , m_handle(handle) - , m_dragHandle(new QWaylandDrag(this)) +QWaylandInputDevicePrivate::QWaylandInputDevicePrivate(QWaylandInputDevice *inputdevice, QWaylandCompositor *compositor, QWaylandInputDevice::CapabilityFlags caps) + : QObjectPrivate() + , QtWaylandServer::wl_seat(compositor->waylandDisplay(), 3) + , m_dragHandle(new QWaylandDrag(inputdevice)) , m_compositor(compositor) , m_outputSpace(compositor->primaryOutputSpace()) , m_capabilities(caps) - , m_pointer(m_capabilities & QWaylandInputDevice::Pointer ? new Pointer(m_compositor, this) : 0) - , m_keyboard(m_capabilities & QWaylandInputDevice::Keyboard ? new Keyboard(m_compositor, this) : 0) - , m_touch(m_capabilities & QWaylandInputDevice::Touch ? new Touch(m_compositor) : 0) - , m_inputMethod(m_compositor->extensions() & QWaylandCompositor::TextInputExtension ? new InputMethod(m_compositor, this) : 0) + , m_pointer(m_capabilities & QWaylandInputDevice::Pointer ? new QWaylandPointer(inputdevice) : 0) + , m_keyboard(m_capabilities & QWaylandInputDevice::Keyboard ? new QWaylandKeyboard(inputdevice) : 0) + , m_touch(m_capabilities & QWaylandInputDevice::Touch ? new QWaylandTouch(inputdevice) : 0) + , m_inputMethod(m_compositor->extensionFlags() & QWaylandCompositor::TextInputExtension ? new QtWayland::InputMethod(m_compositor, inputdevice) : 0) , m_data_device() { } -InputDevice::~InputDevice() +QWaylandInputDevicePrivate::~QWaylandInputDevicePrivate() { } -Pointer *InputDevice::pointerDevice() +QWaylandPointer *QWaylandInputDevicePrivate::pointerDevice() const { return m_pointer.data(); } -Keyboard *InputDevice::keyboardDevice() +QWaylandKeyboard *QWaylandInputDevicePrivate::keyboardDevice() const { return m_keyboard.data(); } -Touch *InputDevice::touchDevice() +QWaylandTouch *QWaylandInputDevicePrivate::touchDevice() const { return m_touch.data(); } -InputMethod *InputDevice::inputMethod() +QtWayland::InputMethod *QWaylandInputDevicePrivate::inputMethod() { return m_inputMethod.data(); } -const Pointer *InputDevice::pointerDevice() const -{ - return m_pointer.data(); -} -const Keyboard *InputDevice::keyboardDevice() const -{ - return m_keyboard.data(); -} - -const Touch *InputDevice::touchDevice() const -{ - return m_touch.data(); -} - -void InputDevice::seat_destroy_resource(wl_seat::Resource *) +void QWaylandInputDevicePrivate::seat_destroy_resource(wl_seat::Resource *) { // cleanupDataDeviceForClient(resource->client(), true); } -void InputDevice::seat_bind_resource(wl_seat::Resource *resource) +void QWaylandInputDevicePrivate::seat_bind_resource(wl_seat::Resource *resource) { // The order of m_capabilities matches the order defined in the wayland protocol wl_seat::send_capabilities(resource->handle, (uint32_t)m_capabilities); } -void InputDevice::setCapabilities(QWaylandInputDevice::CapabilityFlags caps) +void QWaylandInputDevicePrivate::setCapabilities(QWaylandInputDevice::CapabilityFlags caps) { + Q_Q(QWaylandInputDevice); if (m_capabilities != caps) { QWaylandInputDevice::CapabilityFlags changed = caps ^ m_capabilities; if (changed & QWaylandInputDevice::Pointer) { - m_pointer.reset(m_pointer.isNull() ? new Pointer(m_compositor, this) : 0); + m_pointer.reset(m_pointer.isNull() ? new QWaylandPointer(q) : 0); } if (changed & QWaylandInputDevice::Keyboard) { - m_keyboard.reset(m_keyboard.isNull() ? new Keyboard(m_compositor, this) : 0); + m_keyboard.reset(m_keyboard.isNull() ? new QWaylandKeyboard(q) : 0); } if (changed & QWaylandInputDevice::Touch) { - m_touch.reset(m_touch.isNull() ? new Touch(m_compositor) : 0); + m_touch.reset(m_touch.isNull() ? new QWaylandTouch(q) : 0); } m_capabilities = caps; @@ -145,110 +131,83 @@ void InputDevice::setCapabilities(QWaylandInputDevice::CapabilityFlags caps) } } -void InputDevice::seat_get_pointer(wl_seat::Resource *resource, uint32_t id) +void QWaylandInputDevicePrivate::seat_get_pointer(wl_seat::Resource *resource, uint32_t id) { if (!m_pointer.isNull()) { - m_pointer->add(resource->client(), id, resource->version()); + m_pointer->addClient(QWaylandClient::fromWlClient(resource->client()), id); } } -void InputDevice::seat_get_keyboard(wl_seat::Resource *resource, uint32_t id) +void QWaylandInputDevicePrivate::seat_get_keyboard(wl_seat::Resource *resource, uint32_t id) { if (!m_keyboard.isNull()) { - m_keyboard->add(resource->client(), id, resource->version()); + QWaylandKeyboardPrivate::get(m_keyboard.data())->add(resource->client(), id, resource->version()); } } -void InputDevice::seat_get_touch(wl_seat::Resource *resource, uint32_t id) +void QWaylandInputDevicePrivate::seat_get_touch(wl_seat::Resource *resource, uint32_t id) { if (!m_touch.isNull()) { - m_touch->add(resource->client(), id, resource->version()); + m_touch->addClient(QWaylandClient::fromWlClient(resource->client()), id); } } -void InputDevice::sendMousePressEvent(Qt::MouseButton button, const QPointF &localPos, const QPointF &globalPos) +void QWaylandInputDevicePrivate::sendMousePressEvent(Qt::MouseButton button) { - pointerDevice()->sendMousePressEvent(button, localPos, globalPos); + pointerDevice()->sendMousePressEvent(button); } -void InputDevice::sendMouseReleaseEvent(Qt::MouseButton button, const QPointF &localPos, const QPointF &globalPos) +void QWaylandInputDevicePrivate::sendMouseReleaseEvent(Qt::MouseButton button) { - pointerDevice()->sendMouseReleaseEvent(button, localPos, globalPos); + pointerDevice()->sendMouseReleaseEvent(button); } -void InputDevice::sendMouseMoveEvent(const QPointF &localPos, const QPointF &globalPos) +void QWaylandInputDevicePrivate::sendMouseMoveEvent(QWaylandSurfaceView *surface, const QPointF &localPos, const QPointF &globalPos) { - pointerDevice()->sendMouseMoveEvent(localPos, globalPos); + pointerDevice()->sendMouseMoveEvent(surface, localPos,globalPos); } -void InputDevice::sendMouseMoveEvent(QWaylandSurfaceView *surface, const QPointF &localPos, const QPointF &globalPos) -{ - setMouseFocus(surface,localPos,globalPos); - sendMouseMoveEvent(localPos,globalPos); -} - -void InputDevice::sendMouseWheelEvent(Qt::Orientation orientation, int delta) +void QWaylandInputDevicePrivate::sendMouseWheelEvent(Qt::Orientation orientation, int delta) { pointerDevice()->sendMouseWheelEvent(orientation, delta); } -void InputDevice::sendMouseEnterEvent(QWaylandSurfaceView *view, const QPointF &localPos) -{ - pointerDevice()->sendMouseEnterEvent(view, localPos); -} - -void InputDevice::sendMouseLeaveEvent(QWaylandSurfaceView *view) +void QWaylandInputDevicePrivate::sendResetCurrentMouseView() { - pointerDevice()->sendMouseLeaveEvent(view); + pointerDevice()->resetCurrentView(); } -void InputDevice::sendTouchPointEvent(int id, double x, double y, Qt::TouchPointState state) +void QWaylandInputDevicePrivate::sendTouchPointEvent(int id, const QPointF &point, Qt::TouchPointState state) { if (m_touch.isNull()) { return; } - - switch (state) { - case Qt::TouchPointPressed: - m_touch->sendDown(id, QPointF(x, y)); - break; - case Qt::TouchPointMoved: - m_touch->sendMotion(id, QPointF(x, y)); - break; - case Qt::TouchPointReleased: - m_touch->sendUp(id); - break; - case Qt::TouchPointStationary: - // stationary points are not sent through wayland, the client must cache them - break; - default: - break; - } + m_touch->sendTouchPointEvent(id, point,state); } -void InputDevice::sendTouchFrameEvent() +void QWaylandInputDevicePrivate::sendTouchFrameEvent() { if (!m_touch.isNull()) { - m_touch->sendFrame(); + m_touch->sendFrameEvent(); } } -void InputDevice::sendTouchCancelEvent() +void QWaylandInputDevicePrivate::sendTouchCancelEvent() { if (!m_touch.isNull()) { - m_touch->sendCancel(); + m_touch->sendCancelEvent(); } } -void InputDevice::sendFullKeyEvent(QKeyEvent *event) +void QWaylandInputDevicePrivate::sendFullKeyEvent(QKeyEvent *event) { if (!keyboardFocus()) { qWarning("Cannot send key event, no keyboard focus, fix the compositor"); return; } - QtKeyExtensionGlobal *ext = QtKeyExtensionGlobal::get(m_compositor->waylandCompositor()); - if (ext && ext->postQtKeyEvent(event, keyboardFocus())) + QtWayland::QtKeyExtensionGlobal *ext = QtWayland::QtKeyExtensionGlobal::get(m_compositor); + if (ext && ext->postQtKeyEvent(event, keyboardFocus()->handle())) return; if (!m_keyboard.isNull() && !event->isAutoRepeat()) { @@ -259,124 +218,92 @@ void InputDevice::sendFullKeyEvent(QKeyEvent *event) } } -void InputDevice::sendFullKeyEvent(Surface *surface, QKeyEvent *event) +void QWaylandInputDevicePrivate::sendFullKeyEvent(QWaylandSurface *surface, QKeyEvent *event) { - QtKeyExtensionGlobal *ext = QtKeyExtensionGlobal::get(m_compositor->waylandCompositor()); + QtWayland::QtKeyExtensionGlobal *ext = QtWayland::QtKeyExtensionGlobal::get(m_compositor); if (ext) - ext->postQtKeyEvent(event, surface); + ext->postQtKeyEvent(event, surface->handle()); } -void InputDevice::sendFullTouchEvent(QTouchEvent *event) +void QWaylandInputDevicePrivate::sendFullTouchEvent(QTouchEvent *event) { if (!mouseFocus()) { qWarning("Cannot send touch event, no pointer focus, fix the compositor"); return; } - if (event->type() == QEvent::TouchCancel) { - sendTouchCancelEvent(); + if (!m_touch) return; - } - TouchExtensionGlobal *ext = TouchExtensionGlobal::get(m_compositor->waylandCompositor()); - if (ext && ext->postTouchEvent(event, mouseFocus())) - return; - - const QList points = event->touchPoints(); - if (points.isEmpty()) - return; - - const int pointCount = points.count(); - QPointF pos = mouseFocus()->requestedPosition(); - for (int i = 0; i < pointCount; ++i) { - const QTouchEvent::TouchPoint &tp(points.at(i)); - // Convert the local pos in the compositor window to surface-relative. - QPointF p = tp.pos() - pos; - sendTouchPointEvent(tp.id(), p.x(), p.y(), tp.state()); - } - sendTouchFrameEvent(); + m_touch->sendFullTouchEvent(event); } -Surface *InputDevice::keyboardFocus() const +QWaylandSurface *QWaylandInputDevicePrivate::keyboardFocus() const { - return m_keyboard.isNull() ? 0 : m_keyboard->focus(); + if (m_keyboard.isNull() || !m_keyboard->focus()) + return Q_NULLPTR; + + return m_keyboard->focus(); } /*! * \return True if the keyboard focus is changed successfully. False for inactive transient surfaces. */ -bool InputDevice::setKeyboardFocus(Surface *surface) +bool QWaylandInputDevicePrivate::setKeyboardFocus(QWaylandSurface *surface) { - if (surface && (surface->transientInactive() || surface->isDestroyed())) + if (surface && (surface->transientInactive() || surface->handle()->isDestroyed())) return false; if (!m_keyboard.isNull()) { m_keyboard->setFocus(surface); if (m_data_device) - m_data_device->setFocus(m_keyboard->focusResource()); + m_data_device->setFocus(m_keyboard->focusClient()); return true; } return false; } -QWaylandSurfaceView *InputDevice::mouseFocus() const +QWaylandSurfaceView *QWaylandInputDevicePrivate::mouseFocus() const { - return m_pointer.isNull() ? 0 : m_pointer->focusSurface(); -} - -void InputDevice::setMouseFocus(QWaylandSurfaceView *view, const QPointF &localPos, const QPointF &globalPos) -{ - if (view && view->surface()->handle()->isDestroyed()) - return; - - if (!m_pointer.isNull()) { - m_pointer->setMouseFocus(view, localPos, globalPos); - } - - if (!m_touch.isNull()) { - // We have no separate touch focus management so make it match the pointer focus always. - // No wl_touch_set_focus() is available so set it manually. - m_touch->setFocus(view); - } + return m_pointer.isNull() ? 0 : m_pointer->currentView(); } -void InputDevice::clientRequestedDataDevice(DataDeviceManager *, struct wl_client *client, uint32_t id) +void QWaylandInputDevicePrivate::clientRequestedDataDevice(QtWayland::DataDeviceManager *, struct wl_client *client, uint32_t id) { + Q_Q(QWaylandInputDevice); if (!m_data_device) - m_data_device.reset(new DataDevice(this)); + m_data_device.reset(new QtWayland::DataDevice(q)); m_data_device->add(client, id, 1); } -Compositor *InputDevice::compositor() const +QWaylandCompositor *QWaylandInputDevicePrivate::compositor() const { return m_compositor; } -QWaylandInputDevice *InputDevice::handle() const -{ - return m_handle; -} - -QWaylandDrag *InputDevice::dragHandle() const +QWaylandDrag *QWaylandInputDevicePrivate::dragHandle() const { return m_dragHandle.data(); } -const DataDevice *InputDevice::dataDevice() const +const QtWayland::DataDevice *QWaylandInputDevicePrivate::dataDevice() const { return m_data_device.data(); } -QWaylandOutputSpace *InputDevice::outputSpace() const +QWaylandOutputSpace *QWaylandInputDevicePrivate::outputSpace() const { return m_outputSpace; } -void InputDevice::setOutputSpace(QWaylandOutputSpace *outputSpace) +void QWaylandInputDevicePrivate::setOutputSpace(QWaylandOutputSpace *outputSpace) { m_outputSpace = outputSpace; } +QWaylandInputDevicePrivate *QWaylandInputDevicePrivate::get(QWaylandInputDevice *device) +{ + return device->d_func(); } QT_END_NAMESPACE diff --git a/src/compositor/wayland_wrapper/qwlinputdevice_p.h b/src/compositor/wayland_wrapper/qwlinputdevice_p.h index da59dd208..dba63c05a 100644 --- a/src/compositor/wayland_wrapper/qwlinputdevice_p.h +++ b/src/compositor/wayland_wrapper/qwlinputdevice_p.h @@ -45,6 +45,7 @@ #include #include #include +#include #ifndef QT_NO_WAYLAND_XKB #include @@ -71,74 +72,70 @@ class Keyboard; class Touch; class InputMethod; -class Q_COMPOSITOR_EXPORT InputDevice : public QtWaylandServer::wl_seat +} + +class Q_COMPOSITOR_EXPORT QWaylandInputDevicePrivate : public QObjectPrivate, public QtWaylandServer::wl_seat { public: - InputDevice(QWaylandInputDevice *handle, Compositor *compositor, QWaylandInputDevice::CapabilityFlags caps); - ~InputDevice(); + Q_DECLARE_PUBLIC(QWaylandInputDevice) + + QWaylandInputDevicePrivate(QWaylandInputDevice *device, QWaylandCompositor *compositor, QWaylandInputDevice::CapabilityFlags caps); + ~QWaylandInputDevicePrivate(); - void sendMousePressEvent(Qt::MouseButton button, const QPointF &localPos, const QPointF &globalPos = QPointF()); - void sendMouseReleaseEvent(Qt::MouseButton button, const QPointF &localPos, const QPointF &globalPos = QPointF()); - void sendMouseMoveEvent(const QPointF &localPos, const QPointF &globalPos = QPointF()); - void sendMouseMoveEvent(QWaylandSurfaceView *surface, const QPointF &localPos, const QPointF &globalPos = QPointF()); + void sendMousePressEvent(Qt::MouseButton button); + void sendMouseReleaseEvent(Qt::MouseButton button); + void sendMouseMoveEvent(QWaylandSurfaceView *surface, const QPointF &localPos, const QPointF &spacePos = QPointF()); void sendMouseWheelEvent(Qt::Orientation orientation, int delta); - void sendMouseEnterEvent(QWaylandSurfaceView *view, const QPointF &localPos); - void sendMouseLeaveEvent(QWaylandSurfaceView *view); + void sendResetCurrentMouseView(); - void sendTouchPointEvent(int id, double x, double y, Qt::TouchPointState state); + void sendTouchPointEvent(int id, const QPointF &point, Qt::TouchPointState state); void sendTouchFrameEvent(); void sendTouchCancelEvent(); void sendFullKeyEvent(QKeyEvent *event); - void sendFullKeyEvent(Surface *surface, QKeyEvent *event); + void sendFullKeyEvent(QWaylandSurface *surface, QKeyEvent *event); void sendFullTouchEvent(QTouchEvent *event); - Surface *keyboardFocus() const; - bool setKeyboardFocus(Surface *surface); + QWaylandSurface *keyboardFocus() const; + bool setKeyboardFocus(QWaylandSurface *surface); QWaylandSurfaceView *mouseFocus() const; - void setMouseFocus(QWaylandSurfaceView *surface, const QPointF &localPos, const QPointF &globalPos); - void clientRequestedDataDevice(DataDeviceManager *dndSelection, struct wl_client *client, uint32_t id); - const DataDevice *dataDevice() const; + void clientRequestedDataDevice(QtWayland::DataDeviceManager *dndSelection, struct wl_client *client, uint32_t id); + const QtWayland::DataDevice *dataDevice() const; QWaylandOutputSpace *outputSpace() const; void setOutputSpace(QWaylandOutputSpace *outputSpace); - Compositor *compositor() const; - QWaylandInputDevice *handle() const; + QWaylandCompositor *compositor() const; QWaylandDrag *dragHandle() const; - Pointer *pointerDevice(); - Keyboard *keyboardDevice(); - Touch *touchDevice(); - InputMethod *inputMethod(); + QWaylandPointer *pointerDevice() const; + QWaylandKeyboard *keyboardDevice() const; + QWaylandTouch *touchDevice() const; + QtWayland::InputMethod *inputMethod(); - const Pointer *pointerDevice() const; - const Keyboard *keyboardDevice() const; - const Touch *touchDevice() const; - - static InputDevice *fromSeatResource(struct ::wl_resource *resource) + static QWaylandInputDevicePrivate *fromSeatResource(struct ::wl_resource *resource) { - return static_cast(wl_seat::Resource::fromResource(resource)->seat_object); + return static_cast(wl_seat::Resource::fromResource(resource)->seat_object); } - QWaylandInputDevice::CapabilityFlags capabilities() { return m_capabilities; } + QWaylandInputDevice::CapabilityFlags capabilities() const { return m_capabilities; } void setCapabilities(QWaylandInputDevice::CapabilityFlags caps); + static QWaylandInputDevicePrivate *get(QWaylandInputDevice *device); private: - QWaylandInputDevice *m_handle; QScopedPointer m_dragHandle; - Compositor *m_compositor; + QWaylandCompositor *m_compositor; QWaylandOutputSpace *m_outputSpace; QWaylandInputDevice::CapabilityFlags m_capabilities; - QScopedPointer m_pointer; - QScopedPointer m_keyboard; - QScopedPointer m_touch; - QScopedPointer m_inputMethod; - QScopedPointer m_data_device; + QScopedPointer m_pointer; + QScopedPointer m_keyboard; + QScopedPointer m_touch; + QScopedPointer m_inputMethod; + QScopedPointer m_data_device; void seat_bind_resource(wl_seat::Resource *resource) Q_DECL_OVERRIDE; @@ -152,8 +149,6 @@ private: void seat_destroy_resource(wl_seat::Resource *resource) Q_DECL_OVERRIDE; }; -} - QT_END_NAMESPACE #endif // WLINPUTDEVICE_H diff --git a/src/compositor/wayland_wrapper/qwlinputmethod.cpp b/src/compositor/wayland_wrapper/qwlinputmethod.cpp index 187c4e13d..a9ea4bbb3 100644 --- a/src/compositor/wayland_wrapper/qwlinputmethod.cpp +++ b/src/compositor/wayland_wrapper/qwlinputmethod.cpp @@ -47,15 +47,15 @@ QT_BEGIN_NAMESPACE namespace QtWayland { -InputMethod::InputMethod(Compositor *compositor, InputDevice *seat) - : QtWaylandServer::wl_input_method(seat->compositor()->wl_display(), 1) +InputMethod::InputMethod(QWaylandCompositor *compositor, QWaylandInputDevice *seat) + : QtWaylandServer::wl_input_method(seat->compositor()->waylandDisplay(), 1) , m_compositor(compositor) , m_seat(seat) , m_resource(0) , m_textInput() , m_context() { - connect(seat->keyboardDevice(), SIGNAL(focusChanged(Surface*)), this, SLOT(focusChanged(Surface*))); + connect(seat->keyboard(), SIGNAL(focusChanged(Surface*)), this, SLOT(focusChanged(Surface*))); } InputMethod::~InputMethod() @@ -78,7 +78,7 @@ void InputMethod::activate(TextInput *textInput) send_activate(m_resource->handle, m_context->resource()->handle); - QWaylandInputPanelPrivate *panel = QWaylandInputPanelPrivate::get(m_compositor->waylandCompositor()); + QWaylandInputPanelPrivate *panel = QWaylandInputPanelPrivate::get(m_compositor); if (panel) { panel->setFocus(textInput->focus()); panel->setCursorRectangle(textInput->cursorRectangle()); @@ -97,7 +97,7 @@ void InputMethod::deactivate() m_textInput = 0; m_context = 0; - QWaylandInputPanelPrivate *panel = QWaylandInputPanelPrivate::get(m_compositor->waylandCompositor()); + QWaylandInputPanelPrivate *panel = QWaylandInputPanelPrivate::get(m_compositor); if (panel) { panel->setFocus(0); panel->setCursorRectangle(QRect()); diff --git a/src/compositor/wayland_wrapper/qwlinputmethod_p.h b/src/compositor/wayland_wrapper/qwlinputmethod_p.h index 473810474..4d857c045 100644 --- a/src/compositor/wayland_wrapper/qwlinputmethod_p.h +++ b/src/compositor/wayland_wrapper/qwlinputmethod_p.h @@ -44,10 +44,11 @@ QT_BEGIN_NAMESPACE +class QWaylandInputDevice; +class QWaylandCompositor; + namespace QtWayland { -class Compositor; -class InputDevice; class InputMethodContext; class TextInput; class Surface; @@ -57,7 +58,7 @@ class InputMethod : public QObject, public QtWaylandServer::wl_input_method Q_OBJECT public: - explicit InputMethod(Compositor *compositor, InputDevice *seat); + explicit InputMethod(QWaylandCompositor *compositor, QWaylandInputDevice *seat); ~InputMethod(); void activate(TextInput *textInput); @@ -76,8 +77,8 @@ private slots: void focusChanged(Surface *surface); private: - Compositor *m_compositor; - InputDevice *m_seat; + QWaylandCompositor *m_compositor; + QWaylandInputDevice *m_seat; Resource *m_resource; TextInput *m_textInput; InputMethodContext *m_context; diff --git a/src/compositor/wayland_wrapper/qwlkeyboard.cpp b/src/compositor/wayland_wrapper/qwlkeyboard.cpp index 8a76cbb40..9811f918a 100644 --- a/src/compositor/wayland_wrapper/qwlkeyboard.cpp +++ b/src/compositor/wayland_wrapper/qwlkeyboard.cpp @@ -40,6 +40,8 @@ #include #include +#include + #include "qwlcompositor_p.h" #include "qwlsurface_p.h" @@ -52,11 +54,8 @@ QT_BEGIN_NAMESPACE -namespace QtWayland { - -Keyboard::Keyboard(Compositor *compositor, InputDevice *seat) +QWaylandKeyboardPrivate::QWaylandKeyboardPrivate(QWaylandInputDevice *seat) : QtWaylandServer::wl_keyboard() - , m_compositor(compositor) , m_seat(seat) , m_grab(this) , m_focus() @@ -74,10 +73,9 @@ Keyboard::Keyboard(Compositor *compositor, InputDevice *seat) #ifndef QT_NO_WAYLAND_XKB initXKB(); #endif - connect(&m_focusDestroyListener, &WlListener::fired, this, &Keyboard::focusDestroyed); } -Keyboard::~Keyboard() +QWaylandKeyboardPrivate::~QWaylandKeyboardPrivate() { #ifndef QT_NO_WAYLAND_XKB if (m_context) { @@ -90,55 +88,57 @@ Keyboard::~Keyboard() #endif } -KeyboardGrabber::~KeyboardGrabber() -{ -} - -void Keyboard::startGrab(KeyboardGrabber *grab) +void QWaylandKeyboardPrivate::startGrab(QWaylandKeyboardGrabber *grab) { + Q_Q(QWaylandKeyboard); m_grab = grab; - m_grab->m_keyboard = this; + m_grab->m_keyboard = q; m_grab->focused(m_focus); } -void Keyboard::endGrab() +void QWaylandKeyboardPrivate::endGrab() { m_grab = this; } -KeyboardGrabber *Keyboard::currentGrab() const +QWaylandKeyboardGrabber *QWaylandKeyboardPrivate::currentGrab() const { return m_grab; } -void Keyboard::focused(Surface *surface) +QWaylandKeyboardPrivate *QWaylandKeyboardPrivate::get(QWaylandKeyboard *keyboard) +{ + return keyboard->d_func(); +} + +void QWaylandKeyboardPrivate::focused(QWaylandSurface *surface) { if (m_focusResource && m_focus != surface) { - uint32_t serial = wl_display_next_serial(m_compositor->wl_display()); - send_leave(m_focusResource->handle, serial, m_focus->resource()->handle); + uint32_t serial = wl_display_next_serial(compositor()->waylandDisplay()); + send_leave(m_focusResource->handle, serial, m_focus->handle()->resource()->handle); m_focusDestroyListener.reset(); } - Resource *resource = surface ? resourceMap().value(surface->resource()->client()) : 0; + Resource *resource = surface ? resourceMap().value(surface->client()->client()) : 0; if (resource && (m_focus != surface || m_focusResource != resource)) { - uint32_t serial = wl_display_next_serial(m_compositor->wl_display()); + uint32_t serial = wl_display_next_serial(compositor()->waylandDisplay()); send_modifiers(resource->handle, serial, m_modsDepressed, m_modsLatched, m_modsLocked, m_group); - send_enter(resource->handle, serial, surface->resource()->handle, QByteArray::fromRawData((char *)m_keys.data(), m_keys.size() * sizeof(uint32_t))); - m_focusDestroyListener.listenForDestruction(surface->resource()->handle); + send_enter(resource->handle, serial, surface->resource(), QByteArray::fromRawData((char *)m_keys.data(), m_keys.size() * sizeof(uint32_t))); + m_focusDestroyListener.listenForDestruction(surface->resource()); } m_focusResource = resource; m_focus = surface; - Q_EMIT focusChanged(m_focus); + Q_EMIT q_func()->focusChanged(m_focus); } -void Keyboard::setFocus(Surface* surface) +void QWaylandKeyboardPrivate::setFocus(QWaylandSurface* surface) { m_grab->focused(surface); } -void Keyboard::setKeymap(const QWaylandKeymap &keymap) +void QWaylandKeyboardPrivate::setKeymap(const QWaylandKeymap &keymap) { m_keymap = keymap; @@ -152,41 +152,27 @@ void Keyboard::setKeymap(const QWaylandKeymap &keymap) } } -void Keyboard::focusDestroyed(void *data) -{ - Q_UNUSED(data) - m_focusDestroyListener.reset(); - - m_focus = 0; - m_focusResource = 0; -} - -void Keyboard::sendKeyModifiers(wl_keyboard::Resource *resource, uint32_t serial) +void QWaylandKeyboardPrivate::sendKeyModifiers(wl_keyboard::Resource *resource, uint32_t serial) { send_modifiers(resource->handle, serial, m_modsDepressed, m_modsLatched, m_modsLocked, m_group); } -void Keyboard::sendKeyPressEvent(uint code) +void QWaylandKeyboardPrivate::sendKeyPressEvent(uint code) { sendKeyEvent(code, WL_KEYBOARD_KEY_STATE_PRESSED); } -void Keyboard::sendKeyReleaseEvent(uint code) +void QWaylandKeyboardPrivate::sendKeyReleaseEvent(uint code) { sendKeyEvent(code, WL_KEYBOARD_KEY_STATE_RELEASED); } -Surface *Keyboard::focus() const +QWaylandSurface *QWaylandKeyboardPrivate::focus() const { return m_focus; } -QtWaylandServer::wl_keyboard::Resource *Keyboard::focusResource() const -{ - return m_focusResource; -} - -void Keyboard::keyboard_bind_resource(wl_keyboard::Resource *resource) +void QWaylandKeyboardPrivate::keyboard_bind_resource(wl_keyboard::Resource *resource) { #ifndef QT_NO_WAYLAND_XKB if (m_context) { @@ -201,26 +187,33 @@ void Keyboard::keyboard_bind_resource(wl_keyboard::Resource *resource) close(null_fd); } -void Keyboard::keyboard_destroy_resource(wl_keyboard::Resource *resource) +void QWaylandKeyboardPrivate::keyboard_destroy_resource(wl_keyboard::Resource *resource) { if (m_focusResource == resource) m_focusResource = 0; } -void Keyboard::keyboard_release(wl_keyboard::Resource *resource) +void QWaylandKeyboardPrivate::keyboard_release(wl_keyboard::Resource *resource) { wl_resource_destroy(resource->handle); } -void Keyboard::key(uint32_t serial, uint32_t time, uint32_t key, uint32_t state) +void QWaylandKeyboardPrivate::key(uint32_t serial, uint32_t time, uint32_t key, uint32_t state) { if (m_focusResource) { send_key(m_focusResource->handle, serial, time, key, state); } } -void Keyboard::keyEvent(uint code, uint32_t state) +void QWaylandKeyboardPrivate::sendKeyEvent(uint code, uint32_t state) { + // There must be no keys pressed when changing the keymap, + // see http://lists.freedesktop.org/archives/wayland-devel/2013-October/011395.html + if (m_pendingKeymap && m_keys.isEmpty()) + updateKeymap(); + + uint32_t time = compositor()->currentTimeMsecs(); + uint32_t serial = wl_display_next_serial(compositor()->waylandDisplay()); uint key = code - 8; if (state == WL_KEYBOARD_KEY_STATE_PRESSED) { m_keys << key; @@ -241,7 +234,7 @@ void Keyboard::sendKeyEvent(uint code, uint32_t state) m_grab->key(serial, time, key, state); } -void Keyboard::modifiers(uint32_t serial, uint32_t mods_depressed, +void QWaylandKeyboardPrivate::modifiers(uint32_t serial, uint32_t mods_depressed, uint32_t mods_latched, uint32_t mods_locked, uint32_t group) { if (m_focusResource) { @@ -249,7 +242,7 @@ void Keyboard::modifiers(uint32_t serial, uint32_t mods_depressed, } } -void Keyboard::updateModifierState(uint code, uint32_t state) +void QWaylandKeyboardPrivate::updateModifierState(uint code, uint32_t state) { #ifndef QT_NO_WAYLAND_XKB if (!m_context) @@ -273,14 +266,14 @@ void Keyboard::updateModifierState(uint code, uint32_t state) m_modsLocked = modsLocked; m_group = group; - m_grab->modifiers(wl_display_next_serial(m_compositor->wl_display()), m_modsDepressed, m_modsLatched, m_modsLocked, m_group); + m_grab->modifiers(wl_display_next_serial(compositor()->waylandDisplay()), m_modsDepressed, m_modsLatched, m_modsLocked, m_group); #else Q_UNUSED(code); Q_UNUSED(state); #endif } -void Keyboard::updateKeymap() +void QWaylandKeyboardPrivate::updateKeymap() { // There must be no keys pressed when changing the keymap, // see http://lists.freedesktop.org/archives/wayland-devel/2013-October/011395.html @@ -299,7 +292,7 @@ void Keyboard::updateKeymap() xkb_state_update_mask(m_state, 0, m_modsLatched, m_modsLocked, 0, 0, 0); if (m_focusResource) - sendKeyModifiers(m_focusResource, wl_display_next_serial(m_compositor->wl_display())); + sendKeyModifiers(m_focusResource, wl_display_next_serial(compositor()->waylandDisplay())); #endif } @@ -334,7 +327,7 @@ static int createAnonymousFile(size_t size) return fd; } -void Keyboard::initXKB() +void QWaylandKeyboardPrivate::initXKB() { m_context = xkb_context_new(static_cast(0)); if (!m_context) { @@ -345,7 +338,7 @@ void Keyboard::initXKB() createXKBKeymap(); } -void Keyboard::createXKBKeymap() +void QWaylandKeyboardPrivate::createXKBKeymap() { if (!m_context) return; @@ -390,6 +383,4 @@ void Keyboard::createXKBKeymap() } #endif -} // namespace QtWayland - QT_END_NAMESPACE diff --git a/src/compositor/wayland_wrapper/qwlkeyboard_p.h b/src/compositor/wayland_wrapper/qwlkeyboard_p.h index 62fc157a2..2579c2da1 100644 --- a/src/compositor/wayland_wrapper/qwlkeyboard_p.h +++ b/src/compositor/wayland_wrapper/qwlkeyboard_p.h @@ -40,8 +40,10 @@ #include #include +#include +#include -#include +#include #include #include @@ -50,7 +52,6 @@ #include #endif -#include "qwllistener_p.h" QT_BEGIN_NAMESPACE @@ -61,55 +62,39 @@ class InputDevice; class Surface; class Keyboard; -class Q_COMPOSITOR_EXPORT KeyboardGrabber { - public: - virtual ~KeyboardGrabber(); - virtual void focused(Surface *surface) = 0; - virtual void key(uint32_t serial, uint32_t time, uint32_t key, uint32_t state) = 0; - virtual void modifiers(uint32_t serial, uint32_t mods_depressed, - uint32_t mods_latched, uint32_t mods_locked, uint32_t group) = 0; +} - Keyboard *m_keyboard; -}; - -class Q_COMPOSITOR_EXPORT Keyboard : public QObject, public QtWaylandServer::wl_keyboard, public KeyboardGrabber +class Q_COMPOSITOR_EXPORT QWaylandKeyboardPrivate : public QObjectPrivate + , public QtWaylandServer::wl_keyboard + , public QWaylandKeyboardGrabber { - Q_OBJECT - public: - Keyboard(Compositor *compositor, InputDevice *seat); - ~Keyboard(); + Q_DECLARE_PUBLIC(QWaylandKeyboard) + + QWaylandKeyboardPrivate(QWaylandInputDevice *seat); + ~QWaylandKeyboardPrivate(); - void setFocus(Surface *surface); + QWaylandCompositor *compositor() const { return m_seat->compositor(); } + void setFocus(QWaylandSurface *surface); void setKeymap(const QWaylandKeymap &keymap); void sendKeyModifiers(Resource *resource, uint32_t serial); void sendKeyPressEvent(uint code); void sendKeyReleaseEvent(uint code); - Surface *focus() const; - Resource *focusResource() const; + QWaylandSurface *focus() const; + Resource *focusResource() const { return m_focusResource; } - void focused(Surface* surface); + void focused(QWaylandSurface* surface); void key(uint32_t serial, uint32_t time, uint32_t key, uint32_t state); void modifiers(uint32_t serial, uint32_t mods_depressed, - uint32_t mods_latched, uint32_t mods_locked, uint32_t group); + uint32_t mods_latched, uint32_t mods_locked, uint32_t group); - void keyEvent(uint code, uint32_t state); - void updateModifierState(uint code, uint32_t state); - void updateKeymap(); + void startGrab(QWaylandKeyboardGrabber *grab); + void endGrab(); + QWaylandKeyboardGrabber *currentGrab() const; - void startGrab(KeyboardGrabber *grab); - void endGrab(); - KeyboardGrabber *currentGrab() const; - -#ifndef QT_NO_WAYLAND_XKB - struct xkb_state *xkbState() const { return m_state; } - uint32_t xkbModsMask() const { return m_modsDepressed | m_modsLatched | m_modsLocked; } -#endif - -Q_SIGNALS: - void focusChanged(Surface *surface); + static QWaylandKeyboardPrivate *get(QWaylandKeyboard *keyboard); protected: void keyboard_bind_resource(Resource *resource); @@ -118,20 +103,20 @@ protected: private: void sendKeyEvent(uint code, uint32_t state); - void focusDestroyed(void *data); + void updateModifierState(uint code, uint32_t state); + void updateKeymap(); #ifndef QT_NO_WAYLAND_XKB void initXKB(); void createXKBKeymap(); #endif - Compositor *m_compositor; - InputDevice *m_seat; + QWaylandInputDevice *m_seat; - KeyboardGrabber* m_grab; - Surface *m_focus; + QWaylandKeyboardGrabber* m_grab; + QWaylandSurface *m_focus; Resource *m_focusResource; - WlListener m_focusDestroyListener; + QWaylandDestroyListener m_focusDestroyListener; QVector m_keys; uint32_t m_modsDepressed; @@ -150,8 +135,6 @@ private: #endif }; -} // namespace QtWayland - QT_END_NAMESPACE #endif // QTWAYLAND_QWLKEYBOARD_P_H diff --git a/src/compositor/wayland_wrapper/qwllistener.cpp b/src/compositor/wayland_wrapper/qwllistener.cpp deleted file mode 100644 index 3099cc108..000000000 --- a/src/compositor/wayland_wrapper/qwllistener.cpp +++ /dev/null @@ -1,65 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 Jolla Ltd, author: -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the QtWaylandCompositor module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPLv3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qwllistener_p.h" - -QT_BEGIN_NAMESPACE - -WlListener::WlListener() -{ - m_listener.parent = this; - m_listener.listener.notify = handler; - wl_list_init(&m_listener.listener.link); -} - -void WlListener::listenForDestruction(::wl_resource *resource) -{ - wl_resource_add_destroy_listener(resource, &m_listener.listener); -} - -void WlListener::reset() -{ - wl_list_remove(&m_listener.listener.link); - wl_list_init(&m_listener.listener.link); -} - -void WlListener::handler(wl_listener *listener, void *data) -{ - WlListener *that = reinterpret_cast(listener)->parent; - emit that->fired(data); -} - -QT_END_NAMESPACE diff --git a/src/compositor/wayland_wrapper/qwllistener_p.h b/src/compositor/wayland_wrapper/qwllistener_p.h deleted file mode 100644 index 8ecab6f7f..000000000 --- a/src/compositor/wayland_wrapper/qwllistener_p.h +++ /dev/null @@ -1,70 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 Jolla Ltd, author: -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the QtWaylandCompositor module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPLv3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QTWAYLAND_QWLLISTENER_H -#define QTWAYLAND_QWLLISTENER_H - -#include - -#include - -QT_BEGIN_NAMESPACE - -class WlListener : public QObject -{ - Q_OBJECT -public: - WlListener(); - - void listenForDestruction(::wl_resource *resource); - void reset(); - -signals: - void fired(void *data); - -private: - static void handler(wl_listener *listener, void *data); - - struct Listener { - wl_listener listener; - WlListener *parent; - }; - Listener m_listener; -}; - -QT_END_NAMESPACE - -#endif diff --git a/src/compositor/wayland_wrapper/qwloutput_p.h b/src/compositor/wayland_wrapper/qwloutput_p.h index 974f5a789..1a261241b 100644 --- a/src/compositor/wayland_wrapper/qwloutput_p.h +++ b/src/compositor/wayland_wrapper/qwloutput_p.h @@ -95,6 +95,7 @@ public: void setGeometry(const QRect &geometry); void setWidth(int newWidth); void setHeight(int newHeight); + QPoint topLeft() const { return geometry().topLeft(); } bool sizeFollowsWindow() const; void setSizeFollowsWindow(bool follow); diff --git a/src/compositor/wayland_wrapper/qwlpointer.cpp b/src/compositor/wayland_wrapper/qwlpointer.cpp index 389964fa2..127003d36 100644 --- a/src/compositor/wayland_wrapper/qwlpointer.cpp +++ b/src/compositor/wayland_wrapper/qwlpointer.cpp @@ -46,196 +46,77 @@ QT_BEGIN_NAMESPACE -namespace QtWayland { - -using QtWaylandServer::wl_keyboard; - -static uint32_t toWaylandButton(Qt::MouseButton button) -{ -#ifndef BTN_LEFT - uint32_t BTN_LEFT = 0x110; -#endif - // the range of valid buttons (evdev module) is from 0x110 - // through 0x11f. 0x120 is the first 'Joystick' button. - switch (button) { - case Qt::LeftButton: return BTN_LEFT; - case Qt::RightButton: return uint32_t(0x111); - case Qt::MiddleButton: return uint32_t(0x112); - case Qt::ExtraButton1: return uint32_t(0x113); // AKA Qt::BackButton, Qt::XButton1 - case Qt::ExtraButton2: return uint32_t(0x114); // AKA Qt::ForwardButton, Qt::XButton2 - case Qt::ExtraButton3: return uint32_t(0x115); - case Qt::ExtraButton4: return uint32_t(0x116); - case Qt::ExtraButton5: return uint32_t(0x117); - case Qt::ExtraButton6: return uint32_t(0x118); - case Qt::ExtraButton7: return uint32_t(0x119); - case Qt::ExtraButton8: return uint32_t(0x11a); - case Qt::ExtraButton9: return uint32_t(0x11b); - case Qt::ExtraButton10: return uint32_t(0x11c); - case Qt::ExtraButton11: return uint32_t(0x11d); - case Qt::ExtraButton12: return uint32_t(0x11e); - case Qt::ExtraButton13: return uint32_t(0x11f); - // default should not occur; but if it does, then return Wayland's highest possible button number. - default: return uint32_t(0x11f); - } -} - -Pointer::Pointer(Compositor *compositor, InputDevice *seat) - : wl_pointer() - , PointerGrabber() - , m_compositor(compositor) +QWaylandPointerPrivate::QWaylandPointerPrivate(QWaylandPointer *pointer, QWaylandInputDevice *seat) + : QObjectPrivate() + , wl_pointer() , m_seat(seat) - , m_grab(this) + , m_output() + , m_defaultGrab(pointer) + , m_grab(&m_defaultGrab) , m_grabButton() , m_grabTime() , m_grabSerial() - , m_position(100, 100) - , m_focus() , m_focusResource() , m_buttonCount() { - connect(&m_focusDestroyListener, &WlListener::fired, this, &Pointer::focusDestroyed); -} - -void Pointer::setFocus(QWaylandSurfaceView *surface, const QPointF &position) -{ - if (m_focusResource && m_focus != surface) { - uint32_t serial = wl_display_next_serial(m_compositor->wl_display()); - send_leave(m_focusResource->handle, serial, m_focus->surface()->handle()->resource()->handle); - m_focusDestroyListener.reset(); - } - - Resource *resource = surface ? resourceMap().value(surface->surface()->handle()->resource()->client()) : 0; - - if (resource && (m_focus != surface || resource != m_focusResource)) { - uint32_t serial = wl_display_next_serial(m_compositor->wl_display()); - Keyboard *keyboard = m_seat->keyboardDevice(); - if (keyboard) { - wl_keyboard::Resource *kr = keyboard->resourceMap().value(surface->surface()->handle()->resource()->client()); - if (kr) - keyboard->sendKeyModifiers(kr, serial); - } - send_enter(resource->handle, serial, surface->surface()->handle()->resource()->handle, - wl_fixed_from_double(position.x()), wl_fixed_from_double(position.y())); - - m_focusDestroyListener.listenForDestruction(surface->surface()->handle()->resource()->handle); - } - - m_focusResource = resource; - m_focus = surface; -} - -void Pointer::focusDestroyed(void *data) -{ - Q_UNUSED(data) - m_focusDestroyListener.reset(); - - m_focus = 0; - m_focusResource = 0; - m_buttonCount = 0; - setMouseFocus(0, QPointF(), QPointF()); - endGrab(); } -void Pointer::startGrab(PointerGrabber *grab) +void QWaylandPointerPrivate::startGrab(QWaylandPointerGrabber *grab) { + Q_Q(QWaylandPointer); m_grab = grab; - grab->m_pointer = this; + grab->pointer = q; if (m_currentPosition.view()) grab->focus(); } -void Pointer::endGrab() +void QWaylandPointerPrivate::endGrab() { - m_grab = this; + m_grab = &m_defaultGrab; m_grab->focus(); } -void Pointer::setCurrent(QWaylandSurfaceView *surface, const QPointF &point) -{ - m_currentPosition.setCurrent(surface, point); -} - -bool Pointer::buttonPressed() const +bool QWaylandPointerPrivate::buttonPressed() const { return m_buttonCount > 0; } -PointerGrabber *Pointer::currentGrab() const +QWaylandPointerGrabber *QWaylandPointerPrivate::currentGrab() const { return m_grab; } -Qt::MouseButton Pointer::grabButton() const +Qt::MouseButton QWaylandPointerPrivate::grabButton() const { return m_grabButton; } -uint32_t Pointer::grabTime() const +uint32_t QWaylandPointerPrivate::grabTime() const { return m_grabTime; } -uint32_t Pointer::grabSerial() const +uint32_t QWaylandPointerPrivate::grabSerial() const { return m_grabSerial; } -QWaylandSurfaceView *Pointer::focusSurface() const -{ - return m_focus; -} - -QWaylandSurfaceView *Pointer::current() const -{ - return m_currentPosition.view(); -} - -QPointF Pointer::position() const -{ - return m_position; -} - -QPointF Pointer::currentPosition() const -{ - return m_currentPosition.position(); -} - -QtWaylandServer::wl_pointer::Resource *Pointer::focusResource() const -{ - return m_focusResource; -} - -void Pointer::pointer_destroy_resource(wl_pointer::Resource *resource) +void QWaylandPointerPrivate::pointer_destroy_resource(wl_pointer::Resource *resource) { if (m_focusResource == resource) m_focusResource = 0; } -void Pointer::pointer_release(wl_pointer::Resource *resource) +void QWaylandPointerPrivate::pointer_release(wl_pointer::Resource *resource) { wl_resource_destroy(resource->handle); } -void Pointer::setMouseFocus(QWaylandSurfaceView *surface, const QPointF &localPos, const QPointF &globalPos) +void QWaylandPointerPrivate::sendMousePressEvent(Qt::MouseButton button) { - m_position = globalPos; - - m_currentPosition.setCurrent(surface, localPos); - - m_grab->focus(); -} - -void Pointer::sendButton(uint32_t time, Qt::MouseButton button, uint32_t state) -{ - uint32_t serial = wl_display_next_serial(m_compositor->wl_display()); - send_button(m_focusResource->handle, serial, time, toWaylandButton(button), state); -} - -void Pointer::sendMousePressEvent(Qt::MouseButton button, const QPointF &localPos, const QPointF &globalPos) -{ - sendMouseMoveEvent(localPos, globalPos); - uint32_t time = m_compositor->currentTimeMsecs(); + Q_Q(QWaylandPointer); + uint32_t time = compositor()->currentTimeMsecs(); if (m_buttonCount == 0) { m_grabButton = button; m_grabTime = time; @@ -243,112 +124,86 @@ void Pointer::sendMousePressEvent(Qt::MouseButton button, const QPointF &localPo m_buttonCount++; m_grab->button(time, button, WL_POINTER_BUTTON_STATE_PRESSED); - if (m_buttonCount == 1) - m_grabSerial = wl_display_get_serial(m_compositor->wl_display()); + if (m_buttonCount == 1) { + m_grabSerial = wl_display_get_serial(compositor()->waylandDisplay()); + q->buttonPressedChanged(); + } } -void Pointer::sendMouseReleaseEvent(Qt::MouseButton button, const QPointF &localPos, const QPointF &globalPos) +void QWaylandPointerPrivate::sendMouseReleaseEvent(Qt::MouseButton button) { - sendMouseMoveEvent(localPos, globalPos); - uint32_t time = m_compositor->currentTimeMsecs(); + Q_Q(QWaylandPointer); + uint32_t time = compositor()->currentTimeMsecs(); m_buttonCount--; m_grab->button(time, button, WL_POINTER_BUTTON_STATE_RELEASED); if (m_buttonCount == 1) - m_grabSerial = wl_display_get_serial(m_compositor->wl_display()); + m_grabSerial = wl_display_get_serial(compositor()->waylandDisplay()); + if (m_buttonCount == 0) + q->buttonPressedChanged(); } -void Pointer::sendMouseMoveEvent(const QPointF &localPos, const QPointF &globalPos) +void QWaylandPointerPrivate::sendMouseMoveEvent(QWaylandSurfaceView *view, const QPointF &localPos, const QPointF &outputSpacePos) { - uint32_t time = m_compositor->currentTimeMsecs(); + Q_Q(QWaylandPointer); + if (m_focusResource && focusView() != view) { + uint32_t serial = wl_display_next_serial(compositor()->waylandDisplay()); + send_leave(m_focusResource->handle, serial, focusView()->surface()->handle()->resource()->handle); + m_focusDestroyListener.reset(); + } + + Resource *resource = view ? resourceMap().value(view->surface()->handle()->resource()->client()) : 0; + + if (resource && (focusView() != view || resource != m_focusResource)) { + uint32_t serial = wl_display_next_serial(compositor()->waylandDisplay()); + QWaylandKeyboard *keyboard = m_seat->keyboard(); + if (keyboard) { + keyboard->sendKeyModifiers(view->surface()->client(), serial); + } + send_enter(resource->handle, serial, view->surface()->handle()->resource()->handle, + wl_fixed_from_double(currentLocalPosition().x()), wl_fixed_from_double(currentLocalPosition().y())); - m_position = globalPos; + m_focusDestroyListener.listenForDestruction(view->surface()->handle()->resource()->handle); + } - m_currentPosition.updatePosition(localPos); + m_focusResource = resource; + m_currentPosition.updatePosition(view, localPos); + m_spacePosition = outputSpacePos; + if (view && view->output()) + q->setOutput(view->output()); - m_grab->motion(time); + m_grab->motion(compositor()->currentTimeMsecs()); } -void Pointer::sendMouseWheelEvent(Qt::Orientation orientation, int delta) +void QWaylandPointerPrivate::sendMouseWheelEvent(Qt::Orientation orientation, int delta) { if (!m_focusResource) return; - uint32_t time = m_compositor->currentTimeMsecs(); + uint32_t time = compositor()->currentTimeMsecs(); uint32_t axis = orientation == Qt::Horizontal ? WL_POINTER_AXIS_HORIZONTAL_SCROLL : WL_POINTER_AXIS_VERTICAL_SCROLL; send_axis(m_focusResource->handle, time, axis, wl_fixed_from_int(-delta / 12)); } -void Pointer::sendMouseEnterEvent(QWaylandSurfaceView *view, const QPointF &localPos) -{ - if (view == m_currentPosition.view()) { - qWarning("Possible input state error. Want to send enter event for the current input surface"); - } - - setMouseFocus(view, localPos, QPointF()); -} - -void Pointer::sendMouseLeaveEvent(QWaylandSurfaceView *view) -{ - if (view != m_currentPosition.view()) { - return; - } - - setMouseFocus(Q_NULLPTR, QPointF(), QPointF()); -} - -void Pointer::focus() -{ - if (buttonPressed()) - return; - - setFocus(m_currentPosition.view(), m_currentPosition.position()); -} - -void Pointer::motion(uint32_t time) -{ - if (m_focusResource) - send_motion(m_focusResource->handle, time, - wl_fixed_from_double(m_currentPosition.x()), - wl_fixed_from_double(m_currentPosition.y())); - -} - -void Pointer::button(uint32_t time, Qt::MouseButton button, uint32_t state) -{ - if (m_focusResource) { - sendButton(time, button, state); - } - - if (!buttonPressed() && state == WL_POINTER_BUTTON_STATE_RELEASED) - setFocus(m_currentPosition.view(), m_currentPosition.position()); -} - static void requestCursorSurface(QWaylandCompositor *compositor, QWaylandSurface *surface, int32_t hotspot_x, int hotspot_y) { compositor->currentCurserSurfaceRequest(surface, hotspot_x, hotspot_y); } -void Pointer::pointer_set_cursor(wl_pointer::Resource *resource, uint32_t serial, wl_resource *surface, int32_t hotspot_x, int32_t hotspot_y) +void QWaylandPointerPrivate::pointer_set_cursor(wl_pointer::Resource *resource, uint32_t serial, wl_resource *surface, int32_t hotspot_x, int32_t hotspot_y) { Q_UNUSED(resource); Q_UNUSED(serial); if (!surface) { - requestCursorSurface(m_compositor->waylandCompositor(), Q_NULLPTR, 0, 0); + requestCursorSurface(compositor(), Q_NULLPTR, 0, 0); return; } - Surface *s = Surface::fromResource(surface); - s->setCursorSurface(true); - requestCursorSurface(m_compositor->waylandCompositor(), s->waylandSurface(), hotspot_x, hotspot_y); + QWaylandSurface *s = QWaylandSurface::fromResource(surface); + s->markAsCursorSurface(true); + requestCursorSurface(compositor(), s, hotspot_x, hotspot_y); } -PointerGrabber::~PointerGrabber() -{ -} - -} // namespace QtWayland - QT_END_NAMESPACE diff --git a/src/compositor/wayland_wrapper/qwlpointer_p.h b/src/compositor/wayland_wrapper/qwlpointer_p.h index 5fe1fc99e..616464318 100644 --- a/src/compositor/wayland_wrapper/qwlpointer_p.h +++ b/src/compositor/wayland_wrapper/qwlpointer_p.h @@ -39,19 +39,21 @@ #define QTWAYLAND_QWLPOINTER_P_H #include +#include +#include #include #include #include +#include #include #include #include +#include #include -#include "qwllistener_p.h" - QT_BEGIN_NAMESPACE class QWaylandSurfaceView; @@ -59,21 +61,8 @@ class QWaylandSurfaceView; namespace QtWayland { class Compositor; -class InputDevice; -class Pointer; class Surface; -class Q_COMPOSITOR_EXPORT PointerGrabber { -public: - virtual ~PointerGrabber(); - - virtual void focus() = 0; - virtual void motion(uint32_t time) = 0; - virtual void button(uint32_t time, Qt::MouseButton button, uint32_t state) = 0; - - Pointer *m_pointer; -}; - class CurrentPosition { public: @@ -81,8 +70,15 @@ public: : m_view(Q_NULLPTR) {} - void updatePosition(const QPointF &position) + void reset() { + m_point = QPointF(); + m_view = Q_NULLPTR; + } + + void updatePosition(QWaylandSurfaceView *view, const QPointF &position) + { + m_view = view; m_point = position; //we adjust if the mouse position is on the edge //to work around Qt's event propogation @@ -102,59 +98,57 @@ public: qreal x() const { return m_point.x(); } qreal y() const { return m_point.y(); } - void setView(QWaylandSurfaceView *view) { m_view = view; } QWaylandSurfaceView *view() const { return m_view; } - void setCurrent(QWaylandSurfaceView *view, const QPointF &position) - { - QPointF toSet = view || position.isNull() ? position : QPointF(); - setView(view); - updatePosition(toSet); - } - private: QWaylandSurfaceView *m_view; QPointF m_point; }; -class Q_COMPOSITOR_EXPORT Pointer : public QObject, public QtWaylandServer::wl_pointer, public PointerGrabber + +} // namespace QtWayland + +class Q_COMPOSITOR_EXPORT QWaylandPointerPrivate : public QObjectPrivate + , public QtWaylandServer::wl_pointer { + Q_DECLARE_PUBLIC(QWaylandPointer) public: - Pointer(Compositor *compositor, InputDevice *seat); + QWaylandPointerPrivate(QWaylandPointer *pointer, QWaylandInputDevice *seat); + + QWaylandOutput *output() const { return m_output; } + void setOutput(QWaylandOutput *output) + { + if (m_output == output) return; + Q_Q(QWaylandPointer); + m_output = output; + q->outputChanged(); + } - void setFocus(QWaylandSurfaceView *surface, const QPointF &position); - void startGrab(PointerGrabber *currentGrab); + void startGrab(QWaylandPointerGrabber *currentGrab); void endGrab(); - PointerGrabber *currentGrab() const; + QWaylandPointerGrabber *currentGrab() const; Qt::MouseButton grabButton() const; uint32_t grabTime() const; uint32_t grabSerial() const; - void setCurrent(QWaylandSurfaceView *surface, const QPointF &point); - void setMouseFocus(QWaylandSurfaceView *surface, const QPointF &localPos, const QPointF &globalPos); - - void sendButton(uint32_t time, Qt::MouseButton button, uint32_t state); - - void sendMousePressEvent(Qt::MouseButton button, const QPointF &localPos, const QPointF &globalPos); - void sendMouseReleaseEvent(Qt::MouseButton button, const QPointF &localPos, const QPointF &globalPos); - void sendMouseMoveEvent(const QPointF &localPos, const QPointF &globalPos); + void sendMousePressEvent(Qt::MouseButton button); + void sendMouseReleaseEvent(Qt::MouseButton button); + void sendMouseMoveEvent(QWaylandSurfaceView *view, const QPointF &localPos, const QPointF &outputSpacePos); void sendMouseWheelEvent(Qt::Orientation orientation, int delta); - void sendMouseEnterEvent(QWaylandSurfaceView *view, const QPointF &localPos); - void sendMouseLeaveEvent(QWaylandSurfaceView *view); - QWaylandSurfaceView *focusSurface() const; - QWaylandSurfaceView *current() const; - QPointF position() const; - QPointF currentPosition() const; - Resource *focusResource() const; + Resource *focusResource() const { return m_focusResource; } + QWaylandSurfaceView *focusView() const { return m_currentPosition.view(); } bool buttonPressed() const; - void focus() Q_DECL_OVERRIDE; - void motion(uint32_t time) Q_DECL_OVERRIDE; - void button(uint32_t time, Qt::MouseButton button, uint32_t state) Q_DECL_OVERRIDE; + QWaylandInputDevice *seat() const { return m_seat; } + QWaylandCompositor *compositor() const { return m_seat->compositor(); } + void resetCurrentState() { m_currentPosition.reset(); } + QWaylandSurfaceView *currentView() const { return m_currentPosition.view(); } + QPointF currentSpacePosition() const { return m_spacePosition; } + QPointF currentLocalPosition() const { return m_currentPosition.position(); } protected: void pointer_set_cursor(Resource *resource, uint32_t serial, wl_resource *surface, int32_t hotspot_x, int32_t hotspot_y) Q_DECL_OVERRIDE; void pointer_release(Resource *resource) Q_DECL_OVERRIDE; @@ -163,28 +157,25 @@ protected: private: void focusDestroyed(void *data); - Compositor *m_compositor; - InputDevice *m_seat; + QWaylandInputDevice *m_seat; + QWaylandOutput *m_output; + QWaylandDefaultPointerGrabber m_defaultGrab; + QtWayland::CurrentPosition m_currentPosition; + QPointF m_spacePosition; - PointerGrabber *m_grab; + QWaylandPointerGrabber *m_grab; Qt::MouseButton m_grabButton; uint32_t m_grabTime; uint32_t m_grabSerial; - QPointF m_position; - - QWaylandSurfaceView *m_focus; Resource *m_focusResource; - CurrentPosition m_currentPosition; int m_buttonCount; - WlListener m_focusDestroyListener; + QWaylandDestroyListener m_focusDestroyListener; }; -} // namespace QtWayland - QT_END_NAMESPACE #endif // QTWAYLAND_QWLPOINTER_P_H diff --git a/src/compositor/wayland_wrapper/qwlsurface.cpp b/src/compositor/wayland_wrapper/qwlsurface.cpp index 498d9f23a..d5eed707a 100644 --- a/src/compositor/wayland_wrapper/qwlsurface.cpp +++ b/src/compositor/wayland_wrapper/qwlsurface.cpp @@ -292,9 +292,8 @@ void Surface::setBackBuffer(SurfaceBuffer *buffer, const QRegion &damage) m_damage = m_damage.intersected(QRect(QPoint(), m_size)); emit m_waylandSurface->damaged(m_damage); - } else { - m_compositor->resetInputDevice(this); } + m_damage = damage; QWaylandSurfacePrivate *priv = QWaylandSurfacePrivate::get(waylandSurface()); diff --git a/src/compositor/wayland_wrapper/qwltouch.cpp b/src/compositor/wayland_wrapper/qwltouch.cpp index b5a17c1a6..98daa20c9 100644 --- a/src/compositor/wayland_wrapper/qwltouch.cpp +++ b/src/compositor/wayland_wrapper/qwltouch.cpp @@ -40,44 +40,34 @@ #include "qwlcompositor_p.h" #include "qwlsurface_p.h" #include "qwaylandsurfaceview.h" +#include "qwlqttouch_p.h" QT_BEGIN_NAMESPACE -namespace QtWayland { - -Touch::Touch(Compositor *compositor) +QWaylandTouchPrivate::QWaylandTouchPrivate(QWaylandTouch *touch, QWaylandInputDevice *seat) : wl_touch() - , m_compositor(compositor) - , m_focus() + , m_seat(seat) , m_focusResource() - , m_grab(this) -{ - m_grab->setTouch(this); - connect(&m_focusDestroyListener, &WlListener::fired, this, &Touch::focusDestroyed); -} - -void Touch::setFocus(QWaylandSurfaceView *surface) + , m_defaultGrab() + , m_grab(&m_defaultGrab) { - m_focusDestroyListener.reset(); - if (surface) - m_focusDestroyListener.listenForDestruction(surface->surface()->handle()->resource()->handle); - - m_focus = surface; - m_focusResource = surface ? resourceMap().value(surface->surface()->handle()->resource()->client()) : 0; + m_grab->touch = touch; + connect(&m_focusDestroyListener, &QWaylandDestroyListener::fired, this, &QWaylandTouchPrivate::focusDestroyed); } -void Touch::startGrab(TouchGrabber *grab) +void QWaylandTouchPrivate::startGrab(QWaylandTouchGrabber *grab) { + Q_Q(QWaylandTouch); m_grab = grab; - grab->setTouch(this); + grab->touch = q; } -void Touch::endGrab() +void QWaylandTouchPrivate::endGrab() { - m_grab = this; + m_grab = &m_defaultGrab; } -void Touch::focusDestroyed(void *data) +void QWaylandTouchPrivate::focusDestroyed(void *data) { Q_UNUSED(data) m_focusDestroyListener.reset(); @@ -86,98 +76,88 @@ void Touch::focusDestroyed(void *data) m_focusResource = 0; } -void Touch::touch_destroy_resource(Resource *resource) +void QWaylandTouchPrivate::touch_destroy_resource(Resource *resource) { if (m_focusResource == resource) m_focusResource = 0; } -void Touch::touch_release(Resource *resource) +void QWaylandTouchPrivate::touch_release(Resource *resource) { wl_resource_destroy(resource->handle); } -void Touch::sendCancel() +void QWaylandTouchPrivate::sendCancel() { if (m_focusResource) send_cancel(m_focusResource->handle); } -void Touch::sendFrame() +void QWaylandTouchPrivate::sendFrame() { if (m_focusResource) send_frame(m_focusResource->handle); } -void Touch::sendDown(int touch_id, const QPointF &position) +void QWaylandTouchPrivate::sendTouchPoint(int id, const QPointF &point, Qt::TouchPointState state) { - m_grab->down(m_compositor->currentTimeMsecs(), touch_id, position); + switch (state) { + case Qt::TouchPointPressed: + sendDown(id, point); + break; + case Qt::TouchPointMoved: + sendMotion(id, point); + break; + case Qt::TouchPointReleased: + sendUp(id); + break; + case Qt::TouchPointStationary: + // stationary points are not sent through wayland, the client must cache them + break; + default: + break; + } } -void Touch::sendMotion(int touch_id, const QPointF &position) +void QWaylandTouchPrivate::sendDown(int touch_id, const QPointF &position) { - m_grab->motion(m_compositor->currentTimeMsecs(), touch_id, position); + m_grab->down(compositor()->currentTimeMsecs(), touch_id, position); } -void Touch::sendUp(int touch_id) +void QWaylandTouchPrivate::sendMotion(int touch_id, const QPointF &position) { - m_grab->up(m_compositor->currentTimeMsecs(), touch_id); + m_grab->motion(compositor()->currentTimeMsecs(), touch_id, position); } -void Touch::down(uint32_t time, int touch_id, const QPointF &position) +void QWaylandTouchPrivate::sendUp(int touch_id) { - if (!m_focusResource || !m_focus) - return; - - uint32_t serial = wl_display_next_serial(m_compositor->wl_display()); - - send_down(m_focusResource->handle, serial, time, m_focus->surface()->handle()->resource()->handle, touch_id, - wl_fixed_from_double(position.x()), wl_fixed_from_double(position.y())); + m_grab->up(compositor()->currentTimeMsecs(), touch_id); } -void Touch::up(uint32_t time, int touch_id) +void QWaylandTouchPrivate::sendFullTouchEvent(QTouchEvent *event) { - if (!m_focusResource) + if (event->type() == QEvent::TouchCancel) { + sendCancel(); return; + } - uint32_t serial = wl_display_next_serial(m_compositor->wl_display()); - - send_up(m_focusResource->handle, serial, time, touch_id); -} - -void Touch::motion(uint32_t time, int touch_id, const QPointF &position) -{ - if (!m_focusResource) + QtWayland::TouchExtensionGlobal *ext = qobject_cast(compositor()->extension(QtWaylandServer::qt_touch_extension::name())); + if (ext && ext->postTouchEvent(event, m_seat->mouseFocus())) return; - send_motion(m_focusResource->handle, time, touch_id, - wl_fixed_from_double(position.x()), wl_fixed_from_double(position.y())); -} - -TouchGrabber::TouchGrabber() - : m_touch(0) -{ -} - -TouchGrabber::~TouchGrabber() -{ -} - -const Touch *TouchGrabber::touch() const -{ - return m_touch; -} - -Touch *TouchGrabber::touch() -{ - return m_touch; -} + const QList points = event->touchPoints(); + if (points.isEmpty()) + return; -void TouchGrabber::setTouch(Touch *touch) -{ - m_touch = touch; + const int pointCount = points.count(); + QPointF pos = m_seat->mouseFocus()->requestedPosition(); + for (int i = 0; i < pointCount; ++i) { + const QTouchEvent::TouchPoint &tp(points.at(i)); + // Convert the local pos in the compositor window to surface-relative. + QPointF p = tp.pos() - pos; + sendTouchPoint(tp.id(), p, tp.state()); + } + sendFrame(); } -} // namespace QtWayland - QT_END_NAMESPACE diff --git a/src/compositor/wayland_wrapper/qwltouch_p.h b/src/compositor/wayland_wrapper/qwltouch_p.h index f3b7d5ee6..0ba8ba921 100644 --- a/src/compositor/wayland_wrapper/qwltouch_p.h +++ b/src/compositor/wayland_wrapper/qwltouch_p.h @@ -39,78 +39,57 @@ #define QTWAYLAND_QWLTOUCH_P_H #include +#include +#include +#include #include -#include +#include #include -#include "qwllistener_p.h" - QT_BEGIN_NAMESPACE class QWaylandSurfaceView; +class QWaylandCompositor; -namespace QtWayland { - -class Compositor; -class Surface; -class Touch; - -class Q_COMPOSITOR_EXPORT TouchGrabber { -public: - TouchGrabber(); - virtual ~TouchGrabber(); - - virtual void down(uint32_t time, int touch_id, const QPointF &position) = 0; - virtual void up(uint32_t time, int touch_id) = 0; - virtual void motion(uint32_t time, int touch_id, const QPointF &position) = 0; - - const Touch *touch() const; - Touch *touch(); - void setTouch(Touch *touch); - -private: - Touch *m_touch; -}; - -class Q_COMPOSITOR_EXPORT Touch : public QObject, public QtWaylandServer::wl_touch, public TouchGrabber +class Q_COMPOSITOR_EXPORT QWaylandTouchPrivate : public QObjectPrivate, public QtWaylandServer::wl_touch { + Q_DECLARE_PUBLIC(QWaylandTouch) public: - explicit Touch(Compositor *compositor); + explicit QWaylandTouchPrivate(QWaylandTouch *touch, QWaylandInputDevice *seat); - void setFocus(QWaylandSurfaceView *surface); + QWaylandCompositor *compositor() const { return m_seat->compositor(); } - void startGrab(TouchGrabber *grab); + void startGrab(QWaylandTouchGrabber *grab); void endGrab(); void sendCancel(); void sendFrame(); + void sendTouchPoint(int id, const QPointF &point, Qt::TouchPointState state); void sendDown(int touch_id, const QPointF &position); void sendMotion(int touch_id, const QPointF &position); void sendUp(int touch_id); - void down(uint32_t time, int touch_id, const QPointF &position); - void up(uint32_t time, int touch_id); - void motion(uint32_t time, int touch_id, const QPointF &position); + void sendFullTouchEvent(QTouchEvent *event); + Resource *focusResource() const { return m_focusResource; } private: void focusDestroyed(void *data); void touch_destroy_resource(Resource *resource) Q_DECL_OVERRIDE; void touch_release(Resource *resource) Q_DECL_OVERRIDE; - Compositor *m_compositor; + QWaylandInputDevice *m_seat; QWaylandSurfaceView *m_focus; Resource *m_focusResource; - WlListener m_focusDestroyListener; + QWaylandDestroyListener m_focusDestroyListener; - TouchGrabber *m_grab; + QWaylandDefaultTouchGrabber m_defaultGrab; + QWaylandTouchGrabber *m_grab; }; -} // namespace QtWayland - QT_END_NAMESPACE #endif // QTWAYLAND_QWLTOUCH_P_H diff --git a/src/compositor/wayland_wrapper/wayland_wrapper.pri b/src/compositor/wayland_wrapper/wayland_wrapper.pri index f7a630bd4..2bc732565 100644 --- a/src/compositor/wayland_wrapper/wayland_wrapper.pri +++ b/src/compositor/wayland_wrapper/wayland_wrapper.pri @@ -21,7 +21,6 @@ HEADERS += \ wayland_wrapper/qwlsurface_p.h \ wayland_wrapper/qwlsurfacebuffer_p.h \ wayland_wrapper/qwltouch_p.h \ - wayland_wrapper/qwllistener_p.h \ ../shared/qwaylandxkb.h \ SOURCES += \ @@ -41,7 +40,6 @@ SOURCES += \ wayland_wrapper/qwlsurface.cpp \ wayland_wrapper/qwlsurfacebuffer.cpp \ wayland_wrapper/qwltouch.cpp \ - wayland_wrapper/qwllistener.cpp \ ../shared/qwaylandxkb.cpp \ INCLUDEPATH += wayland_wrapper -- cgit v1.2.3 From 65800110cb5887c1c110d44307d90c89d708bf9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Thu, 7 May 2015 17:10:07 +0200 Subject: Mouse mouseFocus handling to the QWaylandInputDevice This because both the touch interface and pointer interface depends on it Change-Id: I64718e0db87085c656250a22107715ddb68bc9ae --- src/compositor/wayland_wrapper/qwlinputdevice.cpp | 26 ++++++----- src/compositor/wayland_wrapper/qwlinputdevice_p.h | 5 ++- src/compositor/wayland_wrapper/qwlpointer.cpp | 31 ++++++++----- src/compositor/wayland_wrapper/qwlpointer_p.h | 54 +++-------------------- src/compositor/wayland_wrapper/qwltouch.cpp | 11 ++--- src/compositor/wayland_wrapper/qwltouch_p.h | 17 ++++++- 6 files changed, 62 insertions(+), 82 deletions(-) (limited to 'src/compositor/wayland_wrapper') diff --git a/src/compositor/wayland_wrapper/qwlinputdevice.cpp b/src/compositor/wayland_wrapper/qwlinputdevice.cpp index 768050435..9f180e212 100644 --- a/src/compositor/wayland_wrapper/qwlinputdevice.cpp +++ b/src/compositor/wayland_wrapper/qwlinputdevice.cpp @@ -54,16 +54,14 @@ QT_BEGIN_NAMESPACE -QWaylandInputDevicePrivate::QWaylandInputDevicePrivate(QWaylandInputDevice *inputdevice, QWaylandCompositor *compositor, QWaylandInputDevice::CapabilityFlags caps) +QWaylandInputDevicePrivate::QWaylandInputDevicePrivate(QWaylandInputDevice *inputdevice, QWaylandCompositor *compositor) : QObjectPrivate() , QtWaylandServer::wl_seat(compositor->waylandDisplay(), 3) , m_dragHandle(new QWaylandDrag(inputdevice)) , m_compositor(compositor) , m_outputSpace(compositor->primaryOutputSpace()) - , m_capabilities(caps) - , m_pointer(m_capabilities & QWaylandInputDevice::Pointer ? new QWaylandPointer(inputdevice) : 0) - , m_keyboard(m_capabilities & QWaylandInputDevice::Keyboard ? new QWaylandKeyboard(inputdevice) : 0) - , m_touch(m_capabilities & QWaylandInputDevice::Touch ? new QWaylandTouch(inputdevice) : 0) + , m_mouseFocus(Q_NULLPTR) + , m_capabilities() , m_inputMethod(m_compositor->extensionFlags() & QWaylandCompositor::TextInputExtension ? new QtWayland::InputMethod(m_compositor, inputdevice) : 0) , m_data_device() { @@ -172,11 +170,6 @@ void QWaylandInputDevicePrivate::sendMouseWheelEvent(Qt::Orientation orientation pointerDevice()->sendMouseWheelEvent(orientation, delta); } -void QWaylandInputDevicePrivate::sendResetCurrentMouseView() -{ - pointerDevice()->resetCurrentView(); -} - void QWaylandInputDevicePrivate::sendTouchPointEvent(int id, const QPointF &point, Qt::TouchPointState state) { if (m_touch.isNull()) { @@ -265,7 +258,18 @@ bool QWaylandInputDevicePrivate::setKeyboardFocus(QWaylandSurface *surface) QWaylandSurfaceView *QWaylandInputDevicePrivate::mouseFocus() const { - return m_pointer.isNull() ? 0 : m_pointer->currentView(); + return m_mouseFocus; +} + +void QWaylandInputDevicePrivate::setMouseFocus(QWaylandSurfaceView *focus) +{ + Q_Q(QWaylandInputDevice); + if (focus == m_mouseFocus) + return; + + QWaylandSurfaceView *oldFocus = m_mouseFocus; + m_mouseFocus = focus; + q->mouseFocusChanged(m_mouseFocus, oldFocus); } void QWaylandInputDevicePrivate::clientRequestedDataDevice(QtWayland::DataDeviceManager *, struct wl_client *client, uint32_t id) diff --git a/src/compositor/wayland_wrapper/qwlinputdevice_p.h b/src/compositor/wayland_wrapper/qwlinputdevice_p.h index dba63c05a..08cc96c2e 100644 --- a/src/compositor/wayland_wrapper/qwlinputdevice_p.h +++ b/src/compositor/wayland_wrapper/qwlinputdevice_p.h @@ -79,14 +79,13 @@ class Q_COMPOSITOR_EXPORT QWaylandInputDevicePrivate : public QObjectPrivate, pu public: Q_DECLARE_PUBLIC(QWaylandInputDevice) - QWaylandInputDevicePrivate(QWaylandInputDevice *device, QWaylandCompositor *compositor, QWaylandInputDevice::CapabilityFlags caps); + QWaylandInputDevicePrivate(QWaylandInputDevice *device, QWaylandCompositor *compositor); ~QWaylandInputDevicePrivate(); void sendMousePressEvent(Qt::MouseButton button); void sendMouseReleaseEvent(Qt::MouseButton button); void sendMouseMoveEvent(QWaylandSurfaceView *surface, const QPointF &localPos, const QPointF &spacePos = QPointF()); void sendMouseWheelEvent(Qt::Orientation orientation, int delta); - void sendResetCurrentMouseView(); void sendTouchPointEvent(int id, const QPointF &point, Qt::TouchPointState state); void sendTouchFrameEvent(); @@ -101,6 +100,7 @@ public: bool setKeyboardFocus(QWaylandSurface *surface); QWaylandSurfaceView *mouseFocus() const; + void setMouseFocus(QWaylandSurfaceView *focus); void clientRequestedDataDevice(QtWayland::DataDeviceManager *dndSelection, struct wl_client *client, uint32_t id); const QtWayland::DataDevice *dataDevice() const; @@ -129,6 +129,7 @@ private: QScopedPointer m_dragHandle; QWaylandCompositor *m_compositor; QWaylandOutputSpace *m_outputSpace; + QWaylandSurfaceView *m_mouseFocus; QWaylandInputDevice::CapabilityFlags m_capabilities; QScopedPointer m_pointer; diff --git a/src/compositor/wayland_wrapper/qwlpointer.cpp b/src/compositor/wayland_wrapper/qwlpointer.cpp index 127003d36..a41ae8a3e 100644 --- a/src/compositor/wayland_wrapper/qwlpointer.cpp +++ b/src/compositor/wayland_wrapper/qwlpointer.cpp @@ -57,6 +57,7 @@ QWaylandPointerPrivate::QWaylandPointerPrivate(QWaylandPointer *pointer, QWaylan , m_grabTime() , m_grabSerial() , m_focusResource() + , m_hasSentEnter(false) , m_buttonCount() { } @@ -67,7 +68,7 @@ void QWaylandPointerPrivate::startGrab(QWaylandPointerGrabber *grab) m_grab = grab; grab->pointer = q; - if (m_currentPosition.view()) + if (focusView()) grab->focus(); } @@ -146,29 +147,37 @@ void QWaylandPointerPrivate::sendMouseReleaseEvent(Qt::MouseButton button) void QWaylandPointerPrivate::sendMouseMoveEvent(QWaylandSurfaceView *view, const QPointF &localPos, const QPointF &outputSpacePos) { Q_Q(QWaylandPointer); - if (m_focusResource && focusView() != view) { - uint32_t serial = wl_display_next_serial(compositor()->waylandDisplay()); - send_leave(m_focusResource->handle, serial, focusView()->surface()->handle()->resource()->handle); - m_focusDestroyListener.reset(); + m_seat->setMouseFocus(view); + m_localPosition = localPos; + m_spacePosition = outputSpacePos; + + //we adjust if the mouse position is on the edge + //to work around Qt's event propogation + if (view && view->surface()) { + QSizeF size(view->surface()->size()); + if (m_localPosition.x() == size.width()) + m_localPosition.rx() -= 0.01; + + if (m_localPosition.y() == size.height()) + m_localPosition.ry() -= 0.01; } Resource *resource = view ? resourceMap().value(view->surface()->handle()->resource()->client()) : 0; - - if (resource && (focusView() != view || resource != m_focusResource)) { - uint32_t serial = wl_display_next_serial(compositor()->waylandDisplay()); + if (resource && !m_hasSentEnter) { + uint32_t serial = compositor()->nextSerial(); QWaylandKeyboard *keyboard = m_seat->keyboard(); if (keyboard) { keyboard->sendKeyModifiers(view->surface()->client(), serial); } send_enter(resource->handle, serial, view->surface()->handle()->resource()->handle, - wl_fixed_from_double(currentLocalPosition().x()), wl_fixed_from_double(currentLocalPosition().y())); + wl_fixed_from_double(m_localPosition.x()), wl_fixed_from_double(m_localPosition.y())); m_focusDestroyListener.listenForDestruction(view->surface()->handle()->resource()->handle); + m_hasSentEnter = true; } m_focusResource = resource; - m_currentPosition.updatePosition(view, localPos); - m_spacePosition = outputSpacePos; + if (view && view->output()) q->setOutput(view->output()); diff --git a/src/compositor/wayland_wrapper/qwlpointer_p.h b/src/compositor/wayland_wrapper/qwlpointer_p.h index 616464318..f79418575 100644 --- a/src/compositor/wayland_wrapper/qwlpointer_p.h +++ b/src/compositor/wayland_wrapper/qwlpointer_p.h @@ -63,49 +63,6 @@ namespace QtWayland { class Compositor; class Surface; -class CurrentPosition -{ -public: - CurrentPosition() - : m_view(Q_NULLPTR) - {} - - void reset() - { - m_point = QPointF(); - m_view = Q_NULLPTR; - } - - void updatePosition(QWaylandSurfaceView *view, const QPointF &position) - { - m_view = view; - m_point = position; - //we adjust if the mouse position is on the edge - //to work around Qt's event propogation - if (!m_view || position.isNull()) - return; - if (m_view->surface()) { - QSizeF size(m_view->surface()->size()); - if (m_point.x() == size.width()) - m_point.rx() -= 0.01; - - if (m_point.y() == size.height()) - m_point.ry() -= 0.01; - } - } - - QPointF position() const { return m_point; } - qreal x() const { return m_point.x(); } - qreal y() const { return m_point.y(); } - - QWaylandSurfaceView *view() const { return m_view; } - -private: - QWaylandSurfaceView *m_view; - QPointF m_point; -}; - - } // namespace QtWayland class Q_COMPOSITOR_EXPORT QWaylandPointerPrivate : public QObjectPrivate @@ -138,17 +95,15 @@ public: void sendMouseWheelEvent(Qt::Orientation orientation, int delta); Resource *focusResource() const { return m_focusResource; } - QWaylandSurfaceView *focusView() const { return m_currentPosition.view(); } + QWaylandSurfaceView *focusView() const { return m_seat->mouseFocus(); } bool buttonPressed() const; QWaylandInputDevice *seat() const { return m_seat; } QWaylandCompositor *compositor() const { return m_seat->compositor(); } - void resetCurrentState() { m_currentPosition.reset(); } - QWaylandSurfaceView *currentView() const { return m_currentPosition.view(); } QPointF currentSpacePosition() const { return m_spacePosition; } - QPointF currentLocalPosition() const { return m_currentPosition.position(); } + QPointF currentLocalPosition() const { return m_localPosition; } protected: void pointer_set_cursor(Resource *resource, uint32_t serial, wl_resource *surface, int32_t hotspot_x, int32_t hotspot_y) Q_DECL_OVERRIDE; void pointer_release(Resource *resource) Q_DECL_OVERRIDE; @@ -160,7 +115,8 @@ private: QWaylandInputDevice *m_seat; QWaylandOutput *m_output; QWaylandDefaultPointerGrabber m_defaultGrab; - QtWayland::CurrentPosition m_currentPosition; + + QPointF m_localPosition; QPointF m_spacePosition; QWaylandPointerGrabber *m_grab; @@ -169,7 +125,7 @@ private: uint32_t m_grabSerial; Resource *m_focusResource; - + bool m_hasSentEnter; int m_buttonCount; diff --git a/src/compositor/wayland_wrapper/qwltouch.cpp b/src/compositor/wayland_wrapper/qwltouch.cpp index 98daa20c9..11ed148a2 100644 --- a/src/compositor/wayland_wrapper/qwltouch.cpp +++ b/src/compositor/wayland_wrapper/qwltouch.cpp @@ -52,7 +52,6 @@ QWaylandTouchPrivate::QWaylandTouchPrivate(QWaylandTouch *touch, QWaylandInputDe , m_grab(&m_defaultGrab) { m_grab->touch = touch; - connect(&m_focusDestroyListener, &QWaylandDestroyListener::fired, this, &QWaylandTouchPrivate::focusDestroyed); } void QWaylandTouchPrivate::startGrab(QWaylandTouchGrabber *grab) @@ -67,19 +66,17 @@ void QWaylandTouchPrivate::endGrab() m_grab = &m_defaultGrab; } -void QWaylandTouchPrivate::focusDestroyed(void *data) +void QWaylandTouchPrivate::resetFocusState() { - Q_UNUSED(data) m_focusDestroyListener.reset(); - - m_focus = 0; m_focusResource = 0; } void QWaylandTouchPrivate::touch_destroy_resource(Resource *resource) { - if (m_focusResource == resource) - m_focusResource = 0; + if (m_focusResource == resource) { + resetFocusState(); + } } void QWaylandTouchPrivate::touch_release(Resource *resource) diff --git a/src/compositor/wayland_wrapper/qwltouch_p.h b/src/compositor/wayland_wrapper/qwltouch_p.h index 0ba8ba921..a0f9273b7 100644 --- a/src/compositor/wayland_wrapper/qwltouch_p.h +++ b/src/compositor/wayland_wrapper/qwltouch_p.h @@ -42,6 +42,8 @@ #include #include #include +#include +#include #include #include @@ -75,14 +77,25 @@ public: void sendFullTouchEvent(QTouchEvent *event); Resource *focusResource() const { return m_focusResource; } + + void setFocusResource() + { + if (m_focusResource) + return; + + QWaylandSurfaceView *mouseFocus = m_seat->mouseFocus(); + if (!mouseFocus || !mouseFocus->surface()) + return; + + m_focusResource = resourceMap().value(mouseFocus->surface()->client()->client()); + } private: - void focusDestroyed(void *data); + void resetFocusState(); void touch_destroy_resource(Resource *resource) Q_DECL_OVERRIDE; void touch_release(Resource *resource) Q_DECL_OVERRIDE; QWaylandInputDevice *m_seat; - QWaylandSurfaceView *m_focus; Resource *m_focusResource; QWaylandDestroyListener m_focusDestroyListener; -- cgit v1.2.3 From dc2237deaf7efb5367691843d397021949c3f411 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Fri, 8 May 2015 08:31:01 +0200 Subject: Rename QWaylandPointer::currentView to mouseFocus Change-Id: Ia6c5d96186c8877a51df8541c95b5ccad04a3eb0 --- src/compositor/wayland_wrapper/qwldatadevice.cpp | 4 ++-- src/compositor/wayland_wrapper/qwlpointer.cpp | 2 +- src/compositor/wayland_wrapper/qwlpointer_p.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/compositor/wayland_wrapper') diff --git a/src/compositor/wayland_wrapper/qwldatadevice.cpp b/src/compositor/wayland_wrapper/qwldatadevice.cpp index fd5c6d3ca..d783223de 100644 --- a/src/compositor/wayland_wrapper/qwldatadevice.cpp +++ b/src/compositor/wayland_wrapper/qwldatadevice.cpp @@ -132,7 +132,7 @@ void DataDevice::sourceDestroyed(DataSource *source) void DataDevice::focus() { - QWaylandSurfaceView *focus = pointer->currentView(); + QWaylandSurfaceView *focus = pointer->mouseFocus(); if (focus != m_dragFocus) { setDragFocus(focus, pointer->currentLocalPosition()); } @@ -177,7 +177,7 @@ void DataDevice::data_device_start_drag(Resource *resource, struct ::wl_resource { if (QWaylandInputDevicePrivate::get(m_inputDevice)->pointerDevice()->grabSerial() == serial) { if (!QWaylandInputDevicePrivate::get(m_inputDevice)->pointerDevice()->isButtonPressed() || - QWaylandInputDevicePrivate::get(m_inputDevice)->pointerDevice()->currentView()->surface()->handle() != Surface::fromResource(origin)) + m_inputDevice->mouseFocus()->surfaceResource() != origin) return; m_dragClient = resource->client(); diff --git a/src/compositor/wayland_wrapper/qwlpointer.cpp b/src/compositor/wayland_wrapper/qwlpointer.cpp index a41ae8a3e..d987829e9 100644 --- a/src/compositor/wayland_wrapper/qwlpointer.cpp +++ b/src/compositor/wayland_wrapper/qwlpointer.cpp @@ -68,7 +68,7 @@ void QWaylandPointerPrivate::startGrab(QWaylandPointerGrabber *grab) m_grab = grab; grab->pointer = q; - if (focusView()) + if (mouseFocus()) grab->focus(); } diff --git a/src/compositor/wayland_wrapper/qwlpointer_p.h b/src/compositor/wayland_wrapper/qwlpointer_p.h index f79418575..cc0c0341e 100644 --- a/src/compositor/wayland_wrapper/qwlpointer_p.h +++ b/src/compositor/wayland_wrapper/qwlpointer_p.h @@ -95,7 +95,7 @@ public: void sendMouseWheelEvent(Qt::Orientation orientation, int delta); Resource *focusResource() const { return m_focusResource; } - QWaylandSurfaceView *focusView() const { return m_seat->mouseFocus(); } + QWaylandSurfaceView *mouseFocus() const { return m_seat->mouseFocus(); } bool buttonPressed() const; -- cgit v1.2.3 From 1317bbb4fade31be698d89dc3d0a229f66af89fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Thu, 30 Jul 2015 15:17:24 +0200 Subject: Use Q_SIGNALS and Q_SLOTS instead of signals: slots: in the compositor apis Change-Id: I0b90843647cbea3e3db22386bfba769db5602d86 --- src/compositor/wayland_wrapper/qwlcompositor_p.h | 4 ++-- src/compositor/wayland_wrapper/qwldatadevicemanager_p.h | 2 +- src/compositor/wayland_wrapper/qwlinputmethod_p.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/compositor/wayland_wrapper') diff --git a/src/compositor/wayland_wrapper/qwlcompositor_p.h b/src/compositor/wayland_wrapper/qwlcompositor_p.h index 750807449..13ae861be 100644 --- a/src/compositor/wayland_wrapper/qwlcompositor_p.h +++ b/src/compositor/wayland_wrapper/qwlcompositor_p.h @@ -143,13 +143,13 @@ public: void unregisterSurface(QWaylandSurface *surface); -public slots: +public Q_SLOTS: void cleanupGraphicsResources(); protected: void compositor_create_surface(Resource *resource, uint32_t id) Q_DECL_OVERRIDE; void compositor_create_region(Resource *resource, uint32_t id) Q_DECL_OVERRIDE; -private slots: +private Q_SLOTS: void processWaylandEvents(); protected: diff --git a/src/compositor/wayland_wrapper/qwldatadevicemanager_p.h b/src/compositor/wayland_wrapper/qwldatadevicemanager_p.h index 76d80a56a..5fbd45f6f 100644 --- a/src/compositor/wayland_wrapper/qwldatadevicemanager_p.h +++ b/src/compositor/wayland_wrapper/qwldatadevicemanager_p.h @@ -79,7 +79,7 @@ protected: void data_device_manager_create_data_source(Resource *resource, uint32_t id) Q_DECL_OVERRIDE; void data_device_manager_get_data_device(Resource *resource, uint32_t id, struct ::wl_resource *seat) Q_DECL_OVERRIDE; -private slots: +private Q_SLOTS: void readFromClient(int fd); private: diff --git a/src/compositor/wayland_wrapper/qwlinputmethod_p.h b/src/compositor/wayland_wrapper/qwlinputmethod_p.h index 4d857c045..ee43b7ebc 100644 --- a/src/compositor/wayland_wrapper/qwlinputmethod_p.h +++ b/src/compositor/wayland_wrapper/qwlinputmethod_p.h @@ -73,7 +73,7 @@ protected: void input_method_bind_resource(Resource *resource); void input_method_destroy_resource(Resource *resource); -private slots: +private Q_SLOTS: void focusChanged(Surface *surface); private: -- cgit v1.2.3 From 5a72fce03ee0046ffc67229f788332259e233492 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Fri, 8 May 2015 08:49:53 +0200 Subject: Make addClient virutal api for Keyboard Pointer and touch Change-Id: I8787d109ffcd3017d8ee3d13715016c3ce8e9287 --- src/compositor/wayland_wrapper/qwlinputdevice.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/compositor/wayland_wrapper') diff --git a/src/compositor/wayland_wrapper/qwlinputdevice.cpp b/src/compositor/wayland_wrapper/qwlinputdevice.cpp index 9f180e212..643677521 100644 --- a/src/compositor/wayland_wrapper/qwlinputdevice.cpp +++ b/src/compositor/wayland_wrapper/qwlinputdevice.cpp @@ -139,7 +139,7 @@ void QWaylandInputDevicePrivate::seat_get_pointer(wl_seat::Resource *resource, u void QWaylandInputDevicePrivate::seat_get_keyboard(wl_seat::Resource *resource, uint32_t id) { if (!m_keyboard.isNull()) { - QWaylandKeyboardPrivate::get(m_keyboard.data())->add(resource->client(), id, resource->version()); + m_keyboard->addClient(QWaylandClient::fromWlClient(resource->client()), id); } } -- cgit v1.2.3 From 0dcca22ab39096b60446225f51689df06a6f98e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Fri, 8 May 2015 09:08:58 +0200 Subject: Make it possible to subclass QWayland(Pointer|Keyboard|Touch) by having factory functions on QWaylandCompositor and use them from QWaylandInputDevicePrivate Change-Id: Id5e0413ca1fb40e2f7eba571dda361b2809fe313 --- src/compositor/wayland_wrapper/qwlcompositor_p.h | 1 + src/compositor/wayland_wrapper/qwlinputdevice.cpp | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'src/compositor/wayland_wrapper') diff --git a/src/compositor/wayland_wrapper/qwlcompositor_p.h b/src/compositor/wayland_wrapper/qwlcompositor_p.h index 13ae861be..f6e0e0024 100644 --- a/src/compositor/wayland_wrapper/qwlcompositor_p.h +++ b/src/compositor/wayland_wrapper/qwlcompositor_p.h @@ -149,6 +149,7 @@ public Q_SLOTS: protected: void compositor_create_surface(Resource *resource, uint32_t id) Q_DECL_OVERRIDE; void compositor_create_region(Resource *resource, uint32_t id) Q_DECL_OVERRIDE; + private Q_SLOTS: void processWaylandEvents(); diff --git a/src/compositor/wayland_wrapper/qwlinputdevice.cpp b/src/compositor/wayland_wrapper/qwlinputdevice.cpp index 643677521..74c90f8f5 100644 --- a/src/compositor/wayland_wrapper/qwlinputdevice.cpp +++ b/src/compositor/wayland_wrapper/qwlinputdevice.cpp @@ -110,15 +110,15 @@ void QWaylandInputDevicePrivate::setCapabilities(QWaylandInputDevice::Capability QWaylandInputDevice::CapabilityFlags changed = caps ^ m_capabilities; if (changed & QWaylandInputDevice::Pointer) { - m_pointer.reset(m_pointer.isNull() ? new QWaylandPointer(q) : 0); + m_pointer.reset(m_pointer.isNull() ? compositor()->createPointerDevice(q) : 0); } if (changed & QWaylandInputDevice::Keyboard) { - m_keyboard.reset(m_keyboard.isNull() ? new QWaylandKeyboard(q) : 0); + m_keyboard.reset(m_keyboard.isNull() ? compositor()->createKeyboardDevice(q) : 0); } if (changed & QWaylandInputDevice::Touch) { - m_touch.reset(m_touch.isNull() ? new QWaylandTouch(q) : 0); + m_touch.reset(m_touch.isNull() ? compositor()->createTouchDevice(q) : 0); } m_capabilities = caps; -- cgit v1.2.3 From fb84a2bfd5ac4d4574df63d0f29d7904e043f123 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Thu, 30 Jul 2015 15:19:42 +0200 Subject: Remove the static instance of a compositor. All classes that needs to access the compositor instance needs to keep a reference to it Change-Id: Ia0d4b04b460200ad3c7907b94c032afe90c18771 --- src/compositor/wayland_wrapper/qwlcompositor.cpp | 9 +-------- src/compositor/wayland_wrapper/qwlcompositor_p.h | 2 -- src/compositor/wayland_wrapper/qwlinputdevice.cpp | 6 +++--- 3 files changed, 4 insertions(+), 13 deletions(-) (limited to 'src/compositor/wayland_wrapper') diff --git a/src/compositor/wayland_wrapper/qwlcompositor.cpp b/src/compositor/wayland_wrapper/qwlcompositor.cpp index 0aef63671..7951ee065 100644 --- a/src/compositor/wayland_wrapper/qwlcompositor.cpp +++ b/src/compositor/wayland_wrapper/qwlcompositor.cpp @@ -149,11 +149,6 @@ public: Compositor *compositor; }; -Compositor *Compositor::instance() -{ - return compositor; -} - Compositor::Compositor(QWaylandCompositor *qt_compositor) : m_extensions(QWaylandCompositor::DefaultExtensions) , m_display(new Display) @@ -172,7 +167,6 @@ Compositor::Compositor(QWaylandCompositor *qt_compositor) { m_outputSpaces.append(new QWaylandOutputSpace(qt_compositor)); m_timer.start(); - compositor = this; QWindowSystemInterfacePrivate::installWindowSystemEventHandler(m_eventHandler.data()); } @@ -319,7 +313,7 @@ void Compositor::cleanupGraphicsResources() void Compositor::compositor_create_surface(Resource *resource, uint32_t id) { - QWaylandClient *client = QWaylandClient::fromWlClient(resource->client()); + QWaylandClient *client = QWaylandClient::fromWlClient(m_qt_compositor, resource->client()); QWaylandSurface *surface = m_qt_compositor->createSurface(client, id, resource->version()); m_all_surfaces.append(surface); if (primaryOutput()) @@ -329,7 +323,6 @@ void Compositor::compositor_create_surface(Resource *resource, uint32_t id) void Compositor::compositor_create_region(Resource *resource, uint32_t id) { - Q_UNUSED(compositor); new Region(resource->client(), id); } diff --git a/src/compositor/wayland_wrapper/qwlcompositor_p.h b/src/compositor/wayland_wrapper/qwlcompositor_p.h index f6e0e0024..ce9d95460 100644 --- a/src/compositor/wayland_wrapper/qwlcompositor_p.h +++ b/src/compositor/wayland_wrapper/qwlcompositor_p.h @@ -122,8 +122,6 @@ public: struct wl_display *wl_display() const { return m_display->handle(); } Display *display() const { return m_display; } - static Compositor *instance(); - QList clients() const; QWaylandCompositor::ExtensionFlags extensions() const; diff --git a/src/compositor/wayland_wrapper/qwlinputdevice.cpp b/src/compositor/wayland_wrapper/qwlinputdevice.cpp index 74c90f8f5..2f972425f 100644 --- a/src/compositor/wayland_wrapper/qwlinputdevice.cpp +++ b/src/compositor/wayland_wrapper/qwlinputdevice.cpp @@ -132,21 +132,21 @@ void QWaylandInputDevicePrivate::setCapabilities(QWaylandInputDevice::Capability void QWaylandInputDevicePrivate::seat_get_pointer(wl_seat::Resource *resource, uint32_t id) { if (!m_pointer.isNull()) { - m_pointer->addClient(QWaylandClient::fromWlClient(resource->client()), id); + m_pointer->addClient(QWaylandClient::fromWlClient(m_compositor, resource->client()), id); } } void QWaylandInputDevicePrivate::seat_get_keyboard(wl_seat::Resource *resource, uint32_t id) { if (!m_keyboard.isNull()) { - m_keyboard->addClient(QWaylandClient::fromWlClient(resource->client()), id); + m_keyboard->addClient(QWaylandClient::fromWlClient(m_compositor, resource->client()), id); } } void QWaylandInputDevicePrivate::seat_get_touch(wl_seat::Resource *resource, uint32_t id) { if (!m_touch.isNull()) { - m_touch->addClient(QWaylandClient::fromWlClient(resource->client()), id); + m_touch->addClient(QWaylandClient::fromWlClient(m_compositor, resource->client()), id); } } -- cgit v1.2.3 From 85b1d4e6524504321fa769457eea5fb3b7e62e7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Thu, 30 Jul 2015 15:20:30 +0200 Subject: Remove transient(inactive|parent|offset) from QWaylandSurface Change-Id: I0fad382c0baa13ec72ff5e45cc1eba0bd4d5c70a --- src/compositor/wayland_wrapper/qwlinputdevice.cpp | 6 +++--- src/compositor/wayland_wrapper/qwlkeyboard.cpp | 8 ++++++-- src/compositor/wayland_wrapper/qwlkeyboard_p.h | 2 +- src/compositor/wayland_wrapper/qwlsurface.cpp | 10 ---------- src/compositor/wayland_wrapper/qwlsurface_p.h | 12 ------------ 5 files changed, 10 insertions(+), 28 deletions(-) (limited to 'src/compositor/wayland_wrapper') diff --git a/src/compositor/wayland_wrapper/qwlinputdevice.cpp b/src/compositor/wayland_wrapper/qwlinputdevice.cpp index 2f972425f..52060f194 100644 --- a/src/compositor/wayland_wrapper/qwlinputdevice.cpp +++ b/src/compositor/wayland_wrapper/qwlinputdevice.cpp @@ -47,6 +47,7 @@ #include "qwlpointer_p.h" #include "qwlkeyboard_p.h" #include "qwltouch_p.h" +#include "qwlshellsurface_p.h" #include "qwaylandsurfaceview.h" #include @@ -244,11 +245,10 @@ QWaylandSurface *QWaylandInputDevicePrivate::keyboardFocus() const */ bool QWaylandInputDevicePrivate::setKeyboardFocus(QWaylandSurface *surface) { - if (surface && (surface->transientInactive() || surface->handle()->isDestroyed())) + if (surface && surface->handle()->isDestroyed()) return false; - if (!m_keyboard.isNull()) { - m_keyboard->setFocus(surface); + if (!m_keyboard.isNull() && m_keyboard->setFocus(surface)) { if (m_data_device) m_data_device->setFocus(m_keyboard->focusClient()); return true; diff --git a/src/compositor/wayland_wrapper/qwlkeyboard.cpp b/src/compositor/wayland_wrapper/qwlkeyboard.cpp index 9811f918a..2a0f857ea 100644 --- a/src/compositor/wayland_wrapper/qwlkeyboard.cpp +++ b/src/compositor/wayland_wrapper/qwlkeyboard.cpp @@ -36,7 +36,7 @@ ****************************************************************************/ #include "qwlkeyboard_p.h" - +#include "qwlshellsurface_p.h" #include #include @@ -133,9 +133,13 @@ void QWaylandKeyboardPrivate::focused(QWaylandSurface *surface) Q_EMIT q_func()->focusChanged(m_focus); } -void QWaylandKeyboardPrivate::setFocus(QWaylandSurface* surface) +bool QWaylandKeyboardPrivate::setFocus(QWaylandSurface* surface) { + QtWayland::ShellSurface *shellsurface = QtWayland::ShellSurface::get(surface); + if (shellsurface && shellsurface->isTransientInactive()) + return false; m_grab->focused(surface); + return true; } void QWaylandKeyboardPrivate::setKeymap(const QWaylandKeymap &keymap) diff --git a/src/compositor/wayland_wrapper/qwlkeyboard_p.h b/src/compositor/wayland_wrapper/qwlkeyboard_p.h index 2579c2da1..c97021abd 100644 --- a/src/compositor/wayland_wrapper/qwlkeyboard_p.h +++ b/src/compositor/wayland_wrapper/qwlkeyboard_p.h @@ -75,7 +75,7 @@ public: ~QWaylandKeyboardPrivate(); QWaylandCompositor *compositor() const { return m_seat->compositor(); } - void setFocus(QWaylandSurface *surface); + bool setFocus(QWaylandSurface *surface); void setKeymap(const QWaylandKeymap &keymap); void sendKeyModifiers(Resource *resource, uint32_t serial); diff --git a/src/compositor/wayland_wrapper/qwlsurface.cpp b/src/compositor/wayland_wrapper/qwlsurface.cpp index d5eed707a..dd2e8aafb 100644 --- a/src/compositor/wayland_wrapper/qwlsurface.cpp +++ b/src/compositor/wayland_wrapper/qwlsurface.cpp @@ -46,7 +46,6 @@ #include "qwlregion_p.h" #include "qwlsubsurface_p.h" #include "qwlsurfacebuffer_p.h" -#include "qwlshellsurface_p.h" #include "qwaylandsurfaceview.h" #include "qwaylandoutput.h" @@ -122,9 +121,6 @@ Surface::Surface(struct wl_client *client, uint32_t id, int version, QWaylandCom , m_subSurface(0) , m_inputPanelSurface(0) , m_inputRegion(infiniteRegion()) - , m_transientParent(0) - , m_transientInactive(false) - , m_transientOffset(QPointF(0, 0)) , m_isCursorSurface(false) , m_destroyed(false) , m_contentOrientation(Qt::PrimaryOrientation) @@ -164,12 +160,6 @@ bool Surface::setRole(const SurfaceRole *role, wl_resource *errorResource, uint3 return true; } -void Surface::setTransientOffset(qreal x, qreal y) -{ - m_transientOffset.setX(x); - m_transientOffset.setY(y); -} - Surface *Surface::fromResource(struct ::wl_resource *resource) { return static_cast(Resource::fromResource(resource)->surface_object); diff --git a/src/compositor/wayland_wrapper/qwlsurface_p.h b/src/compositor/wayland_wrapper/qwlsurface_p.h index e896c48a9..7ebad2c0a 100644 --- a/src/compositor/wayland_wrapper/qwlsurface_p.h +++ b/src/compositor/wayland_wrapper/qwlsurface_p.h @@ -67,7 +67,6 @@ namespace QtWayland { class Compositor; class Buffer; -class ShellSurface; class ExtendedSurface; class InputPanelSurface; class SubSurface; @@ -123,14 +122,6 @@ public: QString title() const { return m_title; } void setTitle(const QString &title); - Surface *transientParent() const { return m_transientParent; } - void setTransientParent(Surface *parent) { m_transientParent = parent; } - - bool transientInactive() const { return m_transientInactive; } - void setTransientInactive(bool v) { m_transientInactive = v; } - - void setTransientOffset(qreal x, qreal y); - bool isCursorSurface() const { return m_isCursorSurface; } void setCursorSurface(bool isCursor) { m_isCursorSurface = isCursor; } @@ -205,9 +196,6 @@ protected: QSize m_size; QString m_className; QString m_title; - Surface *m_transientParent; - bool m_transientInactive; - QPointF m_transientOffset; bool m_isCursorSurface; bool m_destroyed; Qt::ScreenOrientation m_contentOrientation; -- cgit v1.2.3 From d1359f8b0c2b8fcffc2112d2e29d530ac1ab7c9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Fri, 8 May 2015 14:55:14 +0200 Subject: Improve QWaylandExtension By using curiously recurring template pattern we can generate a getter which is very convenient, and all QWaylandExtensions should have this casting operation Change-Id: Idb5a786655f2e106cf5388b11ed71e8b6ddddec0 --- src/compositor/wayland_wrapper/qwltouch.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/compositor/wayland_wrapper') diff --git a/src/compositor/wayland_wrapper/qwltouch.cpp b/src/compositor/wayland_wrapper/qwltouch.cpp index 11ed148a2..77464d81d 100644 --- a/src/compositor/wayland_wrapper/qwltouch.cpp +++ b/src/compositor/wayland_wrapper/qwltouch.cpp @@ -138,7 +138,7 @@ void QWaylandTouchPrivate::sendFullTouchEvent(QTouchEvent *event) return; } - QtWayland::TouchExtensionGlobal *ext = qobject_cast(compositor()->extension(QtWaylandServer::qt_touch_extension::name())); + QtWayland::TouchExtensionGlobal *ext = QtWayland::TouchExtensionGlobal::get(compositor()); if (ext && ext->postTouchEvent(event, m_seat->mouseFocus())) return; -- cgit v1.2.3 From 0f3c1a1669aa133efd8701f25b8b8093517b81a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Thu, 30 Jul 2015 15:21:17 +0200 Subject: Rename QWaylandSurfaceView to QWaylandView and rename QWaylandSurfaceItem to QWaylandQuickView Change-Id: I989b482eb79df06e9f265bc2b0ef6b3dce7509d6 --- src/compositor/wayland_wrapper/qwlcompositor.cpp | 4 ++-- src/compositor/wayland_wrapper/qwldatadevice.cpp | 8 ++++---- src/compositor/wayland_wrapper/qwldatadevice_p.h | 10 +++++----- src/compositor/wayland_wrapper/qwlinputdevice.cpp | 10 +++++----- src/compositor/wayland_wrapper/qwlinputdevice_p.h | 10 +++++----- src/compositor/wayland_wrapper/qwloutput.cpp | 13 +++++++------ src/compositor/wayland_wrapper/qwloutput_p.h | 12 ++++++------ src/compositor/wayland_wrapper/qwlpointer.cpp | 4 ++-- src/compositor/wayland_wrapper/qwlpointer_p.h | 8 ++++---- src/compositor/wayland_wrapper/qwlsurface.cpp | 9 ++++----- src/compositor/wayland_wrapper/qwltouch.cpp | 2 +- src/compositor/wayland_wrapper/qwltouch_p.h | 6 +++--- 12 files changed, 48 insertions(+), 48 deletions(-) (limited to 'src/compositor/wayland_wrapper') diff --git a/src/compositor/wayland_wrapper/qwlcompositor.cpp b/src/compositor/wayland_wrapper/qwlcompositor.cpp index 7951ee065..d9b0e1207 100644 --- a/src/compositor/wayland_wrapper/qwlcompositor.cpp +++ b/src/compositor/wayland_wrapper/qwlcompositor.cpp @@ -55,7 +55,7 @@ #include "qwlpointer_p.h" #include "qwltextinputmanager_p.h" #include -#include "qwaylandsurfaceview.h" +#include "qwaylandview.h" #include "qwaylandshmformathelper.h" #include "qwaylandoutput.h" #include "qwlkeyboard_p.h" @@ -208,7 +208,7 @@ void Compositor::init() qRegisterMetaType("SurfaceBuffer*"); qRegisterMetaType("WaylandClient*"); qRegisterMetaType("WaylandSurface*"); - qRegisterMetaType("WaylandSurfaceView*"); + qRegisterMetaType("WaylandSurfaceView*"); //initialize distancefieldglyphcache here initializeHardwareIntegration(); diff --git a/src/compositor/wayland_wrapper/qwldatadevice.cpp b/src/compositor/wayland_wrapper/qwldatadevice.cpp index d783223de..0b3fee393 100644 --- a/src/compositor/wayland_wrapper/qwldatadevice.cpp +++ b/src/compositor/wayland_wrapper/qwldatadevice.cpp @@ -47,7 +47,7 @@ #include "qwldatadevicemanager_p.h" #include "qwaylanddrag.h" -#include "qwaylandsurfaceview.h" +#include "qwaylandview.h" #include #include @@ -85,7 +85,7 @@ void DataDevice::setFocus(QWaylandClient *focusClient) } } -void DataDevice::setDragFocus(QWaylandSurfaceView *focus, const QPointF &localPosition) +void DataDevice::setDragFocus(QWaylandView *focus, const QPointF &localPosition) { if (m_dragFocusResource) { send_leave(m_dragFocusResource->handle); @@ -119,7 +119,7 @@ void DataDevice::setDragFocus(QWaylandSurfaceView *focus, const QPointF &localPo m_dragFocusResource = resource; } -QWaylandSurfaceView *DataDevice::dragIcon() const +QWaylandView *DataDevice::dragIcon() const { return m_dragIcon; } @@ -132,7 +132,7 @@ void DataDevice::sourceDestroyed(DataSource *source) void DataDevice::focus() { - QWaylandSurfaceView *focus = pointer->mouseFocus(); + QWaylandView *focus = pointer->mouseFocus(); if (focus != m_dragFocus) { setDragFocus(focus, pointer->currentLocalPosition()); } diff --git a/src/compositor/wayland_wrapper/qwldatadevice_p.h b/src/compositor/wayland_wrapper/qwldatadevice_p.h index a2facc111..69688580c 100644 --- a/src/compositor/wayland_wrapper/qwldatadevice_p.h +++ b/src/compositor/wayland_wrapper/qwldatadevice_p.h @@ -45,7 +45,7 @@ QT_BEGIN_NAMESPACE -class QWaylandSurfaceView; +class QWaylandView; namespace QtWayland { @@ -61,9 +61,9 @@ public: void setFocus(QWaylandClient *client); - void setDragFocus(QWaylandSurfaceView *focus, const QPointF &localPosition); + void setDragFocus(QWaylandView *focus, const QPointF &localPosition); - QWaylandSurfaceView *dragIcon() const; + QWaylandView *dragIcon() const; void sourceDestroyed(DataSource *source); @@ -84,10 +84,10 @@ private: struct ::wl_client *m_dragClient; DataSource *m_dragDataSource; - QWaylandSurfaceView *m_dragFocus; + QWaylandView *m_dragFocus; Resource *m_dragFocusResource; - QWaylandSurfaceView *m_dragIcon; + QWaylandView *m_dragIcon; }; } diff --git a/src/compositor/wayland_wrapper/qwlinputdevice.cpp b/src/compositor/wayland_wrapper/qwlinputdevice.cpp index 52060f194..2a93edbb8 100644 --- a/src/compositor/wayland_wrapper/qwlinputdevice.cpp +++ b/src/compositor/wayland_wrapper/qwlinputdevice.cpp @@ -48,7 +48,7 @@ #include "qwlkeyboard_p.h" #include "qwltouch_p.h" #include "qwlshellsurface_p.h" -#include "qwaylandsurfaceview.h" +#include "qwaylandview.h" #include #include @@ -161,7 +161,7 @@ void QWaylandInputDevicePrivate::sendMouseReleaseEvent(Qt::MouseButton button) pointerDevice()->sendMouseReleaseEvent(button); } -void QWaylandInputDevicePrivate::sendMouseMoveEvent(QWaylandSurfaceView *surface, const QPointF &localPos, const QPointF &globalPos) +void QWaylandInputDevicePrivate::sendMouseMoveEvent(QWaylandView *surface, const QPointF &localPos, const QPointF &globalPos) { pointerDevice()->sendMouseMoveEvent(surface, localPos,globalPos); } @@ -256,18 +256,18 @@ bool QWaylandInputDevicePrivate::setKeyboardFocus(QWaylandSurface *surface) return false; } -QWaylandSurfaceView *QWaylandInputDevicePrivate::mouseFocus() const +QWaylandView *QWaylandInputDevicePrivate::mouseFocus() const { return m_mouseFocus; } -void QWaylandInputDevicePrivate::setMouseFocus(QWaylandSurfaceView *focus) +void QWaylandInputDevicePrivate::setMouseFocus(QWaylandView *focus) { Q_Q(QWaylandInputDevice); if (focus == m_mouseFocus) return; - QWaylandSurfaceView *oldFocus = m_mouseFocus; + QWaylandView *oldFocus = m_mouseFocus; m_mouseFocus = focus; q->mouseFocusChanged(m_mouseFocus, oldFocus); } diff --git a/src/compositor/wayland_wrapper/qwlinputdevice_p.h b/src/compositor/wayland_wrapper/qwlinputdevice_p.h index 08cc96c2e..1ed8593ac 100644 --- a/src/compositor/wayland_wrapper/qwlinputdevice_p.h +++ b/src/compositor/wayland_wrapper/qwlinputdevice_p.h @@ -59,7 +59,7 @@ class QKeyEvent; class QTouchEvent; class QWaylandInputDevice; class QWaylandDrag; -class QWaylandSurfaceView; +class QWaylandView; namespace QtWayland { @@ -84,7 +84,7 @@ public: void sendMousePressEvent(Qt::MouseButton button); void sendMouseReleaseEvent(Qt::MouseButton button); - void sendMouseMoveEvent(QWaylandSurfaceView *surface, const QPointF &localPos, const QPointF &spacePos = QPointF()); + void sendMouseMoveEvent(QWaylandView *surface, const QPointF &localPos, const QPointF &spacePos = QPointF()); void sendMouseWheelEvent(Qt::Orientation orientation, int delta); void sendTouchPointEvent(int id, const QPointF &point, Qt::TouchPointState state); @@ -99,8 +99,8 @@ public: QWaylandSurface *keyboardFocus() const; bool setKeyboardFocus(QWaylandSurface *surface); - QWaylandSurfaceView *mouseFocus() const; - void setMouseFocus(QWaylandSurfaceView *focus); + QWaylandView *mouseFocus() const; + void setMouseFocus(QWaylandView *focus); void clientRequestedDataDevice(QtWayland::DataDeviceManager *dndSelection, struct wl_client *client, uint32_t id); const QtWayland::DataDevice *dataDevice() const; @@ -129,7 +129,7 @@ private: QScopedPointer m_dragHandle; QWaylandCompositor *m_compositor; QWaylandOutputSpace *m_outputSpace; - QWaylandSurfaceView *m_mouseFocus; + QWaylandView *m_mouseFocus; QWaylandInputDevice::CapabilityFlags m_capabilities; QScopedPointer m_pointer; diff --git a/src/compositor/wayland_wrapper/qwloutput.cpp b/src/compositor/wayland_wrapper/qwloutput.cpp index 813e6e0d8..15f644966 100644 --- a/src/compositor/wayland_wrapper/qwloutput.cpp +++ b/src/compositor/wayland_wrapper/qwloutput.cpp @@ -46,7 +46,8 @@ #include #include -#include +#include +#include QT_BEGIN_NAMESPACE @@ -348,12 +349,12 @@ void Output::sendFrameCallbacks() wl_display_flush_clients(compositor()->waylandDisplay()); } -void Output::addView(QWaylandSurfaceView *view) +void Output::addView(QWaylandView *view) { addView(view, view->surface()); } -void Output::addView(QWaylandSurfaceView *view, QWaylandSurface *surface) +void Output::addView(QWaylandView *view, QWaylandSurface *surface) { for (int i = 0; i < m_surfaceViews.size(); i++) { if (surface == m_surfaceViews.at(i).surface) { @@ -372,12 +373,12 @@ void Output::addView(QWaylandSurfaceView *view, QWaylandSurface *surface) surface->enter(waylandOutput()); } -void Output::removeView(QWaylandSurfaceView *view) +void Output::removeView(QWaylandView *view) { removeView(view, view->surface()); } -void Output::removeView(QWaylandSurfaceView *view, QWaylandSurface *surface) +void Output::removeView(QWaylandView *view, QWaylandSurface *surface) { for (int i = 0; i < m_surfaceViews.size(); i++) { if (surface == m_surfaceViews.at(i).surface) { @@ -393,7 +394,7 @@ void Output::removeView(QWaylandSurfaceView *view, QWaylandSurface *surface) qWarning("%s Could not find view %p for surface %p to remove. Possible invalid state", Q_FUNC_INFO, view, surface); } -void Output::updateSurfaceForView(QWaylandSurfaceView *view, QWaylandSurface *newSurface, QWaylandSurface *oldSurface) +void Output::updateSurfaceForView(QWaylandView *view, QWaylandSurface *newSurface, QWaylandSurface *oldSurface) { removeView(view, oldSurface); addView(view, newSurface); diff --git a/src/compositor/wayland_wrapper/qwloutput_p.h b/src/compositor/wayland_wrapper/qwloutput_p.h index 1a261241b..8005ed26d 100644 --- a/src/compositor/wayland_wrapper/qwloutput_p.h +++ b/src/compositor/wayland_wrapper/qwloutput_p.h @@ -65,7 +65,7 @@ struct SurfaceViewMapper {} QWaylandSurface *surface; - QVector views; + QVector views; }; //Just for naming convenience @@ -124,11 +124,11 @@ public: void frameStarted(); void sendFrameCallbacks(); - void addView(QWaylandSurfaceView *view); - void addView(QWaylandSurfaceView *view, QWaylandSurface *surface); - void removeView(QWaylandSurfaceView *view); - void removeView(QWaylandSurfaceView *view, QWaylandSurface *surface); - void updateSurfaceForView(QWaylandSurfaceView *view, QWaylandSurface *newSurface, QWaylandSurface *oldSurface); + void addView(QWaylandView *view); + void addView(QWaylandView *view, QWaylandSurface *surface); + void removeView(QWaylandView *view); + void removeView(QWaylandView *view, QWaylandSurface *surface); + void updateSurfaceForView(QWaylandView *view, QWaylandSurface *newSurface, QWaylandSurface *oldSurface); QWindow *window() const { return m_window; } diff --git a/src/compositor/wayland_wrapper/qwlpointer.cpp b/src/compositor/wayland_wrapper/qwlpointer.cpp index d987829e9..cf02d003c 100644 --- a/src/compositor/wayland_wrapper/qwlpointer.cpp +++ b/src/compositor/wayland_wrapper/qwlpointer.cpp @@ -42,7 +42,7 @@ #include "qwlkeyboard_p.h" #include "qwlsurface_p.h" #include "qwaylandcompositor.h" -#include "qwaylandsurfaceview.h" +#include "qwaylandview.h" QT_BEGIN_NAMESPACE @@ -144,7 +144,7 @@ void QWaylandPointerPrivate::sendMouseReleaseEvent(Qt::MouseButton button) q->buttonPressedChanged(); } -void QWaylandPointerPrivate::sendMouseMoveEvent(QWaylandSurfaceView *view, const QPointF &localPos, const QPointF &outputSpacePos) +void QWaylandPointerPrivate::sendMouseMoveEvent(QWaylandView *view, const QPointF &localPos, const QPointF &outputSpacePos) { Q_Q(QWaylandPointer); m_seat->setMouseFocus(view); diff --git a/src/compositor/wayland_wrapper/qwlpointer_p.h b/src/compositor/wayland_wrapper/qwlpointer_p.h index cc0c0341e..1feeb1933 100644 --- a/src/compositor/wayland_wrapper/qwlpointer_p.h +++ b/src/compositor/wayland_wrapper/qwlpointer_p.h @@ -48,7 +48,7 @@ #include #include -#include +#include #include #include @@ -56,7 +56,7 @@ QT_BEGIN_NAMESPACE -class QWaylandSurfaceView; +class QWaylandView; namespace QtWayland { @@ -91,11 +91,11 @@ public: void sendMousePressEvent(Qt::MouseButton button); void sendMouseReleaseEvent(Qt::MouseButton button); - void sendMouseMoveEvent(QWaylandSurfaceView *view, const QPointF &localPos, const QPointF &outputSpacePos); + void sendMouseMoveEvent(QWaylandView *view, const QPointF &localPos, const QPointF &outputSpacePos); void sendMouseWheelEvent(Qt::Orientation orientation, int delta); Resource *focusResource() const { return m_focusResource; } - QWaylandSurfaceView *mouseFocus() const { return m_seat->mouseFocus(); } + QWaylandView *mouseFocus() const { return m_seat->mouseFocus(); } bool buttonPressed() const; diff --git a/src/compositor/wayland_wrapper/qwlsurface.cpp b/src/compositor/wayland_wrapper/qwlsurface.cpp index dd2e8aafb..10400fa74 100644 --- a/src/compositor/wayland_wrapper/qwlsurface.cpp +++ b/src/compositor/wayland_wrapper/qwlsurface.cpp @@ -38,7 +38,8 @@ #include "qwaylandsurface.h" #include "qwaylandsurface_p.h" -#include "qwaylandsurfaceview_p.h" +#include "qwaylandview.h" +#include "qwaylandview_p.h" #include "qwaylandoutput.h" #include "qwlcompositor_p.h" #include "qwlinputdevice_p.h" @@ -46,9 +47,7 @@ #include "qwlregion_p.h" #include "qwlsubsurface_p.h" #include "qwlsurfacebuffer_p.h" -#include "qwaylandsurfaceview.h" #include "qwaylandoutput.h" - #include "qwaylandsurface_p.h" #include @@ -350,8 +349,8 @@ Qt::ScreenOrientation Surface::contentOrientation() const void Surface::notifyViewsAboutDestruction() { - foreach (QWaylandSurfaceView *view, m_waylandSurface->views()) { - QWaylandSurfaceViewPrivate::get(view)->markSurfaceAsDestroyed(m_waylandSurface); + foreach (QWaylandView *view, m_waylandSurface->views()) { + QWaylandViewPrivate::get(view)->markSurfaceAsDestroyed(m_waylandSurface); } } diff --git a/src/compositor/wayland_wrapper/qwltouch.cpp b/src/compositor/wayland_wrapper/qwltouch.cpp index 77464d81d..a0676b180 100644 --- a/src/compositor/wayland_wrapper/qwltouch.cpp +++ b/src/compositor/wayland_wrapper/qwltouch.cpp @@ -39,7 +39,7 @@ #include "qwlcompositor_p.h" #include "qwlsurface_p.h" -#include "qwaylandsurfaceview.h" +#include "qwaylandview.h" #include "qwlqttouch_p.h" QT_BEGIN_NAMESPACE diff --git a/src/compositor/wayland_wrapper/qwltouch_p.h b/src/compositor/wayland_wrapper/qwltouch_p.h index a0f9273b7..52beb81a6 100644 --- a/src/compositor/wayland_wrapper/qwltouch_p.h +++ b/src/compositor/wayland_wrapper/qwltouch_p.h @@ -43,7 +43,7 @@ #include #include #include -#include +#include #include #include @@ -52,7 +52,7 @@ QT_BEGIN_NAMESPACE -class QWaylandSurfaceView; +class QWaylandView; class QWaylandCompositor; class Q_COMPOSITOR_EXPORT QWaylandTouchPrivate : public QObjectPrivate, public QtWaylandServer::wl_touch @@ -83,7 +83,7 @@ public: if (m_focusResource) return; - QWaylandSurfaceView *mouseFocus = m_seat->mouseFocus(); + QWaylandView *mouseFocus = m_seat->mouseFocus(); if (!mouseFocus || !mouseFocus->surface()) return; -- cgit v1.2.3 From 2d9b934ba756b46fcdac5a0d8bed240c9d294fb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Mon, 11 May 2015 10:57:12 +0200 Subject: rename QWaylandExtensionTemplate::get to findIn Change-Id: I7fcfd2e4974cf1b5b32592a6d5c03ed335a9f446 --- src/compositor/wayland_wrapper/qwlcompositor.cpp | 2 +- src/compositor/wayland_wrapper/qwlinputdevice.cpp | 4 ++-- src/compositor/wayland_wrapper/qwlinputmethod.cpp | 4 ++-- src/compositor/wayland_wrapper/qwlkeyboard.cpp | 2 +- src/compositor/wayland_wrapper/qwltouch.cpp | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) (limited to 'src/compositor/wayland_wrapper') diff --git a/src/compositor/wayland_wrapper/qwlcompositor.cpp b/src/compositor/wayland_wrapper/qwlcompositor.cpp index d9b0e1207..5ae77d882 100644 --- a/src/compositor/wayland_wrapper/qwlcompositor.cpp +++ b/src/compositor/wayland_wrapper/qwlcompositor.cpp @@ -331,7 +331,7 @@ void Compositor::destroyClient(QWaylandClient *client) if (!client) return; - WindowManagerServerIntegration *wmExtension = static_cast(waylandCompositor()->extension(QtWaylandServer::qt_windowmanager::name())); + QWaylandWindowManagerExtension *wmExtension = QWaylandWindowManagerExtension::findIn(waylandCompositor()); if (wmExtension) wmExtension->sendQuitMessage(client->client()); diff --git a/src/compositor/wayland_wrapper/qwlinputdevice.cpp b/src/compositor/wayland_wrapper/qwlinputdevice.cpp index 2a93edbb8..745c3bbc5 100644 --- a/src/compositor/wayland_wrapper/qwlinputdevice.cpp +++ b/src/compositor/wayland_wrapper/qwlinputdevice.cpp @@ -200,7 +200,7 @@ void QWaylandInputDevicePrivate::sendFullKeyEvent(QKeyEvent *event) return; } - QtWayland::QtKeyExtensionGlobal *ext = QtWayland::QtKeyExtensionGlobal::get(m_compositor); + QtWayland::QtKeyExtensionGlobal *ext = QtWayland::QtKeyExtensionGlobal::findIn(m_compositor); if (ext && ext->postQtKeyEvent(event, keyboardFocus()->handle())) return; @@ -214,7 +214,7 @@ void QWaylandInputDevicePrivate::sendFullKeyEvent(QKeyEvent *event) void QWaylandInputDevicePrivate::sendFullKeyEvent(QWaylandSurface *surface, QKeyEvent *event) { - QtWayland::QtKeyExtensionGlobal *ext = QtWayland::QtKeyExtensionGlobal::get(m_compositor); + QtWayland::QtKeyExtensionGlobal *ext = QtWayland::QtKeyExtensionGlobal::findIn(m_compositor); if (ext) ext->postQtKeyEvent(event, surface->handle()); } diff --git a/src/compositor/wayland_wrapper/qwlinputmethod.cpp b/src/compositor/wayland_wrapper/qwlinputmethod.cpp index a9ea4bbb3..ca7ce53fd 100644 --- a/src/compositor/wayland_wrapper/qwlinputmethod.cpp +++ b/src/compositor/wayland_wrapper/qwlinputmethod.cpp @@ -78,7 +78,7 @@ void InputMethod::activate(TextInput *textInput) send_activate(m_resource->handle, m_context->resource()->handle); - QWaylandInputPanelPrivate *panel = QWaylandInputPanelPrivate::get(m_compositor); + QWaylandInputPanelPrivate *panel = QWaylandInputPanelPrivate::findIn(m_compositor); if (panel) { panel->setFocus(textInput->focus()); panel->setCursorRectangle(textInput->cursorRectangle()); @@ -97,7 +97,7 @@ void InputMethod::deactivate() m_textInput = 0; m_context = 0; - QWaylandInputPanelPrivate *panel = QWaylandInputPanelPrivate::get(m_compositor); + QWaylandInputPanelPrivate *panel = QWaylandInputPanelPrivate::findIn(m_compositor); if (panel) { panel->setFocus(0); panel->setCursorRectangle(QRect()); diff --git a/src/compositor/wayland_wrapper/qwlkeyboard.cpp b/src/compositor/wayland_wrapper/qwlkeyboard.cpp index 2a0f857ea..584bb90c3 100644 --- a/src/compositor/wayland_wrapper/qwlkeyboard.cpp +++ b/src/compositor/wayland_wrapper/qwlkeyboard.cpp @@ -135,7 +135,7 @@ void QWaylandKeyboardPrivate::focused(QWaylandSurface *surface) bool QWaylandKeyboardPrivate::setFocus(QWaylandSurface* surface) { - QtWayland::ShellSurface *shellsurface = QtWayland::ShellSurface::get(surface); + QtWayland::ShellSurface *shellsurface = QtWayland::ShellSurface::findIn(surface); if (shellsurface && shellsurface->isTransientInactive()) return false; m_grab->focused(surface); diff --git a/src/compositor/wayland_wrapper/qwltouch.cpp b/src/compositor/wayland_wrapper/qwltouch.cpp index a0676b180..7f69f955f 100644 --- a/src/compositor/wayland_wrapper/qwltouch.cpp +++ b/src/compositor/wayland_wrapper/qwltouch.cpp @@ -138,7 +138,7 @@ void QWaylandTouchPrivate::sendFullTouchEvent(QTouchEvent *event) return; } - QtWayland::TouchExtensionGlobal *ext = QtWayland::TouchExtensionGlobal::get(compositor()); + QtWayland::TouchExtensionGlobal *ext = QtWayland::TouchExtensionGlobal::findIn(compositor()); if (ext && ext->postTouchEvent(event, m_seat->mouseFocus())) return; -- cgit v1.2.3 From fffa0f761c904b28fcc661f577a2a72ce7feff3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Mon, 11 May 2015 13:56:43 +0200 Subject: Remove the QWaylandCompositor::createView virtual function Views are just a representation of the QWaylandSurface, and many different types of view "sub-classes" will exist depending on its perticular use. Dont enforce just one view implementation for one compositor. Change-Id: Ie237a73e63638e70713f89b479fb1b248426c9ac --- src/compositor/wayland_wrapper/qwldatadevice.cpp | 19 ++++++++++++++----- src/compositor/wayland_wrapper/qwldatadevice_p.h | 6 ++++-- 2 files changed, 18 insertions(+), 7 deletions(-) (limited to 'src/compositor/wayland_wrapper') diff --git a/src/compositor/wayland_wrapper/qwldatadevice.cpp b/src/compositor/wayland_wrapper/qwldatadevice.cpp index 0b3fee393..bd370a063 100644 --- a/src/compositor/wayland_wrapper/qwldatadevice.cpp +++ b/src/compositor/wayland_wrapper/qwldatadevice.cpp @@ -50,6 +50,7 @@ #include "qwaylandview.h" #include +#include #include QT_BEGIN_NAMESPACE @@ -119,11 +120,16 @@ void DataDevice::setDragFocus(QWaylandView *focus, const QPointF &localPosition) m_dragFocusResource = resource; } -QWaylandView *DataDevice::dragIcon() const +QWaylandSurface *DataDevice::dragIcon() const { return m_dragIcon; } +QPointF DataDevice::dragIconPosition() const +{ + return m_dragIconPosition; +} + void DataDevice::sourceDestroyed(DataSource *source) { if (m_selectionSource == source) @@ -140,9 +146,8 @@ void DataDevice::focus() void DataDevice::motion(uint32_t time) { - if (m_dragIcon) { - m_dragIcon->setRequestedPosition(pointer->currentSpacePosition()); - } + Q_EMIT QWaylandInputDevicePrivate::get(m_inputDevice)->dragHandle()->positionChanged(); + m_dragIconPosition = pointer->currentSpacePosition(); if (m_dragFocusResource && m_dragFocus) { const QPointF &surfacePoint = outputSpace()->mapToView(m_dragFocus, pointer->currentSpacePosition()); @@ -165,6 +170,8 @@ void DataDevice::button(uint32_t time, Qt::MouseButton button, uint32_t state) if (m_dragIcon) { m_dragIcon = 0; + m_dragIconPosition = QPointF(); + Q_EMIT QWaylandInputDevicePrivate::get(m_inputDevice)->dragHandle()->positionChanged(); Q_EMIT QWaylandInputDevicePrivate::get(m_inputDevice)->dragHandle()->iconChanged(); } @@ -182,7 +189,9 @@ void DataDevice::data_device_start_drag(Resource *resource, struct ::wl_resource m_dragClient = resource->client(); m_dragDataSource = source != 0 ? DataSource::fromResource(source) : 0; - m_dragIcon = icon != 0 ? m_compositor->createSurfaceView(Surface::fromResource(icon)->waylandSurface()) : 0; + m_dragIcon = icon != 0 ? QWaylandSurface::fromResource(icon) : 0; + m_dragIconPosition = QPointF(); + Q_EMIT QWaylandInputDevicePrivate::get(m_inputDevice)->dragHandle()->positionChanged(); Q_EMIT QWaylandInputDevicePrivate::get(m_inputDevice)->dragHandle()->iconChanged(); QWaylandInputDevicePrivate::get(m_inputDevice)->pointerDevice()->startGrab(this); diff --git a/src/compositor/wayland_wrapper/qwldatadevice_p.h b/src/compositor/wayland_wrapper/qwldatadevice_p.h index 69688580c..435e253e3 100644 --- a/src/compositor/wayland_wrapper/qwldatadevice_p.h +++ b/src/compositor/wayland_wrapper/qwldatadevice_p.h @@ -63,7 +63,8 @@ public: void setDragFocus(QWaylandView *focus, const QPointF &localPosition); - QWaylandView *dragIcon() const; + QWaylandSurface *dragIcon() const; + QPointF dragIconPosition() const; void sourceDestroyed(DataSource *source); @@ -87,7 +88,8 @@ private: QWaylandView *m_dragFocus; Resource *m_dragFocusResource; - QWaylandView *m_dragIcon; + QWaylandSurface *m_dragIcon; + QPointF m_dragIconPosition; }; } -- cgit v1.2.3 From a54921d733043f78165fab10d4ae445ec3970078 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Mon, 11 May 2015 15:36:59 +0200 Subject: Remove unused include Change-Id: Icdcc1915ab5ddac8e49ae46476e897c8f5c449e0 --- src/compositor/wayland_wrapper/qwlinputdevice.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'src/compositor/wayland_wrapper') diff --git a/src/compositor/wayland_wrapper/qwlinputdevice.cpp b/src/compositor/wayland_wrapper/qwlinputdevice.cpp index 745c3bbc5..80d91e684 100644 --- a/src/compositor/wayland_wrapper/qwlinputdevice.cpp +++ b/src/compositor/wayland_wrapper/qwlinputdevice.cpp @@ -47,7 +47,6 @@ #include "qwlpointer_p.h" #include "qwlkeyboard_p.h" #include "qwltouch_p.h" -#include "qwlshellsurface_p.h" #include "qwaylandview.h" #include -- cgit v1.2.3 From 666c3fcc69b9b25caa9b68b988e0004489653171 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Wed, 13 May 2015 14:44:05 +0200 Subject: Remove the default shell functionality This will be readded in a different way. Also, remove the WaylandSurfaceChrome since it is no longer needed, and just use WaylandView directly Change-Id: I8d4a7b2135d9fdaea7dd3fcd729e55cceebf48fb --- src/compositor/wayland_wrapper/qwlcompositor.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/compositor/wayland_wrapper') diff --git a/src/compositor/wayland_wrapper/qwlcompositor.cpp b/src/compositor/wayland_wrapper/qwlcompositor.cpp index 5ae77d882..aea4154e0 100644 --- a/src/compositor/wayland_wrapper/qwlcompositor.cpp +++ b/src/compositor/wayland_wrapper/qwlcompositor.cpp @@ -388,8 +388,6 @@ void Compositor::initializeExtensions() } if (m_extensions & QWaylandCompositor::WindowManagerExtension) new QWaylandWindowManagerExtension(waylandCompositor()); - if (m_extensions & QWaylandCompositor::DefaultShellExtension) - new Shell(waylandCompositor()); } void Compositor::initializeDefaultInputDevice() -- cgit v1.2.3 From b4f037cff4fc8ece612d8dca034ba784d86b816f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Fri, 31 Jul 2015 10:25:12 +0200 Subject: Remove excess definition of QWaylandKeymap Also remove QWaylandUnmapLock Change-Id: I0b481224fd03032603084142f36be279351f6611 --- src/compositor/wayland_wrapper/qwlcompositor.cpp | 2 +- src/compositor/wayland_wrapper/qwlkeyboard.cpp | 15 ++++----------- src/compositor/wayland_wrapper/qwlkeyboard_p.h | 5 +++++ src/compositor/wayland_wrapper/qwlsurface.cpp | 17 +---------------- src/compositor/wayland_wrapper/qwlsurface_p.h | 6 ------ 5 files changed, 11 insertions(+), 34 deletions(-) (limited to 'src/compositor/wayland_wrapper') diff --git a/src/compositor/wayland_wrapper/qwlcompositor.cpp b/src/compositor/wayland_wrapper/qwlcompositor.cpp index aea4154e0..722893bbf 100644 --- a/src/compositor/wayland_wrapper/qwlcompositor.cpp +++ b/src/compositor/wayland_wrapper/qwlcompositor.cpp @@ -110,7 +110,7 @@ public: { if (e->type == QWindowSystemInterfacePrivate::Key) { QWindowSystemInterfacePrivate::KeyEvent *ke = static_cast(e); - Keyboard *keyb = compositor->defaultInputDevice()->keyboardDevice(); + QWaylandKeyboardPrivate *keyb = QWaylandKeyboardPrivate::get(compositor->defaultInputDevice()->keyboard()); uint32_t code = ke->nativeScanCode; bool isDown = ke->keyType == QEvent::KeyPress; diff --git a/src/compositor/wayland_wrapper/qwlkeyboard.cpp b/src/compositor/wayland_wrapper/qwlkeyboard.cpp index 584bb90c3..7ee0e11cc 100644 --- a/src/compositor/wayland_wrapper/qwlkeyboard.cpp +++ b/src/compositor/wayland_wrapper/qwlkeyboard.cpp @@ -209,15 +209,8 @@ void QWaylandKeyboardPrivate::key(uint32_t serial, uint32_t time, uint32_t key, } } -void QWaylandKeyboardPrivate::sendKeyEvent(uint code, uint32_t state) +void QWaylandKeyboardPrivate::keyEvent(uint code, uint32_t state) { - // There must be no keys pressed when changing the keymap, - // see http://lists.freedesktop.org/archives/wayland-devel/2013-October/011395.html - if (m_pendingKeymap && m_keys.isEmpty()) - updateKeymap(); - - uint32_t time = compositor()->currentTimeMsecs(); - uint32_t serial = wl_display_next_serial(compositor()->waylandDisplay()); uint key = code - 8; if (state == WL_KEYBOARD_KEY_STATE_PRESSED) { m_keys << key; @@ -230,10 +223,10 @@ void QWaylandKeyboardPrivate::sendKeyEvent(uint code, uint32_t state) } } -void Keyboard::sendKeyEvent(uint code, uint32_t state) +void QWaylandKeyboardPrivate::sendKeyEvent(uint code, uint32_t state) { - uint32_t time = m_compositor->currentTimeMsecs(); - uint32_t serial = wl_display_next_serial(m_compositor->wl_display()); + uint32_t time = compositor()->currentTimeMsecs(); + uint32_t serial = wl_display_next_serial(compositor()->waylandDisplay()); uint key = code - 8; m_grab->key(serial, time, key, state); } diff --git a/src/compositor/wayland_wrapper/qwlkeyboard_p.h b/src/compositor/wayland_wrapper/qwlkeyboard_p.h index c97021abd..1c1651989 100644 --- a/src/compositor/wayland_wrapper/qwlkeyboard_p.h +++ b/src/compositor/wayland_wrapper/qwlkeyboard_p.h @@ -96,12 +96,17 @@ public: static QWaylandKeyboardPrivate *get(QWaylandKeyboard *keyboard); +#ifndef QT_NO_WAYLAND_XKB + struct xkb_state *xkbState() const { return m_state; } + uint32_t xkbModsMask() const { return m_modsDepressed | m_modsLatched | m_modsLocked; } +#endif protected: void keyboard_bind_resource(Resource *resource); void keyboard_destroy_resource(Resource *resource); void keyboard_release(Resource *resource) Q_DECL_OVERRIDE; private: + void keyEvent(uint code, uint32_t state); void sendKeyEvent(uint code, uint32_t state); void updateModifierState(uint code, uint32_t state); void updateKeymap(); diff --git a/src/compositor/wayland_wrapper/qwlsurface.cpp b/src/compositor/wayland_wrapper/qwlsurface.cpp index 10400fa74..95aa8c98b 100644 --- a/src/compositor/wayland_wrapper/qwlsurface.cpp +++ b/src/compositor/wayland_wrapper/qwlsurface.cpp @@ -134,7 +134,6 @@ Surface::Surface(struct wl_client *client, uint32_t id, int version, QWaylandCom Surface::~Surface() { - removeFromOutput(); delete m_subSurface; m_bufferRef = QWaylandBufferRef(); @@ -166,7 +165,7 @@ Surface *Surface::fromResource(struct ::wl_resource *resource) bool Surface::mapped() const { - return !m_unmapLocks.isEmpty() || (m_buffer && bool(m_buffer->waylandBufferHandle())); + return m_buffer && bool(m_buffer->waylandBufferHandle()); } QSize Surface::size() const @@ -306,20 +305,6 @@ void Surface::setMapped(bool mapped) } } -void Surface::addUnmapLock(QWaylandUnmapLock *l) -{ - m_unmapLocks << l; -} - -void Surface::removeUnmapLock(QWaylandUnmapLock *l) -{ - m_unmapLocks.removeOne(l); - if (!mapped() && m_attacher) { - setSize(QSize()); - m_attacher->unmap(); - } -} - SurfaceBuffer *Surface::createSurfaceBuffer(struct ::wl_resource *buffer) { SurfaceBuffer *newBuffer = 0; diff --git a/src/compositor/wayland_wrapper/qwlsurface_p.h b/src/compositor/wayland_wrapper/qwlsurface_p.h index 7ebad2c0a..6b8a92883 100644 --- a/src/compositor/wayland_wrapper/qwlsurface_p.h +++ b/src/compositor/wayland_wrapper/qwlsurface_p.h @@ -61,8 +61,6 @@ QT_BEGIN_NAMESPACE class QTouchEvent; -class QWaylandUnmapLock; - namespace QtWayland { class Compositor; @@ -127,9 +125,6 @@ public: void frameStarted(); - void addUnmapLock(QWaylandUnmapLock *l); - void removeUnmapLock(QWaylandUnmapLock *l); - void setMapped(bool mapped); void setVisibility(QWindow::Visibility visibility) { m_visibility = visibility; } @@ -169,7 +164,6 @@ protected: SurfaceBuffer *m_buffer; QWaylandBufferRef m_bufferRef; bool m_surfaceMapped; - QVector m_unmapLocks; struct { SurfaceBuffer *buffer; -- cgit v1.2.3 From fd9a8983832bbeb240097327ff9f8565f7356b08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Thu, 6 Aug 2015 13:41:27 +0200 Subject: Fixups after rebasing Change-Id: Ie5d8899157d77f83f2cf65f236d534b972aa4770 --- src/compositor/wayland_wrapper/qwlcompositor.cpp | 2 -- src/compositor/wayland_wrapper/qwlkeyboard.cpp | 2 ++ src/compositor/wayland_wrapper/qwlkeyboard_p.h | 9 +++--- src/compositor/wayland_wrapper/qwlpointer.cpp | 2 ++ src/compositor/wayland_wrapper/qwlsurface.cpp | 35 ++++++++++++------------ 5 files changed, 26 insertions(+), 24 deletions(-) (limited to 'src/compositor/wayland_wrapper') diff --git a/src/compositor/wayland_wrapper/qwlcompositor.cpp b/src/compositor/wayland_wrapper/qwlcompositor.cpp index 722893bbf..3fef11521 100644 --- a/src/compositor/wayland_wrapper/qwlcompositor.cpp +++ b/src/compositor/wayland_wrapper/qwlcompositor.cpp @@ -100,8 +100,6 @@ QT_BEGIN_NAMESPACE namespace QtWayland { -static Compositor *compositor; - class WindowSystemEventHandler : public QWindowSystemEventHandler { public: diff --git a/src/compositor/wayland_wrapper/qwlkeyboard.cpp b/src/compositor/wayland_wrapper/qwlkeyboard.cpp index 7ee0e11cc..d40422c31 100644 --- a/src/compositor/wayland_wrapper/qwlkeyboard.cpp +++ b/src/compositor/wayland_wrapper/qwlkeyboard.cpp @@ -113,6 +113,8 @@ QWaylandKeyboardPrivate *QWaylandKeyboardPrivate::get(QWaylandKeyboard *keyboard void QWaylandKeyboardPrivate::focused(QWaylandSurface *surface) { + if (surface && surface->isCursorSurface()) + surface = Q_NULLPTR; if (m_focusResource && m_focus != surface) { uint32_t serial = wl_display_next_serial(compositor()->waylandDisplay()); send_leave(m_focusResource->handle, serial, m_focus->handle()->resource()->handle); diff --git a/src/compositor/wayland_wrapper/qwlkeyboard_p.h b/src/compositor/wayland_wrapper/qwlkeyboard_p.h index 1c1651989..bcd0bab69 100644 --- a/src/compositor/wayland_wrapper/qwlkeyboard_p.h +++ b/src/compositor/wayland_wrapper/qwlkeyboard_p.h @@ -100,16 +100,17 @@ public: struct xkb_state *xkbState() const { return m_state; } uint32_t xkbModsMask() const { return m_modsDepressed | m_modsLatched | m_modsLocked; } #endif + void keyEvent(uint code, uint32_t state); + void sendKeyEvent(uint code, uint32_t state); + void updateModifierState(uint code, uint32_t state); + void updateKeymap(); + protected: void keyboard_bind_resource(Resource *resource); void keyboard_destroy_resource(Resource *resource); void keyboard_release(Resource *resource) Q_DECL_OVERRIDE; private: - void keyEvent(uint code, uint32_t state); - void sendKeyEvent(uint code, uint32_t state); - void updateModifierState(uint code, uint32_t state); - void updateKeymap(); #ifndef QT_NO_WAYLAND_XKB void initXKB(); diff --git a/src/compositor/wayland_wrapper/qwlpointer.cpp b/src/compositor/wayland_wrapper/qwlpointer.cpp index cf02d003c..13963d269 100644 --- a/src/compositor/wayland_wrapper/qwlpointer.cpp +++ b/src/compositor/wayland_wrapper/qwlpointer.cpp @@ -147,6 +147,8 @@ void QWaylandPointerPrivate::sendMouseReleaseEvent(Qt::MouseButton button) void QWaylandPointerPrivate::sendMouseMoveEvent(QWaylandView *view, const QPointF &localPos, const QPointF &outputSpacePos) { Q_Q(QWaylandPointer); + if (view && (!view->surface() || view->surface()->isCursorSurface())) + view = Q_NULLPTR; m_seat->setMouseFocus(view); m_localPosition = localPos; m_spacePosition = outputSpacePos; diff --git a/src/compositor/wayland_wrapper/qwlsurface.cpp b/src/compositor/wayland_wrapper/qwlsurface.cpp index 95aa8c98b..7992f6d18 100644 --- a/src/compositor/wayland_wrapper/qwlsurface.cpp +++ b/src/compositor/wayland_wrapper/qwlsurface.cpp @@ -163,11 +163,6 @@ Surface *Surface::fromResource(struct ::wl_resource *resource) return static_cast(Resource::fromResource(resource)->surface_object); } -bool Surface::mapped() const -{ - return m_buffer && bool(m_buffer->waylandBufferHandle()); -} - QSize Surface::size() const { return m_size; @@ -278,31 +273,35 @@ void Surface::setBackBuffer(SurfaceBuffer *buffer, const QRegion &damage) if (valid) setSize(m_buffer->size()); - m_damage = m_damage.intersected(QRect(QPoint(), m_size)); - emit m_waylandSurface->damaged(m_damage); + m_damage = damage.intersected(QRect(QPoint(), m_size)); + } else { + setSize(QSize()); + m_damage = QRect(); } - m_damage = damage; - QWaylandSurfacePrivate *priv = QWaylandSurfacePrivate::get(waylandSurface()); for (int i = 0; i < priv->views.size(); i++) { - priv->views.at(i)->attach(m_bufferRef); + priv->views.at(i)->attach(m_bufferRef, m_damage); } - emit m_waylandSurface->configure(m_bufferRef.hasBuffer()); + emit m_waylandSurface->damaged(m_damage); + setMapped(m_bufferRef.hasBuffer()); if (!m_pending.offset.isNull()) emit m_waylandSurface->offsetForNextFrame(m_pending.offset); } +bool Surface::mapped() const +{ + return m_buffer && bool(m_buffer->waylandBufferHandle()); +} + void Surface::setMapped(bool mapped) { - if (!m_surfaceMapped && mapped) { - m_surfaceMapped = true; - emit m_waylandSurface->mapped(); - } else if (!mapped && m_surfaceMapped) { - m_surfaceMapped = false; - emit m_waylandSurface->unmapped(); - } + if (m_surfaceMapped == mapped) + return; + + m_surfaceMapped = mapped; + emit m_waylandSurface->mappedChanged(); } SurfaceBuffer *Surface::createSurfaceBuffer(struct ::wl_resource *buffer) -- cgit v1.2.3 From dfec7314fd3758375e96d4641d2d6b5bec595320 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Fri, 7 Aug 2015 12:35:44 +0200 Subject: Remove output from QWaylandSurface It is the views that belong to outputs. This leads to a couple of interesting cases with enter and leave events, but the implementation says you will get enter events for the first view of a surface entering an output, and for the last view being removed from an output. Also to throttle a surface, there has to be 1 surface which takes care of this. This is because if multiple views throttle, then the client might render to quick. Change-Id: If4bba380fd4d7f506fd769606cbdea4ce58b908d --- src/compositor/wayland_wrapper/qwlcompositor.cpp | 2 -- src/compositor/wayland_wrapper/qwloutput.cpp | 34 +++++++++++++++++------- src/compositor/wayland_wrapper/qwloutput_p.h | 18 ++++++++++++- src/compositor/wayland_wrapper/qwlsurface.cpp | 21 --------------- src/compositor/wayland_wrapper/qwlsurface_p.h | 5 ---- 5 files changed, 41 insertions(+), 39 deletions(-) (limited to 'src/compositor/wayland_wrapper') diff --git a/src/compositor/wayland_wrapper/qwlcompositor.cpp b/src/compositor/wayland_wrapper/qwlcompositor.cpp index 3fef11521..fee40c7ef 100644 --- a/src/compositor/wayland_wrapper/qwlcompositor.cpp +++ b/src/compositor/wayland_wrapper/qwlcompositor.cpp @@ -314,8 +314,6 @@ void Compositor::compositor_create_surface(Resource *resource, uint32_t id) QWaylandClient *client = QWaylandClient::fromWlClient(m_qt_compositor, resource->client()); QWaylandSurface *surface = m_qt_compositor->createSurface(client, id, resource->version()); m_all_surfaces.append(surface); - if (primaryOutput()) - surface->setPrimaryOutput(primaryOutput()); emit m_qt_compositor->surfaceCreated(surface); } diff --git a/src/compositor/wayland_wrapper/qwloutput.cpp b/src/compositor/wayland_wrapper/qwloutput.cpp index 15f644966..caffb9028 100644 --- a/src/compositor/wayland_wrapper/qwloutput.cpp +++ b/src/compositor/wayland_wrapper/qwloutput.cpp @@ -331,8 +331,7 @@ void Output::frameStarted() { for (int i = 0; i < m_surfaceViews.size(); i++) { SurfaceViewMapper &surfacemapper = m_surfaceViews[i]; - if (surfacemapper.surface && (!surfacemapper.surface->primaryOutput() - || surfacemapper.surface->primaryOutput()->handle() == this)) + if (surfacemapper.maybeThrottelingView()) surfacemapper.surface->handle()->frameStarted(); } } @@ -341,14 +340,31 @@ void Output::sendFrameCallbacks() { for (int i = 0; i < m_surfaceViews.size(); i++) { const SurfaceViewMapper &surfacemapper = m_surfaceViews.at(i); - if (surfacemapper.surface && surfacemapper.surface->isMapped() - && (!surfacemapper.surface->primaryOutput() - || surfacemapper.surface->primaryOutput()->handle() == this)) - surfacemapper.surface->handle()->sendFrameCallback(); + if (surfacemapper.surface && surfacemapper.surface->isMapped()) { + if (!surfacemapper.has_entered) { + surfaceEnter(surfacemapper.surface); + } + if (surfacemapper.maybeThrottelingView()) + surfacemapper.surface->handle()->sendFrameCallback(); + } } wl_display_flush_clients(compositor()->waylandDisplay()); } +void Output::surfaceEnter(QWaylandSurface *surface) +{ + if (!surface) + return; + surface->handle()->send_enter(outputForClient(surface->client())->handle); +} + +void Output::surfaceLeave(QWaylandSurface *surface) +{ + if (!surface) + return; + surface->handle()->send_leave(outputForClient(surface->client())->handle); +} + void Output::addView(QWaylandView *view) { addView(view, view->surface()); @@ -369,8 +385,6 @@ void Output::addView(QWaylandView *view, QWaylandSurface *surface) surfaceViewMapper.surface = surface; surfaceViewMapper.views.append(view); m_surfaceViews.append(surfaceViewMapper); - if (surface) - surface->enter(waylandOutput()); } void Output::removeView(QWaylandView *view) @@ -384,9 +398,9 @@ void Output::removeView(QWaylandView *view, QWaylandSurface *surface) if (surface == m_surfaceViews.at(i).surface) { bool removed = m_surfaceViews[i].views.removeOne(view); if (m_surfaceViews.at(i).views.isEmpty() && removed) { + if (m_surfaceViews.at(i).has_entered) + surfaceLeave(surface); m_surfaceViews.remove(i); - if (surface) - surface->leave(waylandOutput()); } return; } diff --git a/src/compositor/wayland_wrapper/qwloutput_p.h b/src/compositor/wayland_wrapper/qwloutput_p.h index 8005ed26d..5ec9b1cbc 100644 --- a/src/compositor/wayland_wrapper/qwloutput_p.h +++ b/src/compositor/wayland_wrapper/qwloutput_p.h @@ -40,11 +40,13 @@ #include +#include #include #include #include #include +#include #include #include @@ -62,10 +64,21 @@ struct SurfaceViewMapper SurfaceViewMapper() : surface(0) , views() + , has_entered(false) {} + QWaylandView *maybeThrottelingView() const + { + for (int i = 0; i < views.size(); i++) { + if (surface && surface->throttlingView() == views.at(i)) + return views.at(i); + } + return Q_NULLPTR; + } + QWaylandSurface *surface; QVector views; + bool has_entered; }; //Just for naming convenience @@ -124,6 +137,9 @@ public: void frameStarted(); void sendFrameCallbacks(); + void surfaceEnter(QWaylandSurface *surface); + void surfaceLeave(QWaylandSurface *surface); + void addView(QWaylandView *view); void addView(QWaylandView *view, QWaylandSurface *surface); void removeView(QWaylandView *view); @@ -132,6 +148,7 @@ public: QWindow *window() const { return m_window; } + OutputResource *outputForClient(QWaylandClient *client) const { return outputForClient(client->client()); } OutputResource *outputForClient(struct wl_client *client) const; void output_bind_resource(Resource *resource) Q_DECL_OVERRIDE; @@ -154,7 +171,6 @@ private: QWaylandOutput::Subpixel m_subpixel; QWaylandOutput::Transform m_transform; int m_scaleFactor; - QList m_surfaces; bool m_sizeFollowsWindow; void sendGeometryInfo(); diff --git a/src/compositor/wayland_wrapper/qwlsurface.cpp b/src/compositor/wayland_wrapper/qwlsurface.cpp index 7992f6d18..961163b88 100644 --- a/src/compositor/wayland_wrapper/qwlsurface.cpp +++ b/src/compositor/wayland_wrapper/qwlsurface.cpp @@ -114,7 +114,6 @@ Surface::Surface(struct wl_client *client, uint32_t id, int version, QWaylandCom : QtWaylandServer::wl_surface(client, id, version) , m_compositor(compositor->handle()) , m_waylandSurface(surface) - , m_primaryOutput(0) , m_buffer(0) , m_surfaceMapped(false) , m_subSurface(0) @@ -239,23 +238,6 @@ Compositor *Surface::compositor() const return m_compositor; } -void Surface::setPrimaryOutput(Output *output) -{ - if (m_primaryOutput == output) - return; - - QWaylandOutput *new_output = output ? output->waylandOutput() : Q_NULLPTR; - QWaylandOutput *old_output = m_primaryOutput ? m_primaryOutput->waylandOutput() : Q_NULLPTR; - m_primaryOutput = output; - - waylandSurface()->primaryOutputChanged(new_output, old_output); -} - -Output *Surface::primaryOutput() const -{ - return m_primaryOutput; -} - /*! * Sets the backbuffer for this surface. The back buffer is not yet on * screen and will become live during the next swapBuffers(). @@ -406,9 +388,6 @@ void Surface::surface_commit(Resource *) m_inputRegion = m_pending.inputRegion.intersected(QRect(QPoint(), m_size)); emit m_waylandSurface->redraw(); - - if (primaryOutput()) - primaryOutput()->waylandOutput()->update(); } void Surface::surface_set_buffer_transform(Resource *resource, int32_t orientation) diff --git a/src/compositor/wayland_wrapper/qwlsurface_p.h b/src/compositor/wayland_wrapper/qwlsurface_p.h index 6b8a92883..4014d3d2e 100644 --- a/src/compositor/wayland_wrapper/qwlsurface_p.h +++ b/src/compositor/wayland_wrapper/qwlsurface_p.h @@ -40,7 +40,6 @@ #include #include -#include #include #include @@ -111,9 +110,6 @@ public: Compositor *compositor() const; - Output *primaryOutput() const; - void setPrimaryOutput(Output *output); - QString className() const { return m_className; } void setClassName(const QString &className); @@ -158,7 +154,6 @@ protected: Compositor *m_compositor; QWaylandSurface *m_waylandSurface; - Output *m_primaryOutput; QRegion m_damage; SurfaceBuffer *m_buffer; -- cgit v1.2.3 From bc331abe8e8ffaa3db12be7ae69e7b658dd700ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Fri, 7 Aug 2015 14:25:30 +0200 Subject: Remove the Surface role functionality This replaced by the QWaylandExtension and QWaylandExtensionContainers Change-Id: Iba0299725542ede618b636fb2d40715acfcb3b51 --- src/compositor/wayland_wrapper/qwlsurface.cpp | 13 ------ src/compositor/wayland_wrapper/qwlsurface_p.h | 62 --------------------------- 2 files changed, 75 deletions(-) (limited to 'src/compositor/wayland_wrapper') diff --git a/src/compositor/wayland_wrapper/qwlsurface.cpp b/src/compositor/wayland_wrapper/qwlsurface.cpp index 961163b88..45194f13a 100644 --- a/src/compositor/wayland_wrapper/qwlsurface.cpp +++ b/src/compositor/wayland_wrapper/qwlsurface.cpp @@ -123,8 +123,6 @@ Surface::Surface(struct wl_client *client, uint32_t id, int version, QWaylandCom , m_destroyed(false) , m_contentOrientation(Qt::PrimaryOrientation) , m_visibility(QWindow::Hidden) - , m_role(0) - , m_roleHandler(0) { m_pending.buffer = 0; m_pending.newlyAttached = false; @@ -146,17 +144,6 @@ Surface::~Surface() c->destroy(); } -bool Surface::setRole(const SurfaceRole *role, wl_resource *errorResource, uint32_t errorCode) -{ - if (m_role && m_role != role) { - wl_resource_post_error(errorResource, errorCode, "Cannot assign role %s to wl_surface@%d, already has role %s\n", role->name, - wl_resource_get_id(resource()->handle), m_role->name); - return false; - } - m_role = role; - return true; -} - Surface *Surface::fromResource(struct ::wl_resource *resource) { return static_cast(Resource::fromResource(resource)->surface_object); diff --git a/src/compositor/wayland_wrapper/qwlsurface_p.h b/src/compositor/wayland_wrapper/qwlsurface_p.h index 4014d3d2e..ae92d6f47 100644 --- a/src/compositor/wayland_wrapper/qwlsurface_p.h +++ b/src/compositor/wayland_wrapper/qwlsurface_p.h @@ -69,20 +69,12 @@ class InputPanelSurface; class SubSurface; class FrameCallback; -class SurfaceRole; -class RoleBase; - class Q_COMPOSITOR_EXPORT Surface : public QtWaylandServer::wl_surface { public: Surface(struct wl_client *client, uint32_t id, int version, QWaylandCompositor *compositor, QWaylandSurface *surface); ~Surface(); - bool setRole(const SurfaceRole *role, wl_resource *errorResource, uint32_t errorCode); - const SurfaceRole *role() const { return m_role; } - template - bool setRoleHandler(T *handler); - static Surface *fromResource(struct ::wl_resource *resource); bool mapped() const; @@ -190,67 +182,13 @@ protected: Qt::ScreenOrientation m_contentOrientation; QWindow::Visibility m_visibility; - const SurfaceRole *m_role; - RoleBase *m_roleHandler; - void setBackBuffer(SurfaceBuffer *buffer, const QRegion &damage); SurfaceBuffer *createSurfaceBuffer(struct ::wl_resource *buffer); friend class QWaylandSurface; - friend class RoleBase; -}; - -class SurfaceRole -{ -public: - const char *name; -}; - -class RoleBase -{ -public: - virtual ~RoleBase() { - if (m_surface) { - m_surface->m_roleHandler = 0; m_surface = 0; - } - } - -protected: - RoleBase() : m_surface(0) {} - static inline RoleBase *roleOf(Surface *s) { return s->m_roleHandler; } - - virtual void configure(int dx, int dy) = 0; - -private: - Surface *m_surface; - friend class Surface; }; -template -class SurfaceRoleHandler : public RoleBase -{ -public: - static T *get(Surface *surface) { - if (surface->role() == T::role()) { - return static_cast(roleOf(surface)); - } - return 0; - } -}; - -template -bool Surface::setRoleHandler(T *handler) -{ - RoleBase *base = handler; - if (m_role == T::role()) { - m_roleHandler = base; - base->m_surface = this; - return true; - } - return false; -} - } QT_END_NAMESPACE -- cgit v1.2.3 From e01b81339a37830c48f2cec0583e5d0aba592601 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Tue, 11 Aug 2015 16:07:23 +0200 Subject: Remove QtWayland::Surface Its enough to have QWaylandSurface and QWaylandSurfacePrivate. Also don't pass QWaylandSurfacePrivate around, but pass QWaylandSurface and then use the QWaylandSurfacePrivate::get function. Change-Id: I915cc9d7b4497ad1c6f1f2dee61d9d0db069ba6b --- src/compositor/wayland_wrapper/qwlcompositor.cpp | 10 +- src/compositor/wayland_wrapper/qwlcompositor_p.h | 4 +- src/compositor/wayland_wrapper/qwldatadevice.cpp | 8 +- .../wayland_wrapper/qwldatadevicemanager.cpp | 3 +- src/compositor/wayland_wrapper/qwlinputdevice.cpp | 11 +- src/compositor/wayland_wrapper/qwlinputmethod.cpp | 4 +- src/compositor/wayland_wrapper/qwlinputmethod_p.h | 5 +- src/compositor/wayland_wrapper/qwlkeyboard.cpp | 5 +- src/compositor/wayland_wrapper/qwloutput.cpp | 11 +- src/compositor/wayland_wrapper/qwlpointer.cpp | 7 +- src/compositor/wayland_wrapper/qwlsurface.cpp | 427 --------------------- src/compositor/wayland_wrapper/qwlsurface_p.h | 196 ---------- .../wayland_wrapper/qwlsurfacebuffer.cpp | 9 +- .../wayland_wrapper/qwlsurfacebuffer_p.h | 11 +- src/compositor/wayland_wrapper/qwltouch.cpp | 1 - src/compositor/wayland_wrapper/qwltouch_p.h | 2 +- src/compositor/wayland_wrapper/wayland_wrapper.pri | 2 - 17 files changed, 43 insertions(+), 673 deletions(-) delete mode 100644 src/compositor/wayland_wrapper/qwlsurface.cpp delete mode 100644 src/compositor/wayland_wrapper/qwlsurface_p.h (limited to 'src/compositor/wayland_wrapper') diff --git a/src/compositor/wayland_wrapper/qwlcompositor.cpp b/src/compositor/wayland_wrapper/qwlcompositor.cpp index fee40c7ef..65b669a02 100644 --- a/src/compositor/wayland_wrapper/qwlcompositor.cpp +++ b/src/compositor/wayland_wrapper/qwlcompositor.cpp @@ -40,7 +40,7 @@ #include "qwaylandinput.h" #include "qwldisplay_p.h" #include "qwloutput_p.h" -#include "qwlsurface_p.h" +#include "qwaylandsurface_p.h" #include "qwaylandclient.h" #include "qwaylandcompositor.h" #include "qwldatadevicemanager_p.h" @@ -290,11 +290,11 @@ void Compositor::processWaylandEvents() wl_display_flush_clients(m_display->handle()); } -void Compositor::destroySurface(Surface *surface) +void Compositor::destroySurface(QWaylandSurface *surface) { - waylandCompositor()->surfaceAboutToBeDestroyed(surface->waylandSurface()); + waylandCompositor()->surfaceAboutToBeDestroyed(surface); - m_destroyed_surfaces << surface->waylandSurface(); + m_destroyed_surfaces << surface; } void Compositor::unregisterSurface(QWaylandSurface *surface) @@ -440,7 +440,7 @@ bool Compositor::isDragging() const } void Compositor::sendDragMoveEvent(const QPoint &global, const QPoint &local, - Surface *surface) + QWaylandSurface *surface) { Q_UNUSED(global); Q_UNUSED(local); diff --git a/src/compositor/wayland_wrapper/qwlcompositor_p.h b/src/compositor/wayland_wrapper/qwlcompositor_p.h index ce9d95460..fb71ea57c 100644 --- a/src/compositor/wayland_wrapper/qwlcompositor_p.h +++ b/src/compositor/wayland_wrapper/qwlcompositor_p.h @@ -96,7 +96,7 @@ public: QWaylandInputDevice *inputDeviceFor(QInputEvent *inputEvent); void removeInputDevice(QWaylandInputDevice *device); - void destroySurface(Surface *surface); + void destroySurface(QWaylandSurface *surface); void destroyClient(QWaylandClient *client); @@ -131,7 +131,7 @@ public: DataDeviceManager *dataDeviceManager() const; bool isDragging() const; - void sendDragMoveEvent(const QPoint &global, const QPoint &local, Surface *surface); + void sendDragMoveEvent(const QPoint &global, const QPoint &local, QWaylandSurface *surface); void sendDragEndEvent(); void setRetainedSelectionEnabled(bool enabled); diff --git a/src/compositor/wayland_wrapper/qwldatadevice.cpp b/src/compositor/wayland_wrapper/qwldatadevice.cpp index bd370a063..8dd33d3b0 100644 --- a/src/compositor/wayland_wrapper/qwldatadevice.cpp +++ b/src/compositor/wayland_wrapper/qwldatadevice.cpp @@ -42,7 +42,7 @@ #include "qwlinputdevice_p.h" #include "qwlkeyboard_p.h" #include "qwlpointer_p.h" -#include "qwlsurface_p.h" +#include "qwaylandsurface_p.h" #include "qwltouch_p.h" #include "qwldatadevicemanager_p.h" @@ -97,10 +97,10 @@ void DataDevice::setDragFocus(QWaylandView *focus, const QPointF &localPosition) if (!focus) return; - if (!m_dragDataSource && m_dragClient != focus->surface()->handle()->resource()->client()) + if (!m_dragDataSource && m_dragClient != focus->surface()->waylandClient()) return; - Resource *resource = resourceMap().value(focus->surface()->handle()->resource()->client()); + Resource *resource = resourceMap().value(focus->surface()->waylandClient()); if (!resource) return; @@ -112,7 +112,7 @@ void DataDevice::setDragFocus(QWaylandView *focus, const QPointF &localPosition) if (m_dragDataSource && !offer) return; - send_enter(resource->handle, serial, focus->surface()->handle()->resource()->handle, + send_enter(resource->handle, serial, focus->surface()->resource(), wl_fixed_from_double(localPosition.x()), wl_fixed_from_double(localPosition.y()), offer->resource()->handle); diff --git a/src/compositor/wayland_wrapper/qwldatadevicemanager.cpp b/src/compositor/wayland_wrapper/qwldatadevicemanager.cpp index 35bbf59f4..affc17d72 100644 --- a/src/compositor/wayland_wrapper/qwldatadevicemanager.cpp +++ b/src/compositor/wayland_wrapper/qwldatadevicemanager.cpp @@ -41,7 +41,6 @@ #include "qwlinputdevice_p.h" #include "qwlcompositor_p.h" #include "qwldataoffer_p.h" -#include "qwlsurface_p.h" #include "qwaylandmimehelper.h" #include @@ -204,7 +203,7 @@ void DataDeviceManager::overrideSelection(const QMimeData &mimeData) QWaylandSurface *focusSurface = QWaylandInputDevicePrivate::get(dev)->keyboardFocus(); if (focusSurface) offerFromCompositorToClient( - QWaylandInputDevicePrivate::get(dev)->dataDevice()->resourceMap().value(QWaylandSurfacePrivate::get(focusSurface)->resource()->client())->handle); + QWaylandInputDevicePrivate::get(dev)->dataDevice()->resourceMap().value(focusSurface->waylandClient())->handle); } bool DataDeviceManager::offerFromCompositorToClient(wl_resource *clientDataDeviceResource) diff --git a/src/compositor/wayland_wrapper/qwlinputdevice.cpp b/src/compositor/wayland_wrapper/qwlinputdevice.cpp index 80d91e684..858495ac1 100644 --- a/src/compositor/wayland_wrapper/qwlinputdevice.cpp +++ b/src/compositor/wayland_wrapper/qwlinputdevice.cpp @@ -39,7 +39,6 @@ #include "qwlcompositor_p.h" #include "qwldatadevice_p.h" #include "qwlinputmethod_p.h" -#include "qwlsurface_p.h" #include "qwlqttouch_p.h" #include "qwlqtkey_p.h" #include "qwaylandcompositor.h" @@ -160,9 +159,9 @@ void QWaylandInputDevicePrivate::sendMouseReleaseEvent(Qt::MouseButton button) pointerDevice()->sendMouseReleaseEvent(button); } -void QWaylandInputDevicePrivate::sendMouseMoveEvent(QWaylandView *surface, const QPointF &localPos, const QPointF &globalPos) +void QWaylandInputDevicePrivate::sendMouseMoveEvent(QWaylandView *view, const QPointF &localPos, const QPointF &globalPos) { - pointerDevice()->sendMouseMoveEvent(surface, localPos,globalPos); + pointerDevice()->sendMouseMoveEvent(view, localPos,globalPos); } void QWaylandInputDevicePrivate::sendMouseWheelEvent(Qt::Orientation orientation, int delta) @@ -200,7 +199,7 @@ void QWaylandInputDevicePrivate::sendFullKeyEvent(QKeyEvent *event) } QtWayland::QtKeyExtensionGlobal *ext = QtWayland::QtKeyExtensionGlobal::findIn(m_compositor); - if (ext && ext->postQtKeyEvent(event, keyboardFocus()->handle())) + if (ext && ext->postQtKeyEvent(event, keyboardFocus())) return; if (!m_keyboard.isNull() && !event->isAutoRepeat()) { @@ -215,7 +214,7 @@ void QWaylandInputDevicePrivate::sendFullKeyEvent(QWaylandSurface *surface, QKey { QtWayland::QtKeyExtensionGlobal *ext = QtWayland::QtKeyExtensionGlobal::findIn(m_compositor); if (ext) - ext->postQtKeyEvent(event, surface->handle()); + ext->postQtKeyEvent(event, surface); } void QWaylandInputDevicePrivate::sendFullTouchEvent(QTouchEvent *event) @@ -244,7 +243,7 @@ QWaylandSurface *QWaylandInputDevicePrivate::keyboardFocus() const */ bool QWaylandInputDevicePrivate::setKeyboardFocus(QWaylandSurface *surface) { - if (surface && surface->handle()->isDestroyed()) + if (surface && surface->isDestroyed()) return false; if (!m_keyboard.isNull() && m_keyboard->setFocus(surface)) { diff --git a/src/compositor/wayland_wrapper/qwlinputmethod.cpp b/src/compositor/wayland_wrapper/qwlinputmethod.cpp index ca7ce53fd..59f01c666 100644 --- a/src/compositor/wayland_wrapper/qwlinputmethod.cpp +++ b/src/compositor/wayland_wrapper/qwlinputmethod.cpp @@ -55,7 +55,7 @@ InputMethod::InputMethod(QWaylandCompositor *compositor, QWaylandInputDevice *se , m_textInput() , m_context() { - connect(seat->keyboard(), SIGNAL(focusChanged(Surface*)), this, SLOT(focusChanged(Surface*))); + connect(seat->keyboard(), &QWaylandKeyboard::focusChanged, this, &InputMethod::focusChanged); } InputMethod::~InputMethod() @@ -105,7 +105,7 @@ void InputMethod::deactivate() } } -void InputMethod::focusChanged(Surface *surface) +void InputMethod::focusChanged(QWaylandSurface *surface) { if (!m_textInput) return; diff --git a/src/compositor/wayland_wrapper/qwlinputmethod_p.h b/src/compositor/wayland_wrapper/qwlinputmethod_p.h index ee43b7ebc..b49a6668a 100644 --- a/src/compositor/wayland_wrapper/qwlinputmethod_p.h +++ b/src/compositor/wayland_wrapper/qwlinputmethod_p.h @@ -42,6 +42,8 @@ #include #include +#include + QT_BEGIN_NAMESPACE class QWaylandInputDevice; @@ -51,7 +53,6 @@ namespace QtWayland { class InputMethodContext; class TextInput; -class Surface; class InputMethod : public QObject, public QtWaylandServer::wl_input_method { @@ -74,7 +75,7 @@ protected: void input_method_destroy_resource(Resource *resource); private Q_SLOTS: - void focusChanged(Surface *surface); + void focusChanged(QWaylandSurface *surface); private: QWaylandCompositor *m_compositor; diff --git a/src/compositor/wayland_wrapper/qwlkeyboard.cpp b/src/compositor/wayland_wrapper/qwlkeyboard.cpp index d40422c31..c22b0cb26 100644 --- a/src/compositor/wayland_wrapper/qwlkeyboard.cpp +++ b/src/compositor/wayland_wrapper/qwlkeyboard.cpp @@ -43,7 +43,6 @@ #include #include "qwlcompositor_p.h" -#include "qwlsurface_p.h" #include #include @@ -117,11 +116,11 @@ void QWaylandKeyboardPrivate::focused(QWaylandSurface *surface) surface = Q_NULLPTR; if (m_focusResource && m_focus != surface) { uint32_t serial = wl_display_next_serial(compositor()->waylandDisplay()); - send_leave(m_focusResource->handle, serial, m_focus->handle()->resource()->handle); + send_leave(m_focusResource->handle, serial, m_focus->resource()); m_focusDestroyListener.reset(); } - Resource *resource = surface ? resourceMap().value(surface->client()->client()) : 0; + Resource *resource = surface ? resourceMap().value(surface->waylandClient()) : 0; if (resource && (m_focus != surface || m_focusResource != resource)) { uint32_t serial = wl_display_next_serial(compositor()->waylandDisplay()); diff --git a/src/compositor/wayland_wrapper/qwloutput.cpp b/src/compositor/wayland_wrapper/qwloutput.cpp index caffb9028..82278f301 100644 --- a/src/compositor/wayland_wrapper/qwloutput.cpp +++ b/src/compositor/wayland_wrapper/qwloutput.cpp @@ -37,7 +37,6 @@ #include "qwloutput_p.h" #include "qwlcompositor_p.h" -#include "qwlsurface_p.h" #include #include @@ -49,6 +48,8 @@ #include #include +#include + QT_BEGIN_NAMESPACE namespace QtWayland { @@ -332,7 +333,7 @@ void Output::frameStarted() for (int i = 0; i < m_surfaceViews.size(); i++) { SurfaceViewMapper &surfacemapper = m_surfaceViews[i]; if (surfacemapper.maybeThrottelingView()) - surfacemapper.surface->handle()->frameStarted(); + QWaylandSurfacePrivate::get(surfacemapper.surface)->frameStarted(); } } @@ -345,7 +346,7 @@ void Output::sendFrameCallbacks() surfaceEnter(surfacemapper.surface); } if (surfacemapper.maybeThrottelingView()) - surfacemapper.surface->handle()->sendFrameCallback(); + QWaylandSurfacePrivate::get(surfacemapper.surface)->sendFrameCallback(); } } wl_display_flush_clients(compositor()->waylandDisplay()); @@ -355,14 +356,14 @@ void Output::surfaceEnter(QWaylandSurface *surface) { if (!surface) return; - surface->handle()->send_enter(outputForClient(surface->client())->handle); + QWaylandSurfacePrivate::get(surface)->send_enter(outputForClient(surface->client())->handle); } void Output::surfaceLeave(QWaylandSurface *surface) { if (!surface) return; - surface->handle()->send_leave(outputForClient(surface->client())->handle); + QWaylandSurfacePrivate::get(surface)->send_leave(outputForClient(surface->client())->handle); } void Output::addView(QWaylandView *view) diff --git a/src/compositor/wayland_wrapper/qwlpointer.cpp b/src/compositor/wayland_wrapper/qwlpointer.cpp index 13963d269..9e66f4636 100644 --- a/src/compositor/wayland_wrapper/qwlpointer.cpp +++ b/src/compositor/wayland_wrapper/qwlpointer.cpp @@ -40,7 +40,6 @@ #include "qwlcompositor_p.h" #include "qwlinputdevice_p.h" #include "qwlkeyboard_p.h" -#include "qwlsurface_p.h" #include "qwaylandcompositor.h" #include "qwaylandview.h" @@ -164,17 +163,17 @@ void QWaylandPointerPrivate::sendMouseMoveEvent(QWaylandView *view, const QPoint m_localPosition.ry() -= 0.01; } - Resource *resource = view ? resourceMap().value(view->surface()->handle()->resource()->client()) : 0; + Resource *resource = view ? resourceMap().value(view->surface()->waylandClient()) : 0; if (resource && !m_hasSentEnter) { uint32_t serial = compositor()->nextSerial(); QWaylandKeyboard *keyboard = m_seat->keyboard(); if (keyboard) { keyboard->sendKeyModifiers(view->surface()->client(), serial); } - send_enter(resource->handle, serial, view->surface()->handle()->resource()->handle, + send_enter(resource->handle, serial, view->surface()->resource(), wl_fixed_from_double(m_localPosition.x()), wl_fixed_from_double(m_localPosition.y())); - m_focusDestroyListener.listenForDestruction(view->surface()->handle()->resource()->handle); + m_focusDestroyListener.listenForDestruction(view->surface()->resource()); m_hasSentEnter = true; } diff --git a/src/compositor/wayland_wrapper/qwlsurface.cpp b/src/compositor/wayland_wrapper/qwlsurface.cpp deleted file mode 100644 index 45194f13a..000000000 --- a/src/compositor/wayland_wrapper/qwlsurface.cpp +++ /dev/null @@ -1,427 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the QtWaylandCompositor module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPLv3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qwlsurface_p.h" - -#include "qwaylandsurface.h" -#include "qwaylandsurface_p.h" -#include "qwaylandview.h" -#include "qwaylandview_p.h" -#include "qwaylandoutput.h" -#include "qwlcompositor_p.h" -#include "qwlinputdevice_p.h" -#include "qwlextendedsurface_p.h" -#include "qwlregion_p.h" -#include "qwlsubsurface_p.h" -#include "qwlsurfacebuffer_p.h" -#include "qwaylandoutput.h" -#include "qwaylandsurface_p.h" - -#include -#include -#include -#include - -#include - -QT_BEGIN_NAMESPACE - -namespace QtWayland { - -class FrameCallback { -public: - FrameCallback(Surface *surf, wl_resource *res) - : surface(surf) - , resource(res) - , canSend(false) - { -#if WAYLAND_VERSION_MAJOR < 1 || (WAYLAND_VERSION_MAJOR == 1 && WAYLAND_VERSION_MINOR <= 2) - res->data = this; - res->destroy = destroyCallback; -#else - wl_resource_set_implementation(res, 0, this, destroyCallback); -#endif - } - ~FrameCallback() - { - } - void destroy() - { - if (resource) - wl_resource_destroy(resource); - else - delete this; - } - void send(uint time) - { - wl_callback_send_done(resource, time); - wl_resource_destroy(resource); - } - static void destroyCallback(wl_resource *res) - { -#if WAYLAND_VERSION_MAJOR < 1 || (WAYLAND_VERSION_MAJOR == 1 && WAYLAND_VERSION_MINOR <= 2) - FrameCallback *_this = static_cast(res->data); -#else - FrameCallback *_this = static_cast(wl_resource_get_user_data(res)); -#endif - _this->surface->removeFrameCallback(_this); - delete _this; - } - Surface *surface; - wl_resource *resource; - bool canSend; -}; - -static QRegion infiniteRegion() { - return QRegion(QRect(QPoint(std::numeric_limits::min(), std::numeric_limits::min()), - QPoint(std::numeric_limits::max(), std::numeric_limits::max()))); -} - -Surface::Surface(struct wl_client *client, uint32_t id, int version, QWaylandCompositor *compositor, QWaylandSurface *surface) - : QtWaylandServer::wl_surface(client, id, version) - , m_compositor(compositor->handle()) - , m_waylandSurface(surface) - , m_buffer(0) - , m_surfaceMapped(false) - , m_subSurface(0) - , m_inputPanelSurface(0) - , m_inputRegion(infiniteRegion()) - , m_isCursorSurface(false) - , m_destroyed(false) - , m_contentOrientation(Qt::PrimaryOrientation) - , m_visibility(QWindow::Hidden) -{ - m_pending.buffer = 0; - m_pending.newlyAttached = false; - m_pending.inputRegion = infiniteRegion(); -} - -Surface::~Surface() -{ - delete m_subSurface; - - m_bufferRef = QWaylandBufferRef(); - - for (int i = 0; i < m_bufferPool.size(); i++) - m_bufferPool[i]->setDestroyIfUnused(true); - - foreach (FrameCallback *c, m_pendingFrameCallbacks) - c->destroy(); - foreach (FrameCallback *c, m_frameCallbacks) - c->destroy(); -} - -Surface *Surface::fromResource(struct ::wl_resource *resource) -{ - return static_cast(Resource::fromResource(resource)->surface_object); -} - -QSize Surface::size() const -{ - return m_size; -} - -void Surface::setSize(const QSize &size) -{ - if (size != m_size) { - m_opaqueRegion = QRegion(); - m_size = size; - m_waylandSurface->sizeChanged(); - } -} - -QRegion Surface::inputRegion() const -{ - return m_inputRegion; -} - -QRegion Surface::opaqueRegion() const -{ - return m_opaqueRegion; -} - -void Surface::sendFrameCallback() -{ - uint time = m_compositor->currentTimeMsecs(); - foreach (FrameCallback *callback, m_frameCallbacks) { - if (callback->canSend) { - callback->send(time); - m_frameCallbacks.removeOne(callback); - } - } -} - -void Surface::removeFrameCallback(FrameCallback *callback) -{ - m_pendingFrameCallbacks.removeOne(callback); - m_frameCallbacks.removeOne(callback); -} - -QWaylandSurface * Surface::waylandSurface() const -{ - return m_waylandSurface; -} - -QPoint Surface::lastMousePos() const -{ - return m_lastLocalMousePos; -} - -void Surface::setSubSurface(SubSurface *subSurface) -{ - m_subSurface = subSurface; -} - -SubSurface *Surface::subSurface() const -{ - return m_subSurface; -} - -void Surface::setInputPanelSurface(InputPanelSurface *inputPanelSurface) -{ - m_inputPanelSurface = inputPanelSurface; -} - -InputPanelSurface *Surface::inputPanelSurface() const -{ - return m_inputPanelSurface; -} - -Compositor *Surface::compositor() const -{ - return m_compositor; -} - -/*! - * Sets the backbuffer for this surface. The back buffer is not yet on - * screen and will become live during the next swapBuffers(). - * - * The backbuffer represents the current state of the surface for the - * purpose of GUI-thread accessible properties such as size and visibility. - */ -void Surface::setBackBuffer(SurfaceBuffer *buffer, const QRegion &damage) -{ - m_buffer = buffer; - m_bufferRef = QWaylandBufferRef(m_buffer); - - if (m_buffer) { - bool valid = m_buffer->waylandBufferHandle() != 0; - if (valid) - setSize(m_buffer->size()); - - m_damage = damage.intersected(QRect(QPoint(), m_size)); - } else { - setSize(QSize()); - m_damage = QRect(); - } - - QWaylandSurfacePrivate *priv = QWaylandSurfacePrivate::get(waylandSurface()); - for (int i = 0; i < priv->views.size(); i++) { - priv->views.at(i)->attach(m_bufferRef, m_damage); - } - - emit m_waylandSurface->damaged(m_damage); - setMapped(m_bufferRef.hasBuffer()); - if (!m_pending.offset.isNull()) - emit m_waylandSurface->offsetForNextFrame(m_pending.offset); -} - -bool Surface::mapped() const -{ - return m_buffer && bool(m_buffer->waylandBufferHandle()); -} - -void Surface::setMapped(bool mapped) -{ - if (m_surfaceMapped == mapped) - return; - - m_surfaceMapped = mapped; - emit m_waylandSurface->mappedChanged(); -} - -SurfaceBuffer *Surface::createSurfaceBuffer(struct ::wl_resource *buffer) -{ - SurfaceBuffer *newBuffer = 0; - for (int i = 0; i < m_bufferPool.size(); i++) { - if (!m_bufferPool[i]->isRegisteredWithBuffer()) { - newBuffer = m_bufferPool[i]; - newBuffer->initialize(buffer); - break; - } - } - - if (!newBuffer) { - newBuffer = new SurfaceBuffer(this); - newBuffer->initialize(buffer); - m_bufferPool.append(newBuffer); - if (m_bufferPool.size() > 3) - qWarning() << "Increased buffer pool size to" << m_bufferPool.size() << "for surface with title:" << title() << "className:" << className(); - } - - return newBuffer; -} - -Qt::ScreenOrientation Surface::contentOrientation() const -{ - return m_contentOrientation; -} - -void Surface::notifyViewsAboutDestruction() -{ - foreach (QWaylandView *view, m_waylandSurface->views()) { - QWaylandViewPrivate::get(view)->markSurfaceAsDestroyed(m_waylandSurface); - } -} - -void Surface::surface_destroy_resource(Resource *) -{ - notifyViewsAboutDestruction(); - - m_destroyed = true; - m_waylandSurface->destroy(); - emit m_waylandSurface->surfaceDestroyed(); -} - -void Surface::surface_destroy(Resource *resource) -{ - wl_resource_destroy(resource->handle); -} - -void Surface::surface_attach(Resource *, struct wl_resource *buffer, int x, int y) -{ - if (m_pending.buffer) - m_pending.buffer->disown(); - m_pending.buffer = createSurfaceBuffer(buffer); - m_pending.offset = QPoint(x, y); - m_pending.newlyAttached = true; -} - -void Surface::surface_damage(Resource *, int32_t x, int32_t y, int32_t width, int32_t height) -{ - m_pending.damage = m_pending.damage.united(QRect(x, y, width, height)); -} - -void Surface::surface_frame(Resource *resource, uint32_t callback) -{ - struct wl_resource *frame_callback = wl_resource_create(resource->client(), &wl_callback_interface, wl_callback_interface.version, callback); - m_pendingFrameCallbacks << new FrameCallback(this, frame_callback); -} - -void Surface::surface_set_opaque_region(Resource *, struct wl_resource *region) -{ - m_opaqueRegion = region ? Region::fromResource(region)->region() : QRegion(); -} - -void Surface::surface_set_input_region(Resource *, struct wl_resource *region) -{ - if (region) { - m_pending.inputRegion = Region::fromResource(region)->region(); - } else { - m_pending.inputRegion = infiniteRegion(); - } -} - -void Surface::surface_commit(Resource *) -{ - if (m_pending.buffer || m_pending.newlyAttached) { - setBackBuffer(m_pending.buffer, m_pending.damage); - } - - m_pending.buffer = 0; - m_pending.offset = QPoint(); - m_pending.newlyAttached = false; - m_pending.damage = QRegion(); - - if (m_buffer) - m_buffer->setCommitted(); - - m_frameCallbacks << m_pendingFrameCallbacks; - m_pendingFrameCallbacks.clear(); - - m_inputRegion = m_pending.inputRegion.intersected(QRect(QPoint(), m_size)); - - emit m_waylandSurface->redraw(); -} - -void Surface::surface_set_buffer_transform(Resource *resource, int32_t orientation) -{ - Q_UNUSED(resource); - QScreen *screen = QGuiApplication::primaryScreen(); - bool isPortrait = screen->primaryOrientation() == Qt::PortraitOrientation; - Qt::ScreenOrientation oldOrientation = m_contentOrientation; - switch (orientation) { - case WL_OUTPUT_TRANSFORM_90: - m_contentOrientation = isPortrait ? Qt::InvertedLandscapeOrientation : Qt::PortraitOrientation; - break; - case WL_OUTPUT_TRANSFORM_180: - m_contentOrientation = isPortrait ? Qt::InvertedPortraitOrientation : Qt::InvertedLandscapeOrientation; - break; - case WL_OUTPUT_TRANSFORM_270: - m_contentOrientation = isPortrait ? Qt::LandscapeOrientation : Qt::InvertedPortraitOrientation; - break; - default: - m_contentOrientation = Qt::PrimaryOrientation; - } - if (m_contentOrientation != oldOrientation) - emit waylandSurface()->contentOrientationChanged(); -} - -void Surface::frameStarted() -{ - foreach (FrameCallback *c, m_frameCallbacks) - c->canSend = true; -} - -void Surface::setClassName(const QString &className) -{ - if (m_className != className) { - m_className = className; - emit waylandSurface()->classNameChanged(); - } -} - -void Surface::setTitle(const QString &title) -{ - if (m_title != title) { - m_title = title; - emit waylandSurface()->titleChanged(); - } -} - -} // namespace Wayland - -QT_END_NAMESPACE diff --git a/src/compositor/wayland_wrapper/qwlsurface_p.h b/src/compositor/wayland_wrapper/qwlsurface_p.h deleted file mode 100644 index ae92d6f47..000000000 --- a/src/compositor/wayland_wrapper/qwlsurface_p.h +++ /dev/null @@ -1,196 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the QtWaylandCompositor module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPLv3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef WL_SURFACE_H -#define WL_SURFACE_H - -#include - -#include -#include -#include - -#include -#include -#include -#include -#include - -#include -#include - -#include - -#include - -QT_BEGIN_NAMESPACE - -class QTouchEvent; - -namespace QtWayland { - -class Compositor; -class Buffer; -class ExtendedSurface; -class InputPanelSurface; -class SubSurface; -class FrameCallback; - -class Q_COMPOSITOR_EXPORT Surface : public QtWaylandServer::wl_surface -{ -public: - Surface(struct wl_client *client, uint32_t id, int version, QWaylandCompositor *compositor, QWaylandSurface *surface); - ~Surface(); - - static Surface *fromResource(struct ::wl_resource *resource); - - bool mapped() const; - - using QtWaylandServer::wl_surface::resource; - - QSize size() const; - void setSize(const QSize &size); - - QRegion inputRegion() const; - QRegion opaqueRegion() const; - - void sendFrameCallback(); - void removeFrameCallback(FrameCallback *callback); - - QWaylandSurface *waylandSurface() const; - - QPoint lastMousePos() const; - - void setSubSurface(SubSurface *subSurface); - SubSurface *subSurface() const; - - void setInputPanelSurface(InputPanelSurface *inputPanelSurface); - InputPanelSurface *inputPanelSurface() const; - - Compositor *compositor() const; - - QString className() const { return m_className; } - void setClassName(const QString &className); - - QString title() const { return m_title; } - void setTitle(const QString &title); - - bool isCursorSurface() const { return m_isCursorSurface; } - void setCursorSurface(bool isCursor) { m_isCursorSurface = isCursor; } - - void frameStarted(); - - void setMapped(bool mapped); - void setVisibility(QWindow::Visibility visibility) { m_visibility = visibility; } - - inline bool isDestroyed() const { return m_destroyed; } - - Qt::ScreenOrientation contentOrientation() const; - - QWaylandSurface::Origin origin() const { return m_buffer ? m_buffer->origin() : QWaylandSurface::OriginTopLeft; } - - QWaylandBufferRef currentBufferRef() const { return m_bufferRef; } - - void notifyViewsAboutDestruction(); -protected: - void surface_destroy_resource(Resource *resource) Q_DECL_OVERRIDE; - - void surface_destroy(Resource *resource) Q_DECL_OVERRIDE; - void surface_attach(Resource *resource, - struct wl_resource *buffer, int x, int y) Q_DECL_OVERRIDE; - void surface_damage(Resource *resource, - int32_t x, int32_t y, int32_t width, int32_t height) Q_DECL_OVERRIDE; - void surface_frame(Resource *resource, - uint32_t callback) Q_DECL_OVERRIDE; - void surface_set_opaque_region(Resource *resource, - struct wl_resource *region) Q_DECL_OVERRIDE; - void surface_set_input_region(Resource *resource, - struct wl_resource *region) Q_DECL_OVERRIDE; - void surface_commit(Resource *resource) Q_DECL_OVERRIDE; - void surface_set_buffer_transform(Resource *resource, int32_t transform) Q_DECL_OVERRIDE; - - Q_DISABLE_COPY(Surface) - - Compositor *m_compositor; - QWaylandSurface *m_waylandSurface; - - QRegion m_damage; - SurfaceBuffer *m_buffer; - QWaylandBufferRef m_bufferRef; - bool m_surfaceMapped; - - struct { - SurfaceBuffer *buffer; - QRegion damage; - QPoint offset; - bool newlyAttached; - QRegion inputRegion; - } m_pending; - - QPoint m_lastLocalMousePos; - QPoint m_lastGlobalMousePos; - - QList m_pendingFrameCallbacks; - QList m_frameCallbacks; - - SubSurface *m_subSurface; - InputPanelSurface *m_inputPanelSurface; - - QRegion m_inputRegion; - QRegion m_opaqueRegion; - - QVector m_bufferPool; - - QSize m_size; - QString m_className; - QString m_title; - bool m_isCursorSurface; - bool m_destroyed; - Qt::ScreenOrientation m_contentOrientation; - QWindow::Visibility m_visibility; - - void setBackBuffer(SurfaceBuffer *buffer, const QRegion &damage); - - SurfaceBuffer *createSurfaceBuffer(struct ::wl_resource *buffer); - - friend class QWaylandSurface; -}; - -} - -QT_END_NAMESPACE - -#endif //WL_SURFACE_H diff --git a/src/compositor/wayland_wrapper/qwlsurfacebuffer.cpp b/src/compositor/wayland_wrapper/qwlsurfacebuffer.cpp index 225b49f4f..9c7671855 100644 --- a/src/compositor/wayland_wrapper/qwlsurfacebuffer.cpp +++ b/src/compositor/wayland_wrapper/qwlsurfacebuffer.cpp @@ -36,7 +36,6 @@ #include "qwlsurfacebuffer_p.h" -#include "qwlsurface_p.h" #include "qwlcompositor_p.h" #ifdef QT_COMPOSITOR_WAYLAND_GL @@ -53,7 +52,7 @@ QT_BEGIN_NAMESPACE namespace QtWayland { -SurfaceBuffer::SurfaceBuffer(Surface *surface) +SurfaceBuffer::SurfaceBuffer(QWaylandSurface *surface) : m_surface(surface) , m_compositor(surface->compositor()) , m_buffer(0) @@ -161,7 +160,7 @@ QSize SurfaceBuffer::size() const int height = wl_shm_buffer_get_height(shmBuffer); return QSize(width, height); } - if (ClientBufferIntegration *integration = m_compositor->clientBufferIntegration()) { + if (ClientBufferIntegration *integration = m_compositor->handle()->clientBufferIntegration()) { return integration->bufferSize(m_buffer); } @@ -174,7 +173,7 @@ QWaylandSurface::Origin SurfaceBuffer::origin() const return QWaylandSurface::OriginTopLeft; } - if (ClientBufferIntegration *integration = m_compositor->clientBufferIntegration()) { + if (ClientBufferIntegration *integration = m_compositor->handle()->clientBufferIntegration()) { return integration->origin(m_buffer); } return QWaylandSurface::OriginTopLeft; @@ -210,7 +209,7 @@ void SurfaceBuffer::bindToTexture() const glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, image.width(), image.height(), 0, GL_RGB, GL_UNSIGNED_BYTE, image.constBits()); } } else { - if (QtWayland::ClientBufferIntegration *clientInt = m_compositor->clientBufferIntegration()) { + if (QtWayland::ClientBufferIntegration *clientInt = m_compositor->handle()->clientBufferIntegration()) { clientInt->bindTextureToBuffer(m_buffer); } } diff --git a/src/compositor/wayland_wrapper/qwlsurfacebuffer_p.h b/src/compositor/wayland_wrapper/qwlsurfacebuffer_p.h index 8eecfa73f..ce2c2686d 100644 --- a/src/compositor/wayland_wrapper/qwlsurfacebuffer_p.h +++ b/src/compositor/wayland_wrapper/qwlsurfacebuffer_p.h @@ -50,12 +50,10 @@ QT_BEGIN_NAMESPACE class QWaylandClientBufferIntegration; class QWaylandBufferRef; +class QWaylandCompositor; namespace QtWayland { -class Surface; -class Compositor; - struct surface_buffer_destroy_listener { struct wl_listener listener; @@ -65,7 +63,7 @@ struct surface_buffer_destroy_listener class SurfaceBuffer { public: - SurfaceBuffer(Surface *surface); + SurfaceBuffer(QWaylandSurface *surface); ~SurfaceBuffer(); @@ -96,13 +94,14 @@ public: QImage image() const; void bindToTexture() const; + static bool hasContent(SurfaceBuffer *buffer) { return buffer && buffer->isRegisteredWithBuffer(); } private: void ref(); void deref(); void destroyIfUnused(); - Surface *m_surface; - Compositor *m_compositor; + QWaylandSurface *m_surface; + QWaylandCompositor *m_compositor; struct ::wl_resource *m_buffer; struct surface_buffer_destroy_listener m_destroy_listener; bool m_committed; diff --git a/src/compositor/wayland_wrapper/qwltouch.cpp b/src/compositor/wayland_wrapper/qwltouch.cpp index 7f69f955f..85675a624 100644 --- a/src/compositor/wayland_wrapper/qwltouch.cpp +++ b/src/compositor/wayland_wrapper/qwltouch.cpp @@ -38,7 +38,6 @@ #include "qwltouch_p.h" #include "qwlcompositor_p.h" -#include "qwlsurface_p.h" #include "qwaylandview.h" #include "qwlqttouch_p.h" diff --git a/src/compositor/wayland_wrapper/qwltouch_p.h b/src/compositor/wayland_wrapper/qwltouch_p.h index 52beb81a6..c970d1c87 100644 --- a/src/compositor/wayland_wrapper/qwltouch_p.h +++ b/src/compositor/wayland_wrapper/qwltouch_p.h @@ -87,7 +87,7 @@ public: if (!mouseFocus || !mouseFocus->surface()) return; - m_focusResource = resourceMap().value(mouseFocus->surface()->client()->client()); + m_focusResource = resourceMap().value(mouseFocus->surface()->waylandClient()); } private: void resetFocusState(); diff --git a/src/compositor/wayland_wrapper/wayland_wrapper.pri b/src/compositor/wayland_wrapper/wayland_wrapper.pri index 2bc732565..cf7194fe6 100644 --- a/src/compositor/wayland_wrapper/wayland_wrapper.pri +++ b/src/compositor/wayland_wrapper/wayland_wrapper.pri @@ -18,7 +18,6 @@ HEADERS += \ wayland_wrapper/qwloutput_p.h \ wayland_wrapper/qwlpointer_p.h \ wayland_wrapper/qwlregion_p.h \ - wayland_wrapper/qwlsurface_p.h \ wayland_wrapper/qwlsurfacebuffer_p.h \ wayland_wrapper/qwltouch_p.h \ ../shared/qwaylandxkb.h \ @@ -37,7 +36,6 @@ SOURCES += \ wayland_wrapper/qwloutput.cpp \ wayland_wrapper/qwlpointer.cpp \ wayland_wrapper/qwlregion.cpp \ - wayland_wrapper/qwlsurface.cpp \ wayland_wrapper/qwlsurfacebuffer.cpp \ wayland_wrapper/qwltouch.cpp \ ../shared/qwaylandxkb.cpp \ -- cgit v1.2.3 From 1b9e6e56269a5768cb8a83dc5e4b888fd63dd13c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Tue, 11 Aug 2015 16:20:56 +0200 Subject: Move some virtual functions into protected scoping. Users should not call these functions, but they should be able to sub-class QWaylandCompositor to reimplement them Change-Id: I35888fec67bec085820733135f201bab1df268a3 --- src/compositor/wayland_wrapper/qwlcompositor_p.h | 7 +++++++ src/compositor/wayland_wrapper/qwlinputdevice.cpp | 6 +++--- 2 files changed, 10 insertions(+), 3 deletions(-) (limited to 'src/compositor/wayland_wrapper') diff --git a/src/compositor/wayland_wrapper/qwlcompositor_p.h b/src/compositor/wayland_wrapper/qwlcompositor_p.h index fb71ea57c..4881addae 100644 --- a/src/compositor/wayland_wrapper/qwlcompositor_p.h +++ b/src/compositor/wayland_wrapper/qwlcompositor_p.h @@ -141,6 +141,13 @@ public: void unregisterSurface(QWaylandSurface *surface); + QWaylandPointer *callCreatePointerDevice(QWaylandInputDevice *inputDevice) + { return m_qt_compositor->createPointerDevice(inputDevice); } + QWaylandKeyboard *callCreateKeyboardDevice(QWaylandInputDevice *inputDevice) + { return m_qt_compositor->createKeyboardDevice(inputDevice); } + QWaylandTouch *callCreateTouchDevice(QWaylandInputDevice *inputDevice) + { return m_qt_compositor->createTouchDevice(inputDevice); } + public Q_SLOTS: void cleanupGraphicsResources(); diff --git a/src/compositor/wayland_wrapper/qwlinputdevice.cpp b/src/compositor/wayland_wrapper/qwlinputdevice.cpp index 858495ac1..2849a2373 100644 --- a/src/compositor/wayland_wrapper/qwlinputdevice.cpp +++ b/src/compositor/wayland_wrapper/qwlinputdevice.cpp @@ -109,15 +109,15 @@ void QWaylandInputDevicePrivate::setCapabilities(QWaylandInputDevice::Capability QWaylandInputDevice::CapabilityFlags changed = caps ^ m_capabilities; if (changed & QWaylandInputDevice::Pointer) { - m_pointer.reset(m_pointer.isNull() ? compositor()->createPointerDevice(q) : 0); + m_pointer.reset(m_pointer.isNull() ? compositor()->handle()->callCreatePointerDevice(q) : 0); } if (changed & QWaylandInputDevice::Keyboard) { - m_keyboard.reset(m_keyboard.isNull() ? compositor()->createKeyboardDevice(q) : 0); + m_keyboard.reset(m_keyboard.isNull() ? compositor()->handle()->callCreateKeyboardDevice(q) : 0); } if (changed & QWaylandInputDevice::Touch) { - m_touch.reset(m_touch.isNull() ? compositor()->createTouchDevice(q) : 0); + m_touch.reset(m_touch.isNull() ? compositor()->handle()->callCreateTouchDevice(q) : 0); } m_capabilities = caps; -- cgit v1.2.3 From 674c6eef06ae23abadab7969125834617a7be562 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Wed, 12 Aug 2015 15:39:39 +0200 Subject: Remove QtWayland::Compositor and add QWaylandCompositorPrivate Embrace PIMPL Change-Id: I8c8b5971e15c208317ff33231bda1513e7b8d489 --- src/compositor/wayland_wrapper/qwlcompositor.cpp | 529 --------------------- src/compositor/wayland_wrapper/qwlcompositor_p.h | 218 --------- src/compositor/wayland_wrapper/qwldatadevice.cpp | 6 +- .../wayland_wrapper/qwldatadevicemanager.cpp | 16 +- .../wayland_wrapper/qwldatadevicemanager_p.h | 10 +- src/compositor/wayland_wrapper/qwldatasource.cpp | 1 - src/compositor/wayland_wrapper/qwldisplay.cpp | 61 --- src/compositor/wayland_wrapper/qwldisplay_p.h | 64 --- src/compositor/wayland_wrapper/qwlinputdevice.cpp | 12 +- src/compositor/wayland_wrapper/qwlinputmethod.cpp | 4 +- src/compositor/wayland_wrapper/qwlkeyboard.cpp | 14 +- src/compositor/wayland_wrapper/qwloutput.cpp | 6 +- src/compositor/wayland_wrapper/qwlpointer.cpp | 5 +- src/compositor/wayland_wrapper/qwlregion.cpp | 2 - .../wayland_wrapper/qwlsurfacebuffer.cpp | 10 +- src/compositor/wayland_wrapper/qwltouch.cpp | 2 +- src/compositor/wayland_wrapper/wayland_wrapper.pri | 4 - 17 files changed, 41 insertions(+), 923 deletions(-) delete mode 100644 src/compositor/wayland_wrapper/qwlcompositor.cpp delete mode 100644 src/compositor/wayland_wrapper/qwlcompositor_p.h delete mode 100644 src/compositor/wayland_wrapper/qwldisplay.cpp delete mode 100644 src/compositor/wayland_wrapper/qwldisplay_p.h (limited to 'src/compositor/wayland_wrapper') diff --git a/src/compositor/wayland_wrapper/qwlcompositor.cpp b/src/compositor/wayland_wrapper/qwlcompositor.cpp deleted file mode 100644 index 65b669a02..000000000 --- a/src/compositor/wayland_wrapper/qwlcompositor.cpp +++ /dev/null @@ -1,529 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 Pier Luigi Fiorini -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the QtWaylandCompositor module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPLv3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qwlcompositor_p.h" - -#include "qwaylandinput.h" -#include "qwldisplay_p.h" -#include "qwloutput_p.h" -#include "qwaylandsurface_p.h" -#include "qwaylandclient.h" -#include "qwaylandcompositor.h" -#include "qwldatadevicemanager_p.h" -#include "qwldatadevice_p.h" -#include "qwlextendedsurface_p.h" -#include "qwlsubsurface_p.h" -#include "qwlshellsurface_p.h" -#include "qwlqttouch_p.h" -#include "qwlqtkey_p.h" -#include "qwlinputdevice_p.h" -#include "qwlregion_p.h" -#include "qwlpointer_p.h" -#include "qwltextinputmanager_p.h" -#include -#include "qwaylandview.h" -#include "qwaylandshmformathelper.h" -#include "qwaylandoutput.h" -#include "qwlkeyboard_p.h" - -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#include - -#if defined (QT_COMPOSITOR_WAYLAND_GL) -#include "hardware_integration/qwlhwintegration_p.h" -#include "hardware_integration/qwlclientbufferintegration_p.h" -#include "hardware_integration/qwlserverbufferintegration_p.h" -#endif -#include "extensions/qwaylandwindowmanagerextension.h" - -#include "hardware_integration/qwlclientbufferintegrationfactory_p.h" -#include "hardware_integration/qwlserverbufferintegrationfactory_p.h" - -#include "../shared/qwaylandxkb.h" - -QT_BEGIN_NAMESPACE - -namespace QtWayland { - -class WindowSystemEventHandler : public QWindowSystemEventHandler -{ -public: - WindowSystemEventHandler(Compositor *c) : compositor(c) {} - bool sendEvent(QWindowSystemInterfacePrivate::WindowSystemEvent *e) Q_DECL_OVERRIDE - { - if (e->type == QWindowSystemInterfacePrivate::Key) { - QWindowSystemInterfacePrivate::KeyEvent *ke = static_cast(e); - QWaylandKeyboardPrivate *keyb = QWaylandKeyboardPrivate::get(compositor->defaultInputDevice()->keyboard()); - - uint32_t code = ke->nativeScanCode; - bool isDown = ke->keyType == QEvent::KeyPress; - -#ifndef QT_NO_WAYLAND_XKB - QString text; - Qt::KeyboardModifiers modifiers = QWaylandXkb::modifiers(keyb->xkbState()); - - const xkb_keysym_t sym = xkb_state_key_get_one_sym(keyb->xkbState(), code); - uint utf32 = xkb_keysym_to_utf32(sym); - if (utf32) - text = QString::fromUcs4(&utf32, 1); - int qtkey = QWaylandXkb::keysymToQtKey(sym, modifiers, text); - - ke->key = qtkey; - ke->modifiers = modifiers; - ke->nativeVirtualKey = sym; - ke->nativeModifiers = keyb->xkbModsMask(); - ke->unicode = text; -#endif - if (!ke->repeat) - keyb->keyEvent(code, isDown ? WL_KEYBOARD_KEY_STATE_PRESSED : WL_KEYBOARD_KEY_STATE_RELEASED); - - QWindowSystemEventHandler::sendEvent(e); - - if (!ke->repeat) { - keyb->updateKeymap(); - keyb->updateModifierState(code, isDown ? WL_KEYBOARD_KEY_STATE_PRESSED : WL_KEYBOARD_KEY_STATE_RELEASED); - } - } else { - QWindowSystemEventHandler::sendEvent(e); - } - return true; - } - - Compositor *compositor; -}; - -Compositor::Compositor(QWaylandCompositor *qt_compositor) - : m_extensions(QWaylandCompositor::DefaultExtensions) - , m_display(new Display) - , m_current_frame(0) - , m_last_queued_buf(-1) - , m_qt_compositor(qt_compositor) - , m_orientation(Qt::PrimaryOrientation) -#if defined (QT_COMPOSITOR_WAYLAND_GL) - , m_hw_integration(0) - , m_client_buffer_integration(0) - , m_server_buffer_integration(0) -#endif - , m_eventHandler(new WindowSystemEventHandler(this)) - , m_retainSelection(false) - , m_initialized(false) -{ - m_outputSpaces.append(new QWaylandOutputSpace(qt_compositor)); - m_timer.start(); - - QWindowSystemInterfacePrivate::installWindowSystemEventHandler(m_eventHandler.data()); -} - -void Compositor::init() -{ - QStringList arguments = QCoreApplication::instance()->arguments(); - - int socketArg = arguments.indexOf(QLatin1String("--wayland-socket-name")); - if (socketArg != -1 && socketArg + 1 < arguments.size()) - m_socket_name = arguments.at(socketArg + 1).toLocal8Bit(); - - wl_compositor::init(m_display->handle(), 3); - - m_data_device_manager = new DataDeviceManager(this); - - wl_display_init_shm(m_display->handle()); - QVector formats = QWaylandShmFormatHelper::supportedWaylandFormats(); - foreach (wl_shm_format format, formats) - wl_display_add_shm_format(m_display->handle(), format); - - const char *socketName = 0; - if (m_socket_name.size()) - socketName = m_socket_name.constData(); - if (wl_display_add_socket(m_display->handle(), socketName)) { - qFatal("Fatal: Failed to open server socket\n"); - } - - m_loop = wl_display_get_event_loop(m_display->handle()); - - int fd = wl_event_loop_get_fd(m_loop); - - QSocketNotifier *sockNot = new QSocketNotifier(fd, QSocketNotifier::Read, this); - connect(sockNot, SIGNAL(activated(int)), this, SLOT(processWaylandEvents())); - - QAbstractEventDispatcher *dispatcher = QGuiApplicationPrivate::eventDispatcher; - connect(dispatcher, SIGNAL(aboutToBlock()), this, SLOT(processWaylandEvents())); - - qRegisterMetaType("SurfaceBuffer*"); - qRegisterMetaType("WaylandClient*"); - qRegisterMetaType("WaylandSurface*"); - qRegisterMetaType("WaylandSurfaceView*"); - //initialize distancefieldglyphcache here - - initializeHardwareIntegration(); - initializeExtensions(); - initializeDefaultInputDevice(); - - m_initialized = true; -} - -Compositor::~Compositor() -{ - if (!m_destroyed_surfaces.isEmpty()) - qWarning("QWaylandCompositor::cleanupGraphicsResources() must be called manually"); - qDeleteAll(m_clients); - - qDeleteAll(m_outputSpaces); - - removeInputDevice(m_default_wayland_input_device); - delete m_default_wayland_input_device; - delete m_data_device_manager; - - delete m_display; -} - -uint Compositor::currentTimeMsecs() const -{ - return m_timer.elapsed(); -} - -QWaylandOutput *Compositor::output(QWindow *window) const -{ - foreach (QWaylandOutputSpace *outputSpace, m_outputSpaces) { - QWaylandOutput *output = outputSpace->output(window); - if (output) - return output; - } - - return Q_NULLPTR; -} - -QWaylandOutput *Compositor::primaryOutput() const -{ - return primaryOutputSpace()->primaryOutput(); -} - -QWaylandOutputSpace *Compositor::primaryOutputSpace() const -{ - Q_ASSERT(!m_outputSpaces.isEmpty()); - return m_outputSpaces.first(); -} - -void Compositor::setPrimaryOutputSpace(QWaylandOutputSpace *outputSpace) -{ - Q_ASSERT(!m_outputSpaces.isEmpty()); - if (m_outputSpaces.first() == outputSpace) - return; - if (m_outputSpaces.removeOne(outputSpace)) { - m_outputSpaces.prepend(outputSpace); - waylandCompositor()->primaryOutputSpaceChanged(); - } -} - -void Compositor::addOutputSpace(QWaylandOutputSpace *outputSpace) -{ - Q_ASSERT(!m_outputSpaces.contains(outputSpace)); - m_outputSpaces.append(outputSpace); - waylandCompositor()->outputSpacesChanged(); -} - -void Compositor::removeOutputSpace(QWaylandOutputSpace *outputSpace) -{ - if (m_outputSpaces.removeOne(outputSpace)) - waylandCompositor()->outputSpacesChanged(); -} - -void Compositor::processWaylandEvents() -{ - int ret = wl_event_loop_dispatch(m_loop, 0); - if (ret) - fprintf(stderr, "wl_event_loop_dispatch error: %d\n", ret); - wl_display_flush_clients(m_display->handle()); -} - -void Compositor::destroySurface(QWaylandSurface *surface) -{ - waylandCompositor()->surfaceAboutToBeDestroyed(surface); - - m_destroyed_surfaces << surface; -} - -void Compositor::unregisterSurface(QWaylandSurface *surface) -{ - if (!m_all_surfaces.removeOne(surface)) - qWarning("%s Unexpected state. Cant find registered surface\n", Q_FUNC_INFO); -} - -void Compositor::cleanupGraphicsResources() -{ - qDeleteAll(m_destroyed_surfaces); - m_destroyed_surfaces.clear(); -} - -void Compositor::compositor_create_surface(Resource *resource, uint32_t id) -{ - QWaylandClient *client = QWaylandClient::fromWlClient(m_qt_compositor, resource->client()); - QWaylandSurface *surface = m_qt_compositor->createSurface(client, id, resource->version()); - m_all_surfaces.append(surface); - emit m_qt_compositor->surfaceCreated(surface); -} - -void Compositor::compositor_create_region(Resource *resource, uint32_t id) -{ - new Region(resource->client(), id); -} - -void Compositor::destroyClient(QWaylandClient *client) -{ - if (!client) - return; - - QWaylandWindowManagerExtension *wmExtension = QWaylandWindowManagerExtension::findIn(waylandCompositor()); - if (wmExtension) - wmExtension->sendQuitMessage(client->client()); - - wl_client_destroy(client->client()); -} - -ClientBufferIntegration * Compositor::clientBufferIntegration() const -{ -#ifdef QT_COMPOSITOR_WAYLAND_GL - return m_client_buffer_integration.data(); -#else - return 0; -#endif -} - -ServerBufferIntegration * Compositor::serverBufferIntegration() const -{ -#ifdef QT_COMPOSITOR_WAYLAND_GL - return m_server_buffer_integration.data(); -#else - return 0; -#endif -} - -void Compositor::initializeHardwareIntegration() -{ -#ifdef QT_COMPOSITOR_WAYLAND_GL - if (m_extensions & QWaylandCompositor::HardwareIntegrationExtension) - m_hw_integration.reset(new HardwareIntegration(this)); - - loadClientBufferIntegration(); - loadServerBufferIntegration(); - - if (m_client_buffer_integration) - m_client_buffer_integration->initializeHardware(m_display); - if (m_server_buffer_integration) - m_server_buffer_integration->initializeHardware(m_qt_compositor); -#endif -} - -void Compositor::initializeExtensions() -{ - if (m_extensions & QWaylandCompositor::SurfaceExtension) - new SurfaceExtensionGlobal(this); - if (m_extensions & QWaylandCompositor::SubSurfaceExtension) - new SubSurfaceExtensionGlobal(waylandCompositor()); - if (m_extensions & QWaylandCompositor::TouchExtension) - new TouchExtensionGlobal(this); - if (m_extensions & QWaylandCompositor::QtKeyExtension) - new QtKeyExtensionGlobal(this); - if (m_extensions & QWaylandCompositor::TextInputExtension) { - new TextInputManager(this); - new QWaylandInputPanel(waylandCompositor()); - } - if (m_extensions & QWaylandCompositor::WindowManagerExtension) - new QWaylandWindowManagerExtension(waylandCompositor()); -} - -void Compositor::initializeDefaultInputDevice() -{ - m_default_wayland_input_device = m_qt_compositor->createInputDevice(); - registerInputDevice(m_default_wayland_input_device); -} - -QList Compositor::clients() const -{ - return m_clients; -} - -QWaylandCompositor::ExtensionFlags Compositor::extensions() const -{ - return m_extensions; -} - -QWaylandInputDevice *Compositor::defaultInputDevice() -{ - // The list gets prepended so that default is the last element - return m_inputDevices.last(); -} - -DataDeviceManager *Compositor::dataDeviceManager() const -{ - return m_data_device_manager; -} - -void Compositor::setRetainedSelectionEnabled(bool enabled) -{ - m_retainSelection = enabled; -} - -bool Compositor::retainedSelectionEnabled() const -{ - return m_retainSelection; -} - -void Compositor::feedRetainedSelectionData(QMimeData *data) -{ - if (m_retainSelection) - m_qt_compositor->retainedSelectionReceived(data); -} - -void Compositor::overrideSelection(const QMimeData *data) -{ - m_data_device_manager->overrideSelection(*data); -} - -bool Compositor::isDragging() const -{ - return false; -} - -void Compositor::sendDragMoveEvent(const QPoint &global, const QPoint &local, - QWaylandSurface *surface) -{ - Q_UNUSED(global); - Q_UNUSED(local); - Q_UNUSED(surface); -// Drag::instance()->dragMove(global, local, surface); -} - -void Compositor::sendDragEndEvent() -{ -// Drag::instance()->dragEnd(); -} - -void Compositor::loadClientBufferIntegration() -{ -#ifdef QT_COMPOSITOR_WAYLAND_GL - QStringList keys = ClientBufferIntegrationFactory::keys(); - QString targetKey; - QByteArray clientBufferIntegration = qgetenv("QT_WAYLAND_HARDWARE_INTEGRATION"); - if (clientBufferIntegration.isEmpty()) - clientBufferIntegration = qgetenv("QT_WAYLAND_CLIENT_BUFFER_INTEGRATION"); - if (keys.contains(QString::fromLocal8Bit(clientBufferIntegration.constData()))) { - targetKey = QString::fromLocal8Bit(clientBufferIntegration.constData()); - } else if (keys.contains(QString::fromLatin1("wayland-egl"))) { - targetKey = QString::fromLatin1("wayland-egl"); - } else if (!keys.isEmpty()) { - targetKey = keys.first(); - } - - if (!targetKey.isEmpty()) { - m_client_buffer_integration.reset(ClientBufferIntegrationFactory::create(targetKey, QStringList())); - if (m_client_buffer_integration) { - m_client_buffer_integration->setCompositor(m_qt_compositor); - if (m_hw_integration) - m_hw_integration->setClientBufferIntegration(targetKey); - } - } - //BUG: if there is no client buffer integration, bad things will happen when opengl is used -#endif -} - -void Compositor::loadServerBufferIntegration() -{ -#ifdef QT_COMPOSITOR_WAYLAND_GL - QStringList keys = ServerBufferIntegrationFactory::keys(); - QString targetKey; - QByteArray serverBufferIntegration = qgetenv("QT_WAYLAND_SERVER_BUFFER_INTEGRATION"); - if (keys.contains(QString::fromLocal8Bit(serverBufferIntegration.constData()))) { - targetKey = QString::fromLocal8Bit(serverBufferIntegration.constData()); - } - if (!targetKey.isEmpty()) { - m_server_buffer_integration.reset(ServerBufferIntegrationFactory::create(targetKey, QStringList())); - if (m_hw_integration) - m_hw_integration->setServerBufferIntegration(targetKey); - } -#endif -} - -void Compositor::registerInputDevice(QWaylandInputDevice *device) -{ - // The devices get prepended as the first input device that gets added - // is assumed to be the default and it will claim to accept all the input - // events if asked - m_inputDevices.prepend(device); -} - -void Compositor::removeInputDevice(QWaylandInputDevice *device) -{ - m_inputDevices.removeOne(device); -} - -QWaylandInputDevice *Compositor::inputDeviceFor(QInputEvent *inputEvent) -{ - QWaylandInputDevice *dev = NULL; - for (int i = 0; i < m_inputDevices.size(); i++) { - QWaylandInputDevice *candidate = m_inputDevices.at(i); - if (candidate->isOwner(inputEvent)) { - dev = candidate; - break; - } - } - return dev; -} - -} // namespace Wayland - -QT_END_NAMESPACE diff --git a/src/compositor/wayland_wrapper/qwlcompositor_p.h b/src/compositor/wayland_wrapper/qwlcompositor_p.h deleted file mode 100644 index 4881addae..000000000 --- a/src/compositor/wayland_wrapper/qwlcompositor_p.h +++ /dev/null @@ -1,218 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014-2015 Pier Luigi Fiorini -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the QtWaylandCompositor module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPLv3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef WL_COMPOSITOR_H -#define WL_COMPOSITOR_H - -#include -#include - -#include - -#include -#include - -#include - -#include - -QT_BEGIN_NAMESPACE - -class QWaylandClient; -class QWaylandClientPrivate; -class QInputEvent; - -class QWaylandCompositor; -class QWaylandInputDevice; -class WindowManagerServerIntegration; -class QMimeData; -class QPlatformScreenBuffer; -class QWaylandSurface; -class QWindowSystemEventHandler; - -namespace QtWayland { - -class Surface; -class SurfaceBuffer; -class InputDevice; -class DataDeviceManager; -class SurfaceExtensionGlobal; -class TouchExtensionGlobal; -class QtKeyExtensionGlobal; -class TextInputManager; -class InputPanel; -class HardwareIntegration; -class ClientBufferIntegration; -class ServerBufferIntegration; - -class Q_COMPOSITOR_EXPORT Compositor : public QObject, public QtWaylandServer::wl_compositor -{ - Q_OBJECT - -public: - Compositor(QWaylandCompositor *qt_compositor); - ~Compositor(); - - void init(); - - QWaylandInputDevice *defaultInputDevice(); - - void registerInputDevice(QWaylandInputDevice *device); - QList inputDevices() const { return m_inputDevices; } - QWaylandInputDevice *inputDeviceFor(QInputEvent *inputEvent); - void removeInputDevice(QWaylandInputDevice *device); - - void destroySurface(QWaylandSurface *surface); - - void destroyClient(QWaylandClient *client); - - uint currentTimeMsecs() const; - - QWaylandOutput *output(QWindow *window) const; - - QWaylandOutput *primaryOutput() const; - QWaylandOutputSpace *primaryOutputSpace() const; - void setPrimaryOutputSpace(QWaylandOutputSpace *outputSpace); - void addOutputSpace(QWaylandOutputSpace *outputSpace); - void removeOutputSpace(QWaylandOutputSpace *outputSpace); - - ClientBufferIntegration *clientBufferIntegration() const; - ServerBufferIntegration *serverBufferIntegration() const; - void initializeHardwareIntegration(); - void initializeExtensions(); - void initializeDefaultInputDevice(); - void initializeWindowManagerProtocol(); - - QWaylandCompositor *waylandCompositor() const { return m_qt_compositor; } - - struct wl_display *wl_display() const { return m_display->handle(); } - Display *display() const { return m_display; } - - QList clients() const; - - QWaylandCompositor::ExtensionFlags extensions() const; - - InputPanel *inputPanel() const; - - DataDeviceManager *dataDeviceManager() const; - - bool isDragging() const; - void sendDragMoveEvent(const QPoint &global, const QPoint &local, QWaylandSurface *surface); - void sendDragEndEvent(); - - void setRetainedSelectionEnabled(bool enabled); - bool retainedSelectionEnabled() const; - void overrideSelection(const QMimeData *data); - void feedRetainedSelectionData(QMimeData *data); - - void unregisterSurface(QWaylandSurface *surface); - - QWaylandPointer *callCreatePointerDevice(QWaylandInputDevice *inputDevice) - { return m_qt_compositor->createPointerDevice(inputDevice); } - QWaylandKeyboard *callCreateKeyboardDevice(QWaylandInputDevice *inputDevice) - { return m_qt_compositor->createKeyboardDevice(inputDevice); } - QWaylandTouch *callCreateTouchDevice(QWaylandInputDevice *inputDevice) - { return m_qt_compositor->createTouchDevice(inputDevice); } - -public Q_SLOTS: - void cleanupGraphicsResources(); - -protected: - void compositor_create_surface(Resource *resource, uint32_t id) Q_DECL_OVERRIDE; - void compositor_create_region(Resource *resource, uint32_t id) Q_DECL_OVERRIDE; - -private Q_SLOTS: - void processWaylandEvents(); - -protected: - void loadClientBufferIntegration(); - void loadServerBufferIntegration(); - - QWaylandCompositor::ExtensionFlags m_extensions; - - Display *m_display; - QByteArray m_socket_name; - - /* Input */ - QWaylandInputDevice *m_default_wayland_input_device; - - QList m_inputDevices; - - /* Output */ - QList m_outputSpaces; - - QList m_all_surfaces; - - DataDeviceManager *m_data_device_manager; - - QElapsedTimer m_timer; - QSet m_destroyed_surfaces; - - /* Render state */ - uint32_t m_current_frame; - int m_last_queued_buf; - - wl_event_loop *m_loop; - - QWaylandCompositor *m_qt_compositor; - Qt::ScreenOrientation m_orientation; - QList m_clients; - -#ifdef QT_COMPOSITOR_WAYLAND_GL - QScopedPointer m_hw_integration; - QScopedPointer m_client_buffer_integration; - QScopedPointer m_server_buffer_integration; -#endif - - QScopedPointer m_eventHandler; - - static void bind_func(struct wl_client *client, void *data, - uint32_t version, uint32_t id); - - bool m_retainSelection; - bool m_initialized; - - friend class QT_PREPEND_NAMESPACE(QWaylandCompositor); - friend class QT_PREPEND_NAMESPACE(QWaylandClient); - friend class QT_PREPEND_NAMESPACE(QWaylandClientPrivate); -}; - -} - -QT_END_NAMESPACE - -#endif //WL_COMPOSITOR_H diff --git a/src/compositor/wayland_wrapper/qwldatadevice.cpp b/src/compositor/wayland_wrapper/qwldatadevice.cpp index 8dd33d3b0..a7cb3bd9c 100644 --- a/src/compositor/wayland_wrapper/qwldatadevice.cpp +++ b/src/compositor/wayland_wrapper/qwldatadevice.cpp @@ -36,7 +36,6 @@ #include "qwldatadevice_p.h" -#include "qwlcompositor_p.h" #include "qwldatasource_p.h" #include "qwldataoffer_p.h" #include "qwlinputdevice_p.h" @@ -49,6 +48,7 @@ #include "qwaylanddrag.h" #include "qwaylandview.h" #include +#include #include #include @@ -105,7 +105,7 @@ void DataDevice::setDragFocus(QWaylandView *focus, const QPointF &localPosition) if (!resource) return; - uint32_t serial = wl_display_next_serial(m_compositor->waylandDisplay()); + uint32_t serial = m_compositor->nextSerial(); DataOffer *offer = m_dragDataSource ? new DataOffer(m_dragDataSource, resource) : 0; @@ -208,7 +208,7 @@ void DataDevice::data_device_set_selection(Resource *, struct ::wl_resource *sou m_selectionSource->cancel(); m_selectionSource = dataSource; - m_compositor->handle()->dataDeviceManager()->setCurrentSelectionSource(m_selectionSource); + QWaylandCompositorPrivate::get(m_compositor)->dataDeviceManager()->setCurrentSelectionSource(m_selectionSource); if (m_selectionSource) m_selectionSource->setDevice(this); diff --git a/src/compositor/wayland_wrapper/qwldatadevicemanager.cpp b/src/compositor/wayland_wrapper/qwldatadevicemanager.cpp index affc17d72..23e85813a 100644 --- a/src/compositor/wayland_wrapper/qwldatadevicemanager.cpp +++ b/src/compositor/wayland_wrapper/qwldatadevicemanager.cpp @@ -36,15 +36,15 @@ #include "qwldatadevicemanager_p.h" +#include + +#include #include "qwldatadevice_p.h" #include "qwldatasource_p.h" #include "qwlinputdevice_p.h" -#include "qwlcompositor_p.h" #include "qwldataoffer_p.h" #include "qwaylandmimehelper.h" -#include - #include #include #include @@ -55,9 +55,9 @@ QT_BEGIN_NAMESPACE namespace QtWayland { -DataDeviceManager::DataDeviceManager(Compositor *compositor) +DataDeviceManager::DataDeviceManager(QWaylandCompositor *compositor) : QObject(0) - , wl_data_device_manager(compositor->wl_display(), 1) + , wl_data_device_manager(compositor->display(), 1) , m_compositor(compositor) , m_current_selection_source(0) , m_retainedReadNotifier(0) @@ -105,7 +105,7 @@ void DataDeviceManager::retain() QList offers = m_current_selection_source->mimeTypes(); finishReadFromClient(); if (m_retainedReadIndex >= offers.count()) { - m_compositor->feedRetainedSelectionData(&m_retainedData); + QWaylandCompositorPrivate::get(m_compositor)->feedRetainedSelectionData(&m_retainedData); return; } QString mimeType = offers.at(m_retainedReadIndex); @@ -182,7 +182,7 @@ DataSource *DataDeviceManager::currentSelectionSource() struct wl_display *DataDeviceManager::display() const { - return m_compositor->wl_display(); + return m_compositor->display(); } void DataDeviceManager::overrideSelection(const QMimeData &mimeData) @@ -195,7 +195,7 @@ void DataDeviceManager::overrideSelection(const QMimeData &mimeData) foreach (const QString &format, formats) m_retainedData.setData(format, mimeData.data(format)); - m_compositor->feedRetainedSelectionData(&m_retainedData); + QWaylandCompositorPrivate::get(m_compositor)->feedRetainedSelectionData(&m_retainedData); m_compositorOwnsSelection = true; diff --git a/src/compositor/wayland_wrapper/qwldatadevicemanager_p.h b/src/compositor/wayland_wrapper/qwldatadevicemanager_p.h index 5fbd45f6f..3bc50f64e 100644 --- a/src/compositor/wayland_wrapper/qwldatadevicemanager_p.h +++ b/src/compositor/wayland_wrapper/qwldatadevicemanager_p.h @@ -37,13 +37,13 @@ #ifndef WLDATADEVICEMANAGER_H #define WLDATADEVICEMANAGER_H -#include - #include #include #include #include +#include + #include QT_BEGIN_NAMESPACE @@ -52,8 +52,6 @@ class QSocketNotifier; namespace QtWayland { -class Compositor; - class DataDevice; class DataSource; @@ -62,7 +60,7 @@ class DataDeviceManager : public QObject, public QtWaylandServer::wl_data_device Q_OBJECT public: - DataDeviceManager(Compositor *compositor); + DataDeviceManager(QWaylandCompositor *compositor); void setCurrentSelectionSource(DataSource *source); DataSource *currentSelectionSource(); @@ -86,7 +84,7 @@ private: void retain(); void finishReadFromClient(bool exhausted = false); - Compositor *m_compositor; + QWaylandCompositor *m_compositor; QList m_data_device_list; DataSource *m_current_selection_source; diff --git a/src/compositor/wayland_wrapper/qwldatasource.cpp b/src/compositor/wayland_wrapper/qwldatasource.cpp index 552fda3a5..641b63b0d 100644 --- a/src/compositor/wayland_wrapper/qwldatasource.cpp +++ b/src/compositor/wayland_wrapper/qwldatasource.cpp @@ -38,7 +38,6 @@ #include "qwldataoffer_p.h" #include "qwldatadevice_p.h" #include "qwldatadevicemanager_p.h" -#include "qwlcompositor_p.h" #include #include diff --git a/src/compositor/wayland_wrapper/qwldisplay.cpp b/src/compositor/wayland_wrapper/qwldisplay.cpp deleted file mode 100644 index 47279cca0..000000000 --- a/src/compositor/wayland_wrapper/qwldisplay.cpp +++ /dev/null @@ -1,61 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the QtWaylandCompositor module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPLv3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qwldisplay_p.h" - -#include - -#include - -QT_BEGIN_NAMESPACE - -namespace QtWayland { - -Display::Display() -{ - m_display = wl_display_create(); - - Q_ASSERT(m_display); -} - -Display::~Display() -{ - wl_display_destroy(m_display); -} - -} - -QT_END_NAMESPACE diff --git a/src/compositor/wayland_wrapper/qwldisplay_p.h b/src/compositor/wayland_wrapper/qwldisplay_p.h deleted file mode 100644 index 9409316ea..000000000 --- a/src/compositor/wayland_wrapper/qwldisplay_p.h +++ /dev/null @@ -1,64 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the QtWaylandCompositor module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPLv3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef WL_DISPLAY_H -#define WL_DISPLAY_H - -#include -#include - -QT_BEGIN_NAMESPACE - -namespace QtWayland { - -class Display -{ -public: - Display(); - ~Display(); - - struct wl_display *handle() const { return m_display; } - struct wl_display *handle() { return m_display; } - -private: - struct wl_display *m_display; -}; - -} - -QT_END_NAMESPACE - -#endif //WL_DISPLAY_H diff --git a/src/compositor/wayland_wrapper/qwlinputdevice.cpp b/src/compositor/wayland_wrapper/qwlinputdevice.cpp index 2849a2373..12c38bf83 100644 --- a/src/compositor/wayland_wrapper/qwlinputdevice.cpp +++ b/src/compositor/wayland_wrapper/qwlinputdevice.cpp @@ -36,12 +36,12 @@ #include "qwlinputdevice_p.h" -#include "qwlcompositor_p.h" +#include +#include #include "qwldatadevice_p.h" #include "qwlinputmethod_p.h" #include "qwlqttouch_p.h" #include "qwlqtkey_p.h" -#include "qwaylandcompositor.h" #include "qwaylanddrag.h" #include "qwlpointer_p.h" #include "qwlkeyboard_p.h" @@ -55,7 +55,7 @@ QT_BEGIN_NAMESPACE QWaylandInputDevicePrivate::QWaylandInputDevicePrivate(QWaylandInputDevice *inputdevice, QWaylandCompositor *compositor) : QObjectPrivate() - , QtWaylandServer::wl_seat(compositor->waylandDisplay(), 3) + , QtWaylandServer::wl_seat(compositor->display(), 3) , m_dragHandle(new QWaylandDrag(inputdevice)) , m_compositor(compositor) , m_outputSpace(compositor->primaryOutputSpace()) @@ -109,15 +109,15 @@ void QWaylandInputDevicePrivate::setCapabilities(QWaylandInputDevice::Capability QWaylandInputDevice::CapabilityFlags changed = caps ^ m_capabilities; if (changed & QWaylandInputDevice::Pointer) { - m_pointer.reset(m_pointer.isNull() ? compositor()->handle()->callCreatePointerDevice(q) : 0); + m_pointer.reset(m_pointer.isNull() ? QWaylandCompositorPrivate::get(compositor())->callCreatePointerDevice(q) : 0); } if (changed & QWaylandInputDevice::Keyboard) { - m_keyboard.reset(m_keyboard.isNull() ? compositor()->handle()->callCreateKeyboardDevice(q) : 0); + m_keyboard.reset(m_keyboard.isNull() ? QWaylandCompositorPrivate::get(compositor())->callCreateKeyboardDevice(q) : 0); } if (changed & QWaylandInputDevice::Touch) { - m_touch.reset(m_touch.isNull() ? compositor()->handle()->callCreateTouchDevice(q) : 0); + m_touch.reset(m_touch.isNull() ? QWaylandCompositorPrivate::get(compositor())->callCreateTouchDevice(q) : 0); } m_capabilities = caps; diff --git a/src/compositor/wayland_wrapper/qwlinputmethod.cpp b/src/compositor/wayland_wrapper/qwlinputmethod.cpp index 59f01c666..59b23cdd3 100644 --- a/src/compositor/wayland_wrapper/qwlinputmethod.cpp +++ b/src/compositor/wayland_wrapper/qwlinputmethod.cpp @@ -36,7 +36,7 @@ #include "qwlinputmethod_p.h" -#include "qwlcompositor_p.h" +#include #include "qwlinputdevice_p.h" #include "qwlinputmethodcontext_p.h" #include "qwlinputpanel_p.h" @@ -48,7 +48,7 @@ QT_BEGIN_NAMESPACE namespace QtWayland { InputMethod::InputMethod(QWaylandCompositor *compositor, QWaylandInputDevice *seat) - : QtWaylandServer::wl_input_method(seat->compositor()->waylandDisplay(), 1) + : QtWaylandServer::wl_input_method(compositor->display(), 1) , m_compositor(compositor) , m_seat(seat) , m_resource(0) diff --git a/src/compositor/wayland_wrapper/qwlkeyboard.cpp b/src/compositor/wayland_wrapper/qwlkeyboard.cpp index c22b0cb26..4977ce014 100644 --- a/src/compositor/wayland_wrapper/qwlkeyboard.cpp +++ b/src/compositor/wayland_wrapper/qwlkeyboard.cpp @@ -37,12 +37,12 @@ #include "qwlkeyboard_p.h" #include "qwlshellsurface_p.h" + #include #include #include - -#include "qwlcompositor_p.h" +#include #include #include @@ -115,7 +115,7 @@ void QWaylandKeyboardPrivate::focused(QWaylandSurface *surface) if (surface && surface->isCursorSurface()) surface = Q_NULLPTR; if (m_focusResource && m_focus != surface) { - uint32_t serial = wl_display_next_serial(compositor()->waylandDisplay()); + uint32_t serial = compositor()->nextSerial(); send_leave(m_focusResource->handle, serial, m_focus->resource()); m_focusDestroyListener.reset(); } @@ -123,7 +123,7 @@ void QWaylandKeyboardPrivate::focused(QWaylandSurface *surface) Resource *resource = surface ? resourceMap().value(surface->waylandClient()) : 0; if (resource && (m_focus != surface || m_focusResource != resource)) { - uint32_t serial = wl_display_next_serial(compositor()->waylandDisplay()); + uint32_t serial = compositor()->nextSerial(); send_modifiers(resource->handle, serial, m_modsDepressed, m_modsLatched, m_modsLocked, m_group); send_enter(resource->handle, serial, surface->resource(), QByteArray::fromRawData((char *)m_keys.data(), m_keys.size() * sizeof(uint32_t))); m_focusDestroyListener.listenForDestruction(surface->resource()); @@ -227,7 +227,7 @@ void QWaylandKeyboardPrivate::keyEvent(uint code, uint32_t state) void QWaylandKeyboardPrivate::sendKeyEvent(uint code, uint32_t state) { uint32_t time = compositor()->currentTimeMsecs(); - uint32_t serial = wl_display_next_serial(compositor()->waylandDisplay()); + uint32_t serial = compositor()->nextSerial(); uint key = code - 8; m_grab->key(serial, time, key, state); } @@ -264,7 +264,7 @@ void QWaylandKeyboardPrivate::updateModifierState(uint code, uint32_t state) m_modsLocked = modsLocked; m_group = group; - m_grab->modifiers(wl_display_next_serial(compositor()->waylandDisplay()), m_modsDepressed, m_modsLatched, m_modsLocked, m_group); + m_grab->modifiers(compositor()->nextSerial(), m_modsDepressed, m_modsLatched, m_modsLocked, m_group); #else Q_UNUSED(code); Q_UNUSED(state); @@ -290,7 +290,7 @@ void QWaylandKeyboardPrivate::updateKeymap() xkb_state_update_mask(m_state, 0, m_modsLatched, m_modsLocked, 0, 0, 0); if (m_focusResource) - sendKeyModifiers(m_focusResource, wl_display_next_serial(compositor()->waylandDisplay())); + sendKeyModifiers(m_focusResource, compositor()->nextSerial()); #endif } diff --git a/src/compositor/wayland_wrapper/qwloutput.cpp b/src/compositor/wayland_wrapper/qwloutput.cpp index 82278f301..d11d91ea4 100644 --- a/src/compositor/wayland_wrapper/qwloutput.cpp +++ b/src/compositor/wayland_wrapper/qwloutput.cpp @@ -36,10 +36,10 @@ ****************************************************************************/ #include "qwloutput_p.h" -#include "qwlcompositor_p.h" #include #include +#include #include #include @@ -101,7 +101,7 @@ static QtWaylandServer::wl_output::transform toWlTransform(const QWaylandOutput: } Output::Output(QWaylandOutput *output, QWaylandOutputSpace *outputSpace, QWindow *window) - : QtWaylandServer::wl_output(outputSpace->compositor()->waylandDisplay(), 2) + : QtWaylandServer::wl_output(outputSpace->compositor()->display(), 2) , m_window(window) , m_output(output) , m_outputSpace(Q_NULLPTR) @@ -349,7 +349,7 @@ void Output::sendFrameCallbacks() QWaylandSurfacePrivate::get(surfacemapper.surface)->sendFrameCallback(); } } - wl_display_flush_clients(compositor()->waylandDisplay()); + wl_display_flush_clients(compositor()->display()); } void Output::surfaceEnter(QWaylandSurface *surface) diff --git a/src/compositor/wayland_wrapper/qwlpointer.cpp b/src/compositor/wayland_wrapper/qwlpointer.cpp index 9e66f4636..28a72b76e 100644 --- a/src/compositor/wayland_wrapper/qwlpointer.cpp +++ b/src/compositor/wayland_wrapper/qwlpointer.cpp @@ -37,7 +37,6 @@ #include "qwlpointer_p.h" -#include "qwlcompositor_p.h" #include "qwlinputdevice_p.h" #include "qwlkeyboard_p.h" #include "qwaylandcompositor.h" @@ -125,7 +124,7 @@ void QWaylandPointerPrivate::sendMousePressEvent(Qt::MouseButton button) m_grab->button(time, button, WL_POINTER_BUTTON_STATE_PRESSED); if (m_buttonCount == 1) { - m_grabSerial = wl_display_get_serial(compositor()->waylandDisplay()); + m_grabSerial = compositor()->nextSerial(); q->buttonPressedChanged(); } } @@ -138,7 +137,7 @@ void QWaylandPointerPrivate::sendMouseReleaseEvent(Qt::MouseButton button) m_grab->button(time, button, WL_POINTER_BUTTON_STATE_RELEASED); if (m_buttonCount == 1) - m_grabSerial = wl_display_get_serial(compositor()->waylandDisplay()); + m_grabSerial = compositor()->nextSerial(); if (m_buttonCount == 0) q->buttonPressedChanged(); } diff --git a/src/compositor/wayland_wrapper/qwlregion.cpp b/src/compositor/wayland_wrapper/qwlregion.cpp index 14a749afb..9f55980e8 100644 --- a/src/compositor/wayland_wrapper/qwlregion.cpp +++ b/src/compositor/wayland_wrapper/qwlregion.cpp @@ -36,8 +36,6 @@ #include "qwlregion_p.h" -#include "qwlcompositor_p.h" - QT_BEGIN_NAMESPACE namespace QtWayland { diff --git a/src/compositor/wayland_wrapper/qwlsurfacebuffer.cpp b/src/compositor/wayland_wrapper/qwlsurfacebuffer.cpp index 9c7671855..d65cbc567 100644 --- a/src/compositor/wayland_wrapper/qwlsurfacebuffer.cpp +++ b/src/compositor/wayland_wrapper/qwlsurfacebuffer.cpp @@ -36,8 +36,6 @@ #include "qwlsurfacebuffer_p.h" -#include "qwlcompositor_p.h" - #ifdef QT_COMPOSITOR_WAYLAND_GL #include "hardware_integration/qwlclientbufferintegration_p.h" #include @@ -48,6 +46,8 @@ #include #include "qwaylandshmformathelper.h" +#include + QT_BEGIN_NAMESPACE namespace QtWayland { @@ -160,7 +160,7 @@ QSize SurfaceBuffer::size() const int height = wl_shm_buffer_get_height(shmBuffer); return QSize(width, height); } - if (ClientBufferIntegration *integration = m_compositor->handle()->clientBufferIntegration()) { + if (ClientBufferIntegration *integration = QWaylandCompositorPrivate::get(m_compositor)->clientBufferIntegration()) { return integration->bufferSize(m_buffer); } @@ -173,7 +173,7 @@ QWaylandSurface::Origin SurfaceBuffer::origin() const return QWaylandSurface::OriginTopLeft; } - if (ClientBufferIntegration *integration = m_compositor->handle()->clientBufferIntegration()) { + if (ClientBufferIntegration *integration = QWaylandCompositorPrivate::get(m_compositor)->clientBufferIntegration()) { return integration->origin(m_buffer); } return QWaylandSurface::OriginTopLeft; @@ -209,7 +209,7 @@ void SurfaceBuffer::bindToTexture() const glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, image.width(), image.height(), 0, GL_RGB, GL_UNSIGNED_BYTE, image.constBits()); } } else { - if (QtWayland::ClientBufferIntegration *clientInt = m_compositor->handle()->clientBufferIntegration()) { + if (QtWayland::ClientBufferIntegration *clientInt = QWaylandCompositorPrivate::get(m_compositor)->clientBufferIntegration()) { clientInt->bindTextureToBuffer(m_buffer); } } diff --git a/src/compositor/wayland_wrapper/qwltouch.cpp b/src/compositor/wayland_wrapper/qwltouch.cpp index 85675a624..226f68b6a 100644 --- a/src/compositor/wayland_wrapper/qwltouch.cpp +++ b/src/compositor/wayland_wrapper/qwltouch.cpp @@ -37,7 +37,7 @@ #include "qwltouch_p.h" -#include "qwlcompositor_p.h" +#include #include "qwaylandview.h" #include "qwlqttouch_p.h" diff --git a/src/compositor/wayland_wrapper/wayland_wrapper.pri b/src/compositor/wayland_wrapper/wayland_wrapper.pri index cf7194fe6..b32bf4cbb 100644 --- a/src/compositor/wayland_wrapper/wayland_wrapper.pri +++ b/src/compositor/wayland_wrapper/wayland_wrapper.pri @@ -5,12 +5,10 @@ WAYLANDSERVERSOURCES += \ ../3rdparty/protocol/text.xml HEADERS += \ - wayland_wrapper/qwlcompositor_p.h \ wayland_wrapper/qwldatadevice_p.h \ wayland_wrapper/qwldatadevicemanager_p.h \ wayland_wrapper/qwldataoffer_p.h \ wayland_wrapper/qwldatasource_p.h \ - wayland_wrapper/qwldisplay_p.h \ wayland_wrapper/qwlinputdevice_p.h \ wayland_wrapper/qwlinputmethod_p.h \ wayland_wrapper/qwlinputmethodcontext_p.h \ @@ -23,12 +21,10 @@ HEADERS += \ ../shared/qwaylandxkb.h \ SOURCES += \ - wayland_wrapper/qwlcompositor.cpp \ wayland_wrapper/qwldatadevice.cpp \ wayland_wrapper/qwldatadevicemanager.cpp \ wayland_wrapper/qwldataoffer.cpp \ wayland_wrapper/qwldatasource.cpp \ - wayland_wrapper/qwldisplay.cpp \ wayland_wrapper/qwlinputdevice.cpp \ wayland_wrapper/qwlinputmethod.cpp \ wayland_wrapper/qwlinputmethodcontext.cpp \ -- cgit v1.2.3 From bd6a5c4669801d7c86ffe2f8664dcfe0b4b7a906 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Fri, 14 Aug 2015 11:47:08 +0200 Subject: Remove the QtWayland::Output class and add QWaylandOutputPrivate. Also make sure no other class holds a pointer to the QWaylandOutputPrivate but only to QWaylandOutput Change-Id: I6c5914d5bf9b394c6fbd7e181e603076fbdc79d7 --- src/compositor/wayland_wrapper/qwloutput.cpp | 420 --------------------- src/compositor/wayland_wrapper/qwloutput_p.h | 183 --------- src/compositor/wayland_wrapper/wayland_wrapper.pri | 2 - 3 files changed, 605 deletions(-) delete mode 100644 src/compositor/wayland_wrapper/qwloutput.cpp delete mode 100644 src/compositor/wayland_wrapper/qwloutput_p.h (limited to 'src/compositor/wayland_wrapper') diff --git a/src/compositor/wayland_wrapper/qwloutput.cpp b/src/compositor/wayland_wrapper/qwloutput.cpp deleted file mode 100644 index d11d91ea4..000000000 --- a/src/compositor/wayland_wrapper/qwloutput.cpp +++ /dev/null @@ -1,420 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 Pier Luigi Fiorini -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the QtWaylandCompositor module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPLv3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qwloutput_p.h" - -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include - -QT_BEGIN_NAMESPACE - -namespace QtWayland { - -static QtWaylandServer::wl_output::subpixel toWlSubpixel(const QWaylandOutput::Subpixel &value) -{ - switch (value) { - case QWaylandOutput::SubpixelUnknown: - return QtWaylandServer::wl_output::subpixel_unknown; - case QWaylandOutput::SubpixelNone: - return QtWaylandServer::wl_output::subpixel_none; - case QWaylandOutput::SubpixelHorizontalRgb: - return QtWaylandServer::wl_output::subpixel_horizontal_rgb; - case QWaylandOutput::SubpixelHorizontalBgr: - return QtWaylandServer::wl_output::subpixel_horizontal_bgr; - case QWaylandOutput::SubpixelVerticalRgb: - return QtWaylandServer::wl_output::subpixel_vertical_rgb; - case QWaylandOutput::SubpixelVerticalBgr: - return QtWaylandServer::wl_output::subpixel_vertical_bgr; - default: - break; - } - - return QtWaylandServer::wl_output::subpixel_unknown; -} - -static QtWaylandServer::wl_output::transform toWlTransform(const QWaylandOutput::Transform &value) -{ - switch (value) { - case QWaylandOutput::Transform90: - return QtWaylandServer::wl_output::transform_90; - case QWaylandOutput::Transform180: - return QtWaylandServer::wl_output::transform_180; - case QWaylandOutput::Transform270: - return QtWaylandServer::wl_output::transform_270; - case QWaylandOutput::TransformFlipped: - return QtWaylandServer::wl_output::transform_flipped; - case QWaylandOutput::TransformFlipped90: - return QtWaylandServer::wl_output::transform_flipped_90; - case QWaylandOutput::TransformFlipped180: - return QtWaylandServer::wl_output::transform_flipped_180; - case QWaylandOutput::TransformFlipped270: - return QtWaylandServer::wl_output::transform_flipped_270; - default: - break; - } - - return QtWaylandServer::wl_output::transform_normal; -} - -Output::Output(QWaylandOutput *output, QWaylandOutputSpace *outputSpace, QWindow *window) - : QtWaylandServer::wl_output(outputSpace->compositor()->display(), 2) - , m_window(window) - , m_output(output) - , m_outputSpace(Q_NULLPTR) - , m_position(QPoint()) - , m_availableGeometry(QRect()) - , m_physicalSize(QSize()) - , m_subpixel(QWaylandOutput::SubpixelUnknown) - , m_transform(QWaylandOutput::TransformNormal) - , m_scaleFactor(1) - , m_sizeFollowsWindow(true) -{ - m_mode.size = window ? window->size() : QSize(); - m_mode.refreshRate = 60; - setOutputSpace(outputSpace, false); - - qRegisterMetaType("WaylandOutput::Mode"); -} - -void Output::output_bind_resource(Resource *resource) -{ - send_geometry(resource->handle, - m_position.x(), m_position.y(), - m_physicalSize.width(), m_physicalSize.height(), - toWlSubpixel(m_subpixel), m_manufacturer, m_model, - toWlTransform(m_transform)); - - send_mode(resource->handle, mode_current | mode_preferred, - m_mode.size.width(), m_mode.size.height(), - m_mode.refreshRate); - - if (resource->version() >= 2) { - send_scale(resource->handle, m_scaleFactor); - send_done(resource->handle); - } -} - -void Output::setManufacturer(const QString &manufacturer) -{ - m_manufacturer = manufacturer; -} - -void Output::setModel(const QString &model) -{ - m_model = model; -} - -void Output::setPosition(const QPoint &position) -{ - if (m_position == position) - return; - - m_position = position; - - sendGeometryInfo(); -} - -void Output::setMode(const QWaylandOutput::Mode &mode) -{ - if (m_mode.size == mode.size && m_mode.refreshRate == mode.refreshRate) - return; - - m_mode = mode; - - Q_FOREACH (Resource *resource, resourceMap().values()) { - send_mode(resource->handle, mode_current, - m_mode.size.width(), m_mode.size.height(), - m_mode.refreshRate * 1000); - if (resource->version() >= 2) - send_done(resource->handle); - } -} - -QRect Output::geometry() const -{ - return QRect(m_position, m_mode.size); -} - -bool Output::sizeFollowsWindow() const -{ - return m_sizeFollowsWindow; -} - -void Output::setSizeFollowsWindow(bool follow) -{ - if (follow != m_sizeFollowsWindow) { - if (follow) { - QObject::connect(m_window, &QWindow::widthChanged, m_output, &QWaylandOutput::setWidth); - QObject::connect(m_window, &QWindow::heightChanged, m_output, &QWaylandOutput::setHeight); - } else { - QObject::disconnect(m_window, &QWindow::widthChanged, m_output, &QWaylandOutput::setWidth); - QObject::disconnect(m_window, &QWindow::heightChanged, m_output, &QWaylandOutput::setHeight); - } - m_sizeFollowsWindow = follow; - m_output->sizeFollowsWindowChanged(); - } -} - -void Output::setGeometry(const QRect &geometry) -{ - if (m_position == geometry.topLeft() && m_mode.size == geometry.size()) - return; - - m_position = geometry.topLeft(); - m_mode.size = geometry.size(); - - Q_FOREACH (Resource *resource, resourceMap().values()) { - send_geometry(resource->handle, - m_position.x(), m_position.y(), - m_physicalSize.width(), m_physicalSize.height(), - toWlSubpixel(m_subpixel), m_manufacturer, m_model, - toWlTransform(m_transform)); - send_mode(resource->handle, mode_current, - m_mode.size.width(), m_mode.size.height(), - m_mode.refreshRate * 1000); - if (resource->version() >= 2) - send_done(resource->handle); - } -} - -void Output::setWidth(int newWidth) -{ - if (m_mode.size.width() == newWidth) - return; - - QSize s = m_mode.size; - s.setWidth(newWidth); - setGeometry(QRect(m_position, s)); -} - -void Output::setHeight(int newHeight) -{ - if (m_mode.size.height() == newHeight) - return; - - QSize s = m_mode.size; - s.setHeight(newHeight); - setGeometry(QRect(m_position, s)); -} - -void Output::setAvailableGeometry(const QRect &availableGeometry) -{ - m_availableGeometry = availableGeometry; -} - -void Output::setPhysicalSize(const QSize &physicalSize) -{ - if (m_physicalSize == physicalSize) - return; - - m_physicalSize = physicalSize; - - sendGeometryInfo(); -} - -void Output::setSubpixel(const QWaylandOutput::Subpixel &subpixel) -{ - if (m_subpixel == subpixel) - return; - - m_subpixel = subpixel; - - sendGeometryInfo(); -} - -void Output::setTransform(const QWaylandOutput::Transform &transform) -{ - if (m_transform == transform) - return; - - m_transform = transform; - - sendGeometryInfo(); -} - -void Output::setScaleFactor(int scale) -{ - if (m_scaleFactor == scale) - return; - - m_scaleFactor = scale; - - Q_FOREACH (Resource *resource, resourceMap().values()) { - if (resource->version() >= 2) { - send_scale(resource->handle, m_scaleFactor); - send_done(resource->handle); - } - } -} - -void Output::setOutputSpace(QWaylandOutputSpace *outputSpace, bool setOutputSpace) -{ - if (m_outputSpace == outputSpace) - return; - - if (m_outputSpace) { - m_outputSpace->removeOutput(waylandOutput()); - } - - m_outputSpace = outputSpace; - - if (outputSpace && setOutputSpace) { - outputSpace->addOutput(waylandOutput()); - } - - waylandOutput()->outputSpaceChanged(); -} - -OutputResource *Output::outputForClient(wl_client *client) const -{ - return static_cast(resourceMap().value(client)); -} - -void Output::sendGeometryInfo() -{ - Q_FOREACH (Resource *resource, resourceMap().values()) { - send_geometry(resource->handle, - m_position.x(), m_position.x(), - m_physicalSize.width(), m_physicalSize.height(), - toWlSubpixel(m_subpixel), m_manufacturer, m_model, - toWlTransform(m_transform)); - if (resource->version() >= 2) - send_done(resource->handle); - } -} - - -void Output::frameStarted() -{ - for (int i = 0; i < m_surfaceViews.size(); i++) { - SurfaceViewMapper &surfacemapper = m_surfaceViews[i]; - if (surfacemapper.maybeThrottelingView()) - QWaylandSurfacePrivate::get(surfacemapper.surface)->frameStarted(); - } -} - -void Output::sendFrameCallbacks() -{ - for (int i = 0; i < m_surfaceViews.size(); i++) { - const SurfaceViewMapper &surfacemapper = m_surfaceViews.at(i); - if (surfacemapper.surface && surfacemapper.surface->isMapped()) { - if (!surfacemapper.has_entered) { - surfaceEnter(surfacemapper.surface); - } - if (surfacemapper.maybeThrottelingView()) - QWaylandSurfacePrivate::get(surfacemapper.surface)->sendFrameCallback(); - } - } - wl_display_flush_clients(compositor()->display()); -} - -void Output::surfaceEnter(QWaylandSurface *surface) -{ - if (!surface) - return; - QWaylandSurfacePrivate::get(surface)->send_enter(outputForClient(surface->client())->handle); -} - -void Output::surfaceLeave(QWaylandSurface *surface) -{ - if (!surface) - return; - QWaylandSurfacePrivate::get(surface)->send_leave(outputForClient(surface->client())->handle); -} - -void Output::addView(QWaylandView *view) -{ - addView(view, view->surface()); -} - -void Output::addView(QWaylandView *view, QWaylandSurface *surface) -{ - for (int i = 0; i < m_surfaceViews.size(); i++) { - if (surface == m_surfaceViews.at(i).surface) { - if (!m_surfaceViews.at(i).views.contains(view)) { - m_surfaceViews[i].views.append(view); - } - return; - } - } - - SurfaceViewMapper surfaceViewMapper; - surfaceViewMapper.surface = surface; - surfaceViewMapper.views.append(view); - m_surfaceViews.append(surfaceViewMapper); -} - -void Output::removeView(QWaylandView *view) -{ - removeView(view, view->surface()); -} - -void Output::removeView(QWaylandView *view, QWaylandSurface *surface) -{ - for (int i = 0; i < m_surfaceViews.size(); i++) { - if (surface == m_surfaceViews.at(i).surface) { - bool removed = m_surfaceViews[i].views.removeOne(view); - if (m_surfaceViews.at(i).views.isEmpty() && removed) { - if (m_surfaceViews.at(i).has_entered) - surfaceLeave(surface); - m_surfaceViews.remove(i); - } - return; - } - } - qWarning("%s Could not find view %p for surface %p to remove. Possible invalid state", Q_FUNC_INFO, view, surface); -} - -void Output::updateSurfaceForView(QWaylandView *view, QWaylandSurface *newSurface, QWaylandSurface *oldSurface) -{ - removeView(view, oldSurface); - addView(view, newSurface); -} - -} // namespace Wayland - -QT_END_NAMESPACE diff --git a/src/compositor/wayland_wrapper/qwloutput_p.h b/src/compositor/wayland_wrapper/qwloutput_p.h deleted file mode 100644 index 5ec9b1cbc..000000000 --- a/src/compositor/wayland_wrapper/qwloutput_p.h +++ /dev/null @@ -1,183 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 Pier Luigi Fiorini -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the QtWaylandCompositor module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPLv3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef WL_OUTPUT_H -#define WL_OUTPUT_H - -#include - -#include -#include -#include -#include - -#include -#include - -#include -#include - -QT_BEGIN_NAMESPACE - -class QWindow; - -namespace QtWayland { - -class Compositor; - -struct SurfaceViewMapper -{ - SurfaceViewMapper() - : surface(0) - , views() - , has_entered(false) - {} - - QWaylandView *maybeThrottelingView() const - { - for (int i = 0; i < views.size(); i++) { - if (surface && surface->throttlingView() == views.at(i)) - return views.at(i); - } - return Q_NULLPTR; - } - - QWaylandSurface *surface; - QVector views; - bool has_entered; -}; - -//Just for naming convenience -class OutputResource : public QtWaylandServer::wl_output::Resource -{ -}; - -class Output : public QtWaylandServer::wl_output -{ -public: - Output(QWaylandOutput *output, QWaylandOutputSpace *outputSpace, QWindow *window); - - QWaylandCompositor *compositor() const { return m_outputSpace->compositor(); } - - QWaylandOutput *waylandOutput() const { return m_output; } - - QString manufacturer() const { return m_manufacturer; } - void setManufacturer(const QString &manufacturer); - - QString model() const { return m_model; } - void setModel(const QString &model); - - QPoint position() const { return m_position; } - void setPosition(const QPoint &position); - - QRect geometry() const; - void setGeometry(const QRect &geometry); - void setWidth(int newWidth); - void setHeight(int newHeight); - QPoint topLeft() const { return geometry().topLeft(); } - - bool sizeFollowsWindow() const; - void setSizeFollowsWindow(bool follow); - - QWaylandOutput::Mode mode() const { return m_mode; } - void setMode(const QWaylandOutput::Mode &mode); - - QRect availableGeometry() const { return m_availableGeometry; } - void setAvailableGeometry(const QRect &availableGeometry); - - QSize physicalSize() const { return m_physicalSize; } - void setPhysicalSize(const QSize &physicalSize); - - QWaylandOutput::Subpixel subpixel() const { return m_subpixel; } - void setSubpixel(const QWaylandOutput::Subpixel &subpixel); - - QWaylandOutput::Transform transform() const { return m_transform; } - void setTransform(const QWaylandOutput::Transform &transform); - - int scaleFactor() const { return m_scaleFactor; } - void setScaleFactor(int scale); - - void setOutputSpace(QWaylandOutputSpace *outputSpace, bool setOutputSpace); - QWaylandOutputSpace *outputSpace() const { return m_outputSpace; } - - void frameStarted(); - void sendFrameCallbacks(); - - void surfaceEnter(QWaylandSurface *surface); - void surfaceLeave(QWaylandSurface *surface); - - void addView(QWaylandView *view); - void addView(QWaylandView *view, QWaylandSurface *surface); - void removeView(QWaylandView *view); - void removeView(QWaylandView *view, QWaylandSurface *surface); - void updateSurfaceForView(QWaylandView *view, QWaylandSurface *newSurface, QWaylandSurface *oldSurface); - - QWindow *window() const { return m_window; } - - OutputResource *outputForClient(QWaylandClient *client) const { return outputForClient(client->client()); } - OutputResource *outputForClient(struct wl_client *client) const; - - void output_bind_resource(Resource *resource) Q_DECL_OVERRIDE; - Resource *output_allocate() Q_DECL_OVERRIDE { return new OutputResource; } - - const QVector surfaceMappers() const { return m_surfaceViews; } -private: - friend class QT_PREPEND_NAMESPACE(QWaylandOutput); - - QWindow *m_window; - QWaylandOutput *m_output; - QWaylandOutputSpace *m_outputSpace; - QString m_manufacturer; - QString m_model; - QPoint m_position; - QWaylandOutput::Mode m_mode; - QRect m_availableGeometry; - QVector m_surfaceViews; - QSize m_physicalSize; - QWaylandOutput::Subpixel m_subpixel; - QWaylandOutput::Transform m_transform; - int m_scaleFactor; - bool m_sizeFollowsWindow; - - void sendGeometryInfo(); -}; - -} - -QT_END_NAMESPACE - -#endif //WL_OUTPUT_H diff --git a/src/compositor/wayland_wrapper/wayland_wrapper.pri b/src/compositor/wayland_wrapper/wayland_wrapper.pri index b32bf4cbb..66de019cc 100644 --- a/src/compositor/wayland_wrapper/wayland_wrapper.pri +++ b/src/compositor/wayland_wrapper/wayland_wrapper.pri @@ -13,7 +13,6 @@ HEADERS += \ wayland_wrapper/qwlinputmethod_p.h \ wayland_wrapper/qwlinputmethodcontext_p.h \ wayland_wrapper/qwlkeyboard_p.h \ - wayland_wrapper/qwloutput_p.h \ wayland_wrapper/qwlpointer_p.h \ wayland_wrapper/qwlregion_p.h \ wayland_wrapper/qwlsurfacebuffer_p.h \ @@ -29,7 +28,6 @@ SOURCES += \ wayland_wrapper/qwlinputmethod.cpp \ wayland_wrapper/qwlinputmethodcontext.cpp \ wayland_wrapper/qwlkeyboard.cpp \ - wayland_wrapper/qwloutput.cpp \ wayland_wrapper/qwlpointer.cpp \ wayland_wrapper/qwlregion.cpp \ wayland_wrapper/qwlsurfacebuffer.cpp \ -- cgit v1.2.3 From 463b9137b1b78def03fca6fc987df9bf249cb2f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Fri, 14 Aug 2015 14:15:18 +0200 Subject: Remove QtWayland::InputDevice and add QWaylandInputDevicePrivate. Also make sure noone holds a reference to the private instance. Change-Id: Ic2327595d58d6308e1e2699370f53aef47061b04 --- src/compositor/wayland_wrapper/qwldatadevice.cpp | 18 +- src/compositor/wayland_wrapper/qwldatadevice_p.h | 1 - .../wayland_wrapper/qwldatadevicemanager.cpp | 8 +- src/compositor/wayland_wrapper/qwlinputdevice.cpp | 311 --------------------- src/compositor/wayland_wrapper/qwlinputdevice_p.h | 155 ---------- src/compositor/wayland_wrapper/qwlinputmethod.cpp | 1 - src/compositor/wayland_wrapper/qwlpointer.cpp | 1 - src/compositor/wayland_wrapper/wayland_wrapper.pri | 2 - 8 files changed, 13 insertions(+), 484 deletions(-) delete mode 100644 src/compositor/wayland_wrapper/qwlinputdevice.cpp delete mode 100644 src/compositor/wayland_wrapper/qwlinputdevice_p.h (limited to 'src/compositor/wayland_wrapper') diff --git a/src/compositor/wayland_wrapper/qwldatadevice.cpp b/src/compositor/wayland_wrapper/qwldatadevice.cpp index a7cb3bd9c..83d0b9dd3 100644 --- a/src/compositor/wayland_wrapper/qwldatadevice.cpp +++ b/src/compositor/wayland_wrapper/qwldatadevice.cpp @@ -38,7 +38,6 @@ #include "qwldatasource_p.h" #include "qwldataoffer_p.h" -#include "qwlinputdevice_p.h" #include "qwlkeyboard_p.h" #include "qwlpointer_p.h" #include "qwaylandsurface_p.h" @@ -49,6 +48,7 @@ #include "qwaylandview.h" #include #include +#include #include #include @@ -146,7 +146,7 @@ void DataDevice::focus() void DataDevice::motion(uint32_t time) { - Q_EMIT QWaylandInputDevicePrivate::get(m_inputDevice)->dragHandle()->positionChanged(); + Q_EMIT m_inputDevice->drag()->positionChanged(); m_dragIconPosition = pointer->currentSpacePosition(); if (m_dragFocusResource && m_dragFocus) { @@ -171,8 +171,8 @@ void DataDevice::button(uint32_t time, Qt::MouseButton button, uint32_t state) if (m_dragIcon) { m_dragIcon = 0; m_dragIconPosition = QPointF(); - Q_EMIT QWaylandInputDevicePrivate::get(m_inputDevice)->dragHandle()->positionChanged(); - Q_EMIT QWaylandInputDevicePrivate::get(m_inputDevice)->dragHandle()->iconChanged(); + Q_EMIT m_inputDevice->drag()->positionChanged(); + Q_EMIT m_inputDevice->drag()->iconChanged(); } setDragFocus(0, QPointF()); @@ -182,8 +182,8 @@ void DataDevice::button(uint32_t time, Qt::MouseButton button, uint32_t state) void DataDevice::data_device_start_drag(Resource *resource, struct ::wl_resource *source, struct ::wl_resource *origin, struct ::wl_resource *icon, uint32_t serial) { - if (QWaylandInputDevicePrivate::get(m_inputDevice)->pointerDevice()->grabSerial() == serial) { - if (!QWaylandInputDevicePrivate::get(m_inputDevice)->pointerDevice()->isButtonPressed() || + if (m_inputDevice->pointer()->grabSerial() == serial) { + if (!m_inputDevice->pointer()->isButtonPressed() || m_inputDevice->mouseFocus()->surfaceResource() != origin) return; @@ -191,10 +191,10 @@ void DataDevice::data_device_start_drag(Resource *resource, struct ::wl_resource m_dragDataSource = source != 0 ? DataSource::fromResource(source) : 0; m_dragIcon = icon != 0 ? QWaylandSurface::fromResource(icon) : 0; m_dragIconPosition = QPointF(); - Q_EMIT QWaylandInputDevicePrivate::get(m_inputDevice)->dragHandle()->positionChanged(); - Q_EMIT QWaylandInputDevicePrivate::get(m_inputDevice)->dragHandle()->iconChanged(); + Q_EMIT m_inputDevice->drag()->positionChanged(); + Q_EMIT m_inputDevice->drag()->iconChanged(); - QWaylandInputDevicePrivate::get(m_inputDevice)->pointerDevice()->startGrab(this); + m_inputDevice->pointer()->startGrab(this); } } diff --git a/src/compositor/wayland_wrapper/qwldatadevice_p.h b/src/compositor/wayland_wrapper/qwldatadevice_p.h index 435e253e3..6d4f4f1b5 100644 --- a/src/compositor/wayland_wrapper/qwldatadevice_p.h +++ b/src/compositor/wayland_wrapper/qwldatadevice_p.h @@ -38,7 +38,6 @@ #define WLDATADEVICE_H #include -#include #include #include #include diff --git a/src/compositor/wayland_wrapper/qwldatadevicemanager.cpp b/src/compositor/wayland_wrapper/qwldatadevicemanager.cpp index 23e85813a..56c7f8026 100644 --- a/src/compositor/wayland_wrapper/qwldatadevicemanager.cpp +++ b/src/compositor/wayland_wrapper/qwldatadevicemanager.cpp @@ -39,9 +39,9 @@ #include #include +#include #include "qwldatadevice_p.h" #include "qwldatasource_p.h" -#include "qwlinputdevice_p.h" #include "qwldataoffer_p.h" #include "qwaylandmimehelper.h" @@ -200,7 +200,7 @@ void DataDeviceManager::overrideSelection(const QMimeData &mimeData) m_compositorOwnsSelection = true; QWaylandInputDevice *dev = m_compositor->defaultInputDevice(); - QWaylandSurface *focusSurface = QWaylandInputDevicePrivate::get(dev)->keyboardFocus(); + QWaylandSurface *focusSurface = dev->keyboardFocus(); if (focusSurface) offerFromCompositorToClient( QWaylandInputDevicePrivate::get(dev)->dataDevice()->resourceMap().value(focusSurface->waylandClient())->handle); @@ -243,8 +243,8 @@ void DataDeviceManager::data_device_manager_create_data_source(Resource *resourc void DataDeviceManager::data_device_manager_get_data_device(Resource *resource, uint32_t id, struct ::wl_resource *seat) { - QWaylandInputDevicePrivate *input_device = QWaylandInputDevicePrivate::fromSeatResource(seat); - input_device->clientRequestedDataDevice(this, resource->client(), id); + QWaylandInputDevice *input_device = QWaylandInputDevice::fromSeatResource(seat); + QWaylandInputDevicePrivate::get(input_device)->clientRequestedDataDevice(this, resource->client(), id); } void DataDeviceManager::comp_accept(wl_client *, wl_resource *, uint32_t, const char *) diff --git a/src/compositor/wayland_wrapper/qwlinputdevice.cpp b/src/compositor/wayland_wrapper/qwlinputdevice.cpp deleted file mode 100644 index 12c38bf83..000000000 --- a/src/compositor/wayland_wrapper/qwlinputdevice.cpp +++ /dev/null @@ -1,311 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the QtWaylandCompositor module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPLv3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qwlinputdevice_p.h" - -#include -#include -#include "qwldatadevice_p.h" -#include "qwlinputmethod_p.h" -#include "qwlqttouch_p.h" -#include "qwlqtkey_p.h" -#include "qwaylanddrag.h" -#include "qwlpointer_p.h" -#include "qwlkeyboard_p.h" -#include "qwltouch_p.h" -#include "qwaylandview.h" -#include - -#include - -QT_BEGIN_NAMESPACE - -QWaylandInputDevicePrivate::QWaylandInputDevicePrivate(QWaylandInputDevice *inputdevice, QWaylandCompositor *compositor) - : QObjectPrivate() - , QtWaylandServer::wl_seat(compositor->display(), 3) - , m_dragHandle(new QWaylandDrag(inputdevice)) - , m_compositor(compositor) - , m_outputSpace(compositor->primaryOutputSpace()) - , m_mouseFocus(Q_NULLPTR) - , m_capabilities() - , m_inputMethod(m_compositor->extensionFlags() & QWaylandCompositor::TextInputExtension ? new QtWayland::InputMethod(m_compositor, inputdevice) : 0) - , m_data_device() -{ -} - -QWaylandInputDevicePrivate::~QWaylandInputDevicePrivate() -{ -} - -QWaylandPointer *QWaylandInputDevicePrivate::pointerDevice() const -{ - return m_pointer.data(); -} - -QWaylandKeyboard *QWaylandInputDevicePrivate::keyboardDevice() const -{ - return m_keyboard.data(); -} - -QWaylandTouch *QWaylandInputDevicePrivate::touchDevice() const -{ - return m_touch.data(); -} - -QtWayland::InputMethod *QWaylandInputDevicePrivate::inputMethod() -{ - return m_inputMethod.data(); -} - - -void QWaylandInputDevicePrivate::seat_destroy_resource(wl_seat::Resource *) -{ -// cleanupDataDeviceForClient(resource->client(), true); -} - -void QWaylandInputDevicePrivate::seat_bind_resource(wl_seat::Resource *resource) -{ - // The order of m_capabilities matches the order defined in the wayland protocol - wl_seat::send_capabilities(resource->handle, (uint32_t)m_capabilities); -} - -void QWaylandInputDevicePrivate::setCapabilities(QWaylandInputDevice::CapabilityFlags caps) -{ - Q_Q(QWaylandInputDevice); - if (m_capabilities != caps) { - QWaylandInputDevice::CapabilityFlags changed = caps ^ m_capabilities; - - if (changed & QWaylandInputDevice::Pointer) { - m_pointer.reset(m_pointer.isNull() ? QWaylandCompositorPrivate::get(compositor())->callCreatePointerDevice(q) : 0); - } - - if (changed & QWaylandInputDevice::Keyboard) { - m_keyboard.reset(m_keyboard.isNull() ? QWaylandCompositorPrivate::get(compositor())->callCreateKeyboardDevice(q) : 0); - } - - if (changed & QWaylandInputDevice::Touch) { - m_touch.reset(m_touch.isNull() ? QWaylandCompositorPrivate::get(compositor())->callCreateTouchDevice(q) : 0); - } - - m_capabilities = caps; - QList resources = resourceMap().values(); - for (int i = 0; i < resources.size(); i++) { - wl_seat::send_capabilities(resources.at(i)->handle, (uint32_t)m_capabilities); - } - } -} - -void QWaylandInputDevicePrivate::seat_get_pointer(wl_seat::Resource *resource, uint32_t id) -{ - if (!m_pointer.isNull()) { - m_pointer->addClient(QWaylandClient::fromWlClient(m_compositor, resource->client()), id); - } -} - -void QWaylandInputDevicePrivate::seat_get_keyboard(wl_seat::Resource *resource, uint32_t id) -{ - if (!m_keyboard.isNull()) { - m_keyboard->addClient(QWaylandClient::fromWlClient(m_compositor, resource->client()), id); - } -} - -void QWaylandInputDevicePrivate::seat_get_touch(wl_seat::Resource *resource, uint32_t id) -{ - if (!m_touch.isNull()) { - m_touch->addClient(QWaylandClient::fromWlClient(m_compositor, resource->client()), id); - } -} - -void QWaylandInputDevicePrivate::sendMousePressEvent(Qt::MouseButton button) -{ - pointerDevice()->sendMousePressEvent(button); -} - -void QWaylandInputDevicePrivate::sendMouseReleaseEvent(Qt::MouseButton button) -{ - pointerDevice()->sendMouseReleaseEvent(button); -} - -void QWaylandInputDevicePrivate::sendMouseMoveEvent(QWaylandView *view, const QPointF &localPos, const QPointF &globalPos) -{ - pointerDevice()->sendMouseMoveEvent(view, localPos,globalPos); -} - -void QWaylandInputDevicePrivate::sendMouseWheelEvent(Qt::Orientation orientation, int delta) -{ - pointerDevice()->sendMouseWheelEvent(orientation, delta); -} - -void QWaylandInputDevicePrivate::sendTouchPointEvent(int id, const QPointF &point, Qt::TouchPointState state) -{ - if (m_touch.isNull()) { - return; - } - m_touch->sendTouchPointEvent(id, point,state); -} - -void QWaylandInputDevicePrivate::sendTouchFrameEvent() -{ - if (!m_touch.isNull()) { - m_touch->sendFrameEvent(); - } -} - -void QWaylandInputDevicePrivate::sendTouchCancelEvent() -{ - if (!m_touch.isNull()) { - m_touch->sendCancelEvent(); - } -} - -void QWaylandInputDevicePrivate::sendFullKeyEvent(QKeyEvent *event) -{ - if (!keyboardFocus()) { - qWarning("Cannot send key event, no keyboard focus, fix the compositor"); - return; - } - - QtWayland::QtKeyExtensionGlobal *ext = QtWayland::QtKeyExtensionGlobal::findIn(m_compositor); - if (ext && ext->postQtKeyEvent(event, keyboardFocus())) - return; - - if (!m_keyboard.isNull() && !event->isAutoRepeat()) { - if (event->type() == QEvent::KeyPress) - m_keyboard->sendKeyPressEvent(event->nativeScanCode()); - else if (event->type() == QEvent::KeyRelease) - m_keyboard->sendKeyReleaseEvent(event->nativeScanCode()); - } -} - -void QWaylandInputDevicePrivate::sendFullKeyEvent(QWaylandSurface *surface, QKeyEvent *event) -{ - QtWayland::QtKeyExtensionGlobal *ext = QtWayland::QtKeyExtensionGlobal::findIn(m_compositor); - if (ext) - ext->postQtKeyEvent(event, surface); -} - -void QWaylandInputDevicePrivate::sendFullTouchEvent(QTouchEvent *event) -{ - if (!mouseFocus()) { - qWarning("Cannot send touch event, no pointer focus, fix the compositor"); - return; - } - - if (!m_touch) - return; - - m_touch->sendFullTouchEvent(event); -} - -QWaylandSurface *QWaylandInputDevicePrivate::keyboardFocus() const -{ - if (m_keyboard.isNull() || !m_keyboard->focus()) - return Q_NULLPTR; - - return m_keyboard->focus(); -} - -/*! - * \return True if the keyboard focus is changed successfully. False for inactive transient surfaces. - */ -bool QWaylandInputDevicePrivate::setKeyboardFocus(QWaylandSurface *surface) -{ - if (surface && surface->isDestroyed()) - return false; - - if (!m_keyboard.isNull() && m_keyboard->setFocus(surface)) { - if (m_data_device) - m_data_device->setFocus(m_keyboard->focusClient()); - return true; - } - return false; -} - -QWaylandView *QWaylandInputDevicePrivate::mouseFocus() const -{ - return m_mouseFocus; -} - -void QWaylandInputDevicePrivate::setMouseFocus(QWaylandView *focus) -{ - Q_Q(QWaylandInputDevice); - if (focus == m_mouseFocus) - return; - - QWaylandView *oldFocus = m_mouseFocus; - m_mouseFocus = focus; - q->mouseFocusChanged(m_mouseFocus, oldFocus); -} - -void QWaylandInputDevicePrivate::clientRequestedDataDevice(QtWayland::DataDeviceManager *, struct wl_client *client, uint32_t id) -{ - Q_Q(QWaylandInputDevice); - if (!m_data_device) - m_data_device.reset(new QtWayland::DataDevice(q)); - m_data_device->add(client, id, 1); -} - -QWaylandCompositor *QWaylandInputDevicePrivate::compositor() const -{ - return m_compositor; -} - -QWaylandDrag *QWaylandInputDevicePrivate::dragHandle() const -{ - return m_dragHandle.data(); -} - -const QtWayland::DataDevice *QWaylandInputDevicePrivate::dataDevice() const -{ - return m_data_device.data(); -} - -QWaylandOutputSpace *QWaylandInputDevicePrivate::outputSpace() const -{ - return m_outputSpace; -} - -void QWaylandInputDevicePrivate::setOutputSpace(QWaylandOutputSpace *outputSpace) -{ - m_outputSpace = outputSpace; -} - -QWaylandInputDevicePrivate *QWaylandInputDevicePrivate::get(QWaylandInputDevice *device) -{ - return device->d_func(); -} - -QT_END_NAMESPACE diff --git a/src/compositor/wayland_wrapper/qwlinputdevice_p.h b/src/compositor/wayland_wrapper/qwlinputdevice_p.h deleted file mode 100644 index 1ed8593ac..000000000 --- a/src/compositor/wayland_wrapper/qwlinputdevice_p.h +++ /dev/null @@ -1,155 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the QtWaylandCompositor module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPLv3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef WLINPUTDEVICE_H -#define WLINPUTDEVICE_H - -#include - -#include -#include - -#include -#include -#include -#include - -#ifndef QT_NO_WAYLAND_XKB -#include -#endif - -#include - -QT_BEGIN_NAMESPACE - -class QKeyEvent; -class QTouchEvent; -class QWaylandInputDevice; -class QWaylandDrag; -class QWaylandView; - -namespace QtWayland { - -class Compositor; -class DataDevice; -class Surface; -class DataDeviceManager; -class Pointer; -class Keyboard; -class Touch; -class InputMethod; - -} - -class Q_COMPOSITOR_EXPORT QWaylandInputDevicePrivate : public QObjectPrivate, public QtWaylandServer::wl_seat -{ -public: - Q_DECLARE_PUBLIC(QWaylandInputDevice) - - QWaylandInputDevicePrivate(QWaylandInputDevice *device, QWaylandCompositor *compositor); - ~QWaylandInputDevicePrivate(); - - void sendMousePressEvent(Qt::MouseButton button); - void sendMouseReleaseEvent(Qt::MouseButton button); - void sendMouseMoveEvent(QWaylandView *surface, const QPointF &localPos, const QPointF &spacePos = QPointF()); - void sendMouseWheelEvent(Qt::Orientation orientation, int delta); - - void sendTouchPointEvent(int id, const QPointF &point, Qt::TouchPointState state); - void sendTouchFrameEvent(); - void sendTouchCancelEvent(); - - void sendFullKeyEvent(QKeyEvent *event); - void sendFullKeyEvent(QWaylandSurface *surface, QKeyEvent *event); - - void sendFullTouchEvent(QTouchEvent *event); - - QWaylandSurface *keyboardFocus() const; - bool setKeyboardFocus(QWaylandSurface *surface); - - QWaylandView *mouseFocus() const; - void setMouseFocus(QWaylandView *focus); - - void clientRequestedDataDevice(QtWayland::DataDeviceManager *dndSelection, struct wl_client *client, uint32_t id); - const QtWayland::DataDevice *dataDevice() const; - - QWaylandOutputSpace *outputSpace() const; - void setOutputSpace(QWaylandOutputSpace *outputSpace); - - QWaylandCompositor *compositor() const; - QWaylandDrag *dragHandle() const; - - QWaylandPointer *pointerDevice() const; - QWaylandKeyboard *keyboardDevice() const; - QWaylandTouch *touchDevice() const; - QtWayland::InputMethod *inputMethod(); - - static QWaylandInputDevicePrivate *fromSeatResource(struct ::wl_resource *resource) - { - return static_cast(wl_seat::Resource::fromResource(resource)->seat_object); - } - - QWaylandInputDevice::CapabilityFlags capabilities() const { return m_capabilities; } - void setCapabilities(QWaylandInputDevice::CapabilityFlags caps); - - static QWaylandInputDevicePrivate *get(QWaylandInputDevice *device); -private: - QScopedPointer m_dragHandle; - QWaylandCompositor *m_compositor; - QWaylandOutputSpace *m_outputSpace; - QWaylandView *m_mouseFocus; - QWaylandInputDevice::CapabilityFlags m_capabilities; - - QScopedPointer m_pointer; - QScopedPointer m_keyboard; - QScopedPointer m_touch; - QScopedPointer m_inputMethod; - QScopedPointer m_data_device; - - void seat_bind_resource(wl_seat::Resource *resource) Q_DECL_OVERRIDE; - - void seat_get_pointer(wl_seat::Resource *resource, - uint32_t id) Q_DECL_OVERRIDE; - void seat_get_keyboard(wl_seat::Resource *resource, - uint32_t id) Q_DECL_OVERRIDE; - void seat_get_touch(wl_seat::Resource *resource, - uint32_t id) Q_DECL_OVERRIDE; - - void seat_destroy_resource(wl_seat::Resource *resource) Q_DECL_OVERRIDE; -}; - -QT_END_NAMESPACE - -#endif // WLINPUTDEVICE_H diff --git a/src/compositor/wayland_wrapper/qwlinputmethod.cpp b/src/compositor/wayland_wrapper/qwlinputmethod.cpp index 59b23cdd3..106cb40a7 100644 --- a/src/compositor/wayland_wrapper/qwlinputmethod.cpp +++ b/src/compositor/wayland_wrapper/qwlinputmethod.cpp @@ -37,7 +37,6 @@ #include "qwlinputmethod_p.h" #include -#include "qwlinputdevice_p.h" #include "qwlinputmethodcontext_p.h" #include "qwlinputpanel_p.h" #include "qwlkeyboard_p.h" diff --git a/src/compositor/wayland_wrapper/qwlpointer.cpp b/src/compositor/wayland_wrapper/qwlpointer.cpp index 28a72b76e..5f5068f5c 100644 --- a/src/compositor/wayland_wrapper/qwlpointer.cpp +++ b/src/compositor/wayland_wrapper/qwlpointer.cpp @@ -37,7 +37,6 @@ #include "qwlpointer_p.h" -#include "qwlinputdevice_p.h" #include "qwlkeyboard_p.h" #include "qwaylandcompositor.h" #include "qwaylandview.h" diff --git a/src/compositor/wayland_wrapper/wayland_wrapper.pri b/src/compositor/wayland_wrapper/wayland_wrapper.pri index 66de019cc..96d05116e 100644 --- a/src/compositor/wayland_wrapper/wayland_wrapper.pri +++ b/src/compositor/wayland_wrapper/wayland_wrapper.pri @@ -9,7 +9,6 @@ HEADERS += \ wayland_wrapper/qwldatadevicemanager_p.h \ wayland_wrapper/qwldataoffer_p.h \ wayland_wrapper/qwldatasource_p.h \ - wayland_wrapper/qwlinputdevice_p.h \ wayland_wrapper/qwlinputmethod_p.h \ wayland_wrapper/qwlinputmethodcontext_p.h \ wayland_wrapper/qwlkeyboard_p.h \ @@ -24,7 +23,6 @@ SOURCES += \ wayland_wrapper/qwldatadevicemanager.cpp \ wayland_wrapper/qwldataoffer.cpp \ wayland_wrapper/qwldatasource.cpp \ - wayland_wrapper/qwlinputdevice.cpp \ wayland_wrapper/qwlinputmethod.cpp \ wayland_wrapper/qwlinputmethodcontext.cpp \ wayland_wrapper/qwlkeyboard.cpp \ -- cgit v1.2.3 From eae177e743d1f538e530b969363c236ae1326ed8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Fri, 14 Aug 2015 15:18:20 +0200 Subject: Move QWaylandPointerPrivate into a _p file and remove the api and make sure all other classes uses the public QWaylandPointer type Change-Id: Ie7ff24160c253ff700eb27eb46788fe021386dd7 --- src/compositor/wayland_wrapper/qwldatadevice.cpp | 2 +- src/compositor/wayland_wrapper/qwldatadevice_p.h | 2 +- src/compositor/wayland_wrapper/qwlpointer.cpp | 217 --------------------- src/compositor/wayland_wrapper/qwlpointer_p.h | 137 ------------- src/compositor/wayland_wrapper/wayland_wrapper.pri | 2 - 5 files changed, 2 insertions(+), 358 deletions(-) delete mode 100644 src/compositor/wayland_wrapper/qwlpointer.cpp delete mode 100644 src/compositor/wayland_wrapper/qwlpointer_p.h (limited to 'src/compositor/wayland_wrapper') diff --git a/src/compositor/wayland_wrapper/qwldatadevice.cpp b/src/compositor/wayland_wrapper/qwldatadevice.cpp index 83d0b9dd3..7a375b628 100644 --- a/src/compositor/wayland_wrapper/qwldatadevice.cpp +++ b/src/compositor/wayland_wrapper/qwldatadevice.cpp @@ -39,7 +39,6 @@ #include "qwldatasource_p.h" #include "qwldataoffer_p.h" #include "qwlkeyboard_p.h" -#include "qwlpointer_p.h" #include "qwaylandsurface_p.h" #include "qwltouch_p.h" #include "qwldatadevicemanager_p.h" @@ -49,6 +48,7 @@ #include #include #include +#include #include #include diff --git a/src/compositor/wayland_wrapper/qwldatadevice_p.h b/src/compositor/wayland_wrapper/qwldatadevice_p.h index 6d4f4f1b5..dc8c3be20 100644 --- a/src/compositor/wayland_wrapper/qwldatadevice_p.h +++ b/src/compositor/wayland_wrapper/qwldatadevice_p.h @@ -39,7 +39,7 @@ #include #include -#include +#include #include QT_BEGIN_NAMESPACE diff --git a/src/compositor/wayland_wrapper/qwlpointer.cpp b/src/compositor/wayland_wrapper/qwlpointer.cpp deleted file mode 100644 index 5f5068f5c..000000000 --- a/src/compositor/wayland_wrapper/qwlpointer.cpp +++ /dev/null @@ -1,217 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Copyright (C) 2013 Klarälvdalens Datakonsult AB (KDAB). -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the QtWaylandCompositor module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPLv3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qwlpointer_p.h" - -#include "qwlkeyboard_p.h" -#include "qwaylandcompositor.h" -#include "qwaylandview.h" - -QT_BEGIN_NAMESPACE - -QWaylandPointerPrivate::QWaylandPointerPrivate(QWaylandPointer *pointer, QWaylandInputDevice *seat) - : QObjectPrivate() - , wl_pointer() - , m_seat(seat) - , m_output() - , m_defaultGrab(pointer) - , m_grab(&m_defaultGrab) - , m_grabButton() - , m_grabTime() - , m_grabSerial() - , m_focusResource() - , m_hasSentEnter(false) - , m_buttonCount() -{ -} - -void QWaylandPointerPrivate::startGrab(QWaylandPointerGrabber *grab) -{ - Q_Q(QWaylandPointer); - m_grab = grab; - grab->pointer = q; - - if (mouseFocus()) - grab->focus(); -} - -void QWaylandPointerPrivate::endGrab() -{ - m_grab = &m_defaultGrab; - m_grab->focus(); -} - -bool QWaylandPointerPrivate::buttonPressed() const -{ - return m_buttonCount > 0; -} - -QWaylandPointerGrabber *QWaylandPointerPrivate::currentGrab() const -{ - return m_grab; -} - -Qt::MouseButton QWaylandPointerPrivate::grabButton() const -{ - return m_grabButton; -} - -uint32_t QWaylandPointerPrivate::grabTime() const -{ - return m_grabTime; -} - -uint32_t QWaylandPointerPrivate::grabSerial() const -{ - return m_grabSerial; -} - -void QWaylandPointerPrivate::pointer_destroy_resource(wl_pointer::Resource *resource) -{ - if (m_focusResource == resource) - m_focusResource = 0; -} - -void QWaylandPointerPrivate::pointer_release(wl_pointer::Resource *resource) -{ - wl_resource_destroy(resource->handle); -} - -void QWaylandPointerPrivate::sendMousePressEvent(Qt::MouseButton button) -{ - Q_Q(QWaylandPointer); - uint32_t time = compositor()->currentTimeMsecs(); - if (m_buttonCount == 0) { - m_grabButton = button; - m_grabTime = time; - } - m_buttonCount++; - m_grab->button(time, button, WL_POINTER_BUTTON_STATE_PRESSED); - - if (m_buttonCount == 1) { - m_grabSerial = compositor()->nextSerial(); - q->buttonPressedChanged(); - } -} - -void QWaylandPointerPrivate::sendMouseReleaseEvent(Qt::MouseButton button) -{ - Q_Q(QWaylandPointer); - uint32_t time = compositor()->currentTimeMsecs(); - m_buttonCount--; - m_grab->button(time, button, WL_POINTER_BUTTON_STATE_RELEASED); - - if (m_buttonCount == 1) - m_grabSerial = compositor()->nextSerial(); - if (m_buttonCount == 0) - q->buttonPressedChanged(); -} - -void QWaylandPointerPrivate::sendMouseMoveEvent(QWaylandView *view, const QPointF &localPos, const QPointF &outputSpacePos) -{ - Q_Q(QWaylandPointer); - if (view && (!view->surface() || view->surface()->isCursorSurface())) - view = Q_NULLPTR; - m_seat->setMouseFocus(view); - m_localPosition = localPos; - m_spacePosition = outputSpacePos; - - //we adjust if the mouse position is on the edge - //to work around Qt's event propogation - if (view && view->surface()) { - QSizeF size(view->surface()->size()); - if (m_localPosition.x() == size.width()) - m_localPosition.rx() -= 0.01; - - if (m_localPosition.y() == size.height()) - m_localPosition.ry() -= 0.01; - } - - Resource *resource = view ? resourceMap().value(view->surface()->waylandClient()) : 0; - if (resource && !m_hasSentEnter) { - uint32_t serial = compositor()->nextSerial(); - QWaylandKeyboard *keyboard = m_seat->keyboard(); - if (keyboard) { - keyboard->sendKeyModifiers(view->surface()->client(), serial); - } - send_enter(resource->handle, serial, view->surface()->resource(), - wl_fixed_from_double(m_localPosition.x()), wl_fixed_from_double(m_localPosition.y())); - - m_focusDestroyListener.listenForDestruction(view->surface()->resource()); - m_hasSentEnter = true; - } - - m_focusResource = resource; - - if (view && view->output()) - q->setOutput(view->output()); - - m_grab->motion(compositor()->currentTimeMsecs()); -} - -void QWaylandPointerPrivate::sendMouseWheelEvent(Qt::Orientation orientation, int delta) -{ - if (!m_focusResource) - return; - - uint32_t time = compositor()->currentTimeMsecs(); - uint32_t axis = orientation == Qt::Horizontal ? WL_POINTER_AXIS_HORIZONTAL_SCROLL - : WL_POINTER_AXIS_VERTICAL_SCROLL; - send_axis(m_focusResource->handle, time, axis, wl_fixed_from_int(-delta / 12)); -} - -static void requestCursorSurface(QWaylandCompositor *compositor, QWaylandSurface *surface, int32_t hotspot_x, int hotspot_y) -{ - compositor->currentCurserSurfaceRequest(surface, hotspot_x, hotspot_y); -} - -void QWaylandPointerPrivate::pointer_set_cursor(wl_pointer::Resource *resource, uint32_t serial, wl_resource *surface, int32_t hotspot_x, int32_t hotspot_y) -{ - Q_UNUSED(resource); - Q_UNUSED(serial); - - if (!surface) { - requestCursorSurface(compositor(), Q_NULLPTR, 0, 0); - return; - } - - QWaylandSurface *s = QWaylandSurface::fromResource(surface); - s->markAsCursorSurface(true); - requestCursorSurface(compositor(), s, hotspot_x, hotspot_y); -} - -QT_END_NAMESPACE diff --git a/src/compositor/wayland_wrapper/qwlpointer_p.h b/src/compositor/wayland_wrapper/qwlpointer_p.h deleted file mode 100644 index 1feeb1933..000000000 --- a/src/compositor/wayland_wrapper/qwlpointer_p.h +++ /dev/null @@ -1,137 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Copyright (C) 2013 Klarälvdalens Datakonsult AB (KDAB). -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the QtWaylandCompositor module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPLv3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QTWAYLAND_QWLPOINTER_P_H -#define QTWAYLAND_QWLPOINTER_P_H - -#include -#include -#include - -#include -#include -#include -#include - -#include -#include -#include -#include - -#include - -QT_BEGIN_NAMESPACE - -class QWaylandView; - -namespace QtWayland { - -class Compositor; -class Surface; - -} // namespace QtWayland - -class Q_COMPOSITOR_EXPORT QWaylandPointerPrivate : public QObjectPrivate - , public QtWaylandServer::wl_pointer -{ - Q_DECLARE_PUBLIC(QWaylandPointer) -public: - QWaylandPointerPrivate(QWaylandPointer *pointer, QWaylandInputDevice *seat); - - QWaylandOutput *output() const { return m_output; } - void setOutput(QWaylandOutput *output) - { - if (m_output == output) return; - Q_Q(QWaylandPointer); - m_output = output; - q->outputChanged(); - } - - - void startGrab(QWaylandPointerGrabber *currentGrab); - void endGrab(); - QWaylandPointerGrabber *currentGrab() const; - Qt::MouseButton grabButton() const; - uint32_t grabTime() const; - uint32_t grabSerial() const; - - void sendMousePressEvent(Qt::MouseButton button); - void sendMouseReleaseEvent(Qt::MouseButton button); - void sendMouseMoveEvent(QWaylandView *view, const QPointF &localPos, const QPointF &outputSpacePos); - void sendMouseWheelEvent(Qt::Orientation orientation, int delta); - - Resource *focusResource() const { return m_focusResource; } - QWaylandView *mouseFocus() const { return m_seat->mouseFocus(); } - - bool buttonPressed() const; - - QWaylandInputDevice *seat() const { return m_seat; } - QWaylandCompositor *compositor() const { return m_seat->compositor(); } - - QPointF currentSpacePosition() const { return m_spacePosition; } - QPointF currentLocalPosition() const { return m_localPosition; } -protected: - void pointer_set_cursor(Resource *resource, uint32_t serial, wl_resource *surface, int32_t hotspot_x, int32_t hotspot_y) Q_DECL_OVERRIDE; - void pointer_release(Resource *resource) Q_DECL_OVERRIDE; - void pointer_destroy_resource(Resource *resource) Q_DECL_OVERRIDE; - -private: - void focusDestroyed(void *data); - - QWaylandInputDevice *m_seat; - QWaylandOutput *m_output; - QWaylandDefaultPointerGrabber m_defaultGrab; - - QPointF m_localPosition; - QPointF m_spacePosition; - - QWaylandPointerGrabber *m_grab; - Qt::MouseButton m_grabButton; - uint32_t m_grabTime; - uint32_t m_grabSerial; - - Resource *m_focusResource; - bool m_hasSentEnter; - - int m_buttonCount; - - QWaylandDestroyListener m_focusDestroyListener; -}; - -QT_END_NAMESPACE - -#endif // QTWAYLAND_QWLPOINTER_P_H diff --git a/src/compositor/wayland_wrapper/wayland_wrapper.pri b/src/compositor/wayland_wrapper/wayland_wrapper.pri index 96d05116e..3ffc7148e 100644 --- a/src/compositor/wayland_wrapper/wayland_wrapper.pri +++ b/src/compositor/wayland_wrapper/wayland_wrapper.pri @@ -12,7 +12,6 @@ HEADERS += \ wayland_wrapper/qwlinputmethod_p.h \ wayland_wrapper/qwlinputmethodcontext_p.h \ wayland_wrapper/qwlkeyboard_p.h \ - wayland_wrapper/qwlpointer_p.h \ wayland_wrapper/qwlregion_p.h \ wayland_wrapper/qwlsurfacebuffer_p.h \ wayland_wrapper/qwltouch_p.h \ @@ -26,7 +25,6 @@ SOURCES += \ wayland_wrapper/qwlinputmethod.cpp \ wayland_wrapper/qwlinputmethodcontext.cpp \ wayland_wrapper/qwlkeyboard.cpp \ - wayland_wrapper/qwlpointer.cpp \ wayland_wrapper/qwlregion.cpp \ wayland_wrapper/qwlsurfacebuffer.cpp \ wayland_wrapper/qwltouch.cpp \ -- cgit v1.2.3 From e713952c87e2e7b653acc3463481ec885212daca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Wed, 19 Aug 2015 10:17:48 +0200 Subject: Move QWaylandKeyboardPrivate away from wayland_wrapper Change-Id: I77dce1eecdda21f4a9907d1cd7fafe23de326136 --- src/compositor/wayland_wrapper/qwldatadevice.cpp | 1 - src/compositor/wayland_wrapper/qwlinputmethod.cpp | 3 +- src/compositor/wayland_wrapper/qwlkeyboard.cpp | 384 --------------------- src/compositor/wayland_wrapper/qwlkeyboard_p.h | 146 -------- src/compositor/wayland_wrapper/wayland_wrapper.pri | 2 - 5 files changed, 2 insertions(+), 534 deletions(-) delete mode 100644 src/compositor/wayland_wrapper/qwlkeyboard.cpp delete mode 100644 src/compositor/wayland_wrapper/qwlkeyboard_p.h (limited to 'src/compositor/wayland_wrapper') diff --git a/src/compositor/wayland_wrapper/qwldatadevice.cpp b/src/compositor/wayland_wrapper/qwldatadevice.cpp index 7a375b628..b2eb25684 100644 --- a/src/compositor/wayland_wrapper/qwldatadevice.cpp +++ b/src/compositor/wayland_wrapper/qwldatadevice.cpp @@ -38,7 +38,6 @@ #include "qwldatasource_p.h" #include "qwldataoffer_p.h" -#include "qwlkeyboard_p.h" #include "qwaylandsurface_p.h" #include "qwltouch_p.h" #include "qwldatadevicemanager_p.h" diff --git a/src/compositor/wayland_wrapper/qwlinputmethod.cpp b/src/compositor/wayland_wrapper/qwlinputmethod.cpp index 106cb40a7..febb47a1e 100644 --- a/src/compositor/wayland_wrapper/qwlinputmethod.cpp +++ b/src/compositor/wayland_wrapper/qwlinputmethod.cpp @@ -37,9 +37,10 @@ #include "qwlinputmethod_p.h" #include +#include +#include #include "qwlinputmethodcontext_p.h" #include "qwlinputpanel_p.h" -#include "qwlkeyboard_p.h" #include "qwltextinput_p.h" QT_BEGIN_NAMESPACE diff --git a/src/compositor/wayland_wrapper/qwlkeyboard.cpp b/src/compositor/wayland_wrapper/qwlkeyboard.cpp deleted file mode 100644 index 4977ce014..000000000 --- a/src/compositor/wayland_wrapper/qwlkeyboard.cpp +++ /dev/null @@ -1,384 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Copyright (C) 2013 Klarälvdalens Datakonsult AB (KDAB). -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the QtWaylandCompositor module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPLv3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qwlkeyboard_p.h" -#include "qwlshellsurface_p.h" - -#include -#include - -#include -#include - -#include -#include -#ifndef QT_NO_WAYLAND_XKB -#include -#include -#endif - -QT_BEGIN_NAMESPACE - -QWaylandKeyboardPrivate::QWaylandKeyboardPrivate(QWaylandInputDevice *seat) - : QtWaylandServer::wl_keyboard() - , m_seat(seat) - , m_grab(this) - , m_focus() - , m_focusResource() - , m_keys() - , m_modsDepressed() - , m_modsLatched() - , m_modsLocked() - , m_group() - , m_pendingKeymap(false) -#ifndef QT_NO_WAYLAND_XKB - , m_state(0) -#endif -{ -#ifndef QT_NO_WAYLAND_XKB - initXKB(); -#endif -} - -QWaylandKeyboardPrivate::~QWaylandKeyboardPrivate() -{ -#ifndef QT_NO_WAYLAND_XKB - if (m_context) { - if (m_keymap_area) - munmap(m_keymap_area, m_keymap_size); - close(m_keymap_fd); - xkb_context_unref(m_context); - xkb_state_unref(m_state); - } -#endif -} - -void QWaylandKeyboardPrivate::startGrab(QWaylandKeyboardGrabber *grab) -{ - Q_Q(QWaylandKeyboard); - m_grab = grab; - m_grab->m_keyboard = q; - m_grab->focused(m_focus); -} - -void QWaylandKeyboardPrivate::endGrab() -{ - m_grab = this; -} - -QWaylandKeyboardGrabber *QWaylandKeyboardPrivate::currentGrab() const -{ - return m_grab; -} - -QWaylandKeyboardPrivate *QWaylandKeyboardPrivate::get(QWaylandKeyboard *keyboard) -{ - return keyboard->d_func(); -} - -void QWaylandKeyboardPrivate::focused(QWaylandSurface *surface) -{ - if (surface && surface->isCursorSurface()) - surface = Q_NULLPTR; - if (m_focusResource && m_focus != surface) { - uint32_t serial = compositor()->nextSerial(); - send_leave(m_focusResource->handle, serial, m_focus->resource()); - m_focusDestroyListener.reset(); - } - - Resource *resource = surface ? resourceMap().value(surface->waylandClient()) : 0; - - if (resource && (m_focus != surface || m_focusResource != resource)) { - uint32_t serial = compositor()->nextSerial(); - send_modifiers(resource->handle, serial, m_modsDepressed, m_modsLatched, m_modsLocked, m_group); - send_enter(resource->handle, serial, surface->resource(), QByteArray::fromRawData((char *)m_keys.data(), m_keys.size() * sizeof(uint32_t))); - m_focusDestroyListener.listenForDestruction(surface->resource()); - } - - m_focusResource = resource; - m_focus = surface; - Q_EMIT q_func()->focusChanged(m_focus); -} - -bool QWaylandKeyboardPrivate::setFocus(QWaylandSurface* surface) -{ - QtWayland::ShellSurface *shellsurface = QtWayland::ShellSurface::findIn(surface); - if (shellsurface && shellsurface->isTransientInactive()) - return false; - m_grab->focused(surface); - return true; -} - -void QWaylandKeyboardPrivate::setKeymap(const QWaylandKeymap &keymap) -{ - m_keymap = keymap; - - // If there is no key currently pressed, update right away the keymap - // Otherwise, delay the update when keys are released - // see http://lists.freedesktop.org/archives/wayland-devel/2013-October/011395.html - if (m_keys.isEmpty()) { - updateKeymap(); - } else { - m_pendingKeymap = true; - } -} - -void QWaylandKeyboardPrivate::sendKeyModifiers(wl_keyboard::Resource *resource, uint32_t serial) -{ - send_modifiers(resource->handle, serial, m_modsDepressed, m_modsLatched, m_modsLocked, m_group); -} - -void QWaylandKeyboardPrivate::sendKeyPressEvent(uint code) -{ - sendKeyEvent(code, WL_KEYBOARD_KEY_STATE_PRESSED); -} - -void QWaylandKeyboardPrivate::sendKeyReleaseEvent(uint code) -{ - sendKeyEvent(code, WL_KEYBOARD_KEY_STATE_RELEASED); -} - -QWaylandSurface *QWaylandKeyboardPrivate::focus() const -{ - return m_focus; -} - -void QWaylandKeyboardPrivate::keyboard_bind_resource(wl_keyboard::Resource *resource) -{ -#ifndef QT_NO_WAYLAND_XKB - if (m_context) { - send_keymap(resource->handle, WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1, - m_keymap_fd, m_keymap_size); - return; - } -#endif - int null_fd = open("/dev/null", O_RDONLY); - send_keymap(resource->handle, 0 /* WL_KEYBOARD_KEYMAP_FORMAT_NO_KEYMAP */, - null_fd, 0); - close(null_fd); -} - -void QWaylandKeyboardPrivate::keyboard_destroy_resource(wl_keyboard::Resource *resource) -{ - if (m_focusResource == resource) - m_focusResource = 0; -} - -void QWaylandKeyboardPrivate::keyboard_release(wl_keyboard::Resource *resource) -{ - wl_resource_destroy(resource->handle); -} - -void QWaylandKeyboardPrivate::key(uint32_t serial, uint32_t time, uint32_t key, uint32_t state) -{ - if (m_focusResource) { - send_key(m_focusResource->handle, serial, time, key, state); - } -} - -void QWaylandKeyboardPrivate::keyEvent(uint code, uint32_t state) -{ - uint key = code - 8; - if (state == WL_KEYBOARD_KEY_STATE_PRESSED) { - m_keys << key; - } else { - for (int i = 0; i < m_keys.size(); ++i) { - if (m_keys.at(i) == key) { - m_keys.remove(i); - } - } - } -} - -void QWaylandKeyboardPrivate::sendKeyEvent(uint code, uint32_t state) -{ - uint32_t time = compositor()->currentTimeMsecs(); - uint32_t serial = compositor()->nextSerial(); - uint key = code - 8; - m_grab->key(serial, time, key, state); -} - -void QWaylandKeyboardPrivate::modifiers(uint32_t serial, uint32_t mods_depressed, - uint32_t mods_latched, uint32_t mods_locked, uint32_t group) -{ - if (m_focusResource) { - send_modifiers(m_focusResource->handle, serial, mods_depressed, mods_latched, mods_locked, group); - } -} - -void QWaylandKeyboardPrivate::updateModifierState(uint code, uint32_t state) -{ -#ifndef QT_NO_WAYLAND_XKB - if (!m_context) - return; - - xkb_state_update_key(m_state, code, state == WL_KEYBOARD_KEY_STATE_PRESSED ? XKB_KEY_DOWN : XKB_KEY_UP); - - uint32_t modsDepressed = xkb_state_serialize_mods(m_state, (xkb_state_component)XKB_STATE_DEPRESSED); - uint32_t modsLatched = xkb_state_serialize_mods(m_state, (xkb_state_component)XKB_STATE_LATCHED); - uint32_t modsLocked = xkb_state_serialize_mods(m_state, (xkb_state_component)XKB_STATE_LOCKED); - uint32_t group = xkb_state_serialize_group(m_state, (xkb_state_component)XKB_STATE_EFFECTIVE); - - if (modsDepressed == m_modsDepressed - && modsLatched == m_modsLatched - && modsLocked == m_modsLocked - && group == m_group) - return; - - m_modsDepressed = modsDepressed; - m_modsLatched = modsLatched; - m_modsLocked = modsLocked; - m_group = group; - - m_grab->modifiers(compositor()->nextSerial(), m_modsDepressed, m_modsLatched, m_modsLocked, m_group); -#else - Q_UNUSED(code); - Q_UNUSED(state); -#endif -} - -void QWaylandKeyboardPrivate::updateKeymap() -{ - // There must be no keys pressed when changing the keymap, - // see http://lists.freedesktop.org/archives/wayland-devel/2013-October/011395.html - if (!m_pendingKeymap || !m_keys.isEmpty()) - return; - - m_pendingKeymap = false; -#ifndef QT_NO_WAYLAND_XKB - if (!m_context) - return; - - createXKBKeymap(); - foreach (Resource *res, resourceMap()) { - send_keymap(res->handle, WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1, m_keymap_fd, m_keymap_size); - } - - xkb_state_update_mask(m_state, 0, m_modsLatched, m_modsLocked, 0, 0, 0); - if (m_focusResource) - sendKeyModifiers(m_focusResource, compositor()->nextSerial()); -#endif -} - -#ifndef QT_NO_WAYLAND_XKB -static int createAnonymousFile(size_t size) -{ - QString path = QStandardPaths::writableLocation(QStandardPaths::RuntimeLocation); - if (path.isEmpty()) - return -1; - - QByteArray name = QFile::encodeName(path + QStringLiteral("/qtwayland-XXXXXX")); - - int fd = mkstemp(name.data()); - if (fd < 0) - return -1; - - long flags = fcntl(fd, F_GETFD); - if (flags == -1 || fcntl(fd, F_SETFD, flags | FD_CLOEXEC) == -1) { - close(fd); - fd = -1; - } - unlink(name.constData()); - - if (fd < 0) - return -1; - - if (ftruncate(fd, size) < 0) { - close(fd); - return -1; - } - - return fd; -} - -void QWaylandKeyboardPrivate::initXKB() -{ - m_context = xkb_context_new(static_cast(0)); - if (!m_context) { - qWarning("Failed to create a XKB context: keymap will not be supported"); - return; - } - - createXKBKeymap(); -} - -void QWaylandKeyboardPrivate::createXKBKeymap() -{ - if (!m_context) - return; - - if (m_state) - xkb_state_unref(m_state); - - struct xkb_rule_names rule_names = { strdup(qPrintable(m_keymap.rules())), - strdup(qPrintable(m_keymap.model())), - strdup(qPrintable(m_keymap.layout())), - strdup(qPrintable(m_keymap.variant())), - strdup(qPrintable(m_keymap.options())) }; - struct xkb_keymap *keymap = xkb_keymap_new_from_names(m_context, &rule_names, static_cast(0)); - - char *keymap_str = xkb_keymap_get_as_string(keymap, XKB_KEYMAP_FORMAT_TEXT_V1); - if (!keymap_str) - qFatal("Failed to compile global XKB keymap"); - - m_keymap_size = strlen(keymap_str) + 1; - m_keymap_fd = createAnonymousFile(m_keymap_size); - if (m_keymap_fd < 0) - qFatal("Failed to create anonymous file of size %lu", static_cast(m_keymap_size)); - - m_keymap_area = static_cast(mmap(0, m_keymap_size, PROT_READ | PROT_WRITE, MAP_SHARED, m_keymap_fd, 0)); - if (m_keymap_area == MAP_FAILED) { - close(m_keymap_fd); - qFatal("Failed to map shared memory segment"); - } - - strcpy(m_keymap_area, keymap_str); - free(keymap_str); - - m_state = xkb_state_new(keymap); - - xkb_keymap_unref(keymap); - - free((char *)rule_names.rules); - free((char *)rule_names.model); - free((char *)rule_names.layout); - free((char *)rule_names.variant); - free((char *)rule_names.options); -} -#endif - -QT_END_NAMESPACE diff --git a/src/compositor/wayland_wrapper/qwlkeyboard_p.h b/src/compositor/wayland_wrapper/qwlkeyboard_p.h deleted file mode 100644 index bcd0bab69..000000000 --- a/src/compositor/wayland_wrapper/qwlkeyboard_p.h +++ /dev/null @@ -1,146 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Copyright (C) 2013 Klarälvdalens Datakonsult AB (KDAB). -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the QtWaylandCompositor module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPLv3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QTWAYLAND_QWLKEYBOARD_P_H -#define QTWAYLAND_QWLKEYBOARD_P_H - -#include -#include -#include -#include - -#include -#include - -#include - -#ifndef QT_NO_WAYLAND_XKB -#include -#endif - - -QT_BEGIN_NAMESPACE - -namespace QtWayland { - -class Compositor; -class InputDevice; -class Surface; -class Keyboard; - -} - -class Q_COMPOSITOR_EXPORT QWaylandKeyboardPrivate : public QObjectPrivate - , public QtWaylandServer::wl_keyboard - , public QWaylandKeyboardGrabber -{ -public: - Q_DECLARE_PUBLIC(QWaylandKeyboard) - - QWaylandKeyboardPrivate(QWaylandInputDevice *seat); - ~QWaylandKeyboardPrivate(); - - QWaylandCompositor *compositor() const { return m_seat->compositor(); } - bool setFocus(QWaylandSurface *surface); - void setKeymap(const QWaylandKeymap &keymap); - - void sendKeyModifiers(Resource *resource, uint32_t serial); - void sendKeyPressEvent(uint code); - void sendKeyReleaseEvent(uint code); - - QWaylandSurface *focus() const; - Resource *focusResource() const { return m_focusResource; } - - void focused(QWaylandSurface* surface); - void key(uint32_t serial, uint32_t time, uint32_t key, uint32_t state); - void modifiers(uint32_t serial, uint32_t mods_depressed, - uint32_t mods_latched, uint32_t mods_locked, uint32_t group); - - void startGrab(QWaylandKeyboardGrabber *grab); - void endGrab(); - QWaylandKeyboardGrabber *currentGrab() const; - - static QWaylandKeyboardPrivate *get(QWaylandKeyboard *keyboard); - -#ifndef QT_NO_WAYLAND_XKB - struct xkb_state *xkbState() const { return m_state; } - uint32_t xkbModsMask() const { return m_modsDepressed | m_modsLatched | m_modsLocked; } -#endif - void keyEvent(uint code, uint32_t state); - void sendKeyEvent(uint code, uint32_t state); - void updateModifierState(uint code, uint32_t state); - void updateKeymap(); - -protected: - void keyboard_bind_resource(Resource *resource); - void keyboard_destroy_resource(Resource *resource); - void keyboard_release(Resource *resource) Q_DECL_OVERRIDE; - -private: - -#ifndef QT_NO_WAYLAND_XKB - void initXKB(); - void createXKBKeymap(); -#endif - - QWaylandInputDevice *m_seat; - - QWaylandKeyboardGrabber* m_grab; - QWaylandSurface *m_focus; - Resource *m_focusResource; - QWaylandDestroyListener m_focusDestroyListener; - - QVector m_keys; - uint32_t m_modsDepressed; - uint32_t m_modsLatched; - uint32_t m_modsLocked; - uint32_t m_group; - - QWaylandKeymap m_keymap; - bool m_pendingKeymap; -#ifndef QT_NO_WAYLAND_XKB - size_t m_keymap_size; - int m_keymap_fd; - char *m_keymap_area; - struct xkb_context *m_context; - struct xkb_state *m_state; -#endif -}; - -QT_END_NAMESPACE - -#endif // QTWAYLAND_QWLKEYBOARD_P_H diff --git a/src/compositor/wayland_wrapper/wayland_wrapper.pri b/src/compositor/wayland_wrapper/wayland_wrapper.pri index 3ffc7148e..6355bbb2c 100644 --- a/src/compositor/wayland_wrapper/wayland_wrapper.pri +++ b/src/compositor/wayland_wrapper/wayland_wrapper.pri @@ -11,7 +11,6 @@ HEADERS += \ wayland_wrapper/qwldatasource_p.h \ wayland_wrapper/qwlinputmethod_p.h \ wayland_wrapper/qwlinputmethodcontext_p.h \ - wayland_wrapper/qwlkeyboard_p.h \ wayland_wrapper/qwlregion_p.h \ wayland_wrapper/qwlsurfacebuffer_p.h \ wayland_wrapper/qwltouch_p.h \ @@ -24,7 +23,6 @@ SOURCES += \ wayland_wrapper/qwldatasource.cpp \ wayland_wrapper/qwlinputmethod.cpp \ wayland_wrapper/qwlinputmethodcontext.cpp \ - wayland_wrapper/qwlkeyboard.cpp \ wayland_wrapper/qwlregion.cpp \ wayland_wrapper/qwlsurfacebuffer.cpp \ wayland_wrapper/qwltouch.cpp \ -- cgit v1.2.3 From b4a796f3c15f4fc47957aa2f3dd2a87c45e151fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Wed, 19 Aug 2015 10:24:14 +0200 Subject: Remove the qt_sub_surface extension Change-Id: I380590722f2c95ff68972f5b3c94a7cc4cfe016f --- src/compositor/wayland_wrapper/qwlsubsurface.cpp | 187 ----------------------- 1 file changed, 187 deletions(-) delete mode 100644 src/compositor/wayland_wrapper/qwlsubsurface.cpp (limited to 'src/compositor/wayland_wrapper') diff --git a/src/compositor/wayland_wrapper/qwlsubsurface.cpp b/src/compositor/wayland_wrapper/qwlsubsurface.cpp deleted file mode 100644 index beffee403..000000000 --- a/src/compositor/wayland_wrapper/qwlsubsurface.cpp +++ /dev/null @@ -1,187 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the QtWaylandCompositor module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPLv3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qwlsubsurface_p.h" - -#include "qwlcompositor_p.h" -#include "qwaylandsurface.h" -#include "qwaylandsurfaceview.h" - -QT_BEGIN_NAMESPACE - -namespace QtWayland { - -SubSurfaceExtensionGlobal::SubSurfaceExtensionGlobal(Compositor *compositor) - : m_compositor(compositor) -{ - wl_global_create(m_compositor->wl_display(), - &qt_sub_surface_extension_interface, - qt_sub_surface_extension_interface.version, - this, - SubSurfaceExtensionGlobal::bind_func); -} - -void SubSurfaceExtensionGlobal::bind_func(wl_client *client, void *data, uint32_t version, uint32_t id) -{ - Q_UNUSED(version); - struct wl_resource *resource = wl_resource_create(client, &qt_sub_surface_extension_interface,version,id); - wl_resource_set_implementation(resource, &sub_surface_extension_interface, data, 0); -} - -void SubSurfaceExtensionGlobal::get_sub_surface_aware_surface(wl_client *client, wl_resource *sub_surface_extension_resource, uint32_t id, wl_resource *surface_resource) -{ - Q_UNUSED(sub_surface_extension_resource); - Surface *surface = Surface::fromResource(surface_resource); - new SubSurface(client,id,surface); -} - -const struct qt_sub_surface_extension_interface SubSurfaceExtensionGlobal::sub_surface_extension_interface = { - SubSurfaceExtensionGlobal::get_sub_surface_aware_surface -}; - -SubSurface::SubSurface(wl_client *client, uint32_t id, Surface *surface) - : m_surface(surface) - , m_parent(0) -{ - surface->setSubSurface(this); - m_sub_surface_resource = wl_resource_create(client, &qt_sub_surface_interface, qt_sub_surface_interface.version, id); - wl_resource_set_implementation(m_sub_surface_resource, &sub_surface_interface, this, 0); -} - -SubSurface::~SubSurface() -{ - if (m_parent) { - m_parent->removeSubSurface(this); - } - QLinkedList::iterator it; - for (it = m_sub_surfaces.begin(); it != m_sub_surfaces.end(); ++it) { - (*it)->handle()->subSurface()->parentDestroyed(); - } -} - -void SubSurface::setSubSurface(SubSurface *subSurface, int x, int y) -{ - if (!m_sub_surfaces.contains(subSurface->m_surface->waylandSurface())) { - m_sub_surfaces.append(subSurface->m_surface->waylandSurface()); - subSurface->setParent(this); - } - foreach (QWaylandSurfaceView *view, subSurface->m_surface->waylandSurface()->views()) - view->setRequestedPosition(QPointF(x,y)); -} - -void SubSurface::removeSubSurface(SubSurface *subSurfaces) -{ - Q_ASSERT(m_sub_surfaces.contains(subSurfaces->m_surface->waylandSurface())); - m_sub_surfaces.removeOne(subSurfaces->m_surface->waylandSurface()); -} - -SubSurface *SubSurface::parent() const -{ - return m_parent; -} - -void SubSurface::setParent(SubSurface *parent) -{ - if (m_parent == parent) - return; - - QWaylandSurface *oldParent = 0; - QWaylandSurface *newParent = 0; - - if (m_parent) { - oldParent = m_parent->m_surface->waylandSurface(); - m_parent->removeSubSurface(this); - } - if (parent) { - newParent = parent->m_surface->waylandSurface(); - } - m_parent = parent; - - m_surface->waylandSurface()->parentChanged(newParent,oldParent); -} - -QLinkedList SubSurface::subSurfaces() const -{ - return m_sub_surfaces; -} - -void SubSurface::parentDestroyed() -{ - m_parent = 0; -} -void SubSurface::attach_sub_surface(wl_client *client, wl_resource *sub_surface_parent_resource, wl_resource *sub_surface_child_resource, int32_t x, int32_t y) -{ - Q_UNUSED(client); - SubSurface *parent_sub_surface = static_cast(sub_surface_parent_resource->data); - SubSurface *child_sub_surface = static_cast(sub_surface_child_resource->data); - parent_sub_surface->setSubSurface(child_sub_surface,x,y); -} - -void SubSurface::move_sub_surface(wl_client *client, wl_resource *sub_surface_parent_resource, wl_resource *sub_surface_child_resource, int32_t x, int32_t y) -{ - Q_UNUSED(client); - Q_UNUSED(x); - Q_UNUSED(y); - SubSurface *parent_sub_surface = static_cast(sub_surface_parent_resource->data); - SubSurface *child_sub_surface = static_cast(sub_surface_child_resource->data); - Q_UNUSED(parent_sub_surface); - Q_UNUSED(child_sub_surface); -} - -void SubSurface::raise(wl_client *client, wl_resource *sub_surface_parent_resource, wl_resource *sub_surface_child_resource) -{ - Q_UNUSED(client); - Q_UNUSED(sub_surface_parent_resource); - Q_UNUSED(sub_surface_child_resource); -} - -void SubSurface::lower(wl_client *client, wl_resource *sub_surface_parent_resource, wl_resource *sub_surface_child_resource) -{ - Q_UNUSED(client); - Q_UNUSED(sub_surface_parent_resource); - Q_UNUSED(sub_surface_child_resource); -} - -const struct qt_sub_surface_interface SubSurface::sub_surface_interface = { - SubSurface::attach_sub_surface, - SubSurface::move_sub_surface, - SubSurface::raise, - SubSurface::lower -}; - -} - -QT_END_NAMESPACE -- cgit v1.2.3 From 9c88f97492959025f7433c9a379b474095efc0dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Wed, 19 Aug 2015 11:22:54 +0200 Subject: Move qwltouch_p.h into qwaylandtouch_p.h Change-Id: Id93b3d70fa97307d905300dc4fc842bcf5ce5f1d --- src/compositor/wayland_wrapper/qwltouch.cpp | 159 --------------------- src/compositor/wayland_wrapper/qwltouch_p.h | 108 -------------- src/compositor/wayland_wrapper/wayland_wrapper.pri | 2 - 3 files changed, 269 deletions(-) delete mode 100644 src/compositor/wayland_wrapper/qwltouch.cpp delete mode 100644 src/compositor/wayland_wrapper/qwltouch_p.h (limited to 'src/compositor/wayland_wrapper') diff --git a/src/compositor/wayland_wrapper/qwltouch.cpp b/src/compositor/wayland_wrapper/qwltouch.cpp deleted file mode 100644 index 226f68b6a..000000000 --- a/src/compositor/wayland_wrapper/qwltouch.cpp +++ /dev/null @@ -1,159 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Copyright (C) 2013 Klarälvdalens Datakonsult AB (KDAB). -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the QtWaylandCompositor module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPLv3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qwltouch_p.h" - -#include -#include "qwaylandview.h" -#include "qwlqttouch_p.h" - -QT_BEGIN_NAMESPACE - -QWaylandTouchPrivate::QWaylandTouchPrivate(QWaylandTouch *touch, QWaylandInputDevice *seat) - : wl_touch() - , m_seat(seat) - , m_focusResource() - , m_defaultGrab() - , m_grab(&m_defaultGrab) -{ - m_grab->touch = touch; -} - -void QWaylandTouchPrivate::startGrab(QWaylandTouchGrabber *grab) -{ - Q_Q(QWaylandTouch); - m_grab = grab; - grab->touch = q; -} - -void QWaylandTouchPrivate::endGrab() -{ - m_grab = &m_defaultGrab; -} - -void QWaylandTouchPrivate::resetFocusState() -{ - m_focusDestroyListener.reset(); - m_focusResource = 0; -} - -void QWaylandTouchPrivate::touch_destroy_resource(Resource *resource) -{ - if (m_focusResource == resource) { - resetFocusState(); - } -} - -void QWaylandTouchPrivate::touch_release(Resource *resource) -{ - wl_resource_destroy(resource->handle); -} - -void QWaylandTouchPrivate::sendCancel() -{ - if (m_focusResource) - send_cancel(m_focusResource->handle); -} - -void QWaylandTouchPrivate::sendFrame() -{ - if (m_focusResource) - send_frame(m_focusResource->handle); -} - -void QWaylandTouchPrivate::sendTouchPoint(int id, const QPointF &point, Qt::TouchPointState state) -{ - switch (state) { - case Qt::TouchPointPressed: - sendDown(id, point); - break; - case Qt::TouchPointMoved: - sendMotion(id, point); - break; - case Qt::TouchPointReleased: - sendUp(id); - break; - case Qt::TouchPointStationary: - // stationary points are not sent through wayland, the client must cache them - break; - default: - break; - } -} - -void QWaylandTouchPrivate::sendDown(int touch_id, const QPointF &position) -{ - m_grab->down(compositor()->currentTimeMsecs(), touch_id, position); -} - -void QWaylandTouchPrivate::sendMotion(int touch_id, const QPointF &position) -{ - m_grab->motion(compositor()->currentTimeMsecs(), touch_id, position); -} - -void QWaylandTouchPrivate::sendUp(int touch_id) -{ - m_grab->up(compositor()->currentTimeMsecs(), touch_id); -} - -void QWaylandTouchPrivate::sendFullTouchEvent(QTouchEvent *event) -{ - if (event->type() == QEvent::TouchCancel) { - sendCancel(); - return; - } - - QtWayland::TouchExtensionGlobal *ext = QtWayland::TouchExtensionGlobal::findIn(compositor()); - if (ext && ext->postTouchEvent(event, m_seat->mouseFocus())) - return; - - const QList points = event->touchPoints(); - if (points.isEmpty()) - return; - - const int pointCount = points.count(); - QPointF pos = m_seat->mouseFocus()->requestedPosition(); - for (int i = 0; i < pointCount; ++i) { - const QTouchEvent::TouchPoint &tp(points.at(i)); - // Convert the local pos in the compositor window to surface-relative. - QPointF p = tp.pos() - pos; - sendTouchPoint(tp.id(), p, tp.state()); - } - sendFrame(); -} - -QT_END_NAMESPACE diff --git a/src/compositor/wayland_wrapper/qwltouch_p.h b/src/compositor/wayland_wrapper/qwltouch_p.h deleted file mode 100644 index c970d1c87..000000000 --- a/src/compositor/wayland_wrapper/qwltouch_p.h +++ /dev/null @@ -1,108 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Copyright (C) 2013 Klarälvdalens Datakonsult AB (KDAB). -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the QtWaylandCompositor module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPLv3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QTWAYLAND_QWLTOUCH_P_H -#define QTWAYLAND_QWLTOUCH_P_H - -#include -#include -#include -#include -#include -#include - -#include -#include - -#include - -QT_BEGIN_NAMESPACE - -class QWaylandView; -class QWaylandCompositor; - -class Q_COMPOSITOR_EXPORT QWaylandTouchPrivate : public QObjectPrivate, public QtWaylandServer::wl_touch -{ - Q_DECLARE_PUBLIC(QWaylandTouch) -public: - explicit QWaylandTouchPrivate(QWaylandTouch *touch, QWaylandInputDevice *seat); - - QWaylandCompositor *compositor() const { return m_seat->compositor(); } - - void startGrab(QWaylandTouchGrabber *grab); - void endGrab(); - - void sendCancel(); - void sendFrame(); - - void sendTouchPoint(int id, const QPointF &point, Qt::TouchPointState state); - void sendDown(int touch_id, const QPointF &position); - void sendMotion(int touch_id, const QPointF &position); - void sendUp(int touch_id); - - void sendFullTouchEvent(QTouchEvent *event); - - Resource *focusResource() const { return m_focusResource; } - - void setFocusResource() - { - if (m_focusResource) - return; - - QWaylandView *mouseFocus = m_seat->mouseFocus(); - if (!mouseFocus || !mouseFocus->surface()) - return; - - m_focusResource = resourceMap().value(mouseFocus->surface()->waylandClient()); - } -private: - void resetFocusState(); - void touch_destroy_resource(Resource *resource) Q_DECL_OVERRIDE; - void touch_release(Resource *resource) Q_DECL_OVERRIDE; - - QWaylandInputDevice *m_seat; - - Resource *m_focusResource; - QWaylandDestroyListener m_focusDestroyListener; - - QWaylandDefaultTouchGrabber m_defaultGrab; - QWaylandTouchGrabber *m_grab; -}; - -QT_END_NAMESPACE - -#endif // QTWAYLAND_QWLTOUCH_P_H diff --git a/src/compositor/wayland_wrapper/wayland_wrapper.pri b/src/compositor/wayland_wrapper/wayland_wrapper.pri index 6355bbb2c..0de06a94a 100644 --- a/src/compositor/wayland_wrapper/wayland_wrapper.pri +++ b/src/compositor/wayland_wrapper/wayland_wrapper.pri @@ -13,7 +13,6 @@ HEADERS += \ wayland_wrapper/qwlinputmethodcontext_p.h \ wayland_wrapper/qwlregion_p.h \ wayland_wrapper/qwlsurfacebuffer_p.h \ - wayland_wrapper/qwltouch_p.h \ ../shared/qwaylandxkb.h \ SOURCES += \ @@ -25,7 +24,6 @@ SOURCES += \ wayland_wrapper/qwlinputmethodcontext.cpp \ wayland_wrapper/qwlregion.cpp \ wayland_wrapper/qwlsurfacebuffer.cpp \ - wayland_wrapper/qwltouch.cpp \ ../shared/qwaylandxkb.cpp \ INCLUDEPATH += wayland_wrapper -- cgit v1.2.3 From 88f821e189bd1d4d4550c1864f622ca7df2a7c34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Thu, 20 Aug 2015 12:26:39 +0200 Subject: Remove automatic initialisation of extensions It is the specific compositor application responsibillity to create the specific extensions. Some of the extensions are picked up with the QWaylandExtension::findIn(QWaylandExtensionContainer *) function to work around missing events/apis. It should be a goal not to have these calles in the base implementation of QWayland[Compositor|Surface|Input..]. Change-Id: Iacd576f2e8a79ca0165b858b1e8f44cddad48d93 --- src/compositor/wayland_wrapper/qwldatadevice.cpp | 1 - src/compositor/wayland_wrapper/qwlinputmethod.cpp | 152 --------------------- src/compositor/wayland_wrapper/qwlinputmethod_p.h | 92 ------------- .../wayland_wrapper/qwlinputmethodcontext.cpp | 135 ------------------ .../wayland_wrapper/qwlinputmethodcontext_p.h | 79 ----------- src/compositor/wayland_wrapper/wayland_wrapper.pri | 6 - 6 files changed, 465 deletions(-) delete mode 100644 src/compositor/wayland_wrapper/qwlinputmethod.cpp delete mode 100644 src/compositor/wayland_wrapper/qwlinputmethod_p.h delete mode 100644 src/compositor/wayland_wrapper/qwlinputmethodcontext.cpp delete mode 100644 src/compositor/wayland_wrapper/qwlinputmethodcontext_p.h (limited to 'src/compositor/wayland_wrapper') diff --git a/src/compositor/wayland_wrapper/qwldatadevice.cpp b/src/compositor/wayland_wrapper/qwldatadevice.cpp index b2eb25684..59f6dabbb 100644 --- a/src/compositor/wayland_wrapper/qwldatadevice.cpp +++ b/src/compositor/wayland_wrapper/qwldatadevice.cpp @@ -39,7 +39,6 @@ #include "qwldatasource_p.h" #include "qwldataoffer_p.h" #include "qwaylandsurface_p.h" -#include "qwltouch_p.h" #include "qwldatadevicemanager_p.h" #include "qwaylanddrag.h" diff --git a/src/compositor/wayland_wrapper/qwlinputmethod.cpp b/src/compositor/wayland_wrapper/qwlinputmethod.cpp deleted file mode 100644 index febb47a1e..000000000 --- a/src/compositor/wayland_wrapper/qwlinputmethod.cpp +++ /dev/null @@ -1,152 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Klarälvdalens Datakonsult AB (KDAB). -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the QtWaylandCompositor module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPLv3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qwlinputmethod_p.h" - -#include -#include -#include -#include "qwlinputmethodcontext_p.h" -#include "qwlinputpanel_p.h" -#include "qwltextinput_p.h" - -QT_BEGIN_NAMESPACE - -namespace QtWayland { - -InputMethod::InputMethod(QWaylandCompositor *compositor, QWaylandInputDevice *seat) - : QtWaylandServer::wl_input_method(compositor->display(), 1) - , m_compositor(compositor) - , m_seat(seat) - , m_resource(0) - , m_textInput() - , m_context() -{ - connect(seat->keyboard(), &QWaylandKeyboard::focusChanged, this, &InputMethod::focusChanged); -} - -InputMethod::~InputMethod() -{ -} - -void InputMethod::activate(TextInput *textInput) -{ - if (!m_resource) { - qDebug("Cannot activate (no input method running)."); - return; - } - - if (m_textInput) { - Q_ASSERT(m_textInput != textInput); - m_textInput->deactivate(this); - } - m_textInput = textInput; - m_context = new InputMethodContext(m_resource->client(), textInput); - - send_activate(m_resource->handle, m_context->resource()->handle); - - QWaylandInputPanelPrivate *panel = QWaylandInputPanelPrivate::findIn(m_compositor); - if (panel) { - panel->setFocus(textInput->focus()); - panel->setCursorRectangle(textInput->cursorRectangle()); - panel->setInputPanelVisible(textInput->inputPanelVisible()); - } -} - -void InputMethod::deactivate() -{ - if (!m_resource) { - qDebug("Cannot deactivate (no input method running)."); - return; - } - - send_deactivate(m_resource->handle, m_context->resource()->handle); - m_textInput = 0; - m_context = 0; - - QWaylandInputPanelPrivate *panel = QWaylandInputPanelPrivate::findIn(m_compositor); - if (panel) { - panel->setFocus(0); - panel->setCursorRectangle(QRect()); - panel->setInputPanelVisible(false); - } -} - -void InputMethod::focusChanged(QWaylandSurface *surface) -{ - if (!m_textInput) - return; - - if (!surface || m_textInput->focus() != surface) { - m_textInput->deactivate(this); - } -} - -bool InputMethod::isBound() const -{ - return m_resource != 0; -} - -InputMethodContext *InputMethod::context() const -{ - return m_context; -} - -TextInput *InputMethod::textInput() const -{ - return m_textInput; -} - -void InputMethod::input_method_bind_resource(Resource *resource) -{ - if (m_resource) { - wl_resource_post_error(resource->handle, WL_DISPLAY_ERROR_INVALID_OBJECT, "interface object already bound"); - wl_resource_destroy(resource->handle); - return; - } - - m_resource = resource; -} - -void InputMethod::input_method_destroy_resource(Resource *resource) -{ - Q_ASSERT(resource == m_resource); - m_resource = 0; -} - -} // namespace QtWayland - -QT_END_NAMESPACE diff --git a/src/compositor/wayland_wrapper/qwlinputmethod_p.h b/src/compositor/wayland_wrapper/qwlinputmethod_p.h deleted file mode 100644 index b49a6668a..000000000 --- a/src/compositor/wayland_wrapper/qwlinputmethod_p.h +++ /dev/null @@ -1,92 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Klarälvdalens Datakonsult AB (KDAB). -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the QtWaylandCompositor module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPLv3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QTWAYLAND_QWLINPUTMETHOD_H -#define QTWAYLAND_QWLINPUTMETHOD_H - -#include - -#include -#include - -#include - -QT_BEGIN_NAMESPACE - -class QWaylandInputDevice; -class QWaylandCompositor; - -namespace QtWayland { - -class InputMethodContext; -class TextInput; - -class InputMethod : public QObject, public QtWaylandServer::wl_input_method -{ - Q_OBJECT - -public: - explicit InputMethod(QWaylandCompositor *compositor, QWaylandInputDevice *seat); - ~InputMethod(); - - void activate(TextInput *textInput); - void deactivate(); - - bool isBound() const; - - InputMethodContext *context() const; - TextInput *textInput() const; - -protected: - void input_method_bind_resource(Resource *resource); - void input_method_destroy_resource(Resource *resource); - -private Q_SLOTS: - void focusChanged(QWaylandSurface *surface); - -private: - QWaylandCompositor *m_compositor; - QWaylandInputDevice *m_seat; - Resource *m_resource; - TextInput *m_textInput; - InputMethodContext *m_context; -}; - -} // namespace QtWayland - -QT_END_NAMESPACE - -#endif // QTWAYLAND_QWLINPUTMETHOD_H diff --git a/src/compositor/wayland_wrapper/qwlinputmethodcontext.cpp b/src/compositor/wayland_wrapper/qwlinputmethodcontext.cpp deleted file mode 100644 index 6421d5e76..000000000 --- a/src/compositor/wayland_wrapper/qwlinputmethodcontext.cpp +++ /dev/null @@ -1,135 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Klarälvdalens Datakonsult AB (KDAB). -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the QtWaylandCompositor module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPLv3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qwlinputmethodcontext_p.h" - -#include "qwltextinput_p.h" - -QT_BEGIN_NAMESPACE - -namespace QtWayland { - -InputMethodContext::InputMethodContext(wl_client *client, TextInput *textInput) - : QtWaylandServer::wl_input_method_context(client, 0, 1) - , m_textInput(textInput) -{ -} - -InputMethodContext::~InputMethodContext() -{ -} - -void InputMethodContext::input_method_context_destroy_resource(Resource *) -{ - delete this; -} - -void InputMethodContext::input_method_context_destroy(Resource *resource) -{ - wl_resource_destroy(resource->handle); -} - -void InputMethodContext::input_method_context_commit_string(Resource *, uint32_t serial, const QString &text) -{ - m_textInput->send_commit_string(serial, text); -} - -void InputMethodContext::input_method_context_cursor_position(Resource *, int32_t index, int32_t anchor) -{ - m_textInput->send_cursor_position(index, anchor); -} - -void InputMethodContext::input_method_context_delete_surrounding_text(Resource *, int32_t index, uint32_t length) -{ - m_textInput->send_delete_surrounding_text(index, length); -} - -void InputMethodContext::input_method_context_language(Resource *, uint32_t serial, const QString &language) -{ - m_textInput->send_language(serial, language); -} - -void InputMethodContext::input_method_context_keysym(Resource *, uint32_t serial, uint32_t time, uint32_t sym, uint32_t state, uint32_t modifiers) -{ - m_textInput->send_keysym(serial, time, sym, state, modifiers); -} - -void InputMethodContext::input_method_context_modifiers_map(Resource *, wl_array *map) -{ - QByteArray modifiersArray(static_cast(map->data), map->size); - m_textInput->send_modifiers_map(modifiersArray); -} - -void InputMethodContext::input_method_context_preedit_cursor(Resource *, int32_t index) -{ - m_textInput->send_preedit_cursor(index); -} - -void InputMethodContext::input_method_context_preedit_string(Resource *, uint32_t serial, const QString &text, const QString &commit) -{ - m_textInput->send_preedit_string(serial, text, commit); -} - -void InputMethodContext::input_method_context_preedit_styling(Resource *, uint32_t index, uint32_t length, uint32_t style) -{ - m_textInput->send_preedit_styling(index, length, style); -} - -void InputMethodContext::input_method_context_grab_keyboard(Resource *, uint32_t keyboard) -{ - Q_UNUSED(keyboard); -} - -void InputMethodContext::input_method_context_key(Resource *, uint32_t serial, uint32_t time, uint32_t key, uint32_t state) -{ - Q_UNUSED(serial); - Q_UNUSED(time); - Q_UNUSED(key); - Q_UNUSED(state); -} - -void InputMethodContext::input_method_context_modifiers(Resource *, uint32_t serial, uint32_t mods_depressed, uint32_t mods_latched, uint32_t mods_locked, uint32_t group) -{ - Q_UNUSED(serial); - Q_UNUSED(mods_depressed); - Q_UNUSED(mods_latched); - Q_UNUSED(mods_locked); - Q_UNUSED(group); -} - -} // namespace QtWayland - -QT_END_NAMESPACE diff --git a/src/compositor/wayland_wrapper/qwlinputmethodcontext_p.h b/src/compositor/wayland_wrapper/qwlinputmethodcontext_p.h deleted file mode 100644 index 8853d40bb..000000000 --- a/src/compositor/wayland_wrapper/qwlinputmethodcontext_p.h +++ /dev/null @@ -1,79 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Klarälvdalens Datakonsult AB (KDAB). -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the QtWaylandCompositor module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPLv3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QTWAYLAND_QWLINPUTMETHODCONTEXT_P_H -#define QTWAYLAND_QWLINPUTMETHODCONTEXT_P_H - -#include - -QT_BEGIN_NAMESPACE - -namespace QtWayland { - -class TextInput; - -class InputMethodContext : public QtWaylandServer::wl_input_method_context -{ -public: - explicit InputMethodContext(struct ::wl_client *client, TextInput *textInput); - ~InputMethodContext(); - -protected: - void input_method_context_destroy_resource(Resource *resource) Q_DECL_OVERRIDE; - void input_method_context_destroy(Resource *resource) Q_DECL_OVERRIDE; - - void input_method_context_commit_string(Resource *resource, uint32_t serial, const QString &text) Q_DECL_OVERRIDE; - void input_method_context_cursor_position(Resource *resource, int32_t index, int32_t anchor) Q_DECL_OVERRIDE; - void input_method_context_delete_surrounding_text(Resource *resource, int32_t index, uint32_t length) Q_DECL_OVERRIDE; - void input_method_context_language(Resource *resource, uint32_t serial, const QString &language) Q_DECL_OVERRIDE; - void input_method_context_keysym(Resource *resource, uint32_t serial, uint32_t time, uint32_t sym, uint32_t state, uint32_t modifiers) Q_DECL_OVERRIDE; - void input_method_context_modifiers_map(Resource *resource, wl_array *map) Q_DECL_OVERRIDE; - void input_method_context_preedit_cursor(Resource *resource, int32_t index) Q_DECL_OVERRIDE; - void input_method_context_preedit_string(Resource *resource, uint32_t serial, const QString &text, const QString &commit) Q_DECL_OVERRIDE; - void input_method_context_preedit_styling(Resource *resource, uint32_t index, uint32_t length, uint32_t style) Q_DECL_OVERRIDE; - void input_method_context_grab_keyboard(Resource *resource, uint32_t keyboard) Q_DECL_OVERRIDE; - void input_method_context_key(Resource *resource, uint32_t serial, uint32_t time, uint32_t key, uint32_t state) Q_DECL_OVERRIDE; - void input_method_context_modifiers(Resource *resource, uint32_t serial, uint32_t mods_depressed, uint32_t mods_latched, uint32_t mods_locked, uint32_t group) Q_DECL_OVERRIDE; - -private: - TextInput *m_textInput; -}; - -} // namespace QtWayland - -QT_END_NAMESPACE - -#endif // QTWAYLAND_QWLINPUTMETHODCONTEXT_P_H diff --git a/src/compositor/wayland_wrapper/wayland_wrapper.pri b/src/compositor/wayland_wrapper/wayland_wrapper.pri index 0de06a94a..91ccbe1f8 100644 --- a/src/compositor/wayland_wrapper/wayland_wrapper.pri +++ b/src/compositor/wayland_wrapper/wayland_wrapper.pri @@ -1,16 +1,12 @@ CONFIG += wayland-scanner WAYLANDSERVERSOURCES += \ ../3rdparty/protocol/wayland.xml \ - ../3rdparty/protocol/input-method.xml \ - ../3rdparty/protocol/text.xml HEADERS += \ wayland_wrapper/qwldatadevice_p.h \ wayland_wrapper/qwldatadevicemanager_p.h \ wayland_wrapper/qwldataoffer_p.h \ wayland_wrapper/qwldatasource_p.h \ - wayland_wrapper/qwlinputmethod_p.h \ - wayland_wrapper/qwlinputmethodcontext_p.h \ wayland_wrapper/qwlregion_p.h \ wayland_wrapper/qwlsurfacebuffer_p.h \ ../shared/qwaylandxkb.h \ @@ -20,8 +16,6 @@ SOURCES += \ wayland_wrapper/qwldatadevicemanager.cpp \ wayland_wrapper/qwldataoffer.cpp \ wayland_wrapper/qwldatasource.cpp \ - wayland_wrapper/qwlinputmethod.cpp \ - wayland_wrapper/qwlinputmethodcontext.cpp \ wayland_wrapper/qwlregion.cpp \ wayland_wrapper/qwlsurfacebuffer.cpp \ ../shared/qwaylandxkb.cpp \ -- cgit v1.2.3 From 00fba62ce3e5bd00ba5e8ab6f5b7a71bdb93c6a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Mon, 7 Sep 2015 14:04:17 +0200 Subject: Rename QtCompositor to QtWaylandCompositor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit enable building QtWaylandCompositor by default Change-Id: I7cf34052b304ca9fef55b7e30ef6a6367b5d75f1 Reviewed-by: Jørgen Lind --- src/compositor/wayland_wrapper/qwldatadevice.cpp | 8 ++++---- src/compositor/wayland_wrapper/qwldatadevice_p.h | 8 ++++---- src/compositor/wayland_wrapper/qwldatadevicemanager.cpp | 6 +++--- src/compositor/wayland_wrapper/qwldatadevicemanager_p.h | 4 ++-- src/compositor/wayland_wrapper/qwldataoffer_p.h | 2 +- src/compositor/wayland_wrapper/qwldatasource.cpp | 2 +- src/compositor/wayland_wrapper/qwldatasource_p.h | 2 +- src/compositor/wayland_wrapper/qwlregion_p.h | 4 ++-- src/compositor/wayland_wrapper/qwlsurfacebuffer.cpp | 2 +- src/compositor/wayland_wrapper/qwlsurfacebuffer_p.h | 2 +- 10 files changed, 20 insertions(+), 20 deletions(-) (limited to 'src/compositor/wayland_wrapper') diff --git a/src/compositor/wayland_wrapper/qwldatadevice.cpp b/src/compositor/wayland_wrapper/qwldatadevice.cpp index 59f6dabbb..4c32538e6 100644 --- a/src/compositor/wayland_wrapper/qwldatadevice.cpp +++ b/src/compositor/wayland_wrapper/qwldatadevice.cpp @@ -43,10 +43,10 @@ #include "qwaylanddrag.h" #include "qwaylandview.h" -#include -#include -#include -#include +#include +#include +#include +#include #include #include diff --git a/src/compositor/wayland_wrapper/qwldatadevice_p.h b/src/compositor/wayland_wrapper/qwldatadevice_p.h index dc8c3be20..11946df59 100644 --- a/src/compositor/wayland_wrapper/qwldatadevice_p.h +++ b/src/compositor/wayland_wrapper/qwldatadevice_p.h @@ -37,10 +37,10 @@ #ifndef WLDATADEVICE_H #define WLDATADEVICE_H -#include -#include -#include -#include +#include +#include +#include +#include QT_BEGIN_NAMESPACE diff --git a/src/compositor/wayland_wrapper/qwldatadevicemanager.cpp b/src/compositor/wayland_wrapper/qwldatadevicemanager.cpp index 56c7f8026..3aa55ce18 100644 --- a/src/compositor/wayland_wrapper/qwldatadevicemanager.cpp +++ b/src/compositor/wayland_wrapper/qwldatadevicemanager.cpp @@ -36,10 +36,10 @@ #include "qwldatadevicemanager_p.h" -#include +#include -#include -#include +#include +#include #include "qwldatadevice_p.h" #include "qwldatasource_p.h" #include "qwldataoffer_p.h" diff --git a/src/compositor/wayland_wrapper/qwldatadevicemanager_p.h b/src/compositor/wayland_wrapper/qwldatadevicemanager_p.h index 3bc50f64e..e0109b28b 100644 --- a/src/compositor/wayland_wrapper/qwldatadevicemanager_p.h +++ b/src/compositor/wayland_wrapper/qwldatadevicemanager_p.h @@ -42,9 +42,9 @@ #include #include -#include +#include -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/compositor/wayland_wrapper/qwldataoffer_p.h b/src/compositor/wayland_wrapper/qwldataoffer_p.h index 58400075e..a7d17c82e 100644 --- a/src/compositor/wayland_wrapper/qwldataoffer_p.h +++ b/src/compositor/wayland_wrapper/qwldataoffer_p.h @@ -38,7 +38,7 @@ #define WLDATAOFFER_H #include -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/compositor/wayland_wrapper/qwldatasource.cpp b/src/compositor/wayland_wrapper/qwldatasource.cpp index 641b63b0d..aa2af1604 100644 --- a/src/compositor/wayland_wrapper/qwldatasource.cpp +++ b/src/compositor/wayland_wrapper/qwldatasource.cpp @@ -40,7 +40,7 @@ #include "qwldatadevicemanager_p.h" #include -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/compositor/wayland_wrapper/qwldatasource_p.h b/src/compositor/wayland_wrapper/qwldatasource_p.h index c183f0fe9..4df13a2b2 100644 --- a/src/compositor/wayland_wrapper/qwldatasource_p.h +++ b/src/compositor/wayland_wrapper/qwldatasource_p.h @@ -37,7 +37,7 @@ #ifndef WLDATASOURCE_H #define WLDATASOURCE_H -#include +#include #include #include diff --git a/src/compositor/wayland_wrapper/qwlregion_p.h b/src/compositor/wayland_wrapper/qwlregion_p.h index 2ea0f8f15..8867f2ffe 100644 --- a/src/compositor/wayland_wrapper/qwlregion_p.h +++ b/src/compositor/wayland_wrapper/qwlregion_p.h @@ -37,12 +37,12 @@ #ifndef WL_REGION_H #define WL_REGION_H -#include +#include #include #include -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/compositor/wayland_wrapper/qwlsurfacebuffer.cpp b/src/compositor/wayland_wrapper/qwlsurfacebuffer.cpp index d65cbc567..dadc53b99 100644 --- a/src/compositor/wayland_wrapper/qwlsurfacebuffer.cpp +++ b/src/compositor/wayland_wrapper/qwlsurfacebuffer.cpp @@ -46,7 +46,7 @@ #include #include "qwaylandshmformathelper.h" -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/compositor/wayland_wrapper/qwlsurfacebuffer_p.h b/src/compositor/wayland_wrapper/qwlsurfacebuffer_p.h index ce2c2686d..5a0185638 100644 --- a/src/compositor/wayland_wrapper/qwlsurfacebuffer_p.h +++ b/src/compositor/wayland_wrapper/qwlsurfacebuffer_p.h @@ -42,7 +42,7 @@ #include #include -#include +#include #include -- cgit v1.2.3 From f5f06c709937b657c66ca4e35f4e3065ba390153 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Mon, 14 Sep 2015 12:35:52 +0200 Subject: Remove global coordinates This involves removing: - pickView and mapView from QWaylandOutput - requestedPos[X,Y] from QWaylandView Change-Id: Ie53eef434ac6ae7d0d5474f649f78a59ae857167 Reviewed-by: Paul Olav Tvete --- src/compositor/wayland_wrapper/qwldatadevice.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'src/compositor/wayland_wrapper') diff --git a/src/compositor/wayland_wrapper/qwldatadevice.cpp b/src/compositor/wayland_wrapper/qwldatadevice.cpp index 4c32538e6..85895ae9c 100644 --- a/src/compositor/wayland_wrapper/qwldatadevice.cpp +++ b/src/compositor/wayland_wrapper/qwldatadevice.cpp @@ -145,13 +145,16 @@ void DataDevice::focus() void DataDevice::motion(uint32_t time) { Q_EMIT m_inputDevice->drag()->positionChanged(); - m_dragIconPosition = pointer->currentSpacePosition(); - - if (m_dragFocusResource && m_dragFocus) { - const QPointF &surfacePoint = outputSpace()->mapToView(m_dragFocus, pointer->currentSpacePosition()); - send_motion(m_dragFocusResource->handle, time, - wl_fixed_from_double(surfacePoint.x()), wl_fixed_from_double(surfacePoint.y())); - } + Q_UNUSED(time); +// This abstraction is wrong. +// We might intersept hover events or something, but forget about global coordinates mapping to local coordinates +// m_dragIconPosition = pointer->currentSpacePosition(); + +// if (m_dragFocusResource && m_dragFocus) { +// const QPointF &surfacePoint = outputSpace()->mapToView(m_dragFocus, pointer->currentSpacePosition()); +// send_motion(m_dragFocusResource->handle, time, +// wl_fixed_from_double(surfacePoint.x()), wl_fixed_from_double(surfacePoint.y())); +// } } void DataDevice::button(uint32_t time, Qt::MouseButton button, uint32_t state) -- cgit v1.2.3 From 0345bba55ab67249fd3cda721de12b5fa1d95c36 Mon Sep 17 00:00:00 2001 From: Paul Olav Tvete Date: Tue, 15 Sep 2015 14:39:39 +0200 Subject: Remove the mouse grabber MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is no longer used for move/resize, and we are going to introduce a new concept for drag and drop (which stopped working several changes ago anyway). The old drag and drop code is left commented out to assist in the new implementation. Change-Id: I18cb41d04f09d6033d1c9e666a739793fcef494b Reviewed-by: Jørgen Lind --- src/compositor/wayland_wrapper/qwldatadevice.cpp | 123 ++++++++++++----------- src/compositor/wayland_wrapper/qwldatadevice_p.h | 6 +- 2 files changed, 64 insertions(+), 65 deletions(-) (limited to 'src/compositor/wayland_wrapper') diff --git a/src/compositor/wayland_wrapper/qwldatadevice.cpp b/src/compositor/wayland_wrapper/qwldatadevice.cpp index 85895ae9c..eec142a85 100644 --- a/src/compositor/wayland_wrapper/qwldatadevice.cpp +++ b/src/compositor/wayland_wrapper/qwldatadevice.cpp @@ -134,69 +134,72 @@ void DataDevice::sourceDestroyed(DataSource *source) m_selectionSource = 0; } -void DataDevice::focus() -{ - QWaylandView *focus = pointer->mouseFocus(); - if (focus != m_dragFocus) { - setDragFocus(focus, pointer->currentLocalPosition()); - } -} - -void DataDevice::motion(uint32_t time) -{ - Q_EMIT m_inputDevice->drag()->positionChanged(); - Q_UNUSED(time); -// This abstraction is wrong. -// We might intersept hover events or something, but forget about global coordinates mapping to local coordinates -// m_dragIconPosition = pointer->currentSpacePosition(); - -// if (m_dragFocusResource && m_dragFocus) { -// const QPointF &surfacePoint = outputSpace()->mapToView(m_dragFocus, pointer->currentSpacePosition()); -// send_motion(m_dragFocusResource->handle, time, -// wl_fixed_from_double(surfacePoint.x()), wl_fixed_from_double(surfacePoint.y())); -// } -} - -void DataDevice::button(uint32_t time, Qt::MouseButton button, uint32_t state) -{ - Q_UNUSED(time); - - if (m_dragFocusResource && - pointer->grabButton() == button && - state == QWaylandPointerPrivate::button_state_released) - send_drop(m_dragFocusResource->handle); - - if (!pointer->isButtonPressed() && - state == QWaylandPointerPrivate::button_state_released) { - - if (m_dragIcon) { - m_dragIcon = 0; - m_dragIconPosition = QPointF(); - Q_EMIT m_inputDevice->drag()->positionChanged(); - Q_EMIT m_inputDevice->drag()->iconChanged(); - } - - setDragFocus(0, QPointF()); - pointer->endGrab(); - } -} +// void DataDevice::focus() +// { +// QWaylandView *focus = pointer->mouseFocus(); +// if (focus != m_dragFocus) { +// setDragFocus(focus, pointer->currentLocalPosition()); +// } +// } + +// void DataDevice::motion(uint32_t time) +// { +// Q_EMIT m_inputDevice->drag()->positionChanged(); +// Q_UNUSED(time); +// // This abstraction is wrong. +// // We might intersept hover events or something, but forget about global coordinates mapping to local coordinates +// // m_dragIconPosition = pointer->currentSpacePosition(); + +// // if (m_dragFocusResource && m_dragFocus) { +// // const QPointF &surfacePoint = outputSpace()->mapToView(m_dragFocus, pointer->currentSpacePosition()); +// // send_motion(m_dragFocusResource->handle, time, +// // wl_fixed_from_double(surfacePoint.x()), wl_fixed_from_double(surfacePoint.y())); +// // } +// } + +// void DataDevice::button(uint32_t time, Qt::MouseButton button, uint32_t state) +// { +// Q_UNUSED(time); + +// if (m_dragFocusResource && +// pointer->grabButton() == button && +// state == QWaylandPointerPrivate::button_state_released) +// send_drop(m_dragFocusResource->handle); + +// if (!pointer->isButtonPressed() && +// state == QWaylandPointerPrivate::button_state_released) { + +// if (m_dragIcon) { +// m_dragIcon = 0; +// m_dragIconPosition = QPointF(); +// Q_EMIT m_inputDevice->drag()->positionChanged(); +// Q_EMIT m_inputDevice->drag()->iconChanged(); +// } + +// setDragFocus(0, QPointF()); +// pointer->endGrab(); +// } +// } void DataDevice::data_device_start_drag(Resource *resource, struct ::wl_resource *source, struct ::wl_resource *origin, struct ::wl_resource *icon, uint32_t serial) { - if (m_inputDevice->pointer()->grabSerial() == serial) { - if (!m_inputDevice->pointer()->isButtonPressed() || - m_inputDevice->mouseFocus()->surfaceResource() != origin) - return; - - m_dragClient = resource->client(); - m_dragDataSource = source != 0 ? DataSource::fromResource(source) : 0; - m_dragIcon = icon != 0 ? QWaylandSurface::fromResource(icon) : 0; - m_dragIconPosition = QPointF(); - Q_EMIT m_inputDevice->drag()->positionChanged(); - Q_EMIT m_inputDevice->drag()->iconChanged(); - - m_inputDevice->pointer()->startGrab(this); - } + + qDebug() << "data_device_start_drag"; + + // if (m_inputDevice->pointer()->grabSerial() == serial) { + // if (!m_inputDevice->pointer()->isButtonPressed() || + // m_inputDevice->mouseFocus()->surfaceResource() != origin) + // return; + + // m_dragClient = resource->client(); + // m_dragDataSource = source != 0 ? DataSource::fromResource(source) : 0; + // m_dragIcon = icon != 0 ? QWaylandSurface::fromResource(icon) : 0; + // m_dragIconPosition = QPointF(); + // Q_EMIT m_inputDevice->drag()->positionChanged(); + // Q_EMIT m_inputDevice->drag()->iconChanged(); + + // m_inputDevice->pointer()->startGrab(this); + // } } void DataDevice::data_device_set_selection(Resource *, struct ::wl_resource *source, uint32_t serial) diff --git a/src/compositor/wayland_wrapper/qwldatadevice_p.h b/src/compositor/wayland_wrapper/qwldatadevice_p.h index 11946df59..e440b7d86 100644 --- a/src/compositor/wayland_wrapper/qwldatadevice_p.h +++ b/src/compositor/wayland_wrapper/qwldatadevice_p.h @@ -38,7 +38,6 @@ #define WLDATADEVICE_H #include -#include #include #include @@ -53,7 +52,7 @@ class DataSource; class InputDevice; class Surface; -class DataDevice : public QtWaylandServer::wl_data_device, public QWaylandPointerGrabber +class DataDevice : public QtWaylandServer::wl_data_device { public: DataDevice(QWaylandInputDevice *inputDevice); @@ -67,9 +66,6 @@ public: void sourceDestroyed(DataSource *source); - void focus() Q_DECL_OVERRIDE; - void motion(uint32_t time) Q_DECL_OVERRIDE; - void button(uint32_t time, Qt::MouseButton button, uint32_t state) Q_DECL_OVERRIDE; protected: void data_device_start_drag(Resource *resource, struct ::wl_resource *source, struct ::wl_resource *origin, struct ::wl_resource *icon, uint32_t serial) Q_DECL_OVERRIDE; void data_device_set_selection(Resource *resource, struct ::wl_resource *source, uint32_t serial) Q_DECL_OVERRIDE; -- cgit v1.2.3 From 0bfb35367d3eec75b4d67152b68a7f9f45cc9854 Mon Sep 17 00:00:00 2001 From: Paul Olav Tvete Date: Wed, 16 Sep 2015 14:02:47 +0200 Subject: Return empty size when nil buffer is attached MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I74d46c9d2639315341a1e101e304cdffd748976c Reviewed-by: Jørgen Lind --- src/compositor/wayland_wrapper/qwlsurfacebuffer.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/compositor/wayland_wrapper') diff --git a/src/compositor/wayland_wrapper/qwlsurfacebuffer.cpp b/src/compositor/wayland_wrapper/qwlsurfacebuffer.cpp index dadc53b99..ae0451592 100644 --- a/src/compositor/wayland_wrapper/qwlsurfacebuffer.cpp +++ b/src/compositor/wayland_wrapper/qwlsurfacebuffer.cpp @@ -155,6 +155,9 @@ void SurfaceBuffer::destroyIfUnused() QSize SurfaceBuffer::size() const { + if (!m_buffer) + return QSize(); + if (wl_shm_buffer *shmBuffer = wl_shm_buffer_get(m_buffer)) { int width = wl_shm_buffer_get_width(shmBuffer); int height = wl_shm_buffer_get_height(shmBuffer); -- cgit v1.2.3 From dca52a541eaf61269c8e746555380a7aef942b1e Mon Sep 17 00:00:00 2001 From: Paul Olav Tvete Date: Wed, 16 Sep 2015 12:37:04 +0200 Subject: New API for drag and drop MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Let the compositor implementation keep all the GUI state. Change-Id: I73a865fa3407340276d6765e10378b8e23a76fe2 Reviewed-by: Jørgen Lind --- src/compositor/wayland_wrapper/qwldatadevice.cpp | 102 +++++++---------------- src/compositor/wayland_wrapper/qwldatadevice_p.h | 12 +-- 2 files changed, 37 insertions(+), 77 deletions(-) (limited to 'src/compositor/wayland_wrapper') diff --git a/src/compositor/wayland_wrapper/qwldatadevice.cpp b/src/compositor/wayland_wrapper/qwldatadevice.cpp index eec142a85..56f24db95 100644 --- a/src/compositor/wayland_wrapper/qwldatadevice.cpp +++ b/src/compositor/wayland_wrapper/qwldatadevice.cpp @@ -84,7 +84,7 @@ void DataDevice::setFocus(QWaylandClient *focusClient) } } -void DataDevice::setDragFocus(QWaylandView *focus, const QPointF &localPosition) +void DataDevice::setDragFocus(QWaylandSurface *focus, const QPointF &localPosition) { if (m_dragFocusResource) { send_leave(m_dragFocusResource->handle); @@ -95,10 +95,10 @@ void DataDevice::setDragFocus(QWaylandView *focus, const QPointF &localPosition) if (!focus) return; - if (!m_dragDataSource && m_dragClient != focus->surface()->waylandClient()) + if (!m_dragDataSource && m_dragClient != focus->waylandClient()) return; - Resource *resource = resourceMap().value(focus->surface()->waylandClient()); + Resource *resource = resourceMap().value(focus->waylandClient()); if (!resource) return; @@ -110,7 +110,7 @@ void DataDevice::setDragFocus(QWaylandView *focus, const QPointF &localPosition) if (m_dragDataSource && !offer) return; - send_enter(resource->handle, serial, focus->surface()->resource(), + send_enter(resource->handle, serial, focus->resource(), wl_fixed_from_double(localPosition.x()), wl_fixed_from_double(localPosition.y()), offer->resource()->handle); @@ -123,83 +123,43 @@ QWaylandSurface *DataDevice::dragIcon() const return m_dragIcon; } -QPointF DataDevice::dragIconPosition() const -{ - return m_dragIconPosition; -} - void DataDevice::sourceDestroyed(DataSource *source) { if (m_selectionSource == source) m_selectionSource = 0; } -// void DataDevice::focus() -// { -// QWaylandView *focus = pointer->mouseFocus(); -// if (focus != m_dragFocus) { -// setDragFocus(focus, pointer->currentLocalPosition()); -// } -// } - -// void DataDevice::motion(uint32_t time) -// { -// Q_EMIT m_inputDevice->drag()->positionChanged(); -// Q_UNUSED(time); -// // This abstraction is wrong. -// // We might intersept hover events or something, but forget about global coordinates mapping to local coordinates -// // m_dragIconPosition = pointer->currentSpacePosition(); - -// // if (m_dragFocusResource && m_dragFocus) { -// // const QPointF &surfacePoint = outputSpace()->mapToView(m_dragFocus, pointer->currentSpacePosition()); -// // send_motion(m_dragFocusResource->handle, time, -// // wl_fixed_from_double(surfacePoint.x()), wl_fixed_from_double(surfacePoint.y())); -// // } -// } - -// void DataDevice::button(uint32_t time, Qt::MouseButton button, uint32_t state) -// { -// Q_UNUSED(time); - -// if (m_dragFocusResource && -// pointer->grabButton() == button && -// state == QWaylandPointerPrivate::button_state_released) -// send_drop(m_dragFocusResource->handle); - -// if (!pointer->isButtonPressed() && -// state == QWaylandPointerPrivate::button_state_released) { - -// if (m_dragIcon) { -// m_dragIcon = 0; -// m_dragIconPosition = QPointF(); -// Q_EMIT m_inputDevice->drag()->positionChanged(); -// Q_EMIT m_inputDevice->drag()->iconChanged(); -// } - -// setDragFocus(0, QPointF()); -// pointer->endGrab(); -// } -// } +void DataDevice::dragMove(QWaylandSurface *target, const QPointF &pos) +{ + if (target != m_dragFocus) + setDragFocus(target, pos); + if (!target) + return; + uint time = m_compositor->currentTimeMsecs(); //### should be serial + send_motion(m_dragFocusResource->handle, time, + wl_fixed_from_double(pos.x()), wl_fixed_from_double(pos.y())); +} -void DataDevice::data_device_start_drag(Resource *resource, struct ::wl_resource *source, struct ::wl_resource *origin, struct ::wl_resource *icon, uint32_t serial) +void DataDevice::drop() { + if (m_dragFocusResource) + send_drop(m_dragFocusResource->handle); +} - qDebug() << "data_device_start_drag"; +void DataDevice::cancelDrag() +{ +} - // if (m_inputDevice->pointer()->grabSerial() == serial) { - // if (!m_inputDevice->pointer()->isButtonPressed() || - // m_inputDevice->mouseFocus()->surfaceResource() != origin) - // return; - - // m_dragClient = resource->client(); - // m_dragDataSource = source != 0 ? DataSource::fromResource(source) : 0; - // m_dragIcon = icon != 0 ? QWaylandSurface::fromResource(icon) : 0; - // m_dragIconPosition = QPointF(); - // Q_EMIT m_inputDevice->drag()->positionChanged(); - // Q_EMIT m_inputDevice->drag()->iconChanged(); - - // m_inputDevice->pointer()->startGrab(this); - // } +void DataDevice::data_device_start_drag(Resource *resource, struct ::wl_resource *source, struct ::wl_resource *origin, struct ::wl_resource *icon, uint32_t serial) +{ + m_dragClient = resource->client(); + m_dragDataSource = source ? DataSource::fromResource(source) : 0; + m_dragIcon = icon ? QWaylandSurface::fromResource(icon) : 0; + Q_EMIT m_inputDevice->drag()->iconChanged(); + Q_EMIT m_inputDevice->drag()->dragStarted(); + + Q_UNUSED(serial); + //### need to verify that we have an implicit grab with this serial } void DataDevice::data_device_set_selection(Resource *, struct ::wl_resource *source, uint32_t serial) diff --git a/src/compositor/wayland_wrapper/qwldatadevice_p.h b/src/compositor/wayland_wrapper/qwldatadevice_p.h index e440b7d86..49e4da702 100644 --- a/src/compositor/wayland_wrapper/qwldatadevice_p.h +++ b/src/compositor/wayland_wrapper/qwldatadevice_p.h @@ -43,8 +43,6 @@ QT_BEGIN_NAMESPACE -class QWaylandView; - namespace QtWayland { class Compositor; @@ -59,13 +57,16 @@ public: void setFocus(QWaylandClient *client); - void setDragFocus(QWaylandView *focus, const QPointF &localPosition); + void setDragFocus(QWaylandSurface *focus, const QPointF &localPosition); QWaylandSurface *dragIcon() const; - QPointF dragIconPosition() const; void sourceDestroyed(DataSource *source); + void dragMove(QWaylandSurface *target, const QPointF &pos); + void drop(); + void cancelDrag(); + protected: void data_device_start_drag(Resource *resource, struct ::wl_resource *source, struct ::wl_resource *origin, struct ::wl_resource *icon, uint32_t serial) Q_DECL_OVERRIDE; void data_device_set_selection(Resource *resource, struct ::wl_resource *source, uint32_t serial) Q_DECL_OVERRIDE; @@ -80,11 +81,10 @@ private: struct ::wl_client *m_dragClient; DataSource *m_dragDataSource; - QWaylandView *m_dragFocus; + QWaylandSurface *m_dragFocus; Resource *m_dragFocusResource; QWaylandSurface *m_dragIcon; - QPointF m_dragIconPosition; }; } -- cgit v1.2.3 From 07dffc46ff14a745df020a987c2a17fbfd90d6fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Wed, 16 Sep 2015 15:05:00 +0200 Subject: Remove the QWaylandOutputSpace We don't need this abstraction anymore since we don't have global coordinates in the core api anymore Change-Id: I553a736a0e71026447d6a0af3f8a64607b8c8f06 Reviewed-by: Paul Olav Tvete --- src/compositor/wayland_wrapper/qwldatadevice_p.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/compositor/wayland_wrapper') diff --git a/src/compositor/wayland_wrapper/qwldatadevice_p.h b/src/compositor/wayland_wrapper/qwldatadevice_p.h index 49e4da702..ff553de9a 100644 --- a/src/compositor/wayland_wrapper/qwldatadevice_p.h +++ b/src/compositor/wayland_wrapper/qwldatadevice_p.h @@ -39,7 +39,6 @@ #include #include -#include QT_BEGIN_NAMESPACE @@ -72,7 +71,6 @@ protected: void data_device_set_selection(Resource *resource, struct ::wl_resource *source, uint32_t serial) Q_DECL_OVERRIDE; private: - QWaylandOutputSpace *outputSpace() const { return m_inputDevice->outputSpace(); } QWaylandCompositor *m_compositor; QWaylandInputDevice *m_inputDevice; -- cgit v1.2.3 From 44b920f53b417d7792121e390e40fe89f37199bc Mon Sep 17 00:00:00 2001 From: Paul Olav Tvete Date: Tue, 6 Oct 2015 15:35:10 +0200 Subject: A surface buffer has content iff it has a buffer Change-Id: I357097740a50b677b85e1708ec440da03573d2d2 Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/compositor/wayland_wrapper/qwlsurfacebuffer_p.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/compositor/wayland_wrapper') diff --git a/src/compositor/wayland_wrapper/qwlsurfacebuffer_p.h b/src/compositor/wayland_wrapper/qwlsurfacebuffer_p.h index 5a0185638..2992a766c 100644 --- a/src/compositor/wayland_wrapper/qwlsurfacebuffer_p.h +++ b/src/compositor/wayland_wrapper/qwlsurfacebuffer_p.h @@ -94,7 +94,7 @@ public: QImage image() const; void bindToTexture() const; - static bool hasContent(SurfaceBuffer *buffer) { return buffer && buffer->isRegisteredWithBuffer(); } + static bool hasContent(SurfaceBuffer *buffer) { return buffer && buffer->waylandBufferHandle(); } private: void ref(); void deref(); -- cgit v1.2.3 From 62ecae0238cabec6122cddbec72316b50ad6e1f7 Mon Sep 17 00:00:00 2001 From: Paul Olav Tvete Date: Wed, 14 Oct 2015 13:44:03 +0200 Subject: Add warning to private headers We mean it. Change-Id: I7381c7aad198dcca485d488571fd12296d07f980 Reviewed-by: Friedemann Kleint --- src/compositor/wayland_wrapper/qwlregion_p.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/compositor/wayland_wrapper') diff --git a/src/compositor/wayland_wrapper/qwlregion_p.h b/src/compositor/wayland_wrapper/qwlregion_p.h index 8867f2ffe..bc15378e3 100644 --- a/src/compositor/wayland_wrapper/qwlregion_p.h +++ b/src/compositor/wayland_wrapper/qwlregion_p.h @@ -37,6 +37,17 @@ #ifndef WL_REGION_H #define WL_REGION_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include #include -- cgit v1.2.3