|
|
|
|
@ -21,6 +21,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
|
|
|
#include "scene_qpainter_virtual_backend.h" |
|
|
|
|
#include "screens_virtual.h" |
|
|
|
|
#include "wayland_server.h" |
|
|
|
|
// Qt
|
|
|
|
|
#include <QTemporaryDir> |
|
|
|
|
// KWayland
|
|
|
|
|
#include <KWayland/Server/seat_interface.h> |
|
|
|
|
|
|
|
|
|
@ -30,6 +32,15 @@ namespace KWin |
|
|
|
|
VirtualBackend::VirtualBackend(QObject *parent) |
|
|
|
|
: AbstractBackend(parent) |
|
|
|
|
{ |
|
|
|
|
if (qEnvironmentVariableIsSet("KWIN_WAYLAND_VIRTUAL_SCREENSHOTS")) { |
|
|
|
|
m_screenshotDir.reset(new QTemporaryDir); |
|
|
|
|
if (!m_screenshotDir->isValid()) { |
|
|
|
|
m_screenshotDir.reset(); |
|
|
|
|
} |
|
|
|
|
if (!m_screenshotDir.isNull()) { |
|
|
|
|
qDebug() << "Screenshots saved to: " << m_screenshotDir->path(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
setSoftWareCursor(true); |
|
|
|
|
setSupportsPointerWarping(true); |
|
|
|
|
// currently only QPainter - enforce it
|
|
|
|
|
@ -48,6 +59,14 @@ void VirtualBackend::init() |
|
|
|
|
emit screensQueried(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
QString VirtualBackend::screenshotDirPath() const |
|
|
|
|
{ |
|
|
|
|
if (m_screenshotDir.isNull()) { |
|
|
|
|
return QString(); |
|
|
|
|
} |
|
|
|
|
return m_screenshotDir->path(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Screens *VirtualBackend::createScreens(QObject *parent) |
|
|
|
|
{ |
|
|
|
|
return new VirtualScreens(this, parent); |
|
|
|
|
|