1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

Screen grabber: Don't wait for the flyout to collapse

The menu is now collapsed in the background half a second after
the user clicked on the screenshot button. This is to let the WM have
some time to open the fullscreen window, which itself is now shown
immediately.
This commit is contained in:
Stefan Merettig 2015-03-25 16:05:44 +01:00 committed by tux3
parent e83aac7af7
commit be194e6fa8

View File

@ -866,18 +866,17 @@ void ChatForm::loadHistory(QDateTime since, bool processUndelivered)
void ChatForm::onScreenshotClicked() void ChatForm::onScreenshotClicked()
{ {
connect(fileFlyout, &FlyoutOverlayWidget::hidden, this, &ChatForm::doScreenshot); doScreenshot();
hideFileMenu();
// Give the window manager a moment to open the fullscreen grabber window
QTimer::singleShot(500, this, &ChatForm::hideFileMenu);
} }
void ChatForm::doScreenshot() void ChatForm::doScreenshot()
{ {
disconnect(fileFlyout, &FlyoutOverlayWidget::hidden, this, &ChatForm::doScreenshot);
ScreenshotGrabber* screenshotGrabber = new ScreenshotGrabber(this); ScreenshotGrabber* screenshotGrabber = new ScreenshotGrabber(this);
connect(screenshotGrabber, &ScreenshotGrabber::screenshotTaken, this, &ChatForm::onScreenshotTaken); connect(screenshotGrabber, &ScreenshotGrabber::screenshotTaken, this, &ChatForm::onScreenshotTaken);
screenshotGrabber->showGrabber(); screenshotGrabber->showGrabber();
} }
void ChatForm::onScreenshotTaken(const QPixmap &pixmap) { void ChatForm::onScreenshotTaken(const QPixmap &pixmap) {