@@ -56,6 +56,9 @@ GeneralConf::GeneralConf(QWidget* parent)
5656 initAntialiasingPinZoom ();
5757 initUndoLimit ();
5858 initInsecurePixelate ();
59+ #if !defined(Q_OS_MACOS)
60+ initCaptureActiveMonitor ();
61+ #endif
5962#if defined(Q_OS_LINUX)
6063 initUseX11LegacyScreenshot ();
6164#endif
@@ -127,6 +130,9 @@ void GeneralConf::_updateComponents(bool allowEmptySavePath)
127130#if defined(Q_OS_LINUX) || defined(Q_OS_UNIX)
128131 m_showTray->setChecked (!config.disabledTrayIcon ());
129132#endif
133+ #if !defined(Q_OS_MACOS)
134+ m_captureActiveMonitor->setChecked (config.captureActiveMonitor ());
135+ #endif
130136#if defined(Q_OS_LINUX)
131137 m_useX11LegacyScreenshot->setChecked (config.useX11LegacyScreenshot ());
132138#endif
@@ -916,6 +922,29 @@ void GeneralConf::setInsecurePixelate(bool checked)
916922 ConfigHandler ().setInsecurePixelate (checked);
917923}
918924
925+ #if !defined(Q_OS_MACOS)
926+ void GeneralConf::initCaptureActiveMonitor ()
927+ {
928+ m_captureActiveMonitor = new QCheckBox (
929+ tr (" Capture active monitor (skip monitor selection)" ), this );
930+ m_captureActiveMonitor->setToolTip (
931+ tr (" Automatically capture the monitor where the cursor is located "
932+ " instead of showing the monitor selection dialog. "
933+ " This feature is not supported on Wayland." ));
934+ m_scrollAreaLayout->addWidget (m_captureActiveMonitor);
935+
936+ connect (m_captureActiveMonitor,
937+ &QCheckBox::clicked,
938+ this ,
939+ &GeneralConf::captureActiveMonitorChanged);
940+ }
941+
942+ void GeneralConf::captureActiveMonitorChanged (bool checked)
943+ {
944+ ConfigHandler ().setCaptureActiveMonitor (checked);
945+ }
946+ #endif
947+
919948#if defined(Q_OS_LINUX)
920949void GeneralConf::initUseX11LegacyScreenshot ()
921950{
0 commit comments