Added preserveFocus fix (#178)

Adds the [preserveFocus configuration](https://github.com/symless/synergy-core/wiki/Text-Config#Focus_Preservation) item to the GUI configuration screen. 

This is useful if you want to control a system that you are not the only user of. For example, I use barrier to control my HTPC computer sometimes, but I don't want Kodi to lose focus when my cursor leaves the screen since it will cause other inputs (i.e. CEC Remote) to stop working.
This commit is contained in:
Chris Simons 2018-12-16 15:05:20 -08:00 committed by Adrian Lucrèce Céleste
parent 14a7ca0848
commit ea3e20ade1
4 changed files with 16 additions and 3 deletions

View File

@ -33,7 +33,8 @@ const char* BaseConfig::m_FixNames[] =
"halfDuplexCapsLock", "halfDuplexCapsLock",
"halfDuplexNumLock", "halfDuplexNumLock",
"halfDuplexScrollLock", "halfDuplexScrollLock",
"xtestIsXineramaUnaware" "xtestIsXineramaUnaware",
"preserveFocus"
}; };
const char* BaseConfig::m_SwitchCornerNames[] = const char* BaseConfig::m_SwitchCornerNames[] =

View File

@ -29,7 +29,7 @@ class BaseConfig
public: public:
enum Modifier { DefaultMod = -1, Shift, Ctrl, Alt, Meta, Super, None, NumModifiers }; enum Modifier { DefaultMod = -1, Shift, Ctrl, Alt, Meta, Super, None, NumModifiers };
enum SwitchCorner { TopLeft, TopRight, BottomLeft, BottomRight, NumSwitchCorners }; enum SwitchCorner { TopLeft, TopRight, BottomLeft, BottomRight, NumSwitchCorners };
enum Fix { CapsLock, NumLock, ScrollLock, XTest, NumFixes }; enum Fix { CapsLock, NumLock, ScrollLock, XTest, PreserveFocus, NumFixes };
protected: protected:
BaseConfig() {} BaseConfig() {}

View File

@ -68,6 +68,7 @@ ScreenSettingsDialog::ScreenSettingsDialog(QWidget* parent, Screen* pScreen) :
m_pCheckBoxNumLock->setChecked(m_pScreen->fix(Screen::NumLock)); m_pCheckBoxNumLock->setChecked(m_pScreen->fix(Screen::NumLock));
m_pCheckBoxScrollLock->setChecked(m_pScreen->fix(Screen::ScrollLock)); m_pCheckBoxScrollLock->setChecked(m_pScreen->fix(Screen::ScrollLock));
m_pCheckBoxXTest->setChecked(m_pScreen->fix(Screen::XTest)); m_pCheckBoxXTest->setChecked(m_pScreen->fix(Screen::XTest));
m_pCheckBoxPreserveFocus->setChecked(m_pScreen->fix(Screen::PreserveFocus));
} }
void ScreenSettingsDialog::accept() void ScreenSettingsDialog::accept()
@ -115,6 +116,7 @@ void ScreenSettingsDialog::accept()
m_pScreen->setFix(Screen::NumLock, m_pCheckBoxNumLock->isChecked()); m_pScreen->setFix(Screen::NumLock, m_pCheckBoxNumLock->isChecked());
m_pScreen->setFix(Screen::ScrollLock, m_pCheckBoxScrollLock->isChecked()); m_pScreen->setFix(Screen::ScrollLock, m_pCheckBoxScrollLock->isChecked());
m_pScreen->setFix(Screen::XTest, m_pCheckBoxXTest->isChecked()); m_pScreen->setFix(Screen::XTest, m_pCheckBoxXTest->isChecked());
m_pScreen->setFix(Screen::PreserveFocus, m_pCheckBoxPreserveFocus->isChecked());
QDialog::accept(); QDialog::accept();
} }

View File

@ -463,6 +463,16 @@
</widget> </widget>
</item> </item>
<item row="4" column="0"> <item row="4" column="0">
<widget class="QCheckBox" name="m_pCheckBoxPreserveFocus">
<property name="text">
<string>Fix Preserve Focus</string>
</property>
<property name="checked">
<bool>false</bool>
</property>
</widget>
</item>
<item row="5" column="0">
<spacer> <spacer>
<property name="orientation"> <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>