diff --git a/QtScrcpy/decoder/decoder.cpp b/QtScrcpy/decoder/decoder.cpp index 860a3b8..3e422d3 100644 --- a/QtScrcpy/decoder/decoder.cpp +++ b/QtScrcpy/decoder/decoder.cpp @@ -297,7 +297,9 @@ void Decoder::run() #if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57, 37, 0) int ret; if ((ret = avcodec_send_packet(codecCtx, &packet)) < 0) { - qCritical("Could not send video packet: %d", ret); + char errorbuf[255] = { 0 }; + av_strerror(ret, errorbuf, 254); + qCritical("Could not send video packet: %s", errorbuf); goto runQuit; } if (decodingFrame) { diff --git a/QtScrcpy/uibase/magneticwidget.cpp b/QtScrcpy/uibase/magneticwidget.cpp index c07c689..0d08b82 100644 --- a/QtScrcpy/uibase/magneticwidget.cpp +++ b/QtScrcpy/uibase/magneticwidget.cpp @@ -25,6 +25,11 @@ MagneticWidget::~MagneticWidget() } } +bool MagneticWidget::isAdsorbed() +{ + return m_adsorbed; +} + bool MagneticWidget::eventFilter(QObject *watched, QEvent *event) { if (watched != m_adsorbWidget || !event) { diff --git a/QtScrcpy/uibase/magneticwidget.h b/QtScrcpy/uibase/magneticwidget.h index 07ef267..8ed730a 100644 --- a/QtScrcpy/uibase/magneticwidget.h +++ b/QtScrcpy/uibase/magneticwidget.h @@ -31,6 +31,8 @@ public: explicit MagneticWidget(QWidget* adsorbWidget, AdsorbPositions adsorbPos = AP_ALL); ~MagneticWidget(); + bool isAdsorbed(); + protected: bool eventFilter(QObject *watched, QEvent *event) override; void moveEvent(QMoveEvent *event) override; diff --git a/QtScrcpy/videoform.cpp b/QtScrcpy/videoform.cpp index 97fa78f..e15e51b 100644 --- a/QtScrcpy/videoform.cpp +++ b/QtScrcpy/videoform.cpp @@ -225,7 +225,7 @@ void VideoForm::updateShowSize(const QSize &newSize) showSize.setHeight(qMin(newSize.height(), screenRect.height() - 200)); showSize.setWidth(showSize.height() * m_widthHeightRatio); } else { - showSize.setWidth(qMin(newSize.width(), screenRect.width())); + showSize.setWidth(qMin(newSize.width(), screenRect.width()/2)); showSize.setHeight(showSize.width() * m_widthHeightRatio); }