diff --git a/src/player/video-player.cpp b/src/player/video-player.cpp index 6a4a0d2..4a61aeb 100644 --- a/src/player/video-player.cpp +++ b/src/player/video-player.cpp @@ -257,11 +257,8 @@ uint32_t VideoPlayer::audio_callback(uint8_t **ptr, const uint32_t request_frame // update audio clock pts if (frame.value()->pts >= 0) - audio_pts_ = av::clock::ns(frame.value()->pts, source_->afo.time_base); - - if (audio_pts_.load() != av::clock::nopts) audio_pts_ = - audio_pts_.load() + av::clock::ns(frame.value()->nb_samples, source_->afo.time_base); + av::clock::ns(frame.value()->pts + frame.value()->nb_samples, source_->afo.time_base); sonic_stream_write(sonic_stream_, frame.value()->data[0], frame.value()->nb_samples); } diff --git a/src/setting/settingdialog.cpp b/src/setting/settingdialog.cpp index e7a1562..55af555 100644 --- a/src/setting/settingdialog.cpp +++ b/src/setting/settingdialog.cpp @@ -54,7 +54,7 @@ SettingWindow::SettingWindow(QWidget *parent) menu->addItem(tr("GIF Recording")); menu->addItem(tr("Devices")); menu->addItem(tr("About")); - menu->setMinimumWidth(275); + menu->setMinimumWidth(280); menu->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Expanding); layout->addWidget(menu); @@ -141,8 +141,6 @@ QWidget *SettingWindow::setupGeneralWidget() QWidget *SettingWindow::setupHotkeyWidget() { - using namespace config; - const auto page = new ScrollWidget(); { const auto form = page->addForm(tr("Hotkeys")); diff --git a/src/widgets/framelesswindow.cpp b/src/widgets/framelesswindow.cpp index bea02e3..33de7c5 100644 --- a/src/widgets/framelesswindow.cpp +++ b/src/widgets/framelesswindow.cpp @@ -75,26 +75,16 @@ void FramelessWindow::toggleTransparentInput() TransparentInput(this, transparent_input_); } -void FramelessWindow::mousePressEvent(QMouseEvent *event) -{ - if (!isFullScreen() && event->button() == Qt::LeftButton) { - windowHandle()->startSystemMove(); - return; - } - - return QWidget::mousePressEvent(event); -} - void FramelessWindow::closeEvent(QCloseEvent *event) { emit closed(); - return QWidget::closeEvent(event); + QWidget::closeEvent(event); } void FramelessWindow::hideEvent(QHideEvent *event) { emit hidden(); - return QWidget::hideEvent(event); + QWidget::hideEvent(event); } void FramelessWindow::changeEvent(QEvent *event) @@ -109,7 +99,7 @@ void FramelessWindow::changeEvent(QEvent *event) } #ifdef Q_OS_LINUX -void FramelessWindow::updateCursor(Qt::Edges edges) +void FramelessWindow::updateCursor(const Qt::Edges edges) { switch (edges) { case Qt::LeftEdge: @@ -130,7 +120,12 @@ bool FramelessWindow::event(QEvent *event) switch (event->type()) { case QEvent::MouseButtonPress: if (edges_) { - window()->windowHandle()->startSystemResize(edges_); + windowHandle()->startSystemResize(edges_); + return true; + } + + if(dynamic_cast(event)->button() == Qt::LeftButton) { + windowHandle()->startSystemMove(); return true; } break; diff --git a/src/widgets/framelesswindow.h b/src/widgets/framelesswindow.h index 66e9650..cac1186 100644 --- a/src/widgets/framelesswindow.h +++ b/src/widgets/framelesswindow.h @@ -35,8 +35,6 @@ public slots: void fullscreened(); protected: - void mousePressEvent(QMouseEvent *event) override; - void closeEvent(QCloseEvent *) override; void hideEvent(QHideEvent *event) override; void changeEvent(QEvent *) override;