From b72649d2e9f04009a015957398a20f06489f50b6 Mon Sep 17 00:00:00 2001 From: Mehrad Mahmoudian Date: Fri, 26 Jun 2026 04:21:18 +0300 Subject: [PATCH 1/2] remove the legacy argument parsing for region argument (#4761) This was brought to our attention by @geeknik via security advisory report GHSA-rmr8-cfxx-3757 with adjusted severity of 0.0/10: `CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:A/VC:N/VI:N/VA:N/SC:N/SI:N/SA:N` giving any value starting with `screen` or `all` cause segfault. Considering that we have `full` and `screen` subcommands, I believe this part of the code is no longer needed and can be removed. Thank you @geeknik for bringing this to our attention. --- src/utils/valuehandler.cpp | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/src/utils/valuehandler.cpp b/src/utils/valuehandler.cpp index f65fc53897..6913d1670f 100644 --- a/src/utils/valuehandler.cpp +++ b/src/utils/valuehandler.cpp @@ -545,17 +545,6 @@ QVariant Region::process(const QVariant& val) QString str = val.toString(); - if (str == "all") { - return ScreenGrabber().desktopGeometry(); - } else if (str.startsWith("screen")) { - bool ok; - int number = str.mid(6).toInt(&ok); - if (!ok || number < 0) { - return {}; - } - return ScreenGrabber().screenGeometry(qApp->screens()[number]); - } - static const QRegularExpression regex( "(-{,1}\\d+)" // number (any sign) "[x,\\.\\s]" // separator ('x', ',', '.', or whitespace) From 6a635d2d5d88190dab8152bcebb4a85796a55ab3 Mon Sep 17 00:00:00 2001 From: IndolikarQuantifier <41311751+IndolikarQuantifier@users.noreply.github.com> Date: Fri, 26 Jun 2026 06:51:51 +0530 Subject: [PATCH 2/2] Let the GUI colors be choosen via hex values (#4738) * gui uses choosen color from hex values * added the label for hex color edit box * regex updated to accept only RGB values * fix : updating color in hex input box * clang-format changes --- src/config/uicoloreditor.cpp | 37 +++++++++++++++++++++++++++++++++++- src/config/uicoloreditor.h | 6 ++++++ 2 files changed, 42 insertions(+), 1 deletion(-) diff --git a/src/config/uicoloreditor.cpp b/src/config/uicoloreditor.cpp index d76f6f58da..7b3ea1f3b3 100644 --- a/src/config/uicoloreditor.cpp +++ b/src/config/uicoloreditor.cpp @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -24,6 +25,7 @@ UIcolorEditor::UIcolorEditor(QWidget* parent) m_hLayout->addItem(new QSpacerItem(space, space, QSizePolicy::Expanding)); m_vLayout->setAlignment(Qt::AlignVCenter); + initHexColorInput(); initButtons(); initColorWheel(); @@ -68,6 +70,19 @@ void UIcolorEditor::updateLocalColor(const QColor c) m_contrastColor = c; } m_lastButtonPressed->setColor(c); + m_hexColorEdit->setText(c.name()); +} + +void UIcolorEditor::changeInputColor(const QString& hexColor) +{ + if (hexColor.contains(QRegularExpression("^#[0-9A-Fa-f]{6}$"))) { + QColor color(hexColor); + if (color.isValid()) { + m_colorWheel->setColor(color); + updateLocalColor(color); + updateUIcolor(); + } + } } void UIcolorEditor::initColorWheel() @@ -147,7 +162,25 @@ void UIcolorEditor::initButtons() }); m_lastButtonPressed = m_buttonMainColor; } - +void UIcolorEditor::initHexColorInput() +{ + m_hexColorEdit = new QLineEdit(this); + m_hexColorLabel = new QLabel(this); + m_hexColorLabel->setText(tr("Hex for Main Color")); + m_hexColorEdit->setSizePolicy( + QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed)); + connect(m_hexColorEdit, + &QLineEdit::textChanged, + this, + &UIcolorEditor::changeInputColor); + QRegularExpression rgbRegex("^#[0-9A-Fa-f]{6}$"); + QRegularExpressionValidator* validator = + new QRegularExpressionValidator(rgbRegex, m_hexColorEdit); + m_hexColorEdit->setValidator(validator); + m_hexColorEdit->setMaxLength(7); + m_vLayout->addWidget(m_hexColorLabel); + m_vLayout->addWidget(m_hexColorEdit); +} // visual update for the selected button void UIcolorEditor::changeLastButton(CaptureToolButton* b) { @@ -160,10 +193,12 @@ void UIcolorEditor::changeLastButton(CaptureToolButton* b) m_colorWheel->setColor(m_uiColor); m_labelContrast->setStyleSheet(offStyle); m_labelMain->setStyleSheet(styleSheet()); + m_hexColorLabel->setText(tr("Hex for Main Color")); } else { m_colorWheel->setColor(m_contrastColor); m_labelContrast->setStyleSheet(styleSheet()); m_labelMain->setStyleSheet(offStyle); + m_hexColorLabel->setText(tr("Hex for Contrast Color")); } b->setIcon(b->icon()); } diff --git a/src/config/uicoloreditor.h b/src/config/uicoloreditor.h index 4660aac820..a8788ff73c 100644 --- a/src/config/uicoloreditor.h +++ b/src/config/uicoloreditor.h @@ -12,6 +12,8 @@ class QVBoxLayout; class QHBoxLayout; class CaptureToolButton; class ClickableLabel; +class QLineEdit; +class QLabel; class UIcolorEditor : public QWidget { @@ -26,6 +28,7 @@ private slots: void updateUIcolor(); void updateLocalColor(const QColor); void changeLastButton(CaptureToolButton*); + void changeInputColor(const QString&); private: QColor m_uiColor, m_contrastColor; @@ -35,6 +38,8 @@ private slots: ClickableLabel* m_labelContrast; CaptureToolButton* m_lastButtonPressed; color_widgets::ColorWheel* m_colorWheel; + QLineEdit* m_hexColorEdit; + QLabel* m_hexColorLabel; static const CaptureTool::Type m_buttonIconType = CaptureTool::TYPE_CIRCLE; @@ -43,4 +48,5 @@ private slots: void initColorWheel(); void initButtons(); + void initHexColorInput(); };