Commit d3580183 authored by Jakub Stachowski's avatar Jakub Stachowski

Use grabWindow to obtain screenshot of embedded rdesktop window

BUG:205992


svn path=/trunk/KDE/kdenetwork/krdc/; revision=1171604
parent 8f4908fa
......@@ -157,6 +157,11 @@ void RemoteView::setGrabAllKeys(bool grabAllKeys)
}
}
QPixmap RemoteView::takeScreenshot()
{
return QPixmap::grabWidget(this);
}
void RemoteView::showDotCursor(DotCursorState state)
{
m_dotCursorState = state;
......
......@@ -244,6 +244,11 @@ public:
*/
virtual void updateConfiguration();
/**
* @return screenshot of the view
*/
virtual QPixmap takeScreenshot();
#ifndef QTONLY
/**
* Returns the current host preferences of this view.
......
......@@ -461,7 +461,7 @@ void MainWindow::statusChanged(RemoteView::RemoteStatus status)
void MainWindow::takeScreenshot()
{
const QPixmap snapshot = QPixmap::grabWidget(m_remoteViewList.at(m_currentRemoteView));
const QPixmap snapshot = m_remoteViewList.at(m_currentRemoteView)->takeScreenshot();
QApplication::clipboard()->setPixmap(snapshot);
}
......
......@@ -232,6 +232,11 @@ void RdpView::connectionOpened()
setFocus();
}
QPixmap RdpView::takeScreenshot()
{
return QPixmap::grabWindow(m_container->clientWinId());
}
void RdpView::connectionClosed()
{
emit disconnected();
......
......@@ -63,6 +63,8 @@ public:
void setGrabAllKeys(bool grabAllKeys);
HostPreferences* hostPreferences();
virtual QPixmap takeScreenshot();
public slots:
virtual void switchFullscreen(bool on);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment