diff --git a/.github/workflows/Linux-pack.yml b/.github/workflows/Linux-pack.yml index ba4cf66922..3d009474b2 100644 --- a/.github/workflows/Linux-pack.yml +++ b/.github/workflows/Linux-pack.yml @@ -15,6 +15,7 @@ on: - 'README.md' - 'LICENSE' - 'docs/**' + - 'data/translations/*.ts' workflow_dispatch: diff --git a/.github/workflows/MacOS-pack.yml b/.github/workflows/MacOS-pack.yml index 190401c8f0..38a37bc964 100644 --- a/.github/workflows/MacOS-pack.yml +++ b/.github/workflows/MacOS-pack.yml @@ -15,6 +15,7 @@ on: - 'README.md' - 'LICENSE' - 'docs/**' + - 'data/translations/*.ts' workflow_dispatch: diff --git a/.github/workflows/Windows-pack.yml b/.github/workflows/Windows-pack.yml index 1a864e7b1f..df6e3fb461 100644 --- a/.github/workflows/Windows-pack.yml +++ b/.github/workflows/Windows-pack.yml @@ -15,6 +15,7 @@ on: - 'README.md' - 'LICENSE' - 'docs/**' + - 'data/translations/*.ts' workflow_dispatch: diff --git a/.github/workflows/build_cmake.yml b/.github/workflows/build_cmake.yml index f1c8123658..13eca02249 100644 --- a/.github/workflows/build_cmake.yml +++ b/.github/workflows/build_cmake.yml @@ -13,6 +13,7 @@ on: - 'README.md' - 'LICENSE' - 'docs/**' + - 'data/translations/*.ts' workflow_dispatch: diff --git a/.github/workflows/clang-format.yml b/.github/workflows/clang-format.yml index e9e63e842f..2594be0899 100644 --- a/.github/workflows/clang-format.yml +++ b/.github/workflows/clang-format.yml @@ -6,11 +6,13 @@ on: - 'README.md' - 'LICENSE' - 'docs/**' + - 'data/translations/*.ts' pull_request: paths-ignore: - 'README.md' - 'LICENSE' - 'docs/**' + - 'data/translations/*.ts' workflow_dispatch: diff --git a/src/tools/pin/pinwidget.cpp b/src/tools/pin/pinwidget.cpp index 6b4128d3ed..04623504c1 100644 --- a/src/tools/pin/pinwidget.cpp +++ b/src/tools/pin/pinwidget.cpp @@ -3,6 +3,7 @@ #include #include #include +#include #include "pinwidget.h" #include "qguiappcurrentscreen.h" @@ -34,12 +35,11 @@ PinWidget::PinWidget(const QPixmap& pixmap, , m_shadowEffect(new QGraphicsDropShadowEffect(this)) { setWindowIcon(QIcon(GlobalValues::iconPath())); - setWindowFlags(Qt::WindowStaysOnTopHint | Qt::FramelessWindowHint); + setWindowFlags(Qt::WindowStaysOnTopHint | Qt::FramelessWindowHint | + Qt::Dialog); setFocusPolicy(Qt::StrongFocus); - // set the bottom widget background transparent setAttribute(Qt::WA_TranslucentBackground); setAttribute(Qt::WA_DeleteOnClose); - setWindowTitle("flameshot-pin"); ConfigHandler conf; m_baseColor = conf.uiColor(); m_hoverColor = conf.contrastUiColor(); @@ -69,10 +69,6 @@ PinWidget::PinWidget(const QPixmap& pixmap, static_cast(static_cast(MARGIN) * devicePixelRatio); QRect adjusted_pos = geometry + QMargins(margin, margin, margin, margin); setGeometry(adjusted_pos); -#if defined(Q_OS_LINUX) - setWindowFlags(Qt::X11BypassWindowManagerHint); -#endif - #if defined(Q_OS_MACOS) || defined(Q_OS_LINUX) if (currentScreen != nullptr) { QPoint topLeft = currentScreen->geometry().topLeft(); @@ -152,19 +148,13 @@ void PinWidget::mouseDoubleClickEvent(QMouseEvent*) void PinWidget::mousePressEvent(QMouseEvent* e) { - m_dragStart = e->globalPosition(); - m_offsetX = e->position().x() / width(); - m_offsetY = e->position().y() / height(); + if (QWindow* window = windowHandle(); window != nullptr) { + window->startSystemMove(); + return; + } } -void PinWidget::mouseMoveEvent(QMouseEvent* e) -{ - const QPointF delta = e->globalPosition() - m_dragStart; - const int offsetW = width() * m_offsetX; - const int offsetH = height() * m_offsetY; - move(m_dragStart.x() + delta.x() - offsetW, - m_dragStart.y() + delta.y() - offsetH); -} +void PinWidget::mouseMoveEvent(QMouseEvent* e) {} void PinWidget::keyPressEvent(QKeyEvent* event) { diff --git a/src/tools/pin/pinwidget.h b/src/tools/pin/pinwidget.h index 860ffbf089..54ea92bd57 100644 --- a/src/tools/pin/pinwidget.h +++ b/src/tools/pin/pinwidget.h @@ -45,8 +45,6 @@ class PinWidget : public QWidget QPixmap m_pixmap; QVBoxLayout* m_layout; QLabel* m_label; - QPointF m_dragStart; - qreal m_offsetX{}, m_offsetY{}; QGraphicsDropShadowEffect* m_shadowEffect; QColor m_baseColor, m_hoverColor;