@@ -53,6 +53,7 @@ GeneralConf::GeneralConf(QWidget* parent)
5353 initUseJpgForClipboard ();
5454 initCopyOnDoubleClick ();
5555 initServerTPU ();
56+ initCustomEnv ();
5657 initWindowOffsets ();
5758 initSaveAfterCopy ();
5859 initCopyPathAfterSave ();
@@ -369,9 +370,9 @@ void GeneralConf::initCheckForUpdates()
369370void GeneralConf::initAllowMultipleGuiInstances ()
370371{
371372 m_allowMultipleGuiInstances = new QCheckBox (
372- tr (" Allow multiple flameshot GUI instances simultaneously" ), this );
373+ tr (" Allow multiple Flowshot GUI instances simultaneously" ), this );
373374 m_allowMultipleGuiInstances->setToolTip (tr (
374- " This allows you to take screenshots of Flameshot itself for example" ));
375+ " This allows you to take screenshots of Flowshot itself for example" ));
375376 m_scrollAreaLayout->addWidget (m_allowMultipleGuiInstances);
376377 connect (m_allowMultipleGuiInstances,
377378 &QCheckBox::clicked,
@@ -396,7 +397,7 @@ void GeneralConf::initAutostart()
396397{
397398 m_autostart = new QCheckBox (tr (" Launch in background at startup" ), this );
398399 m_autostart->setToolTip (tr (
399- " Launch Flameshot daemon (background process) when computer is booted" ));
400+ " Launch Flowshot daemon (background process) when computer is booted" ));
400401 m_scrollAreaLayout->addWidget (m_autostart);
401402
402403 connect (
@@ -612,6 +613,37 @@ void GeneralConf::initServerTPU()
612613 hboxLayoutKey->addWidget (labelAPIKey);
613614}
614615
616+ void GeneralConf::initCustomEnv () {
617+ auto * box = new QGroupBox (tr (" Force Qt Platform" ));
618+ box->setFlat (true );
619+ m_scrollAreaLayout->addWidget (box);
620+
621+ auto * vboxLayout = new QVBoxLayout ();
622+ box->setLayout (vboxLayout);
623+
624+ auto * platformLayout = new QHBoxLayout ();
625+ m_selectPlatform = new QComboBox (this );
626+ m_selectPlatform->addItem (tr (" System (default)" ), " default" );
627+ m_selectPlatform->addItem (tr (" Wayland" ), " wayland" );
628+ m_selectPlatform->addItem (tr (" X11 (XCB, Xwayland)" ), " xcb" );
629+ m_selectPlatform->setCurrentIndex (m_selectPlatform->findData (ConfigHandler ().platform ()));
630+ platformLayout->addWidget (m_selectPlatform);
631+ auto * platformWarning =
632+ new QLabel (tr (" This setting requires a restart of "
633+ " Flowshot to take effect.\n\n You may opt to force X11/XCB mode if you have issues with multiple displays or the upload notification window under Wayland.\n\n Setting it to \" default\" will use the default environment variable QT_QPA_PLATFORM." ),
634+ this );
635+ platformWarning->setWordWrap (true );
636+ connect (m_selectPlatform,
637+ QOverload<int >::of (&QComboBox::currentIndexChanged),
638+ this ,
639+ [this ](int index) {
640+ QString platform = m_selectPlatform->itemData (index).toString ();
641+ ConfigHandler ().setPlatform (platform);
642+ });
643+ vboxLayout->addLayout (platformLayout);
644+ vboxLayout->addWidget (platformWarning);
645+ }
646+
615647void GeneralConf::initWindowOffsets ()
616648{
617649 auto * box = new QGroupBox (tr (" Upload Notification Settings" ));
@@ -628,7 +660,7 @@ void GeneralConf::initWindowOffsets()
628660 auto * uploadWindowEnabledWarning =
629661 new QLabel (tr (" WAYLAND USERS: This upload notification window does not "
630662 " currently function correctly under Wayland. Please "
631- " disable if you experience problems and use Wayland ." ),
663+ " disable or force X11 (XCB) mode in Force Qt Platform ." ),
632664 this );
633665 uploadWindowEnabledWarning->setWordWrap (true );
634666
0 commit comments