Merge branch 'master' into SYNERGY-1017-Secure-input-detection-on-mac

# Conflicts:
#	ChangeLog
#	src/gui/src/OSXHelpers.h
This commit is contained in:
Igor Sikachyna 2021-06-10 19:07:34 +03:00
commit bcc0d48ce1
6 changed files with 35 additions and 14 deletions

View file

@ -17,6 +17,7 @@ jobs:
include:
- distro: ubuntu20.04
- distro: ubuntu19.10
- distro: ubuntu21.04
# - distro: ubuntu18.04 #Need to install git 2.18+
# - distro: ubuntu16.04 #Need to install git 2.18+

View file

@ -8,10 +8,12 @@ Bug fixes:
- #7001 Add option to prevent computer from going to sleep
- #7029 | #7033 Wrong encoding for text copied between linux and windows
- #7015 Fix Windows service not starting up after sleep
- #7036 Fix tray icon not changing theme on Big Sur
Enhancements:
- #6998 Remove functionality related to the screen saver synchronisation
- #7026 Update the way we package OpenSSL for Windows build
- #7037 Add Ubuntu 21.04 build
- #7030 Add user nofication for secure input on Mac
===========

View file

@ -6,7 +6,7 @@ jobs:
- job: Linux
pool:
vmImage: 'ubuntu-16.04'
vmImage: 'ubuntu-latest'
strategy:
matrix:
@ -27,6 +27,10 @@ jobs:
image: symless/synergy-core:ubuntu20.04
packager: deb
name: ubuntu20
ubuntu2104:
image: symless/synergy-core:ubuntu21.04
packager: deb
name: ubuntu21
debian9:
image: symless/synergy-core:debian9
packager: deb

View file

@ -379,10 +379,19 @@ void MainWindow::setIcon(qSynergyState state) const
QIcon icon;
#ifdef Q_OS_MAC
if (isOSXUseDarkIcons())
icon.addFile(synergyDarkIconFiles[state]);
else
icon.addFile(synergyLightIconFiles[state]);
switch(getOSXIconsTheme()) {
case IconsTheme::ICONS_DARK:
icon.addFile(synergyDarkIconFiles[state]);
break;
case IconsTheme::ICONS_LIGHT:
icon.addFile(synergyLightIconFiles[state]);
break;
case IconsTheme::ICONS_TEMPLATE:
default:
icon.addFile(synergyDarkIconFiles[state]);
icon.setIsMask(true);
break;
}
#else
icon.addFile(synergyDefaultIconFiles[state]);
#endif

View file

@ -21,10 +21,16 @@
#include <string>
enum class IconsTheme {
ICONS_DARK,
ICONS_LIGHT,
ICONS_TEMPLATE
};
bool isOSXSecureInputEnabled();
int getOSXSecureInputEventPID();
std::string getOSXProcessName(int pid);
bool isOSXInterfaceStyleDark();
bool isOSXUseDarkIcons();
IconsTheme getOSXIconsTheme();
#endif

View file

@ -101,13 +101,12 @@ isOSXInterfaceStyleDark()
return (style && [style isKindOfClass:[NSString class]] && NSOrderedSame == [style caseInsensitiveCompare:@"dark"]);
}
bool
isOSXUseDarkIcons()
IconsTheme
getOSXIconsTheme()
{
if (@available(macOS 11, *)) {
return true;
}
else {
return isOSXInterfaceStyleDark();
}
if (@available(macOS 11, *))
return IconsTheme::ICONS_TEMPLATE;
else if(isOSXInterfaceStyleDark())
return IconsTheme::ICONS_DARK;
return IconsTheme::ICONS_LIGHT;
}