Changeset View
Changeset View
Standalone View
Standalone View
src/PlatformBackends/X11ImageGrabber.cpp
Show First 20 Lines • Show All 658 Lines • ▼ Show 20 Line(s) | 646 | { | |||
---|---|---|---|---|---|
659 | } | 659 | } | ||
660 | 660 | | |||
661 | // No screen found with our cursor, fallback to capturing full screen | 661 | // No screen found with our cursor, fallback to capturing full screen | ||
662 | grabFullScreen(); | 662 | grabFullScreen(); | ||
663 | } | 663 | } | ||
664 | 664 | | |||
665 | void X11ImageGrabber::grabRectangularRegion() | 665 | void X11ImageGrabber::grabRectangularRegion() | ||
666 | { | 666 | { | ||
667 | QuickEditor *editor = new QuickEditor(getToplevelPixmap(QRect(), false)); | 667 | const auto pixmap = getToplevelPixmap(QRect(), false); | ||
668 | if (!pixmap.isNull()) { | ||||
669 | QuickEditor *editor = new QuickEditor(pixmap); | ||||
668 | 670 | | |||
669 | connect(editor, &QuickEditor::grabDone, this, &X11ImageGrabber::rectangleSelectionConfirmed); | 671 | connect(editor, &QuickEditor::grabDone, this, &X11ImageGrabber::rectangleSelectionConfirmed); | ||
670 | connect(editor, &QuickEditor::grabCancelled, this, &X11ImageGrabber::rectangleSelectionCancelled); | 672 | connect(editor, &QuickEditor::grabCancelled, this, &X11ImageGrabber::rectangleSelectionCancelled); | ||
673 | } else { | ||||
674 | emit pixmapChanged(pixmap); | ||||
675 | } | ||||
671 | } | 676 | } | ||
672 | 677 | | |||
673 | xcb_window_t X11ImageGrabber::getRealWindowUnderCursor() | 678 | xcb_window_t X11ImageGrabber::getRealWindowUnderCursor() | ||
674 | { | 679 | { | ||
675 | xcb_connection_t *xcbConn = QX11Info::connection(); | 680 | xcb_connection_t *xcbConn = QX11Info::connection(); | ||
676 | xcb_window_t curWin = QX11Info::appRootWindow(); | 681 | xcb_window_t curWin = QX11Info::appRootWindow(); | ||
677 | 682 | | |||
678 | const QByteArray atomName("WM_STATE"); | 683 | const QByteArray atomName("WM_STATE"); | ||
▲ Show 20 Lines • Show All 73 Lines • Show Last 20 Lines |