Changeset View
Changeset View
Standalone View
Standalone View
src/PlatformBackends/X11ImageGrabber.cpp
Show First 20 Lines • Show All 411 Lines • ▼ Show 20 Line(s) | |||||
412 | { | 412 | { | ||
413 | QObject *sender = QObject::sender(); | 413 | QObject *sender = QObject::sender(); | ||
414 | sender->disconnect(); | 414 | sender->disconnect(); | ||
415 | sender->deleteLater(); | 415 | sender->deleteLater(); | ||
416 | 416 | | |||
417 | emit imageGrabFailed(); | 417 | emit imageGrabFailed(); | ||
418 | } | 418 | } | ||
419 | 419 | | |||
420 | void X11ImageGrabber::rectangleSelectionConfirmed(const QPixmap &pixmap, const QRect ®ion) | 420 | void X11ImageGrabber::rectangleSelectionConfirmed(const QPixmap &pixmap) | ||
421 | { | 421 | { | ||
422 | QObject *sender = QObject::sender(); | 422 | QObject *sender = QObject::sender(); | ||
423 | sender->disconnect(); | 423 | sender->disconnect(); | ||
424 | sender->deleteLater(); | 424 | sender->deleteLater(); | ||
425 | 425 | | |||
426 | if (mCapturePointer) { | | |||
427 | mPixmap = blendCursorImage(pixmap, region.x(), region.y(), region.width(), region.height()); | | |||
428 | } else { | | |||
429 | mPixmap = pixmap; | 426 | mPixmap = pixmap; | ||
430 | } | | |||
431 | emit pixmapChanged(mPixmap); | 427 | emit pixmapChanged(mPixmap); | ||
432 | } | 428 | } | ||
433 | 429 | | |||
434 | // grabber methods | 430 | // grabber methods | ||
435 | 431 | | |||
436 | void X11ImageGrabber::updateWindowTitle(xcb_window_t window) | 432 | void X11ImageGrabber::updateWindowTitle(xcb_window_t window) | ||
437 | { | 433 | { | ||
438 | QString windowTitle = KWindowSystem::readNameProperty(window, XA_WM_NAME); | 434 | QString windowTitle = KWindowSystem::readNameProperty(window, XA_WM_NAME); | ||
▲ Show 20 Lines • Show All 221 Lines • ▼ Show 20 Line(s) | 643 | { | |||
660 | } | 656 | } | ||
661 | 657 | | |||
662 | // No screen found with our cursor, fallback to capturing full screen | 658 | // No screen found with our cursor, fallback to capturing full screen | ||
663 | grabFullScreen(); | 659 | grabFullScreen(); | ||
664 | } | 660 | } | ||
665 | 661 | | |||
666 | void X11ImageGrabber::grabRectangularRegion() | 662 | void X11ImageGrabber::grabRectangularRegion() | ||
667 | { | 663 | { | ||
668 | QuickEditor *editor = new QuickEditor(getToplevelPixmap(QRect(), false)); | 664 | QuickEditor *editor = new QuickEditor(getToplevelPixmap(QRect(), mCapturePointer)); | ||
669 | 665 | | |||
670 | connect(editor, &QuickEditor::grabDone, this, &X11ImageGrabber::rectangleSelectionConfirmed); | 666 | connect(editor, &QuickEditor::grabDone, this, &X11ImageGrabber::rectangleSelectionConfirmed); | ||
671 | connect(editor, &QuickEditor::grabCancelled, this, &X11ImageGrabber::rectangleSelectionCancelled); | 667 | connect(editor, &QuickEditor::grabCancelled, this, &X11ImageGrabber::rectangleSelectionCancelled); | ||
672 | } | 668 | } | ||
673 | 669 | | |||
674 | xcb_window_t X11ImageGrabber::getRealWindowUnderCursor() | 670 | xcb_window_t X11ImageGrabber::getRealWindowUnderCursor() | ||
675 | { | 671 | { | ||
676 | xcb_connection_t *xcbConn = QX11Info::connection(); | 672 | xcb_connection_t *xcbConn = QX11Info::connection(); | ||
▲ Show 20 Lines • Show All 76 Lines • Show Last 20 Lines |