mirror of
https://bitbucket.org/smil3y/kde-extraapps.git
synced 2025-02-23 10:22:52 +00:00
ksnapshot: remove unsupported KWin effect reference
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
52da45aca1
commit
9945d17ddc
2 changed files with 12 additions and 58 deletions
|
@ -31,14 +31,9 @@
|
|||
#include <QMenu>
|
||||
#include <QDesktopWidget>
|
||||
#include <QVarLengthArray>
|
||||
#include <QtGui/qevent.h>
|
||||
#include <QDrag>
|
||||
|
||||
#include <QPainter>
|
||||
#include <QXmlStreamReader>
|
||||
#include <QtDBus/QDBusConnection>
|
||||
#include <QtDBus/QDBusConnectionInterface>
|
||||
#include <QtDBus/QDBusInterface>
|
||||
#include <QtGui/qevent.h>
|
||||
|
||||
#include <klocale.h>
|
||||
|
||||
|
@ -187,26 +182,6 @@ KSnapshot::KSnapshot(QWidget *parent, KSnapshotObject::CaptureMode mode )
|
|||
setIncludePointer(conf.readEntry("includePointer", false));
|
||||
setMode( conf.readEntry("mode", 0) );
|
||||
|
||||
// check if kwin screenshot effect is available
|
||||
includeAlpha = false;
|
||||
if ( QDBusConnection::sessionBus().interface()->isServiceRegistered( "org.kde.kwin" ) ) {
|
||||
QDBusInterface kwinInterface( "org.kde.kwin", "/", "org.freedesktop.DBus.Introspectable" );
|
||||
QDBusReply<QString> reply = kwinInterface.call( "Introspect" );
|
||||
if ( reply.isValid() ) {
|
||||
QXmlStreamReader xml( reply.value() );
|
||||
while ( !xml.atEnd() ) {
|
||||
xml.readNext();
|
||||
if ( xml.tokenType() == QXmlStreamReader::StartElement &&
|
||||
xml.name().toString() == "node" ) {
|
||||
if ( xml.attributes().value( "name" ).toString() == "Screenshot" ) {
|
||||
includeAlpha = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
kDebug() << "Mode = " << mode;
|
||||
if ( mode == KSnapshotObject::FullScreen ) {
|
||||
snapshot = QPixmap::grabWindow( QApplication::desktop()->winId() );
|
||||
|
@ -668,25 +643,7 @@ void KSnapshot::performGrab()
|
|||
x = offset.x();
|
||||
y = offset.y();
|
||||
qDebug() << "last window position is" << offset;
|
||||
}
|
||||
else if ( mode() == WindowUnderCursor ) {
|
||||
if ( includeAlpha ) {
|
||||
// use kwin effect
|
||||
QDBusConnection::sessionBus().connect("org.kde.kwin", "/Screenshot",
|
||||
"org.kde.kwin.Screenshot", "screenshotCreated",
|
||||
this, SLOT(slotScreenshotReceived(qulonglong)));
|
||||
QDBusInterface interface( "org.kde.kwin", "/Screenshot", "org.kde.kwin.Screenshot" );
|
||||
int mask = 0;
|
||||
if ( includeDecorations() )
|
||||
{
|
||||
mask |= 1 << 0;
|
||||
}
|
||||
if ( includePointer() )
|
||||
{
|
||||
mask |= 1 << 1;
|
||||
}
|
||||
interface.call( "screenshotWindowUnderCursor", mask );
|
||||
} else {
|
||||
} else if ( mode() == WindowUnderCursor ) {
|
||||
snapshot = WindowGrabber::grabCurrent( includeDecorations() );
|
||||
|
||||
QPoint offset = WindowGrabber::lastWindowPosition();
|
||||
|
@ -699,9 +656,7 @@ void KSnapshot::performGrab()
|
|||
title = WindowGrabber::lastWindowTitle();
|
||||
windowClass = WindowGrabber::lastWindowClass();
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ( mode() == CurrentScreen ) {
|
||||
} else if ( mode() == CurrentScreen ) {
|
||||
kDebug() << "Desktop Geom2 = " << QApplication::desktop()->geometry();
|
||||
QDesktopWidget *desktop = QApplication::desktop();
|
||||
int screenId = desktop->screenNumber( QCursor::pos() );
|
||||
|
|
|
@ -134,7 +134,6 @@ private:
|
|||
bool modified;
|
||||
QPoint savedPosition;
|
||||
bool haveXFixes;
|
||||
bool includeAlpha;
|
||||
QPolygon lastFreeRegion;
|
||||
QRect lastRegion;
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue