aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@ubuntu.com>2018-09-19 18:23:50 -0400
committerLibravatarUnit 193 <unit193@ubuntu.com>2018-09-19 18:23:50 -0400
commit68a36b3b67ec82cdd3f77e88e40d1043cbab5000 (patch)
tree6a23b540cdd5b17f4df92a850e2bc940d96d1cac
parent4a8bfd06e73d7f051f0b39e19e57616c7bbb8ad1 (diff)
downloadbarrier-68a36b3b67ec82cdd3f77e88e40d1043cbab5000.tar.bz2
barrier-68a36b3b67ec82cdd3f77e88e40d1043cbab5000.tar.xz
barrier-68a36b3b67ec82cdd3f77e88e40d1043cbab5000.tar.zst
New upstream version 2.1.2+dfsgupstream/2.1.2+dfsg
-rw-r--r--.travis.yml40
-rw-r--r--CMakeLists.txt40
-rw-r--r--README.md2
-rw-r--r--clean_build.bat4
-rwxr-xr-xclean_build.sh2
-rw-r--r--cmake/Version.cmake2
-rw-r--r--debian/compat1
-rw-r--r--debian/control17
-rw-r--r--debian/copyright5
-rwxr-xr-xdebian/rules5
-rw-r--r--debian/source/format1
-rw-r--r--dist/inno/barrier.iss.in74
-rw-r--r--dist/inno/scripts/isxdl/english.ini49
-rw-r--r--dist/inno/scripts/isxdl/isxdl.dllbin124416 -> 0 bytes
-rw-r--r--dist/inno/scripts/isxdl/isxdl.iss14
-rw-r--r--dist/inno/scripts/lang/english.iss18
-rw-r--r--dist/inno/scripts/products.iss6
-rw-r--r--dist/inno/scripts/products.pas329
-rw-r--r--dist/inno/scripts/products/msiproduct.iss49
-rw-r--r--dist/inno/scripts/products/stringversion.iss62
-rw-r--r--dist/inno/scripts/products/vcredist2017.iss32
-rw-r--r--dist/inno/scripts/products/winversion.iss49
-rw-r--r--dist/macos/bundle/Barrier.app/Contents/Info.plist.in32
-rw-r--r--dist/macos/bundle/Barrier.app/Contents/PkgInfo1
-rw-r--r--dist/macos/bundle/Barrier.app/Contents/Resources/Barrier.icnsbin470437 -> 0 bytes
-rwxr-xr-xdist/macos/bundle/build_installer.sh.in77
-rwxr-xr-xdist/macos/bundle/reref_dylibs.sh41
-rw-r--r--dist/wix/Barrier.sln27
-rw-r--r--dist/wix/Barrier.wixproj31
-rw-r--r--dist/wix/Include.wxi.in25
-rw-r--r--dist/wix/Product.wxs104
-rw-r--r--osx_environment.sh35
-rw-r--r--src/cmd/barrierc/CMakeLists.txt1
-rw-r--r--src/cmd/barrierc/barrierc.exe.manifest2
-rw-r--r--src/cmd/barriers/CMakeLists.txt1
-rw-r--r--src/cmd/barriers/barriers.exe.manifest2
-rw-r--r--src/gui/CMakeLists.txt5
-rw-r--r--src/gui/src/ActionDialog.cpp1
-rw-r--r--src/gui/src/NewScreenWidget.cpp2
-rw-r--r--src/gui/src/ScreenSettingsDialog.cpp21
-rw-r--r--src/gui/src/ScreenSetupView.cpp1
-rw-r--r--src/gui/src/SettingsDialogBase.ui2
-rw-r--r--src/gui/src/SslCertificate.cpp2
-rw-r--r--src/lib/arch/CMakeLists.txt4
-rw-r--r--src/lib/barrier/ServerApp.cpp2
-rw-r--r--src/lib/base/Unicode.cpp18
-rw-r--r--src/lib/platform/OSXScreen.h4
-rw-r--r--src/lib/platform/OSXScreen.mm8
-rw-r--r--src/lib/platform/XWindowsScreen.cpp30
-rw-r--r--src/lib/platform/XWindowsScreen.h11
50 files changed, 172 insertions, 1119 deletions
diff --git a/.travis.yml b/.travis.yml
index 82f36c5..43bcd89 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,10 +1,34 @@
language: cpp
-before_install:
-- sudo apt-get update -qq
-- sudo apt-get install -qq libxtst-dev
-- sudo apt-get install -qq qtdeclarative5-dev
-- sudo apt-get install -qq libavahi-compat-libdnssd-dev
-script: sh -x ./clean_build.sh
-# skip install phase since we have a customized install package
-# creation tool for each supported platform
+
+matrix:
+ include:
+ - os: linux
+ sudo: false
+ dist: trusty
+ addons:
+ apt:
+ packages:
+ - libxtst-dev
+ - qtdeclarative5-dev
+ - libavahi-compat-libdnssd-dev
+ script: sh -x ./clean_build.sh
+
+ - os: osx
+ osx_image: xcode9
+ script:
+ - export COLUMNS=80
+ - curl -LO https://raw.githubusercontent.com/GiovanniBussi/macports-ci/master/macports-ci
+ - chmod +x ./macports-ci
+ - ./macports-ci install
+ - PATH="$PATH:/opt/local/bin"
+ - sudo port -N install qt5-qtbase openssl
+ - sh -x ./clean_build.sh
+
+ - os: osx
+ osx_image: xcode9
+ script:
+ - brew update
+ - brew install qt openssl
+ - sh -x ./clean_build.sh
+
install: true
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5c4ba6d..f6f6aa7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -63,6 +63,7 @@ if (UNIX)
include (CheckIncludeFileCXX)
include (CheckSymbolExists)
include (CheckCSourceCompiles)
+ include (FindPkgConfig)
check_include_file_cxx (istream HAVE_ISTREAM)
check_include_file_cxx (ostream HAVE_OSTREAM)
@@ -131,7 +132,9 @@ if (UNIX)
# curl is used on both Linux and Mac
find_package (CURL)
if (CURL_FOUND)
- list (APPEND libs curl)
+ include_directories(${CURL_INCLUDE_DIRS})
+ list (APPEND libs ${CURL_LIBRARIES})
+
else()
message (FATAL_ERROR "Missing library: curl")
endif()
@@ -163,6 +166,12 @@ if (UNIX)
link_directories("/usr/local/lib")
endif()
+ if (${PKG_CONFIG_FOUND})
+ pkg_check_modules (AVAHI_COMPAT REQUIRED avahi-compat-libdns_sd)
+ include_directories (BEFORE SYSTEM ${AVAHI_COMPAT_INCLUDE_DIRS})
+ set (CMAKE_REQUIRED_INCLUDES "${CMAKE_REQUIRED_INCLUDES};${AVAHI_COMPAT_INCLUDE_DIRS}")
+ endif ()
+
set (XKBlib "X11/Xlib.h;X11/XKBlib.h")
set (CMAKE_EXTRA_INCLUDE_FILES "${XKBlib};X11/extensions/Xrandr.h")
check_type_size ("XRRNotifyEvent" X11_EXTENSIONS_XRANDR_H)
@@ -187,7 +196,7 @@ if (UNIX)
message (FATAL_ERROR "Missing header: " ${XKBlib})
endif()
- if (NOT HAVE_DNSSD)
+ if (BARRIER_BUILD_GUI AND NOT HAVE_DNSSD)
message (FATAL_ERROR "Missing header: dns_sd.h")
endif()
@@ -302,13 +311,28 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
${OPENSSL_ROOT}/lib/ssleay32.lib
)
elseif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
- set (OPENSSL_ROOT /usr/local/opt/openssl)
- include_directories (BEFORE SYSTEM ${OPENSSL_ROOT}/include)
- set (OPENSSL_LIBS
- ${OPENSSL_ROOT}/lib/libssl.a
- ${OPENSSL_ROOT}/lib/libcrypto.a
- )
+ if (IS_DIRECTORY /opt/local)
+ # macports
+ set (OPENSSL_ROOT /opt/local)
+
+ set (OPENSSL_LIBS
+ ${OPENSSL_ROOT}/lib/libssl.a
+ ${OPENSSL_ROOT}/lib/libcrypto.a
+ z
+ )
+ elseif (IS_DIRECTORY /usr/local/opt/openssl)
+ # brew
+ set (OPENSSL_ROOT /usr/local/opt/openssl)
+
+ include_directories (BEFORE SYSTEM ${OPENSSL_ROOT}/include)
+
+ set (OPENSSL_LIBS
+ ${OPENSSL_ROOT}/lib/libssl.a
+ ${OPENSSL_ROOT}/lib/libcrypto.a
+ )
+ endif()
+
elseif (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set (OPENSSL_LIBS ssl crypto)
else()
diff --git a/README.md b/README.md
index fe10138..8b7d9f8 100644
--- a/README.md
+++ b/README.md
@@ -10,7 +10,7 @@ Barrier is KVM software forked from Symless's synergy 1.9 codebase. Synergy was
### What's different?
-Whereas synergy has moved beyond its goals from the 1.x era, barrier aims to maintain that simplicity. Barrier will let you use your keyboard and mouse from machine A to control machine B (or more). That's it.
+Whereas synergy has moved beyond its goals from the 1.x era, Barrier aims to maintain that simplicity. Barrier will let you use your keyboard and mouse from machine A to control machine B (or more). It's that simple.
### Project goals
diff --git a/clean_build.bat b/clean_build.bat
index c5e2153..b1f0410 100644
--- a/clean_build.bat
+++ b/clean_build.bat
@@ -3,8 +3,8 @@
REM defaults - override them by creating a build_env.bat file
set B_BUILD_TYPE=Debug
set B_QT_ROOT=C:\Qt
-set B_QT_VER=5.6.3
-set B_QT_MSVC=msvc2015_64
+set B_QT_VER=5.11.1
+set B_QT_MSVC=msvc2017_64
set B_BONJOUR=C:\Program Files\Bonjour SDK
set savedir=%cd%
diff --git a/clean_build.sh b/clean_build.sh
index 3085c08..fc1065a 100755
--- a/clean_build.sh
+++ b/clean_build.sh
@@ -14,7 +14,7 @@ if [ "$(uname)" = "Darwin" ]; then
# OSX needs a lot of extra help, poor thing
# run the osx_environment.sh script to fix paths
. ./osx_environment.sh
- B_CMAKE_FLAGS="-DCMAKE_OSX_SYSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -DCMAKE_OSX_DEPLOYMENT_TARGET=10.9 $B_CMAKE_FLAGS"
+ B_CMAKE_FLAGS="-DCMAKE_OSX_SYSROOT=$(xcode-select --print-path)/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -DCMAKE_OSX_DEPLOYMENT_TARGET=10.9 $B_CMAKE_FLAGS"
fi
# allow local customizations to build environment
[ -r ./build_env.sh ] && . ./build_env.sh
diff --git a/cmake/Version.cmake b/cmake/Version.cmake
index 403a02f..6b51e40 100644
--- a/cmake/Version.cmake
+++ b/cmake/Version.cmake
@@ -1,7 +1,7 @@
cmake_minimum_required (VERSION 3.4)
set (BARRIER_VERSION_MAJOR 2)
-set (BARRIER_VERSION_MINOR 1)
+set (BARRIER_VERSION_MINOR 2)
set (BARRIER_VERSION_PATCH 0)
#
diff --git a/debian/compat b/debian/compat
deleted file mode 100644
index ec63514..0000000
--- a/debian/compat
+++ /dev/null
@@ -1 +0,0 @@
-9
diff --git a/debian/control b/debian/control
deleted file mode 100644
index 192dff0..0000000
--- a/debian/control
+++ /dev/null
@@ -1,17 +0,0 @@
-Source: barrier
-Section: utils
-Priority: optional
-Standards-Version: 3.9.7
-Homepage: https://github.com/debauchee/barrier/
-Maintainer: Debauchee Open Source Group <todo@mail.com>
-
-Package: barrier
-Architecture: amd64
-Section: utils
-Priority: optional
-Depends: ${shlibs:Depends},
- ${misc:Depends}
-Description: Keyboard and mouse sharing solution
- Barrier allows you to share one mouse and keyboard between multiple computers.
- Work seamlessly across Windows, macOS and Linux.
-Homepage: https://github.com/debauchee/barrier/
diff --git a/debian/copyright b/debian/copyright
deleted file mode 100644
index d448129..0000000
--- a/debian/copyright
+++ /dev/null
@@ -1,5 +0,0 @@
-Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
-Upstream-Name: Barrier
-Source: https://github.com/debauchee/barrier/
-Disclaimer: This package is not part of the Debian project as it contains closed source proprietary components
-Copyright: Copyright (C) 2018 Debauchee Open Source Group
diff --git a/debian/rules b/debian/rules
deleted file mode 100755
index 64ddd45..0000000
--- a/debian/rules
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/usr/bin/make -f
-
-%:
- dh $@ --buildsystem=cmake --builddirectory=build -Pbuild/debian --parallel
-
diff --git a/debian/source/format b/debian/source/format
deleted file mode 100644
index 89ae9db..0000000
--- a/debian/source/format
+++ /dev/null
@@ -1 +0,0 @@
-3.0 (native)
diff --git a/dist/inno/barrier.iss.in b/dist/inno/barrier.iss.in
deleted file mode 100644
index 6b52bcc..0000000
--- a/dist/inno/barrier.iss.in
+++ /dev/null
@@ -1,74 +0,0 @@
-#define MyAppName "Barrier"
-#define MyAppVersion "@BARRIER_VERSION@"
-#define MyAppPublisher "Debauchee Open Source Group"
-#define MyAppURL "https://github.com/debauchee/barrier/wiki"
-#define MyAppExeName "barrier.exe"
-#define MyAppServiceName "Barrier"
-#define MyAppServiceExe "barrierd.exe"
-#define MyAppServiceDesc "Manages the Barrier background processes."
-
-[Setup]
-AppId={{41036EA6-3F7A-4803-8AE0-469E5E91EFCC}
-AppName={#MyAppName}
-AppVersion={#MyAppVersion}
-AppVerName={#MyAppName} {#MyAppVersion}
-AppPublisher={#MyAppPublisher}
-AppPublisherURL={#MyAppURL}
-AppSupportURL={#MyAppURL}
-AppUpdatesURL={#MyAppURL}
-DefaultDirName={pf}\{#MyAppName}
-DisableProgramGroupPage=yes
-LicenseFile=@CMAKE_CURRENT_SOURCE_DIR@/res/License.rtf
-OutputDir=@CMAKE_RUNTIME_OUTPUT_DIRECTORY@/../installer-inno/bin
-OutputBaseFilename=BarrierSetup-{#MyAppVersion}
-SetupIconFile=@CMAKE_CURRENT_SOURCE_DIR@/res/barrier.ico
-Compression=lzma
-SolidCompression=yes
-ArchitecturesInstallIn64BitMode=x64 ia64
-
-#include "scripts\lang\english.iss"
-
-[Tasks]
-Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
-
-[Files]
-Source: "@CMAKE_RUNTIME_OUTPUT_DIRECTORY@/Release/*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
-; NOTE: Don't use "Flags: ignoreversion" on any shared system files
-
-[Icons]
-Name: "{commonprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
-Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
-
-[Run]
-Filename: {sys}\sc.exe; Parameters: "create {#MyAppServiceName} start= auto binPath= ""{app}\{#MyAppServiceExe}"""; Flags: runhidden
-Filename: {sys}\sc.exe; Parameters: "description {#MyAppServiceName} ""{#MyAppServiceDesc}"""; Flags: runhidden
-Filename: {sys}\sc.exe; Parameters: "start {#MyAppServiceName}"; Flags: runhidden
-Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
-
-[UninstallDelete]
-Type: files; Name: "{app}\barrierd.log"
-
-[UninstallRun]
-Filename: {sys}\sc.exe; Parameters: "stop {#MyAppServiceName}"; Flags: runhidden
-Filename: {sys}\sc.exe; Parameters: "delete {#MyAppServiceName}"; Flags: runhidden
-
-[CustomMessages]
-DependenciesDir="redist"
-
-; shared code for installing the products
-#include "scripts\products.iss"
-#include "scripts\products\stringversion.iss"
-#include "scripts\products\winversion.iss"
-#include "scripts\products\msiproduct.iss"
-#include "scripts\products\vcredist2017.iss"
-
-[Code]
-function InitializeSetup(): boolean;
-begin
- // initialize windows version
- initwinversion();
-
- vcredist2017('14'); // min allowed version is 14.0
-
- Result := true;
-end;
diff --git a/dist/inno/scripts/isxdl/english.ini b/dist/inno/scripts/isxdl/english.ini
deleted file mode 100644
index 0546ae4..0000000
--- a/dist/inno/scripts/isxdl/english.ini
+++ /dev/null
@@ -1,49 +0,0 @@
-[strings]
-; General
-100=File download
-101=Do you want to cancel the download?
-102=%1 (%2 of %3)
-103=%1 KB
-104=%1 KB of %2 KB (%3%)
-
-; Status information
-110=Getting file information...
-111=Redirecting to %1
-112=Sending request...
-113=Resolving %1
-114=Connected to %1
-115=Receiving...
-116=Connecting to %1
-
-; Error messages
-120=Error connecting to the internet.\n\n%1
-121=Error opening %1.\n\nThe server returned status code %2.
-122=Error reading URL.\n\n%1
-123=Error writing file %1.\n\n%2
-124=Error opening file %1.\n\n%2
-125='%1' is an invalid URL.
-126=Error opening %1.\n\n%2
-127=Error sending request.\n\n%1
-128=Unsupported protocol. Only HTTP and FTP protocols are supported.
-129=Failed to connect to %1.\n\n%2
-130=Failed to query status code.\n\n%1
-131=Error requesting file.\n\n%1
-
-; Other
-144=About...
-146=Download
-147=Setup is now downloading additional files to your computer.
-
-; labels
-160=File:
-161=Speed:
-162=Status:
-163=Elapsed Time:
-164=Remaining Time:
-165=Current File:
-166=Overall Progress:
-167=Cancel
-168=OK
-169=User Name and Password
-170=User Name:
-171=Password:
diff --git a/dist/inno/scripts/isxdl/isxdl.dll b/dist/inno/scripts/isxdl/isxdl.dll
deleted file mode 100644
index d227bca..0000000
--- a/dist/inno/scripts/isxdl/isxdl.dll
+++ /dev/null
Binary files differ
diff --git a/dist/inno/scripts/isxdl/isxdl.iss b/dist/inno/scripts/isxdl/isxdl.iss
deleted file mode 100644
index 3c25d6d..0000000
--- a/dist/inno/scripts/isxdl/isxdl.iss
+++ /dev/null
@@ -1,14 +0,0 @@
-[Files]
-Source: "scripts\isxdl\isxdl.dll"; Flags: dontcopy
-
-[Code]
-procedure isxdl_AddFile(URL, Filename: PAnsiChar);
-external 'isxdl_AddFile@files:isxdl.dll stdcall';
-
-function isxdl_DownloadFiles(hWnd: Integer): Integer;
-external 'isxdl_DownloadFiles@files:isxdl.dll stdcall';
-
-function isxdl_SetOption(Option, Value: PAnsiChar): Integer;
-external 'isxdl_SetOption@files:isxdl.dll stdcall';
-
-[Setup]
diff --git a/dist/inno/scripts/lang/english.iss b/dist/inno/scripts/lang/english.iss
deleted file mode 100644
index fa32fc0..0000000
--- a/dist/inno/scripts/lang/english.iss
+++ /dev/null
@@ -1,18 +0,0 @@
-[Languages]
-Name: "en"; MessagesFile: "compiler:Default.isl"
-
-[CustomMessages]
-;http://www.microsoft.com/globaldev/reference/lcid-all.mspx
-en.lcid=1033
-en.depdownload_msg=The following applications are required before setup can continue:%n%n%1%nDownload and install now?
-en.depdownload_memo_title=Download dependencies
-en.depinstall_memo_title=Install dependencies
-en.depinstall_title=Installing dependencies
-en.depinstall_description=Please wait while Setup installs dependencies on your computer.
-en.depinstall_status=Installing %1...
-en.depinstall_missing=%1 must be installed before setup can continue. Please install %1 and run Setup again.
-en.depinstall_error=An error occured while installing the dependencies. Please restart the computer and run the setup again or install the following dependencies manually:%n
-
-en.isxdl_langfile=
-
-[Files]
diff --git a/dist/inno/scripts/products.iss b/dist/inno/scripts/products.iss
deleted file mode 100644
index 63cf4d1..0000000
--- a/dist/inno/scripts/products.iss
+++ /dev/null
@@ -1,6 +0,0 @@
-#include "isxdl\isxdl.iss"
-
-[Code]
-#include "products.pas"
-
-[Setup]
diff --git a/dist/inno/scripts/products.pas b/dist/inno/scripts/products.pas
deleted file mode 100644
index d114c41..0000000
--- a/dist/inno/scripts/products.pas
+++ /dev/null
@@ -1,329 +0,0 @@
-{
- --- TYPES AND VARIABLES ---
-}
-type
- TProduct = record
- File: String;
- Title: String;
- Parameters: String;
- ForceSuccess : boolean;
- InstallClean : boolean;
- MustRebootAfter : boolean;
- end;
-
- InstallResult = (InstallSuccessful, InstallRebootRequired, InstallError);
-
-var
- installMemo, downloadMessage: string;
- products: array of TProduct;
- delayedReboot, isForcedX86: boolean;
- DependencyPage: TOutputProgressWizardPage;
-
-procedure AddProduct(filename, parameters, title, size, url: string; forceSuccess, installClean, mustRebootAfter : boolean);
-{
- Adds a product to the list of products to download.
- Parameters:
- filename: the file name under which to save the file
- parameters: the parameters with which to run the file
- title: the product title
- size: the file size
- url: the URL to download from
- forceSuccess: whether to continue in case of setup failure
- installClean: whether the product needs a reboot before installing
- mustRebootAfter: whether the product needs a reboot after installing
-}
-var
- path: string;
- i: Integer;
-begin
- installMemo := installMemo + '%1' + title + #13;
-
- path := ExpandConstant('{src}{\}') + CustomMessage('DependenciesDir') + '\' + filename;
- if not FileExists(path) then begin
- path := ExpandConstant('{tmp}{\}') + filename;
-
- if not FileExists(path) then begin
- isxdl_AddFile(url, path);
-
- downloadMessage := downloadMessage + '%1' + title + ' (' + size + ')' + #13;
- end;
- end;
-
- i := GetArrayLength(products);
- SetArrayLength(products, i + 1);
- products[i].File := path;
- products[i].Title := title;
- products[i].Parameters := parameters;
- products[i].ForceSuccess := forceSuccess;
- products[i].InstallClean := installClean;
- products[i].MustRebootAfter := mustRebootAfter;
-end;
-
-function SmartExec(product : TProduct; var resultcode : Integer): boolean;
-{
- Executes a product and returns the exit code.
- Parameters:
- product: the product to install
- resultcode: the exit code
-}
-begin
- if (LowerCase(Copy(product.File, Length(product.File) - 2, 3)) = 'exe') then begin
- Result := Exec(product.File, product.Parameters, '', SW_SHOWNORMAL, ewWaitUntilTerminated, resultcode);
- end else begin
- Result := ShellExec('', product.File, product.Parameters, '', SW_SHOWNORMAL, ewWaitUntilTerminated, resultcode);
- end;
-end;
-
-function PendingReboot: boolean;
-{
- Checks whether the machine has a pending reboot.
-}
-var names: String;
-begin
- if (RegQueryMultiStringValue(HKEY_LOCAL_MACHINE, 'SYSTEM\CurrentControlSet\Control\Session Manager', 'PendingFileRenameOperations', names)) then begin
- Result := true;
- end else if ((RegQueryMultiStringValue(HKEY_LOCAL_MACHINE, 'SYSTEM\CurrentControlSet\Control\Session Manager', 'SetupExecute', names)) and (names <> '')) then begin
- Result := true;
- end else begin
- Result := false;
- end;
-end;
-
-function InstallProducts: InstallResult;
-{
- Installs the downloaded products
-}
-var
- resultCode, i, productCount, finishCount: Integer;
-begin
- Result := InstallSuccessful;
- productCount := GetArrayLength(products);
-
- if productCount > 0 then begin
- DependencyPage := CreateOutputProgressPage(CustomMessage('depinstall_title'), CustomMessage('depinstall_description'));
- DependencyPage.Show;
-
- for i := 0 to productCount - 1 do begin
- if (products[i].InstallClean and (delayedReboot or PendingReboot())) then begin
- Result := InstallRebootRequired;
- break;
- end;
-
- DependencyPage.SetText(FmtMessage(CustomMessage('depinstall_status'), [products[i].Title]), '');
- DependencyPage.SetProgress(i, productCount);
-
- while true do begin
- // set 0 as used code for shown error if SmartExec fails
- resultCode := 0;
- if SmartExec(products[i], resultCode) then begin
- // setup executed; resultCode contains the exit code
- if (products[i].MustRebootAfter) then begin
- // delay reboot after install if we installed the last dependency anyways
- if (i = productCount - 1) then begin
- delayedReboot := true;
- end else begin
- Result := InstallRebootRequired;
- end;
- break;
- end else if (resultCode = 0) or (products[i].ForceSuccess) then begin
- finishCount := finishCount + 1;
- break;
- end else if (resultCode = 3010) then begin
- // Windows Installer resultCode 3010: ERROR_SUCCESS_REBOOT_REQUIRED
- delayedReboot := true;
- finishCount := finishCount + 1;
- break;
- end;
- end;
-
- case MsgBox(FmtMessage(SetupMessage(msgErrorFunctionFailed), [products[i].Title, IntToStr(resultCode)]), mbError, MB_ABORTRETRYIGNORE) of
- IDABORT: begin
- Result := InstallError;
- break;
- end;
- IDIGNORE: begin
- break;
- end;
- end;
- end;
-
- if Result <> InstallSuccessful then begin
- break;
- end;
- end;
-
- // only leave not installed products for error message
- for i := 0 to productCount - finishCount - 1 do begin
- products[i] := products[i+finishCount];
- end;
- SetArrayLength(products, productCount - finishCount);
-
- DependencyPage.Hide;
- end;
-end;
-
-{
- --------------------
- INNO EVENT FUNCTIONS
- --------------------
-}
-
-function PrepareToInstall(var NeedsRestart: boolean): String;
-{
- Before the "preparing to install" page.
- See: http://www.jrsoftware.org/ishelp/index.php?topic=scriptevents
-}
-var
- i: Integer;
- s: string;
-begin
- delayedReboot := false;
-
- case InstallProducts() of
- InstallError: begin
- s := CustomMessage('depinstall_error');
-
- for i := 0 to GetArrayLength(products) - 1 do begin
- s := s + #13 + ' ' + products[i].Title;
- end;
-
- Result := s;
- end;
- InstallRebootRequired: begin
- Result := products[0].Title;
- NeedsRestart := true;
-
- // write into the registry that the installer needs to be executed again after restart
- RegWriteStringValue(HKEY_CURRENT_USER, 'SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce', 'InstallBootstrap', ExpandConstant('{srcexe}'));
- end;
- end;
-end;
-
-function NeedRestart : boolean;
-{
- Checks whether a restart is needed at the end of install
- See: http://www.jrsoftware.org/ishelp/index.php?topic=scriptevents
-}
-begin
- Result := delayedReboot;
-end;
-
-function UpdateReadyMemo(Space, NewLine, MemoUserInfoInfo, MemoDirInfo, MemoTypeInfo, MemoComponentsInfo, MemoGroupInfo, MemoTasksInfo: String): String;
-{
- Just before the "ready" page.
- See: http://www.jrsoftware.org/ishelp/index.php?topic=scriptevents
-}
-var
- s: string;
-begin
- if downloadMessage <> '' then
- s := s + CustomMessage('depdownload_memo_title') + ':' + NewLine + FmtMessage(downloadMessage, [Space]) + NewLine;
- if installMemo <> '' then
- s := s + CustomMessage('depinstall_memo_title') + ':' + NewLine + FmtMessage(installMemo, [Space]) + NewLine;
-
- if MemoDirInfo <> '' then
- s := s + MemoDirInfo + NewLine + NewLine;
- if MemoGroupInfo <> '' then
- s := s + MemoGroupInfo + NewLine + NewLine;
- if MemoTasksInfo <> '' then
- s := s + MemoTasksInfo;
-
- Result := s
-end;
-
-function NextButtonClick(CurPageID: Integer): boolean;
-{
- At each "next" button click
- See: http://www.jrsoftware.org/ishelp/index.php?topic=scriptevents
-}
-begin
- Result := true;
-
- if CurPageID = wpReady then begin
- if downloadMessage <> '' then begin
- // change isxdl language only if it is not english because isxdl default language is already english
- if (ActiveLanguage() <> 'en') then begin
- ExtractTemporaryFile(CustomMessage('isxdl_langfile'));
- isxdl_SetOption('language', ExpandConstant('{tmp}{\}') + CustomMessage('isxdl_langfile'));
- end;
- //isxdl_SetOption('title', FmtMessage(SetupMessage(msgSetupWindowTitle), [CustomMessage('appname')]));
-
- //if SuppressibleMsgBox(FmtMessage(CustomMessage('depdownload_msg'), [FmtMessage(downloadMessage, [''])]), mbConfirmation, MB_YESNO, IDYES) = IDNO then
- // Result := false
- //else if
- if isxdl_DownloadFiles(StrToInt(ExpandConstant('{wizardhwnd}'))) = 0 then
- Result := false;
- end;
- end;
-end;
-
-{
- -----------------------------
- ARCHITECTURE HELPER FUNCTIONS
- -----------------------------
-}
-
-function IsX86: boolean;
-{
- Gets whether the computer is x86 (32 bits).
-}
-begin
- Result := isForcedX86 or (ProcessorArchitecture = paX86) or (ProcessorArchitecture = paUnknown);
-end;
-
-function IsX64: boolean;
-{
- Gets whether the computer is x64 (64 bits).
-}
-begin
- Result := (not isForcedX86) and Is64BitInstallMode and (ProcessorArchitecture = paX64);
-end;
-
-function IsIA64: boolean;
-{
- Gets whether the computer is IA64 (Itanium 64 bits).
-}
-begin
- Result := (not isForcedX86) and Is64BitInstallMode and (ProcessorArchitecture = paIA64);
-end;
-
-function GetString(x86, x64, ia64: String): String;
-{
- Gets a string depending on the computer architecture.
- Parameters:
- x86: the string if the computer is x86
- x64: the string if the computer is x64
- ia64: the string if the computer is IA64
-}
-begin
- if IsX64() and (x64 <> '') then begin
- Result := x64;
- end else if IsIA64() and (ia64 <> '') then begin
- Result := ia64;
- end else begin
- Result := x86;
- end;
-end;
-
-function GetArchitectureString(): String;
-{
- Gets the "standard" architecture suffix string.
- Returns either _x64, _ia64 or nothing.
-}
-begin
- if IsX64() then begin
- Result := '_x64';
- end else if IsIA64() then begin
- Result := '_ia64';
- end else begin
- Result := '';
- end;
-end;
-
-procedure SetForceX86(value: boolean);
-{
- Forces the setup to use X86 products
-}
-begin
- isForcedX86 := value;
-end;
diff --git a/dist/inno/scripts/products/msiproduct.iss b/dist/inno/scripts/products/msiproduct.iss
deleted file mode 100644
index 35a8d23..0000000
--- a/dist/inno/scripts/products/msiproduct.iss
+++ /dev/null
@@ -1,49 +0,0 @@
-[Code]
-#ifdef UNICODE
- #define AW "W"
-#else
- #define AW "A"
-#endif
-
-type
- INSTALLSTATE = Longint;
-const
- INSTALLSTATE_INVALIDARG = -2; // An invalid parameter was passed to the function.
- INSTALLSTATE_UNKNOWN = -1; // The product is neither advertised or installed.
- INSTALLSTATE_ADVERTISED = 1; // The product is advertised but not installed.
- INSTALLSTATE_ABSENT = 2; // The product is installed for a different user.
- INSTALLSTATE_DEFAULT = 5; // The product is installed for the current user.
-
-function MsiQueryProductState(szProduct: string): INSTALLSTATE;
-external 'MsiQueryProductState{#AW}@msi.dll stdcall';
-
-function MsiEnumRelatedProducts(szUpgradeCode: string; nReserved: dword; nIndex: dword; szProductCode: string): integer;
-external 'MsiEnumRelatedProducts{#AW}@msi.dll stdcall';
-
-function MsiGetProductInfo(szProductCode: string; szProperty: string; szValue: string; var nvalueSize: dword): integer;
-external 'MsiGetProductInfo{#AW}@msi.dll stdcall';
-
-function msiproduct(productID: string): boolean;
-begin
- Result := MsiQueryProductState(productID) = INSTALLSTATE_DEFAULT;
-end;
-
-function msiproductupgrade(upgradeCode: string; minVersion: string): boolean;
-var
- productCode, version: string;
- valueSize: dword;
-begin
- SetLength(productCode, 39);
- Result := false;
-
- if (MsiEnumRelatedProducts(upgradeCode, 0, 0, productCode) = 0) then begin
- SetLength(version, 39);
- valueSize := Length(version);
-
- if (MsiGetProductInfo(productCode, 'VersionString', version, valueSize) = 0) then begin
- Result := compareversion(version, minVersion) >= 0;
- end;
- end;
-end;
-
-[Setup]
diff --git a/dist/inno/scripts/products/stringversion.iss b/dist/inno/scripts/products/stringversion.iss
deleted file mode 100644
index 4cb114f..0000000
--- a/dist/inno/scripts/products/stringversion.iss
+++ /dev/null
@@ -1,62 +0,0 @@
-[Code]
-function stringtoversion(var temp: String): Integer;
-var
- part: String;
- pos1: Integer;
-
-begin
- if (Length(temp) = 0) then begin
- Result := -1;
- Exit;
- end;
-
- pos1 := Pos('.', temp);
- if (pos1 = 0) then begin
- Result := StrToInt(temp);
- temp := '';
- end else begin
- part := Copy(temp, 1, pos1 - 1);
- temp := Copy(temp, pos1 + 1, Length(temp));
- Result := StrToInt(part);
- end;
-end;
-
-function compareinnerversion(var x, y: String): Integer;
-var
- num1, num2: Integer;
-
-begin
- num1 := stringtoversion(x);
- num2 := stringtoversion(y);
- if (num1 = -1) and (num2 = -1) then begin
- Result := 0;
- Exit;
- end;
-
- if (num1 < 0) then begin
- num1 := 0;
- end;
- if (num2 < 0) then begin
- num2 := 0;
- end;
-
- if (num1 < num2) then begin
- Result := -1;
- end else if (num1 > num2) then begin
- Result := 1;
- end else begin
- Result := compareinnerversion(x, y);
- end;
-end;
-
-function compareversion(versionA, versionB: String): Integer;
-var
- temp1, temp2: String;
-
-begin
- temp1 := versionA;
- temp2 := versionB;
- Result := compareinnerversion(temp1, temp2);
-end;
-
-[Setup]
diff --git a/dist/inno/scripts/products/vcredist2017.iss b/dist/inno/scripts/products/vcredist2017.iss
deleted file mode 100644
index da20e03..0000000
--- a/dist/inno/scripts/products/vcredist2017.iss
+++ /dev/null
@@ -1,32 +0,0 @@
-; requires Windows 10, Windows 7 Service Pack 1, Windows 8, Windows 8.1, Windows Server 2003 Service Pack 2, Windows Server 2008 R2 SP1, Windows Server 2008 Service Pack 2, Windows Server 2012, Windows Vista Service Pack 2, Windows XP Service Pack 3
-; http://www.visualstudio.com/en-us/downloads/
-
-[CustomMessages]
-vcredist2017_title=Visual C++ 2017 Redistributable
-vcredist2017_title_x64=Visual C++ 2017 64-Bit Redistributable
-
-vcredist2017_size=13.7 MB
-vcredist2017_size_x64=14.5 MB
-
-[Code]
-const
- vcredist2017_url = 'http://download.microsoft.com/download/1/f/e/1febbdb2-aded-4e14-9063-39fb17e88444/vc_redist.x86.exe';
- vcredist2017_url_x64 = 'http://download.microsoft.com/download/3/b/f/3bf6e759-c555-4595-8973-86b7b4312927/vc_redist.x64.exe';
-
- vcredist2017_upgradecode = '{65E5BD06-6392-3027-8C26-853107D3CF1A}';
- vcredist2017_upgradecode_x64 = '{36F68A90-239C-34DF-B58C-64B30153CE35}';
-
-procedure vcredist2017(minVersion: string);
-begin
- if (not IsIA64()) then begin
- if (not msiproductupgrade(GetString(vcredist2017_upgradecode, vcredist2017_upgradecode_x64, ''), minVersion)) then
- AddProduct('vcredist2017' + GetArchitectureString() + '.exe',
- '/passive /norestart',
- CustomMessage('vcredist2017_title' + GetArchitectureString()),
- CustomMessage('vcredist2017_size' + GetArchitectureString()),
- GetString(vcredist2017_url, vcredist2017_url_x64, ''),
- false, false, false);
- end;
-end;
-
-[Setup]
diff --git a/dist/inno/scripts/products/winversion.iss b/dist/inno/scripts/products/winversion.iss
deleted file mode 100644
index e1aff98..0000000
--- a/dist/inno/scripts/products/winversion.iss
+++ /dev/null
@@ -1,49 +0,0 @@
-[Code]
-var
- WindowsVersion: TWindowsVersion;
-
-procedure initwinversion();
-begin
- GetWindowsVersionEx(WindowsVersion);
-end;
-
-function exactwinversion(MajorVersion, MinorVersion: integer): boolean;
-begin
- Result := (WindowsVersion.Major = MajorVersion) and (WindowsVersion.Minor = MinorVersion);
-end;
-
-function minwinversion(MajorVersion, MinorVersion: integer): boolean;
-begin
- Result := (WindowsVersion.Major > MajorVersion) or ((WindowsVersion.Major = MajorVersion) and (WindowsVersion.Minor >= MinorVersion));
-end;
-
-function maxwinversion(MajorVersion, MinorVersion: integer): boolean;
-begin
- Result := (WindowsVersion.Major < MajorVersion) or ((WindowsVersion.Major = MajorVersion) and (WindowsVersion.Minor <= MinorVersion));
-end;
-
-function exactwinspversion(MajorVersion, MinorVersion, SpVersion: integer): boolean;
-begin
- if exactwinversion(MajorVersion, MinorVersion) then
- Result := WindowsVersion.ServicePackMajor = SpVersion
- else
- Result := true;
-end;
-
-function minwinspversion(MajorVersion, MinorVersion, SpVersion: integer): boolean;
-begin
- if exactwinversion(MajorVersion, MinorVersion) then
- Result := WindowsVersion.ServicePackMajor >= SpVersion
- else
- Result := true;
-end;
-
-function maxwinspversion(MajorVersion, MinorVersion, SpVersion: integer): boolean;
-begin
- if exactwinversion(MajorVersion, MinorVersion) then
- Result := WindowsVersion.ServicePackMajor <= SpVersion
- else
- Result := true;
-end;
-
-[Setup]
diff --git a/dist/macos/bundle/Barrier.app/Contents/Info.plist.in b/dist/macos/bundle/Barrier.app/Contents/Info.plist.in
deleted file mode 100644
index b973f5e..0000000
--- a/dist/macos/bundle/Barrier.app/Contents/Info.plist.in
+++ /dev/null
@@ -1,32 +0,0 @@
-<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
- <dict>
- <key>CFBundleDevelopmentRegion</key>
- <string>English</string>
- <key>CFBundleDisplayName</key>
- <string>Barrier</string>
- <key>CFBundleExecutable</key>
- <string>barrier.sh</string>
- <key>CFBundleIconFile</key>
- <string>Barrier.icns</string>
- <key>CFBundleIdentifier</key>
- <string>barrier</string>
- <!-- TODO: Fix this in v2.0 //-->
- <key>CFBundleInfoDictionaryVersion</key>
- <string>6.0</string>
- <key>CFBundleName</key>
- <string>Barrier</string>
- <key>CFBundlePackageType</key>
- <string>APPL</string>
- <key>CFBundleSignature</key>
- <string>SYN1</string>
- <key>CFBundleShortVersionString</key>
- <string>@BARRIER_VERSION@</string>
- <key>CFBundleVersion</key>
- <string>@BARRIER_VERSION@</string>
- <key>NSHumanReadableCopyright</key>
- <string>© 2018 Debauchee Open Source Group</string>
- <key>LSMinimumSystemVersion</key>
- <string>10.9.0</string>
- </dict>
-</plist>
diff --git a/dist/macos/bundle/Barrier.app/Contents/PkgInfo b/dist/macos/bundle/Barrier.app/Contents/PkgInfo
deleted file mode 100644
index 583e36a..0000000
--- a/dist/macos/bundle/Barrier.app/Contents/PkgInfo
+++ /dev/null
@@ -1 +0,0 @@
-APPLSYN1 \ No newline at end of file
diff --git a/dist/macos/bundle/Barrier.app/Contents/Resources/Barrier.icns b/dist/macos/bundle/Barrier.app/Contents/Resources/Barrier.icns
deleted file mode 100644
index 9f573da..0000000
--- a/dist/macos/bundle/Barrier.app/Contents/Resources/Barrier.icns
+++ /dev/null
Binary files differ
diff --git a/dist/macos/bundle/build_installer.sh.in b/dist/macos/bundle/build_installer.sh.in
deleted file mode 100755
index f939b77..0000000
--- a/dist/macos/bundle/build_installer.sh.in
+++ /dev/null
@@ -1,77 +0,0 @@
-#!/bin/sh
-
-# change this to rename the installer package
-B_DMG="Barrier-@BARRIER_VERSION@.dmg"
-
-# sanity check so we don't distribute packages full of debug symbols
-if [ "@CMAKE_BUILD_TYPE@" != "Release" ]; then
- echo Will only build installers for Release builds
- exit 1
-fi
-
-cd @CMAKE_CURRENT_SOURCE_DIR@/build/bundle || exit 1
-
-B_REREF_SCRIPT=@CMAKE_CURRENT_SOURCE_DIR@/build/bundle/reref_dylibs.sh
-if [ ! -x $B_REREF_SCRIPT ]; then
- echo Missing script: $B_REREF_SCRIPT
- exit 1
-fi
-
-# remove any old copies so there's no confusion about whether this
-# process completes successfully or not
-rm -rf temp.dmg $B_DMG
-
-cd Barrier.app/Contents 2>/dev/null
-if [ $? -ne 0 ]; then
- echo Please make sure that the build completed successfully
- echo before trying to create the installer.
- exit 1
-fi
-
-# MacOS folder holds the executables, non-system libraries,
-# and the startup script
-rm -rf MacOS
-mkdir MacOS || exit 1
-cd MacOS || exit 1
-
-# copy all executables
-cp @CMAKE_RUNTIME_OUTPUT_DIRECTORY@/* . || exit 1
-
-# copy the qt platform plugin
-# TODO: this is hacky and will probably break if there is more than one qt
-# version installed. need a better way to find this library
-B_COCOA=$(find /usr/local/Cellar/qt -type f -name libqcocoa.dylib | head -1)
-if [ $? -ne 0 ] || [ "x$B_COCOA" = "x" ]; then
- echo "Could not find cocoa platform plugin"
- exit 1
-fi
-mkdir platforms
-cp $B_COCOA platforms/ || exit 1
-
-# make sure we can r/w all these binaries
-chmod -R u+rw * || exit 1
-
-# only one executable (barrier) needs non-system libraries although it's
-# libraries can call each other. use a recursive script to handle the
-# re-referencing
-$B_REREF_SCRIPT barrier || exit 1
-# the cocoa platform plugin also needs to know where to find the qt libraries.
-# because it exists in a subdirectory we append ../ to the relative path of the
-# libraries in its metadata
-$B_REREF_SCRIPT platforms/libqcocoa.dylib ../ || exit 1
-
-# create a startup script that will change to the binary directory
-# before starting barrier
-printf "%s\n" "#!/bin/sh" "cd \$(dirname \$0)" "exec ./barrier" > barrier.sh
-chmod +x barrier.sh
-
-# create the DMG to be distributed in build/bundle
-cd ../../..
-hdiutil create -size 64m -fs HFS+ -volname "Barrier" temp.dmg || exit 1
-hdiutil attach temp.dmg -mountpoint mnt || exit 1
-cp -r Barrier.app mnt/ || exit 1
-hdiutil detach mnt || exit 1
-hdiutil convert temp.dmg -format UDZO -o $B_DMG || exit 1
-rm temp.dmg
-
-echo "Installer created successfully"
diff --git a/dist/macos/bundle/reref_dylibs.sh b/dist/macos/bundle/reref_dylibs.sh
deleted file mode 100755
index 15191bd..0000000
--- a/dist/macos/bundle/reref_dylibs.sh
+++ /dev/null
@@ -1,41 +0,0 @@
-#!/bin/sh
-
-# $1 = binary (program or dylib)
-B_TARGET=$1
-if [ "x$B_TARGET" = "x" ]; then
- echo Which binary needs to be re-referenced?
- exit 1
-fi
-
-cd $(dirname $B_TARGET) || exit 1
-
-# where to find non-system libraries relative to target's directory.
-# the vast majority of the time this should be empty
-B_REL_PATH=$2
-
-# we're in target's directory now. trim off the path
-B_TARGET=$(basename $B_TARGET)
-
-# get a list of non-system libraries and make local copies
-B_LIBS=$(otool -XL $B_TARGET | awk '{ print $1 }' | grep -Ev '^(/usr/lib|/System)')
-[ $? -ne 0 ] && exit 1
-for B_LIB in $B_LIBS; do
- B_LIB_NAME=$(basename $B_LIB)
-
- # ignore self-references
- [ "$B_TARGET" = "$B_LIB_NAME" ] && continue
-
- B_DST=${B_REL_PATH}${B_LIB_NAME}
- if [ ! -e $B_DST ]; then
- cp $B_LIB $B_DST || exit 1
- chmod u+rw $B_DST || exit 1
- # recursively call this script on libraries purposefully not passing
- # $B_REL_PATH so that it is only used explicitly
- $0 $B_DST
- fi
-
- # adjust the target's metadata to point to the local copy
- # rather than the system-wide copy which would only exist on
- # a development machine
- install_name_tool -change $B_LIB @loader_path/$B_DST $B_TARGET || exit 1
-done
diff --git a/dist/wix/Barrier.sln b/dist/wix/Barrier.sln
deleted file mode 100644
index c163c62..0000000
--- a/dist/wix/Barrier.sln
+++ /dev/null
@@ -1,27 +0,0 @@
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 14
-VisualStudioVersion = 14.0.23107.0
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "Barrier", "Barrier.wixproj", "{D4BA9F39-6A35-4C8F-9CB2-67FCBE5CAB17}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|x86 = Debug|x86
- Debug|x64 = Debug|x64
- Release|x86 = Release|x86
- Release|x64 = Release|x64
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {D4BA9F39-6A35-4C8F-9CB2-67FCBE5CAB17}.Debug|x86.ActiveCfg = Debug|x86
- {D4BA9F39-6A35-4C8F-9CB2-67FCBE5CAB17}.Debug|x86.Build.0 = Debug|x86
- {D4BA9F39-6A35-4C8F-9CB2-67FCBE5CAB17}.Debug|x64.ActiveCfg = Debug|x64
- {D4BA9F39-6A35-4C8F-9CB2-67FCBE5CAB17}.Debug|x64.Build.0 = Debug|x64
- {D4BA9F39-6A35-4C8F-9CB2-67FCBE5CAB17}.Release|x86.ActiveCfg = Release|x86
- {D4BA9F39-6A35-4C8F-9CB2-67FCBE5CAB17}.Release|x86.Build.0 = Release|x86
- {D4BA9F39-6A35-4C8F-9CB2-67FCBE5CAB17}.Release|x64.ActiveCfg = Release|x64
- {D4BA9F39-6A35-4C8F-9CB2-67FCBE5CAB17}.Release|x64.Build.0 = Release|x64
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
diff --git a/dist/wix/Barrier.wixproj b/dist/wix/Barrier.wixproj
deleted file mode 100644
index ffc7701..0000000
--- a/dist/wix/Barrier.wixproj
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <ProductVersion>3.10</ProductVersion>
- <ProjectGuid>{d4ba9f39-6a35-4c8f-9cb2-67fcbe5cab17}</ProjectGuid>
- <SchemaVersion>2.0</SchemaVersion>
- <OutputName>Barrier</OutputName>
- <OutputType>Package</OutputType>
- <WixTargetsPath Condition=" '$(WixTargetsPath)' == '' AND '$(MSBuildExtensionsPath32)' != '' ">$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets</WixTargetsPath>
- <WixTargetsPath Condition=" '$(WixTargetsPath)' == '' ">$(MSBuildExtensionsPath)\Microsoft\WiX\v3.x\Wix.targets</WixTargetsPath>
- <OutputPath>bin\$(Configuration)\</OutputPath>
- <IntermediateOutputPath>wix\obj\$(Configuration)\</IntermediateOutputPath>
- </PropertyGroup>
- <ItemGroup>
- <WixExtension Include="WixFirewallExtension">
- <HintPath>$(WixExtDir)\WixFirewallExtension.dll</HintPath>
- <Name>WixFirewallExtension</Name>
- </WixExtension>
- <WixExtension Include="WixUtilExtension">
- <HintPath>$(WixExtDir)\WixUtilExtension.dll</HintPath>
- <Name>WixUtilExtension</Name>
- </WixExtension>
- <WixExtension Include="WixUIExtension">
- <HintPath>$(WixExtDir)\WixUIExtension.dll</HintPath>
- <Name>WixUIExtension</Name>
- </WixExtension>
- <Compile Include="Product.wxs"/>
- <Content Include="Include.wxi"/>
- </ItemGroup>
- <Import Project="$(WixTargetsPath)"/>
-</Project> \ No newline at end of file
diff --git a/dist/wix/Include.wxi.in b/dist/wix/Include.wxi.in
deleted file mode 100644
index 652d203..0000000
--- a/dist/wix/Include.wxi.in
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Include>
- <?define Name="Barrier" ?>
- <?define Version="@BARRIER_VERSION@" ?>
- <?define QtVersion="@QT_VERSION@" ?>
- <?define Author="Debauchee Open Source Group" ?>
- <?define BinPath="@CMAKE_RUNTIME_OUTPUT_DIRECTORY@/$(var.Configuration)" ?>
- <?define ResPath="@CMAKE_CURRENT_SOURCE_DIR@/res" ?>
- <?define ExtPath="@CMAKE_CURRENT_SOURCE_DIR@/ext" ?>
- <?if $(var.Platform) = "x64" ?>
- <?define ProgramFilesFolder="ProgramFiles64Folder" ?>
- <?define PlatformSimpleName="64-bit" ?>
- <?define UpgradeGuid="E8A4FA54-14B9-4FD1-8E00-7BC46555FDA0" ?>
- <?define QtPath="E:\Qt\$(var.QtVersion)\msvc2015_64" ?>
- <?else ?>
- <?define ProgramFilesFolder="ProgramFilesFolder" ?>
- <?define PlatformSimpleName="32-bit" ?>
- <?define UpgradeGuid="BE0B9FD8-45E2-4A8E-A0D8-1F774D074A78" ?>
- <?define QtPath="E:\Qt\$(var.QtVersion)\msvc2015" ?>
- <?endif ?>
- <?define QtBinPath="$(var.QtPath)\bin" ?>
- <?define QtPlatformPath="$(var.QtPath)\plugins\platforms" ?>
- <?define OpenSSLPath="$(var.ExtPath)\openssl\windows\$(var.Platform)" ?>
- <?define OpenSSLBinPath="$(var.OpenSSLPath)\bin" ?>
-</Include>
diff --git a/dist/wix/Product.wxs b/dist/wix/Product.wxs
deleted file mode 100644
index 1abc21e..0000000
--- a/dist/wix/Product.wxs
+++ /dev/null
@@ -1,104 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:fire="http://schemas.microsoft.com/wix/FirewallExtension" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
- <?include Include.wxi?>
- <Product Id="*" Language="1033" Manufacturer="$(var.Author)" Name="$(var.Name) ($(var.PlatformSimpleName))" UpgradeCode="$(var.UpgradeGuid)" Version="$(var.Version)">
- <Package Compressed="yes" InstallScope="perMachine" InstallerVersion="301"/>
- <MajorUpgrade DowngradeErrorMessage="A newer version of $(var.Name) is already installed."/>
- <MediaTemplate EmbedCab="yes"/>
- <UIRef Id="WixUI_InstallDir"/>
- <!-- causes ICE61 warning, but stops user from installing many instances from nightly builds. -->
- <Upgrade Id="$(var.UpgradeGuid)">
- <UpgradeVersion Minimum="0.0.0.0" Property="UPGRADE"/>
- </Upgrade>
- <Feature Id="ProductFeature" Title="$(var.Name)">
- <ComponentGroupRef Id="ProductComponents"/>
- <ComponentGroupRef Id="ProductQtPluginComponents"/>
- <ComponentRef Id="RegistryEntries"/>
- </Feature>
- <DirectoryRef Id="TARGETDIR">
- <Component Guid="7CF3564D-1F8E-4D3D-9781-E1EE22D5BD67" Id="RegistryEntries">
- <RegistryKey ForceCreateOnInstall="yes" ForceDeleteOnUninstall="yes" Key="Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" Root="HKLM">
- <RegistryValue Name="[INSTALLFOLDER]barriers.exe" Type="string" Value="~ HIGHDPIAWARE WIN7RTM"/>
- </RegistryKey>
- <!-- Windows 8 and later only -->
- <Condition><![CDATA[Installed OR (VersionNT >= 602)]]></Condition>
- </Component>
- </DirectoryRef>
- <Icon Id="barrier.ico" SourceFile="$(var.ResPath)/barrier.ico"/>
- <WixVariable Id="WixUILicenseRtf" Value="$(var.ResPath)\License.rtf"/>
- <WixVariable Id="WixUIBannerBmp" Value="$(var.ResPath)\banner.bmp"/>
- <WixVariable Id="WixUIDialogBmp" Value="$(var.ResPath)\dialog.bmp"/>
- <Property Id="ARPPRODUCTICON" Value="barrier.ico"/>
- <Property Id="WIXUI_INSTALLDIR" Value="INSTALLFOLDER"/>
- <Property Id="MSIRESTARTMANAGERCONTROL" Value="Disable"/>
- </Condition>
- <CustomAction ExeCommand="" FileKey="GuiProgram" Id="StartGui" Return="asyncNoWait"/>
- <UI>
- <Publish Control="Finish" Dialog="ExitDialog" Event="DoAction" Value="StartGui">NOT Installed</Publish>
- </UI>
- </Product>
- <Fragment>
- <Directory Id="TARGETDIR" Name="SourceDir">
- <Directory Id="$(var.ProgramFilesFolder)">
- <Directory Id="INSTALLFOLDER" Name="$(var.Name)">
- <Directory Id="OpenSSLDir" Name="OpenSSL"/>
- <Directory Id="PlatformsDir" Name="Platforms"/>
- </Directory>
- </Directory>
- <Directory Id="ProgramMenuFolder"/>
- </Directory>
- </Fragment>
- <Fragment>
- <ComponentGroup Directory="INSTALLFOLDER" Id="ProductComponents">
- <Component Guid="EC9AD3B0-277C-4157-B5C8-5FD5B6A5F4AD" Id="Core">
- <File KeyPath="yes" Source="$(var.BinPath)/barrierd.exe"/>
- <ServiceInstall Description="Controls the $(var.Name) foreground processes." DisplayName="$(var.Name)" ErrorControl="normal" Id="ServiceInstall" Name="Barrier" Start="auto" Type="ownProcess">
- <util:ServiceConfig FirstFailureActionType="restart" ResetPeriodInDays="1" RestartServiceDelayInSeconds="1" SecondFailureActionType="restart" ThirdFailureActionType="restart"/>
- </ServiceInstall>
- <ServiceControl Id="ServiceControl" Name="Barrier" Remove="uninstall" Start="install" Stop="both"/>
- <File Source="$(var.BinPath)/barriers.exe">
- <fire:FirewallException Id="ServerFirewallException" IgnoreFailure="yes" Name="$(var.Name)" Scope="any"/>
- </File>
- <File Source="$(var.BinPath)/barrierc.exe"/>
- <File Source="$(var.OpenSSLBinPath)/libeay32.dll"/>
- <File Source="$(var.OpenSSLBinPath)/ssleay32.dll"/>
- <File Source="$(var.OpenSSLBinPath)/openssl.exe"/>
- <File Source="$(var.ResPath)/openssl/barrier.conf"/>
- </Component>
- <Component Guid="BAC8149B-6287-45BF-9C27-43D71ED40214" Id="Gui">
- <File Id="GuiProgram" KeyPath="yes" Source="$(var.BinPath)/barrier.exe">
- <Shortcut Advertise="yes" Directory="ProgramMenuFolder" Icon="barrier.ico" Id="GuiShortcut" Name="$(var.Name)"/>
- <fire:FirewallException Id="GuiFirewallException" IgnoreFailure="yes" Name="$(var.Name)" Scope="any"/>
- </File>
- <?if $(var.Configuration) = "Debug" ?>
- <File Source="$(var.QtBinPath)\Qt5Cored.dll"/>
- <File Source="$(var.QtBinPath)\Qt5Guid.dll"/>
- <File Source="$(var.QtBinPath)\Qt5Networkd.dll"/>
- <File Source="$(var.QtBinPath)\Qt5Svgd.dll"/>
- <File Source="$(var.QtBinPath)\Qt5Widgetsd.dll"/>
- <File Source="$(var.QtBinPath)\libGLESv2d.dll"/>
- <File Source="$(var.QtBinPath)\libEGLd.dll"/>
- <!-- Hacky -->
- <File Source="C:\Program Files (x86)\Windows Kits\10\bin\$(var.Platform)\ucrt\ucrtbased.dll"/>
- <?else ?>
- <File Source="$(var.QtBinPath)\Qt5Core.dll"/>
- <File Source="$(var.QtBinPath)\Qt5Gui.dll"/>
- <File Source="$(var.QtBinPath)\Qt5Network.dll"/>
- <File Source="$(var.QtBinPath)\Qt5Svg.dll"/>
- <File Source="$(var.QtBinPath)\Qt5Widgets.dll"/>
- <File Source="$(var.QtBinPath)\libGLESv2.dll"/>
- <File Source="$(var.QtBinPath)\libEGL.dll"/>
- <?endif ?>
- </Component>
- </ComponentGroup>
- <ComponentGroup Directory="PlatformsDir" Id="ProductQtPluginComponents">
- <Component Guid="684EFA14-856B-440E-A5E6-E90E04E36B41" Id="QtPlatformPlugin">
- <?if $(var.Configuration) = "Debug" ?>
- <File Source="$(var.QtPlatformPath)\qwindowsd.dll"/>
- <?else ?>
- <File Source="$(var.QtPlatformPath)\qwindows.dll"/>
- <?endif ?>
- </Component>
- </ComponentGroup>
- </Fragment>
-</Wix>
diff --git a/osx_environment.sh b/osx_environment.sh
index f05ba58..e30a0c0 100644
--- a/osx_environment.sh
+++ b/osx_environment.sh
@@ -1,16 +1,37 @@
-#!/bin/sh
+#!/bin/bash
if [ ! $BARRIER_BUILD_ENV ]; then
printf "Modifying environment for Barrier build..."
- QT_PATH=$(brew --prefix qt)
- OPENSSL_PATH=$(brew --prefix openssl)
+ if command -v port; then
+ printf "Detected Macports"
+
+ if [ ! -d /opt/local/lib/cmake/Qt5 ]; then
+ printf "Please install qt5-qtbase port"
+ fi
+ export BARRIER_BUILD_MACPORTS=1
+ export CMAKE_PREFIX_PATH="/opt/local/lib/cmake/Qt5:$CMAKE_PREFIX_PATH"
+ export LD_LIBRARY_PATH="/opt/local/lib:$LD_LIBRARY_PATH"
+ export CPATH="/opt/local/include:$CPATH"
+ export PKG_CONFIG_PATH="/opt/local/libexec/qt5/lib/pkgconfig:$PKG_CONFIG_PATH"
+
+ elif command -v brew; then
+ printf "Detected Homebrew"
+ QT_PATH=$(brew --prefix qt)
+ OPENSSL_PATH=$(brew --prefix openssl)
+
+ export BARRIER_BUILD_BREW=1
+ export CMAKE_PREFIX_PATH="$QT_PATH:$CMAKE_PREFIX_PATH"
+ export LD_LIBRARY_PATH="$OPENSSL_PATH/lib:$LD_LIBRARY_PATH"
+ export CPATH="$OPENSSL_PATH/include:$CPATH"
+ export PKG_CONFIG_PATH="$OPENSSL_PATH/lib/pkgconfig:$PKG_CONFIG_PATH"
+
+ else
+ printf "Neither Homebrew nor Macports is installed. Can't get dependency paths"
+ exit 1
+ fi
- export CMAKE_PREFIX_PATH="$QT_PATH:$CMAKE_PREFIX_PATH"
- export LD_LIBRARY_PATH="$OPENSSL_PATH/lib:$LD_LIBRARY_PATH"
- export CPATH="$OPENSSL_PATH/include:$CPATH"
- export PKG_CONFIG_PATH="$OPENSSL_PATH/lib/pkgconfig:$PKG_CONFIG_PATH"
export BARRIER_BUILD_ENV=1
printf "done\n"
diff --git a/src/cmd/barrierc/CMakeLists.txt b/src/cmd/barrierc/CMakeLists.txt
index 92276d2..0c08550 100644
--- a/src/cmd/barrierc/CMakeLists.txt
+++ b/src/cmd/barrierc/CMakeLists.txt
@@ -29,6 +29,7 @@ if (WIN32)
tb_idle.ico
tb_run.ico
tb_wait.ico
+ barrierc.exe.manifest
)
elseif (APPLE)
file(GLOB arch_headers "OSX*.h")
diff --git a/src/cmd/barrierc/barrierc.exe.manifest b/src/cmd/barrierc/barrierc.exe.manifest
new file mode 100644
index 0000000..7309fde
--- /dev/null
+++ b/src/cmd/barrierc/barrierc.exe.manifest
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"><trustInfo xmlns="urn:schemas-microsoft-com:asm.v3"><security><requestedPrivileges><requestedExecutionLevel level="asInvoker" uiAccess="false"></requestedExecutionLevel></requestedPrivileges></security></trustInfo><application xmlns="urn:schemas-microsoft-com:asm.v3"><windowsSettings><dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware></windowsSettings></application></assembly> \ No newline at end of file
diff --git a/src/cmd/barriers/CMakeLists.txt b/src/cmd/barriers/CMakeLists.txt
index e1871ee..912421f 100644
--- a/src/cmd/barriers/CMakeLists.txt
+++ b/src/cmd/barriers/CMakeLists.txt
@@ -29,6 +29,7 @@ if (WIN32)
tb_idle.ico
tb_run.ico
tb_wait.ico
+ barriers.exe.manifest
)
elseif (APPLE)
file(GLOB arch_headers "OSX*.h")
diff --git a/src/cmd/barriers/barriers.exe.manifest b/src/cmd/barriers/barriers.exe.manifest
new file mode 100644
index 0000000..7309fde
--- /dev/null
+++ b/src/cmd/barriers/barriers.exe.manifest
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"><trustInfo xmlns="urn:schemas-microsoft-com:asm.v3"><security><requestedPrivileges><requestedExecutionLevel level="asInvoker" uiAccess="false"></requestedExecutionLevel></requestedPrivileges></security></trustInfo><application xmlns="urn:schemas-microsoft-com:asm.v3"><windowsSettings><dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware></windowsSettings></application></assembly> \ No newline at end of file
diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt
index 9c90286..9eaa67e 100644
--- a/src/gui/CMakeLists.txt
+++ b/src/gui/CMakeLists.txt
@@ -22,7 +22,7 @@ add_executable (barrier WIN32
include_directories (./src)
-qt5_use_modules (barrier Core Widgets Network)
+target_link_libraries (barrier Qt5::Core Qt5::Widgets Qt5::Network)
target_compile_definitions (barrier PRIVATE -DBARRIER_VERSION_STAGE="${BARRIER_VERSION_STAGE}")
target_compile_definitions (barrier PRIVATE -DBARRIER_REVISION="${BARRIER_REVISION}")
@@ -36,8 +36,7 @@ if (WIN32)
elseif (APPLE)
find_library(APPSERVICES_LIB ApplicationServices)
target_link_libraries(barrier ${APPSERVICES_LIB})
-elseif (${CMAKE_SYSTEM_NAME} MATCHES "Linux" OR
- ${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
+else()
target_link_libraries (barrier dns_sd)
endif()
diff --git a/src/gui/src/ActionDialog.cpp b/src/gui/src/ActionDialog.cpp
index e824ea3..3565cfb 100644
--- a/src/gui/src/ActionDialog.cpp
+++ b/src/gui/src/ActionDialog.cpp
@@ -25,6 +25,7 @@
#include <QtCore>
#include <QtGui>
+#include <QButtonGroup>
ActionDialog::ActionDialog(QWidget* parent, ServerConfig& config, Hotkey& hotkey, Action& action) :
QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint),
diff --git a/src/gui/src/NewScreenWidget.cpp b/src/gui/src/NewScreenWidget.cpp
index 18379c0..0336249 100644
--- a/src/gui/src/NewScreenWidget.cpp
+++ b/src/gui/src/NewScreenWidget.cpp
@@ -1,4 +1,4 @@
-/*
+/*
* barrier -- mouse and keyboard sharing utility
* Copyright (C) 2012-2016 Symless Ltd.
* Copyright (C) 2008 Volker Lanz (vl@fidra.de)
diff --git a/src/gui/src/ScreenSettingsDialog.cpp b/src/gui/src/ScreenSettingsDialog.cpp
index 1e95a9c..4f294e2 100644
--- a/src/gui/src/ScreenSettingsDialog.cpp
+++ b/src/gui/src/ScreenSettingsDialog.cpp
@@ -23,6 +23,19 @@
#include <QtGui>
#include <QMessageBox>
+static const QRegExp ValidScreenName("[a-z0-9\\._-]{,255}", Qt::CaseInsensitive);
+
+static QString check_name_param(QString name)
+{
+ // after internationalization happens the default name "Unnamed" might
+ // be translated with spaces (or other chars). let's replace the spaces
+ // with dashes and just give up if that doesn't pass the regexp
+ name.replace(' ', '-');
+ if (ValidScreenName.exactMatch(name))
+ return name;
+ return "";
+}
+
ScreenSettingsDialog::ScreenSettingsDialog(QWidget* parent, Screen* pScreen) :
QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint),
Ui::ScreenSettingsDialogBase(),
@@ -30,13 +43,11 @@ ScreenSettingsDialog::ScreenSettingsDialog(QWidget* parent, Screen* pScreen) :
{
setupUi(this);
- QRegExp validScreenName("[a-z0-9\\._-]{,255}", Qt::CaseInsensitive);
-
- m_pLineEditName->setText(m_pScreen->name());
- m_pLineEditName->setValidator(new QRegExpValidator(validScreenName, m_pLineEditName));
+ m_pLineEditName->setText(check_name_param(m_pScreen->name()));
+ m_pLineEditName->setValidator(new QRegExpValidator(ValidScreenName, m_pLineEditName));
m_pLineEditName->selectAll();
- m_pLineEditAlias->setValidator(new QRegExpValidator(validScreenName, m_pLineEditName));
+ m_pLineEditAlias->setValidator(new QRegExpValidator(ValidScreenName, m_pLineEditName));
for (int i = 0; i < m_pScreen->aliases().count(); i++)
new QListWidgetItem(m_pScreen->aliases()[i], m_pListAliases);
diff --git a/src/gui/src/ScreenSetupView.cpp b/src/gui/src/ScreenSetupView.cpp
index e42ae17..46e7099 100644
--- a/src/gui/src/ScreenSetupView.cpp
+++ b/src/gui/src/ScreenSetupView.cpp
@@ -22,6 +22,7 @@
#include <QtCore>
#include <QtGui>
+#include <QHeaderView>
ScreenSetupView::ScreenSetupView(QWidget* parent) :
QTableView(parent)
diff --git a/src/gui/src/SettingsDialogBase.ui b/src/gui/src/SettingsDialogBase.ui
index 432ec0d..d75c18c 100644
--- a/src/gui/src/SettingsDialogBase.ui
+++ b/src/gui/src/SettingsDialogBase.ui
@@ -167,7 +167,7 @@
<item row="1" column="0">
<widget class="QLabel" name="m_pLabel_21">
<property name="text">
- <string>&amp;Interface:</string>
+ <string>&amp;Address:</string>
</property>
<property name="buddy">
<cstring>m_pLineEditInterface</cstring>
diff --git a/src/gui/src/SslCertificate.cpp b/src/gui/src/SslCertificate.cpp
index 9b31c5d..80fdfc2 100644
--- a/src/gui/src/SslCertificate.cpp
+++ b/src/gui/src/SslCertificate.cpp
@@ -121,7 +121,7 @@ void SslCertificate::generateCertificate()
// private key
arguments.append("-newkey");
- arguments.append("rsa:1024");
+ arguments.append("rsa:2048");
QDir sslDir(sslDirPath);
if (!sslDir.exists()) {
diff --git a/src/lib/arch/CMakeLists.txt b/src/lib/arch/CMakeLists.txt
index 113cdd9..db92634 100644
--- a/src/lib/arch/CMakeLists.txt
+++ b/src/lib/arch/CMakeLists.txt
@@ -41,7 +41,5 @@ add_library(arch STATIC ${sources})
if (UNIX)
target_link_libraries(arch ${libs})
- if (NOT CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
- target_link_libraries(arch dl)
- endif()
+ target_link_libraries(arch ${CMAKE_DL_LIBS})
endif()
diff --git a/src/lib/barrier/ServerApp.cpp b/src/lib/barrier/ServerApp.cpp
index 6d8d7cd..ff98cc1 100644
--- a/src/lib/barrier/ServerApp.cpp
+++ b/src/lib/barrier/ServerApp.cpp
@@ -145,7 +145,7 @@ ServerApp::help()
<< std::endl
<< "If no configuration file pathname is provided then the first of the" << std::endl
<< "following to load successfully sets the configuration:" << std::endl
- << " " << PathUtilities::concat(DataDirectories::profile(), SYS_CONFIG_NAME) << std::endl
+ << " " << PathUtilities::concat(DataDirectories::profile(), USR_CONFIG_NAME) << std::endl
<< " " << PathUtilities::concat(DataDirectories::systemconfig(), SYS_CONFIG_NAME) << std::endl;
LOG((CLOG_PRINT "%s", buffer.str().c_str()));
diff --git a/src/lib/base/Unicode.cpp b/src/lib/base/Unicode.cpp
index 6a077e7..90a166f 100644
--- a/src/lib/base/Unicode.cpp
+++ b/src/lib/base/Unicode.cpp
@@ -628,25 +628,25 @@ Unicode::fromUTF8(const UInt8*& data, UInt32& n)
case 4:
c = ((static_cast<UInt32>(data[0]) & 0x07) << 18) |
((static_cast<UInt32>(data[1]) & 0x3f) << 12) |
- ((static_cast<UInt32>(data[1]) & 0x3f) << 6) |
- ((static_cast<UInt32>(data[1]) & 0x3f) );
+ ((static_cast<UInt32>(data[2]) & 0x3f) << 6) |
+ ((static_cast<UInt32>(data[3]) & 0x3f) );
break;
case 5:
c = ((static_cast<UInt32>(data[0]) & 0x03) << 24) |
((static_cast<UInt32>(data[1]) & 0x3f) << 18) |
- ((static_cast<UInt32>(data[1]) & 0x3f) << 12) |
- ((static_cast<UInt32>(data[1]) & 0x3f) << 6) |
- ((static_cast<UInt32>(data[1]) & 0x3f) );
+ ((static_cast<UInt32>(data[2]) & 0x3f) << 12) |
+ ((static_cast<UInt32>(data[3]) & 0x3f) << 6) |
+ ((static_cast<UInt32>(data[4]) & 0x3f) );
break;
case 6:
c = ((static_cast<UInt32>(data[0]) & 0x01) << 30) |
((static_cast<UInt32>(data[1]) & 0x3f) << 24) |
- ((static_cast<UInt32>(data[1]) & 0x3f) << 18) |
- ((static_cast<UInt32>(data[1]) & 0x3f) << 12) |
- ((static_cast<UInt32>(data[1]) & 0x3f) << 6) |
- ((static_cast<UInt32>(data[1]) & 0x3f) );
+ ((static_cast<UInt32>(data[2]) & 0x3f) << 18) |
+ ((static_cast<UInt32>(data[3]) & 0x3f) << 12) |
+ ((static_cast<UInt32>(data[4]) & 0x3f) << 6) |
+ ((static_cast<UInt32>(data[5]) & 0x3f) );
break;
default:
diff --git a/src/lib/platform/OSXScreen.h b/src/lib/platform/OSXScreen.h
index 27cb7df..6178529 100644
--- a/src/lib/platform/OSXScreen.h
+++ b/src/lib/platform/OSXScreen.h
@@ -144,10 +144,10 @@ private:
ButtonID mapMacButtonToBarrier(UInt16) const;
// map mac scroll wheel value to a barrier scroll wheel value
- SInt32 mapScrollWheelToBarrier(SInt32) const;
+ SInt32 mapScrollWheelToBarrier(float) const;
// map barrier scroll wheel value to a mac scroll wheel value
- SInt32 mapScrollWheelFromBarrier(SInt32) const;
+ SInt32 mapScrollWheelFromBarrier(float) const;
// get the current scroll wheel speed
double getScrollSpeed() const;
diff --git a/src/lib/platform/OSXScreen.mm b/src/lib/platform/OSXScreen.mm
index 1d80521..1e0268e 100644
--- a/src/lib/platform/OSXScreen.mm
+++ b/src/lib/platform/OSXScreen.mm
@@ -1421,7 +1421,7 @@ OSXScreen::mapMacButtonToBarrier(UInt16 macButton) const
}
SInt32
-OSXScreen::mapScrollWheelToBarrier(SInt32 x) const
+OSXScreen::mapScrollWheelToBarrier(float x) const
{
// return accelerated scrolling but not exponentially scaled as it is
// on the mac.
@@ -1430,7 +1430,7 @@ OSXScreen::mapScrollWheelToBarrier(SInt32 x) const
}
SInt32
-OSXScreen::mapScrollWheelFromBarrier(SInt32 x) const
+OSXScreen::mapScrollWheelFromBarrier(float x) const
{
// use server's acceleration with a little boost since other platforms
// take one wheel step as a larger step than the mac does.
@@ -1948,9 +1948,9 @@ OSXScreen::handleCGInputEvent(CGEventTapProxy proxy,
break;
case kCGEventScrollWheel:
screen->onMouseWheel(screen->mapScrollWheelToBarrier(
- CGEventGetIntegerValueField(event, kCGScrollWheelEventDeltaAxis2)),
+ CGEventGetIntegerValueField(event, kCGScrollWheelEventFixedPtDeltaAxis2) / 65536.0f),
screen->mapScrollWheelToBarrier(
- CGEventGetIntegerValueField(event, kCGScrollWheelEventDeltaAxis1)));
+ CGEventGetIntegerValueField(event, kCGScrollWheelEventFixedPtDeltaAxis1) / 65536.0f));
break;
case kCGEventKeyDown:
case kCGEventKeyUp:
diff --git a/src/lib/platform/XWindowsScreen.cpp b/src/lib/platform/XWindowsScreen.cpp
index 581c911..2846412 100644
--- a/src/lib/platform/XWindowsScreen.cpp
+++ b/src/lib/platform/XWindowsScreen.cpp
@@ -99,6 +99,7 @@ XWindowsScreen::XWindowsScreen(
IEventQueue* events) :
m_isPrimary(isPrimary),
m_mouseScrollDelta(mouseScrollDelta),
+ m_accumulatedScroll(0),
m_display(NULL),
m_root(None),
m_window(None),
@@ -865,9 +866,11 @@ XWindowsScreen::fakeMouseWheel(SInt32, SInt32 yDelta) const
return;
}
- // choose button depending on rotation direction
- const unsigned int xButton = mapButtonToX(static_cast<ButtonID>(
- (yDelta >= 0) ? -1 : -2));
+ int numEvents = accumulateMouseScroll(yDelta);
+
+ // choose button depending on rotation direction
+ const unsigned int xButton = mapButtonToX(static_cast<ButtonID>(
+ (numEvents >= 0) ? -1 : -2));
if (xButton == 0) {
// If we get here, then the XServer does not support the scroll
// wheel buttons, so send PageUp/PageDown keystrokes instead.
@@ -886,20 +889,14 @@ XWindowsScreen::fakeMouseWheel(SInt32, SInt32 yDelta) const
return;
}
- // now use absolute value of delta
- if (yDelta < 0) {
- yDelta = -yDelta;
- }
-
- if (yDelta < m_mouseScrollDelta) {
- LOG((CLOG_WARN "Wheel scroll delta (%d) smaller than threshold (%d)", yDelta, m_mouseScrollDelta));
- }
+ numEvents = std::abs(numEvents);
// send as many clicks as necessary
- for (; yDelta >= m_mouseScrollDelta; yDelta -= m_mouseScrollDelta) {
+ for (; numEvents > 0; numEvents--) {
XTestFakeButtonEvent(m_display, xButton, True, CurrentTime);
XTestFakeButtonEvent(m_display, xButton, False, CurrentTime);
}
+
XFlush(m_display);
}
@@ -1643,6 +1640,15 @@ XWindowsScreen::onMouseMove(const XMotionEvent& xmotion)
}
}
+int
+XWindowsScreen::accumulateMouseScroll(SInt32 yDelta) const
+{
+ m_accumulatedScroll += yDelta;
+ int numEvents = m_accumulatedScroll / m_mouseScrollDelta;
+ m_accumulatedScroll -= numEvents * m_mouseScrollDelta;
+ return numEvents;
+}
+
Cursor
XWindowsScreen::createBlankCursor() const
{
diff --git a/src/lib/platform/XWindowsScreen.h b/src/lib/platform/XWindowsScreen.h
index 35f9368..a2e3495 100644
--- a/src/lib/platform/XWindowsScreen.h
+++ b/src/lib/platform/XWindowsScreen.h
@@ -136,6 +136,10 @@ private:
void onMouseRelease(const XButtonEvent&);
void onMouseMove(const XMotionEvent&);
+ // Returns the number of scroll events needed after the current delta has
+ // been taken into account
+ int accumulateMouseScroll(SInt32 yDelta) const;
+
bool detectXI2();
#ifdef HAVE_XI2
void selectXIRawMotion();
@@ -172,8 +176,15 @@ private:
// true if screen is being used as a primary screen, false otherwise
bool m_isPrimary;
+
+ // The size of a smallest supported scroll event, in points
int m_mouseScrollDelta;
+ // Accumulates scrolls of less than m_mouseScrollDelta across multiple
+ // scroll events. We dispatch a scroll event whenever the accumulated scroll
+ // becomes larger than m_mouseScrollDelta
+ mutable int m_accumulatedScroll;
+
Display* m_display;
Window m_root;
Window m_window;