pax_global_header 0000666 0000000 0000000 00000000064 13262451251 0014513 g ustar 00root root 0000000 0000000 52 comment=e0f20e9f82784857780a763b11e0183b797c110a
tdesktop-1.2.17/ 0000775 0000000 0000000 00000000000 13262451251 0013440 5 ustar 00root root 0000000 0000000 tdesktop-1.2.17/.appveyor/ 0000775 0000000 0000000 00000000000 13262451251 0015363 5 ustar 00root root 0000000 0000000 tdesktop-1.2.17/.appveyor/install.bat 0000664 0000000 0000000 00000005417 13262451251 0017530 0 ustar 00root root 0000000 0000000 @echo off
IF "%BUILD_DIR%"=="" SET BUILD_DIR=C:\TBuild
SET LIB_DIR=%BUILD_DIR%\Libraries
SET SRC_DIR=%BUILD_DIR%\tdesktop
SET QT_VERSION=5_6_2
call:configureBuild
call:getDependencies
call:setupGYP
cd %SRC_DIR%
echo Finished!
GOTO:EOF
:: FUNCTIONS
:logInfo
echo [INFO] %~1
GOTO:EOF
:logError
echo [ERROR] %~1
GOTO:EOF
:getDependencies
call:logInfo "Clone dependencies repository"
git clone -q --depth 1 --branch=master https://github.com/telegramdesktop/dependencies_windows.git %LIB_DIR%
cd %LIB_DIR%
git clone https://github.com/Microsoft/Range-V3-VS2015 range-v3
if exist prepare.bat (
call prepare.bat
) else (
call:logError "Error cloning dependencies, trying again"
rmdir %LIB_DIR% /S /Q
call:getDependencies
)
GOTO:EOF
:setupGYP
call:logInfo "Setup GYP/Ninja and generate VS solution"
cd %LIB_DIR%
git clone https://chromium.googlesource.com/external/gyp
cd gyp
git checkout a478c1ab51
SET PATH=%PATH%;%BUILD_DIR%\Libraries\gyp;%BUILD_DIR%\Libraries\ninja;
cd %SRC_DIR%
git submodule init
git submodule update
cd %SRC_DIR%\Telegram
call gyp\refresh.bat
GOTO:EOF
:configureBuild
call:logInfo "Configuring build"
call:logInfo "Build version: %BUILD_VERSION%"
set TDESKTOP_BUILD_DEFINES=
echo %BUILD_VERSION% | findstr /C:"disable_autoupdate">nul && (
set TDESKTOP_BUILD_DEFINES=%TDESKTOP_BUILD_DEFINES%,TDESKTOP_DISABLE_AUTOUPDATE
)
echo %BUILD_VERSION% | findstr /C:"disable_register_custom_scheme">nul && (
set TDESKTOP_BUILD_DEFINES=%TDESKTOP_BUILD_DEFINES%,TDESKTOP_DISABLE_REGISTER_CUSTOM_SCHEME
)
echo %BUILD_VERSION% | findstr /C:"disable_crash_reports">nul && (
set TDESKTOP_BUILD_DEFINES=%TDESKTOP_BUILD_DEFINES%,TDESKTOP_DISABLE_CRASH_REPORTS
)
echo %BUILD_VERSION% | findstr /C:"disable_network_proxy">nul && (
set TDESKTOP_BUILD_DEFINES=%TDESKTOP_BUILD_DEFINES%,TDESKTOP_DISABLE_NETWORK_PROXY
)
echo %BUILD_VERSION% | findstr /C:"disable_desktop_file_generation">nul && (
set TDESKTOP_BUILD_DEFINES=%TDESKTOP_BUILD_DEFINES%,TDESKTOP_DISABLE_DESKTOP_FILE_GENERATION
)
echo %BUILD_VERSION% | findstr /C:"disable_unity_integration">nul && (
set TDESKTOP_BUILD_DEFINES=%TDESKTOP_BUILD_DEFINES%,TDESKTOP_DISABLE_UNITY_INTEGRATION
)
echo %BUILD_VERSION% | findstr /C:"disable_gtk_integration">nul && (
set TDESKTOP_BUILD_DEFINES=%TDESKTOP_BUILD_DEFINES%,TDESKTOP_DISABLE_GTK_INTEGRATION
)
if not "%TDESKTOP_BUILD_DEFINES%" == "" (
set "TDESKTOP_BUILD_DEFINES=%TDESKTOP_BUILD_DEFINES:~1%"
)
call:logInfo "Build Defines: %TDESKTOP_BUILD_DEFINES%"
GOTO:EOF
tdesktop-1.2.17/.gitattributes 0000664 0000000 0000000 00000000234 13262451251 0016332 0 ustar 00root root 0000000 0000000 # Set the default behavior, in case people don't have core.autocrlf set.
* text=auto
# Ensure diffs have LF endings
*.diff text eol=lf
*.bat text eol=crlf
tdesktop-1.2.17/.github/ 0000775 0000000 0000000 00000000000 13262451251 0015000 5 ustar 00root root 0000000 0000000 tdesktop-1.2.17/.github/CONTRIBUTING.md 0000664 0000000 0000000 00000013452 13262451251 0017236 0 ustar 00root root 0000000 0000000 # Contributing
This document describes how you can contribute to Telegram Desktop. Please read it carefully.
**Table of Contents**
* [What contributions are accepted](#what-contributions-are-accepted)
* [Build instructions](#build-instructions)
* [Pull upstream changes into your fork regularly](#pull-upstream-changes-into-your-fork-regularly)
* [How to get your pull request accepted](#how-to-get-your-pull-request-accepted)
* [Keep your pull requests limited to a single issue](#keep-your-pull-requests-limited-to-a-single-issue)
* [Squash your commits to a single commit](#squash-your-commits-to-a-single-commit)
* [Don't mix code changes with whitespace cleanup](#dont-mix-code-changes-with-whitespace-cleanup)
* [Keep your code simple!](#keep-your-code-simple)
* [Test your changes!](#test-your-changes)
* [Write a good commit message](#write-a-good-commit-message)
## What contributions are accepted
We highly appreciate your contributions in the matter of fixing bugs and optimizing the Telegram Desktop source code and its documentation. In case of fixing the existing user experience please push to your fork and [submit a pull request][pr].
Wait for us. We try to review your pull requests as fast as possible.
If we find issues with your pull request, we may suggest some changes and improvements.
Unfortunately we **do not merge** any pull requests that have new feature implementations, translations to new languages and those which introduce any new user interface elements.
Telegram Desktop is not a standalone application but a part of [Telegram project][telegram], so all the decisions about the features, languages, user experience, user interface and the design are made inside Telegram team, often according to some roadmap which is not public.
## Build instructions
See the [README.md][build_instructions] for details on the various build
environments.
## Pull upstream changes into your fork regularly
Telegram Desktop is advancing quickly. It is therefore critical that you pull upstream changes into your fork on a regular basis. Nothing is worse than putting in a days of hard work into a pull request only to have it rejected because it has diverged too far from upstram.
To pull in upstream changes:
git remote add upstream https://github.com/telegramdesktop/tdesktop.git
git fetch upstream master
Check the log to be sure that you actually want the changes, before merging:
git log upstream/master
Then rebase your changes on the latest commits in the `master` branch:
git rebase upstream/master
After that, you have to force push your commits:
git push --force
For more info, see [GitHub Help][help_fork_repo].
## How to get your pull request accepted
We want to improve Telegram Desktop with your contributions. But we also want to provide a stable experience for our users and the community. Follow these rules and you should succeed without a problem!
### Keep your pull requests limited to a single issue
Pull requests should be as small/atomic as possible. Large, wide-sweeping changes in a pull request will be **rejected**, with comments to isolate the specific code in your pull request. Some examples:
* If you are making spelling corrections in the docs, don't modify other files.
* If you are adding new functions don't '*cleanup*' unrelated functions. That cleanup belongs in another pull request.
#### Squash your commits to a single commit
To keep the history of the project clean, you should make one commit per pull request.
If you already have multiple commits, you can add the commits together (squash them) with the following commands in Git Bash:
1. Open `Git Bash` (or `Git Shell`)
2. Enter following command to squash the recent {N} commits: `git reset --soft HEAD~{N} && git commit` (replace `{N}` with the number of commits you want to squash)
3. Press i to get into Insert-mode
4. Enter the commit message of the new commit
5. After adding the message, press ESC to get out of the Insert-mode
6. Write `:wq` and press Enter to save the new message or write `:q!` to discard your changes
7. Enter `git push --force` to push the new commit to the remote repository
For example, if you want to squash the last 5 commits, use `git reset --soft HEAD~5 && git commit`
### Don't mix code changes with whitespace cleanup
If you change two lines of code and correct 200 lines of whitespace issues in a file the diff on that pull request is functionally unreadable and will be **rejected**. Whitespace cleanups need to be in their own pull request.
### Keep your code simple!
Please keep your code as clean and straightforward as possible.
Furthermore, the pixel shortage is over. We want to see:
* `opacity` instead of `o`
* `placeholder` instead of `ph`
* `myFunctionThatDoesThings()` instead of `mftdt()`
### Test your changes!
Before you submit a pull request, please test your changes. Verify that Telegram Desktop still works and your changes don't cause other issue or crashes.
### Write a good commit message
* Explain why you make the changes. [More infos about a good commit message.][commit_message]
* If you fix an issue with your commit, please close the issue by [adding one of the keywords and the issue number][closing-issues-via-commit-messages] to your commit message.
For example: `Fix #545`
[//]: # (LINKS)
[telegram]: https://telegram.org/
[help_fork_repo]: https://help.github.com/articles/fork-a-repo/
[help_change_commit_message]: https://help.github.com/articles/changing-a-commit-message/
[commit_message]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
[pr]: https://github.com/telegramdesktop/tdesktop/compare
[build_instructions]: https://github.com/telegramdesktop/tdesktop/blob/master/README.md#build-instructions
[closing-issues-via-commit-messages]: https://help.github.com/articles/closing-issues-via-commit-messages/
tdesktop-1.2.17/.github/ISSUE_TEMPLATE.md 0000664 0000000 0000000 00000001153 13262451251 0017505 0 ustar 00root root 0000000 0000000
### Steps to reproduce
1.
2.
3.
### Expected behaviour
Tell us what should happen
### Actual behaviour
Tell us what happens instead
### Configuration
**Operating system:**
**Version of Telegram Desktop:**
**Used theme**:
Logs:
Insert logs here (if necessary)
tdesktop-1.2.17/.gitignore 0000664 0000000 0000000 00000001756 13262451251 0015441 0 ustar 00root root 0000000 0000000 /out/
/Debug/
/Release/
/Deploy/
/ThirdParty/
/Telegram/build/target
/Telegram/GeneratedFiles/
/Telegram/SourceFiles/art/grid.png
/Telegram/SourceFiles/art/grid_125x.png
/Telegram/SourceFiles/art/grid_150x.png
/Telegram/SourceFiles/art/grid_200x.png
/Telegram/SourceFiles/art/sprite_125x.png
/Telegram/SourceFiles/art/sprite_150x.png
/Telegram/Resources/art/grid.png
/Telegram/Resources/art/grid_125x.png
/Telegram/Resources/art/grid_150x.png
/Telegram/Resources/art/grid_200x.png
/Telegram/Resources/art/sprite_125x.png
/Telegram/Resources/art/sprite_150x.png
/Telegram/Debug/
/Telegram/Release/
/Telegram/tests/
/Telegram/gyp/tests/*.test
/Telegram/out/
/Telegram/*.user
*.vcxproj*
*.sln
*.suo
*.sdf
*.opensdf
*.opendb
*.VC.db
*.aps
*.xcodeproj
/Win32/
ipch/
.vs/
/Telegram/log.txt
/Telegram/data
/Telegram/data_config
/Telegram/DebugLogs/
/Telegram/tdata/
/Telegram/tdumps/
.DS_Store
._*
.qmake.stash
/Mac/
project.xcworkspace
xcuserdata
/Telegram/*.user.*
*.pro.user
/Linux/
/Telegram/Makefile
*.*~
tdesktop-1.2.17/.gitmodules 0000664 0000000 0000000 00000001135 13262451251 0015615 0 ustar 00root root 0000000 0000000 [submodule "Telegram/ThirdParty/libtgvoip"]
path = Telegram/ThirdParty/libtgvoip
url = https://github.com/telegramdesktop/libtgvoip
[submodule "Telegram/ThirdParty/variant"]
path = Telegram/ThirdParty/variant
url = https://github.com/mapbox/variant
[submodule "Telegram/ThirdParty/GSL"]
path = Telegram/ThirdParty/GSL
url = https://github.com/Microsoft/GSL.git
[submodule "Telegram/ThirdParty/Catch"]
path = Telegram/ThirdParty/Catch
url = https://github.com/philsquared/Catch
[submodule "Telegram/ThirdParty/crl"]
path = Telegram/ThirdParty/crl
url = https://github.com/telegramdesktop/crl.git
tdesktop-1.2.17/.travis.yml 0000664 0000000 0000000 00000002554 13262451251 0015557 0 ustar 00root root 0000000 0000000 sudo: required
dist: trusty
language: cpp
cache:
directories:
- $HOME/travisCacheDir
env:
matrix:
- BUILD_VERSION=""
- BUILD_VERSION="disable_autoupdate"
- BUILD_VERSION="disable_register_custom_scheme"
- BUILD_VERSION="disable_crash_reports"
- BUILD_VERSION="disable_network_proxy"
- BUILD_VERSION="disable_desktop_file_generation"
- BUILD_VERSION="disable_unity_integration"
- BUILD_VERSION="disable_gtk_integration"
matrix:
fast_finish: true
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- bison
- build-essential
- cmake
- devscripts
- dpatch
- equivs
- fakeroot
- g++-7
- gcc-7
- git
- gnome-common
- gobject-introspection
- gtk-doc-tools
- libappindicator-dev
- libasound2-dev
- libdbusmenu-glib-dev
- liblzma-dev
- libopus-dev
- libpulse-dev
- libssl-dev
- libunity-dev
- libva-dev
- libvdpau-dev
- libxcb-xkb-dev
- libxkbcommon-dev
- lintian
- quilt
- valac
- xutils-dev
- yasm
before_install:
- export CXX="g++-7" CC="gcc-7"
- sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 60 --slave /usr/bin/g++ g++ /usr/bin/g++-7
- sudo update-alternatives --config gcc
- g++ --version
script:
- .travis/build.sh
tdesktop-1.2.17/.travis/ 0000775 0000000 0000000 00000000000 13262451251 0015026 5 ustar 00root root 0000000 0000000 tdesktop-1.2.17/.travis/build.sh 0000775 0000000 0000000 00000042033 13262451251 0016466 0 ustar 00root root 0000000 0000000 #!/bin/bash
set -e
REPO="$PWD"
BUILD="$REPO/build"
UPSTREAM="$REPO/upstream"
EXTERNAL="$REPO/external"
CACHE="$HOME/travisCacheDir"
QT_WAS_BUILT="0"
QT_VERSION=5.6.2
XKB_PATH="$BUILD/libxkbcommon"
XKB_CACHE_VERSION="3"
QT_PATH="$BUILD/qt"
QT_CACHE_VERSION="3"
QT_PATCH="$UPSTREAM/Telegram/Patches/qtbase_${QT_VERSION//\./_}.diff"
BREAKPAD_PATH="$BUILD/breakpad"
BREAKPAD_CACHE_VERSION="3"
GYP_PATH="$BUILD/gyp"
GYP_CACHE_VERSION="3"
GYP_PATCH="$UPSTREAM/Telegram/Patches/gyp.diff"
RANGE_PATH="$BUILD/range-v3"
RANGE_CACHE_VERSION="3"
VA_PATH="$BUILD/libva"
VA_CACHE_VERSION="3"
VDPAU_PATH="$BUILD/libvdpau"
VDPAU_CACHE_VERSION="3"
FFMPEG_PATH="$BUILD/ffmpeg"
FFMPEG_CACHE_VERSION="3"
OPENAL_PATH="$BUILD/openal-soft"
OPENAL_CACHE_VERSION="3"
GYP_DEFINES=""
[[ ! $MAKE_ARGS ]] && MAKE_ARGS="--silent -j4"
run() {
# Move files to subdir
cd ..
mv tdesktop tdesktop2
mkdir tdesktop
mv tdesktop2 "$UPSTREAM"
mkdir "$BUILD"
build
check
}
build() {
mkdir -p "$EXTERNAL"
BUILD_VERSION_DATA=$(echo $BUILD_VERSION | cut -d'-' -f 1)
# libxkbcommon
getXkbCommon
# libva
getVa
# libvdpau
getVdpau
# ffmpeg
getFFmpeg
# openal_soft
getOpenAL
# Patched Qt
getCustomQt
# Breakpad
getBreakpad
# Patched GYP (supports cmake precompiled headers)
getGYP
# Range v3
getRange
# Guideline Support Library
getGSL
if [ "$QT_WAS_BUILT" == "1" ]; then
error_msg "Qt was built, please restart the job :("
exit 1
fi
# Configure the build
if [[ $BUILD_VERSION == *"disable_autoupdate"* ]]; then
GYP_DEFINES+=",TDESKTOP_DISABLE_AUTOUPDATE"
fi
if [[ $BUILD_VERSION == *"disable_register_custom_scheme"* ]]; then
GYP_DEFINES+=",TDESKTOP_DISABLE_REGISTER_CUSTOM_SCHEME"
fi
if [[ $BUILD_VERSION == *"disable_crash_reports"* ]]; then
GYP_DEFINES+=",TDESKTOP_DISABLE_CRASH_REPORTS"
fi
if [[ $BUILD_VERSION == *"disable_network_proxy"* ]]; then
GYP_DEFINES+=",TDESKTOP_DISABLE_NETWORK_PROXY"
fi
if [[ $BUILD_VERSION == *"disable_desktop_file_generation"* ]]; then
GYP_DEFINES+=",TDESKTOP_DISABLE_DESKTOP_FILE_GENERATION"
fi
if [[ $BUILD_VERSION == *"disable_unity_integration"* ]]; then
GYP_DEFINES+=",TDESKTOP_DISABLE_UNITY_INTEGRATION"
fi
if [[ $BUILD_VERSION == *"disable_gtk_integration"* ]]; then
GYP_DEFINES+=",TDESKTOP_DISABLE_GTK_INTEGRATION"
fi
info_msg "Build defines: ${GYP_DEFINES}"
buildTelegram
travisEndFold
}
getXkbCommon() {
travisStartFold "Getting xkbcommon"
local XKB_CACHE="$CACHE/libxkbcommon"
local XKB_CACHE_FILE="$XKB_CACHE/.cache.txt"
local XKB_CACHE_KEY="${XKB_CACHE_VERSION}"
local XKB_CACHE_OUTDATED="1"
if [ ! -d "$XKB_CACHE" ]; then
mkdir -p "$XKB_CACHE"
fi
ln -sf "$XKB_CACHE" "$XKB_PATH"
if [ -f "$XKB_CACHE_FILE" ]; then
local XKB_CACHE_KEY_FOUND=`tail -n 1 $XKB_CACHE_FILE`
if [ "$XKB_CACHE_KEY" == "$XKB_CACHE_KEY_FOUND" ]; then
XKB_CACHE_OUTDATED="0"
else
info_msg "Cache key '$XKB_CACHE_KEY_FOUND' does not match '$XKB_CACHE_KEY', rebuilding libxkbcommon"
fi
fi
if [ "$XKB_CACHE_OUTDATED" == "1" ]; then
buildXkbCommon
sudo echo $XKB_CACHE_KEY > "$XKB_CACHE_FILE"
else
info_msg "Using cached libxkbcommon"
fi
}
buildXkbCommon() {
info_msg "Downloading and building libxkbcommon"
if [ -d "$EXTERNAL/libxkbcommon" ]; then
rm -rf "$EXTERNAL/libxkbcommon"
fi
cd $XKB_PATH
rm -rf *
cd "$EXTERNAL"
git clone https://github.com/xkbcommon/libxkbcommon.git
cd "$EXTERNAL/libxkbcommon"
./autogen.sh --prefix=$XKB_PATH
make $MAKE_ARGS
sudo make install
sudo ldconfig
}
getRange() {
travisStartFold "Getting range-v3"
local RANGE_CACHE="$CACHE/range-v3"
local RANGE_CACHE_FILE="$RANGE_CACHE/.cache.txt"
local RANGE_CACHE_KEY="${RANGE_CACHE_VERSION}"
local RANGE_CACHE_OUTDATED="1"
if [ ! -d "$RANGE_CACHE" ]; then
mkdir -p "$RANGE_CACHE"
fi
ln -sf "$RANGE_CACHE" "$RANGE_PATH"
if [ -f "$RANGE_CACHE_FILE" ]; then
local RANGE_CACHE_KEY_FOUND=`tail -n 1 $RANGE_CACHE_FILE`
if [ "$RANGE_CACHE_KEY" == "$RANGE_CACHE_KEY_FOUND" ]; then
RANGE_CACHE_OUTDATED="0"
else
info_msg "Cache key '$RANGE_CACHE_KEY_FOUND' does not match '$RANGE_CACHE_KEY', getting range-v3"
fi
fi
if [ "$RANGE_CACHE_OUTDATED" == "1" ]; then
buildRange
sudo echo $RANGE_CACHE_KEY > "$RANGE_CACHE_FILE"
else
info_msg "Using cached range-v3"
fi
}
buildRange() {
info_msg "Downloading range-v3"
if [ -d "$EXTERNAL/range-v3" ]; then
rm -rf "$EXTERNAL/range-v3"
fi
cd $RANGE_PATH
rm -rf *
cd "$EXTERNAL"
git clone --depth=1 https://github.com/ericniebler/range-v3
cd "$EXTERNAL/range-v3"
cp -r * "$RANGE_PATH/"
}
getVa() {
travisStartFold "Getting libva"
local VA_CACHE="$CACHE/libva"
local VA_CACHE_FILE="$VA_CACHE/.cache.txt"
local VA_CACHE_KEY="${VA_CACHE_VERSION}"
local VA_CACHE_OUTDATED="1"
if [ ! -d "$VA_CACHE" ]; then
mkdir -p "$VA_CACHE"
fi
ln -sf "$VA_CACHE" "$VA_PATH"
if [ -f "$VA_CACHE_FILE" ]; then
local VA_CACHE_KEY_FOUND=`tail -n 1 $VA_CACHE_FILE`
if [ "$VA_CACHE_KEY" == "$VA_CACHE_KEY_FOUND" ]; then
VA_CACHE_OUTDATED="0"
else
info_msg "Cache key '$VA_CACHE_KEY_FOUND' does not match '$VA_CACHE_KEY', rebuilding libva"
fi
fi
if [ "$VA_CACHE_OUTDATED" == "1" ]; then
buildVa
sudo echo $VA_CACHE_KEY > "$VA_CACHE_FILE"
else
info_msg "Using cached libva"
fi
}
buildVa() {
info_msg "Downloading and building libva"
if [ -d "$EXTERNAL/libva" ]; then
rm -rf "$EXTERNAL/libva"
fi
cd $VA_PATH
rm -rf *
cd "$EXTERNAL"
git clone https://github.com/01org/libva
cd "$EXTERNAL/libva"
./autogen.sh --prefix=$VA_PATH --enable-static
make $MAKE_ARGS
sudo make install
sudo ldconfig
}
getVdpau() {
travisStartFold "Getting libvdpau"
local VDPAU_CACHE="$CACHE/libvdpau"
local VDPAU_CACHE_FILE="$VDPAU_CACHE/.cache.txt"
local VDPAU_CACHE_KEY="${VDPAU_CACHE_VERSION}"
local VDPAU_CACHE_OUTDATED="1"
if [ ! -d "$VDPAU_CACHE" ]; then
mkdir -p "$VDPAU_CACHE"
fi
ln -sf "$VDPAU_CACHE" "$VDPAU_PATH"
if [ -f "$VDPAU_CACHE_FILE" ]; then
local VDPAU_CACHE_KEY_FOUND=`tail -n 1 $VDPAU_CACHE_FILE`
if [ "$VDPAU_CACHE_KEY" == "$VDPAU_CACHE_KEY_FOUND" ]; then
VDPAU_CACHE_OUTDATED="0"
else
info_msg "Cache key '$VDPAU_CACHE_KEY_FOUND' does not match '$VDPAU_CACHE_KEY', rebuilding libvdpau"
fi
fi
if [ "$VDPAU_CACHE_OUTDATED" == "1" ]; then
buildVdpau
sudo echo $VDPAU_CACHE_KEY > "$VDPAU_CACHE_FILE"
else
info_msg "Using cached libvdpau"
fi
}
buildVdpau() {
info_msg "Downloading and building libvdpau"
if [ -d "$EXTERNAL/libvdpau" ]; then
rm -rf "$EXTERNAL/libvdpau"
fi
cd $VDPAU_PATH
rm -rf *
cd "$EXTERNAL"
git clone git://anongit.freedesktop.org/vdpau/libvdpau
cd "$EXTERNAL/libvdpau"
./autogen.sh --prefix=$VDPAU_PATH --enable-static
make $MAKE_ARGS
sudo make install
sudo ldconfig
}
getFFmpeg() {
travisStartFold "Getting ffmpeg"
local FFMPEG_CACHE="$CACHE/ffmpeg"
local FFMPEG_CACHE_FILE="$FFMPEG_CACHE/.cache.txt"
local FFMPEG_CACHE_KEY="${FFMPEG_CACHE_VERSION}"
local FFMPEG_CACHE_OUTDATED="1"
if [ ! -d "$FFMPEG_CACHE" ]; then
mkdir -p "$FFMPEG_CACHE"
fi
ln -sf "$FFMPEG_CACHE" "$FFMPEG_PATH"
if [ -f "$FFMPEG_CACHE_FILE" ]; then
local FFMPEG_CACHE_KEY_FOUND=`tail -n 1 $FFMPEG_CACHE_FILE`
if [ "$FFMPEG_CACHE_KEY" == "$FFMPEG_CACHE_KEY_FOUND" ]; then
FFMPEG_CACHE_OUTDATED="0"
else
info_msg "Cache key '$FFMPEG_CACHE_KEY_FOUND' does not match '$FFMPEG_CACHE_KEY', rebuilding ffmpeg"
fi
fi
if [ "$FFMPEG_CACHE_OUTDATED" == "1" ]; then
buildFFmpeg
sudo echo $FFMPEG_CACHE_KEY > "$FFMPEG_CACHE_FILE"
else
info_msg "Using cached ffmpeg"
fi
}
buildFFmpeg() {
info_msg "Downloading and building ffmpeg"
if [ -d "$EXTERNAL/ffmpeg" ]; then
rm -rf "$EXTERNAL/ffmpeg"
fi
cd $FFMPEG_PATH
rm -rf *
cd "$EXTERNAL"
git clone https://git.ffmpeg.org/ffmpeg.git
cd "$EXTERNAL/ffmpeg"
git checkout release/3.4
./configure \
--prefix=$FFMPEG_PATH \
--disable-debug \
--disable-programs \
--disable-doc \
--disable-everything \
--enable-gpl \
--enable-version3 \
--enable-libopus \
--enable-decoder=aac \
--enable-decoder=aac_latm \
--enable-decoder=aasc \
--enable-decoder=flac \
--enable-decoder=gif \
--enable-decoder=h264 \
--enable-decoder=h264_vdpau \
--enable-decoder=mp1 \
--enable-decoder=mp1float \
--enable-decoder=mp2 \
--enable-decoder=mp2float \
--enable-decoder=mp3 \
--enable-decoder=mp3adu \
--enable-decoder=mp3adufloat \
--enable-decoder=mp3float \
--enable-decoder=mp3on4 \
--enable-decoder=mp3on4float \
--enable-decoder=mpeg4 \
--enable-decoder=mpeg4_vdpau \
--enable-decoder=msmpeg4v2 \
--enable-decoder=msmpeg4v3 \
--enable-decoder=opus \
--enable-decoder=vorbis \
--enable-decoder=wavpack \
--enable-decoder=wmalossless \
--enable-decoder=wmapro \
--enable-decoder=wmav1 \
--enable-decoder=wmav2 \
--enable-decoder=wmavoice \
--enable-encoder=libopus \
--enable-hwaccel=h264_vaapi \
--enable-hwaccel=h264_vdpau \
--enable-hwaccel=mpeg4_vaapi \
--enable-hwaccel=mpeg4_vdpau \
--enable-parser=aac \
--enable-parser=aac_latm \
--enable-parser=flac \
--enable-parser=h264 \
--enable-parser=mpeg4video \
--enable-parser=mpegaudio \
--enable-parser=opus \
--enable-parser=vorbis \
--enable-demuxer=aac \
--enable-demuxer=flac \
--enable-demuxer=gif \
--enable-demuxer=h264 \
--enable-demuxer=mov \
--enable-demuxer=mp3 \
--enable-demuxer=ogg \
--enable-demuxer=wav \
--enable-muxer=ogg \
--enable-muxer=opus
make $MAKE_ARGS
sudo make install
sudo ldconfig
}
getOpenAL() {
travisStartFold "Getting openal-soft"
local OPENAL_CACHE="$CACHE/openal-soft"
local OPENAL_CACHE_FILE="$OPENAL_CACHE/.cache.txt"
local OPENAL_CACHE_KEY="${OPENAL_CACHE_VERSION}"
local OPENAL_CACHE_OUTDATED="1"
if [ ! -d "$OPENAL_CACHE" ]; then
mkdir -p "$OPENAL_CACHE"
fi
ln -sf "$OPENAL_CACHE" "$OPENAL_PATH"
if [ -f "$OPENAL_CACHE_FILE" ]; then
local OPENAL_CACHE_KEY_FOUND=`tail -n 1 $OPENAL_CACHE_FILE`
if [ "$OPENAL_CACHE_KEY" == "$OPENAL_CACHE_KEY_FOUND" ]; then
OPENAL_CACHE_OUTDATED="0"
else
info_msg "Cache key '$OPENAL_CACHE_KEY_FOUND' does not match '$OPENAL_CACHE_KEY', rebuilding openal-soft"
fi
fi
if [ "$OPENAL_CACHE_OUTDATED" == "1" ]; then
buildOpenAL
sudo echo $OPENAL_CACHE_KEY > "$OPENAL_CACHE_FILE"
else
info_msg "Using cached openal-soft"
fi
}
buildOpenAL() {
info_msg "Downloading and building openal-soft"
if [ -d "$EXTERNAL/openal-soft" ]; then
rm -rf "$EXTERNAL/openal-soft"
fi
cd $OPENAL_PATH
rm -rf *
cd "$EXTERNAL"
git clone https://github.com/kcat/openal-soft.git
cd "$EXTERNAL/openal-soft/build"
cmake \
-D CMAKE_INSTALL_PREFIX=$OPENAL_PATH \
-D CMAKE_BUILD_TYPE=Release \
-D LIBTYPE=STATIC \
-D ALSOFT_EXAMPLES=OFF \
-D ALSOFT_TESTS=OFF \
-D ALSOFT_UTILS=OFF \
..
make $MAKE_ARGS
sudo make install
sudo ldconfig
}
getBreakpad() {
travisStartFold "Getting breakpad"
local BREAKPAD_CACHE="$CACHE/breakpad"
local BREAKPAD_CACHE_FILE="$BREAKPAD_CACHE/.cache.txt"
local BREAKPAD_CACHE_KEY="${BREAKPAD_CACHE_VERSION}"
local BREAKPAD_CACHE_OUTDATED="1"
if [ ! -d "$BREAKPAD_CACHE" ]; then
mkdir -p "$BREAKPAD_CACHE"
fi
ln -sf "$BREAKPAD_CACHE" "$BREAKPAD_PATH"
if [ -f "$BREAKPAD_CACHE_FILE" ]; then
local BREAKPAD_CACHE_KEY_FOUND=`tail -n 1 $BREAKPAD_CACHE_FILE`
if [ "$BREAKPAD_CACHE_KEY" == "$BREAKPAD_CACHE_KEY_FOUND" ]; then
BREAKPAD_CACHE_OUTDATED="0"
else
info_msg "Cache key '$BREAKPAD_CACHE_KEY_FOUND' does not match '$BREAKPAD_CACHE_KEY', rebuilding breakpad"
fi
fi
if [ "$BREAKPAD_CACHE_OUTDATED" == "1" ]; then
buildBreakpad
sudo echo $BREAKPAD_CACHE_KEY > "$BREAKPAD_CACHE_FILE"
else
info_msg "Using cached breakpad"
fi
}
buildBreakpad() {
info_msg "Downloading and building breakpad"
if [ -d "$EXTERNAL/breakpad" ]; then
rm -rf "$EXTERNAL/breakpad"
fi
cd $BREAKPAD_PATH
rm -rf *
cd "$EXTERNAL"
git clone https://chromium.googlesource.com/breakpad/breakpad
cd "$EXTERNAL/breakpad/src/third_party"
git clone https://chromium.googlesource.com/linux-syscall-support lss
cd "$EXTERNAL/breakpad"
./configure --prefix=$BREAKPAD_PATH
make $MAKE_ARGS
sudo make install
sudo ldconfig
}
getCustomQt() {
travisStartFold "Getting patched Qt"
local QT_CACHE="$CACHE/qtPatched"
local QT_CACHE_FILE="$QT_CACHE/.cache.txt"
local QT_PATCH_CHECKSUM=`sha1sum $QT_PATCH`
local QT_CACHE_KEY="${QT_VERSION}_${QT_CACHE_VERSION}_${QT_PATCH_CHECKSUM:0:32}"
local QT_CACHE_OUTDATED="1"
if [ ! -d "$QT_CACHE" ]; then
mkdir -p "$QT_CACHE"
fi
ln -sf "$QT_CACHE" "$QT_PATH"
if [ -f "$QT_CACHE_FILE" ]; then
local QT_CACHE_KEY_FOUND=`tail -n 1 $QT_CACHE_FILE`
if [ "$QT_CACHE_KEY" == "$QT_CACHE_KEY_FOUND" ]; then
QT_CACHE_OUTDATED="0"
else
info_msg "Cache key '$QT_CACHE_KEY_FOUND' does not match '$QT_CACHE_KEY', rebuilding patched Qt"
fi
fi
if [ "$QT_CACHE_OUTDATED" == "1" ]; then
buildCustomQt
sudo echo $QT_CACHE_KEY > "$QT_CACHE_FILE"
else
info_msg "Using cached patched Qt"
fi
export PATH="$QT_PATH/bin:$PATH"
}
buildCustomQt() {
QT_WAS_BUILT="1"
info_msg "Downloading and building patched qt"
if [ -d "$EXTERNAL/qt${QT_VERSION}" ]; then
rm -rf "$EXTERNAL/qt${QT_VERSION}"
fi
cd $QT_PATH
rm -rf *
cd "$EXTERNAL"
git clone git://code.qt.io/qt/qt5.git qt${QT_VERSION}
cd "$EXTERNAL/qt${QT_VERSION}"
perl init-repository --branch --module-subset=qtbase,qtimageformats
git checkout v${QT_VERSION}
cd qtbase && git checkout v${QT_VERSION} && cd ..
cd qtimageformats && git checkout v${QT_VERSION} && cd ..
cd "$EXTERNAL/qt${QT_VERSION}/qtbase"
git apply "$QT_PATCH"
cd ..
cd "$EXTERNAL/qt${QT_VERSION}/qtbase/src/plugins/platforminputcontexts"
git clone https://github.com/telegramdesktop/fcitx.git
git clone https://github.com/telegramdesktop/hime.git
cd ../../../..
./configure -prefix $QT_PATH -release -opensource -confirm-license -qt-zlib \
-qt-libpng -qt-libjpeg -qt-freetype -qt-harfbuzz -qt-pcre -qt-xcb \
-qt-xkbcommon-x11 -no-opengl -no-gtkstyle -static \
-nomake examples -nomake tests -no-mirclient \
-dbus-runtime -no-gstreamer -no-mtdev # <- Not sure about these
make $MAKE_ARGS
sudo make install
}
getGSL() {
cd "$UPSTREAM"
git submodule init
git submodule update
}
getGYP() {
travisStartFold "Getting patched GYP"
local GYP_CACHE="$CACHE/gyp"
local GYP_CACHE_FILE="$GYP_CACHE/.cache.txt"
local GYP_PATCH_CHECKSUM=`sha1sum $GYP_PATCH`
local GYP_CACHE_KEY="${GYP_CACHE_VERSION}_${GYP_PATCH_CHECKSUM:0:32}"
local GYP_CACHE_OUTDATED="1"
if [ ! -d "$GYP_CACHE" ]; then
mkdir -p "$GYP_CACHE"
fi
ln -sf "$GYP_CACHE" "$GYP_PATH"
if [ -f "$GYP_CACHE_FILE" ]; then
local GYP_CACHE_KEY_FOUND=`tail -n 1 $GYP_CACHE_FILE`
if [ "$GYP_CACHE_KEY" == "$GYP_CACHE_KEY_FOUND" ]; then
GYP_CACHE_OUTDATED="0"
else
info_msg "Cache key '$GYP_CACHE_KEY_FOUND' does not match '$GYP_CACHE_KEY', rebuilding patched GYP"
fi
fi
if [ "$GYP_CACHE_OUTDATED" == "1" ]; then
buildGYP
sudo echo $GYP_CACHE_KEY > "$GYP_CACHE_FILE"
else
info_msg "Using cached patched GYP"
fi
}
buildGYP() {
info_msg "Downloading and building patched GYP"
if [ -d "$EXTERNAL/gyp" ]; then
rm -rf "$EXTERNAL/gyp"
fi
cd $GYP_PATH
rm -rf *
cd "$EXTERNAL"
git clone https://chromium.googlesource.com/external/gyp
cd "$EXTERNAL/gyp"
git checkout 702ac58e47
git apply "$GYP_PATCH"
cp -r * "$GYP_PATH/"
}
buildTelegram() {
travisStartFold "Build tdesktop"
cd "$UPSTREAM/Telegram/gyp"
"$GYP_PATH/gyp" \
-Dbuild_defines=${GYP_DEFINES:1} \
-Dlinux_path_xkbcommon=$XKB_PATH \
-Dlinux_path_va=$VA_PATH \
-Dlinux_path_vdpau=$VDPAU_PATH \
-Dlinux_path_ffmpeg=$FFMPEG_PATH \
-Dlinux_path_openal=$OPENAL_PATH \
-Dlinux_path_range=$RANGE_PATH \
-Dlinux_path_qt=$QT_PATH \
-Dlinux_path_breakpad=$BREAKPAD_PATH \
-Dlinux_path_libexif_lib=/usr/local/lib \
-Dlinux_path_opus_include=/usr/include/opus \
-Dlinux_lib_ssl=-lssl \
-Dlinux_lib_crypto=-lcrypto \
-Dlinux_lib_icu=-licuuc\ -licutu\ -licui18n \
--depth=. --generator-output=.. --format=cmake -Goutput_dir=../out \
Telegram.gyp
cd "$UPSTREAM/out/Debug"
export ASM="gcc"
cmake .
make $MAKE_ARGS
}
check() {
local filePath="$UPSTREAM/out/Debug/Telegram"
if test -f "$filePath"; then
success_msg "Build successfully done! :)"
local size;
size=$(stat -c %s "$filePath")
success_msg "File size of ${filePath}: ${size} Bytes"
else
error_msg "Build error, output file does not exist"
exit 1
fi
}
source ./.travis/common.sh
run
tdesktop-1.2.17/.travis/common.sh 0000775 0000000 0000000 00000004110 13262451251 0016651 0 ustar 00root root 0000000 0000000 #!/usr/bin/env bash
# set colors
RCol='\e[0m' # Text Reset
# Regular Bold Underline High Intensity BoldHigh Intens Background High Intensity Backgrounds
Bla='\e[0;30m'; BBla='\e[1;30m'; UBla='\e[4;30m'; IBla='\e[0;90m'; BIBla='\e[1;90m'; On_Bla='\e[40m'; On_IBla='\e[0;100m';
Red='\e[0;31m'; BRed='\e[1;31m'; URed='\e[4;31m'; IRed='\e[0;91m'; BIRed='\e[1;91m'; On_Red='\e[41m'; On_IRed='\e[0;101m';
Gre='\e[0;32m'; BGre='\e[1;32m'; UGre='\e[4;32m'; IGre='\e[0;92m'; BIGre='\e[1;92m'; On_Gre='\e[42m'; On_IGre='\e[0;102m';
Yel='\e[0;33m'; BYel='\e[1;33m'; UYel='\e[4;33m'; IYel='\e[0;93m'; BIYel='\e[1;93m'; On_Yel='\e[43m'; On_IYel='\e[0;103m';
Blu='\e[0;34m'; BBlu='\e[1;34m'; UBlu='\e[4;34m'; IBlu='\e[0;94m'; BIBlu='\e[1;94m'; On_Blu='\e[44m'; On_IBlu='\e[0;104m';
Pur='\e[0;35m'; BPur='\e[1;35m'; UPur='\e[4;35m'; IPur='\e[0;95m'; BIPur='\e[1;95m'; On_Pur='\e[45m'; On_IPur='\e[0;105m';
Cya='\e[0;36m'; BCya='\e[1;36m'; UCya='\e[4;36m'; ICya='\e[0;96m'; BICya='\e[1;96m'; On_Cya='\e[46m'; On_ICya='\e[0;106m';
Whi='\e[0;37m'; BWhi='\e[1;37m'; UWhi='\e[4;37m'; IWhi='\e[0;97m'; BIWhi='\e[1;97m'; On_Whi='\e[47m'; On_IWhi='\e[0;107m';
start_msg() {
echo -e "\n${Gre}$*${RCol}"
}
info_msg() {
sameLineInfoMessage "\n$1"
}
error_msg() {
echo -e "\n${BRed}$*${RCol}"
}
success_msg() {
echo -e "\n${BGre}$*${RCol}"
}
sameLineInfoMessage() {
echo -e "${Cya}$*${RCol}"
}
TRAVIS_LAST_FOLD=""
travisStartFold() {
local TITLE="$1"
local NAME=$(sanitizeName "$TITLE")
if [ "$TRAVIS_LAST_FOLD" != "" ]; then
travisEndFold
fi
echo "travis_fold:start:$NAME"
sameLineInfoMessage "$TITLE"
TRAVIS_LAST_FOLD="$NAME"
}
travisEndFold() {
if [ "$TRAVIS_LAST_FOLD" == "" ]; then
return
fi
echo "travis_fold:end:$TRAVIS_LAST_FOLD"
TRAVIS_LAST_FOLD=""
}
sanitizeName() {
local NAME="${1// /_}"
local NAME="${NAME,,}"
echo "$NAME"
}
tdesktop-1.2.17/LEGAL 0000664 0000000 0000000 00000001652 13262451251 0014213 0 ustar 00root root 0000000 0000000 This file is part of Telegram Desktop,
the official desktop application for the Telegram messaging service.
Copyright (c) 2014-2018 John Preston, https://desktop.telegram.org
Telegram Desktop is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
More information about the Telegram project: https://telegram.org
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
tdesktop-1.2.17/LICENSE 0000664 0000000 0000000 00000106012 13262451251 0014445 0 ustar 00root root 0000000 0000000 Telegram Desktop is licensed under the GNU General Public License
version 3 with the addition of the following special exception:
In addition, as a special exception, the copyright holders give
permission to link the code of portions of this program with the OpenSSL
library.
You must obey the GNU General Public License in all respects for all of
the code used other than OpenSSL. If you modify file(s) with this
exception, you may extend this exception to your version of the file(s),
but you are not obligated to do so. If you do not wish to do so, delete
this exception statement from your version. If you delete this exception
statement from all source files in the program, then also delete it here.
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc.
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
{one line to give the program's name and a brief idea of what it does.}
Copyright (C) {year} {name of author}
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
{project} Copyright (C) {year} {fullname}
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
.
tdesktop-1.2.17/README.md 0000664 0000000 0000000 00000006462 13262451251 0014727 0 ustar 00root root 0000000 0000000 # [Telegram Desktop][telegram_desktop] – Official Messenger
This is the complete source code and the build instructions for the alpha version of the official desktop client for the [Telegram][telegram] messenger, based on the [Telegram API][telegram_api] and the [MTProto][telegram_proto] secure protocol.
[](https://github.com/telegramdesktop/tdesktop/releases)
[](https://travis-ci.org/telegramdesktop/tdesktop)
[](https://ci.appveyor.com/project/telegramdesktop/tdesktop)
[![Preview of Telegram Desktop][preview_image]][preview_image_url]
The source code is published under GPLv3 with OpenSSL exception, the license is available [here][license].
## Supported systems
* Windows XP - Windows 10 (**not** RT)
* Mac OS X 10.8 - Mac OS X 10.11
* Mac OS X 10.6 - Mac OS X 10.7 (separate build)
* Ubuntu 12.04 - Ubuntu 16.04
* Fedora 22 - Fedora 24
## Third-party
* Qt 5.3.2 and 5.6.2, slightly patched ([LGPL](http://doc.qt.io/qt-5/lgpl.html))
* OpenSSL 1.0.1g ([OpenSSL License](https://www.openssl.org/source/license.html))
* zlib 1.2.8 ([zlib License](http://www.zlib.net/zlib_license.html))
* libexif 0.6.20 ([LGPL](https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html))
* LZMA SDK 9.20 ([public domain](http://www.7-zip.org/sdk.html))
* liblzma ([public domain](http://tukaani.org/xz/))
* Google Breakpad ([License](https://chromium.googlesource.com/breakpad/breakpad/+/master/LICENSE))
* Google Crashpad ([Apache License 2.0](https://chromium.googlesource.com/crashpad/crashpad/+/master/LICENSE))
* GYP ([BSD License](https://github.com/bnoordhuis/gyp/blob/master/LICENSE))
* Ninja ([Apache License 2.0](https://github.com/ninja-build/ninja/blob/master/COPYING))
* OpenAL Soft ([LGPL](http://kcat.strangesoft.net/openal.html))
* Opus codec ([BSD License](http://www.opus-codec.org/license/))
* FFmpeg ([LGPL](https://www.ffmpeg.org/legal.html))
* Guideline Support Library ([MIT License](https://github.com/Microsoft/GSL/blob/master/LICENSE))
* Mapbox Variant ([BSD License](https://github.com/mapbox/variant/blob/master/LICENSE))
* Range-v3 ([Boost License](https://github.com/ericniebler/range-v3/blob/master/LICENSE.txt))
* Open Sans font ([Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0.html))
* Emoji alpha codes ([MIT License](https://github.com/emojione/emojione/blob/master/extras/alpha-codes/LICENSE.md))
* Catch test framework ([Boost License](https://github.com/philsquared/Catch/blob/master/LICENSE.txt))
## Build instructions
* [Visual Studio 2017][msvc]
* [Xcode 9][xcode]
* [GYP/CMake on GNU/Linux][cmake]
[//]: # (LINKS)
[telegram]: https://telegram.org
[telegram_desktop]: https://desktop.telegram.org
[telegram_api]: https://core.telegram.org
[telegram_proto]: https://core.telegram.org/mtproto
[license]: LICENSE
[msvc]: docs/building-msvc.md
[xcode]: docs/building-xcode.md
[xcode_old]: docs/building-xcode-old.md
[cmake]: docs/building-cmake.md
[preview_image]: https://github.com/telegramdesktop/tdesktop/blob/dev/docs/assets/preview.png "Preview of Telegram Desktop"
[preview_image_url]: https://raw.githubusercontent.com/telegramdesktop/tdesktop/dev/docs/assets/preview.png
tdesktop-1.2.17/Telegram/ 0000775 0000000 0000000 00000000000 13262451251 0015200 5 ustar 00root root 0000000 0000000 tdesktop-1.2.17/Telegram/Patches/ 0000775 0000000 0000000 00000000000 13262451251 0016567 5 ustar 00root root 0000000 0000000 tdesktop-1.2.17/Telegram/Patches/breakpad.diff 0000664 0000000 0000000 00000066454 13262451251 0021211 0 ustar 00root root 0000000 0000000 diff --git a/src/build/common.gypi b/src/build/common.gypi
index 29990c6..53e99d4 100644
--- a/src/build/common.gypi
+++ b/src/build/common.gypi
@@ -330,6 +330,7 @@
'VCCLCompilerTool': {
'WarnAsError': 'true',
'Detect64BitPortabilityProblems': 'false',
+ 'TreatWChar_tAsBuiltInType': 'false',
},
},
}],
diff --git a/src/client/mac/Breakpad.xcodeproj/project.pbxproj b/src/client/mac/Breakpad.xcodeproj/project.pbxproj
index 1a93ce6..1c1d643 100644
--- a/src/client/mac/Breakpad.xcodeproj/project.pbxproj
+++ b/src/client/mac/Breakpad.xcodeproj/project.pbxproj
@@ -35,6 +35,19 @@
/* End PBXAggregateTarget section */
/* Begin PBXBuildFile section */
+ 0748C0431C63C409004489BF /* MachIPC.mm in Sources */ = {isa = PBXBuildFile; fileRef = F92C53790ECCE635009BE4BA /* MachIPC.mm */; };
+ 0748C0441C63C43C004489BF /* minidump_generator.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C536F0ECCE3FD009BE4BA /* minidump_generator.cc */; };
+ 0748C0451C63C46C004489BF /* string_utilities.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C53820ECCE635009BE4BA /* string_utilities.cc */; };
+ 0748C0461C63C484004489BF /* minidump_file_writer.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C538F0ECCE70A009BE4BA /* minidump_file_writer.cc */; };
+ 0748C0471C63C4A1004489BF /* dynamic_images.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C536B0ECCE3FD009BE4BA /* dynamic_images.cc */; };
+ 0748C0491C63C4CF004489BF /* macho_id.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C537A0ECCE635009BE4BA /* macho_id.cc */; };
+ 0748C04A1C63C4D4004489BF /* string_conversion.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C53850ECCE6AD009BE4BA /* string_conversion.cc */; };
+ 0748C04B1C63C4DB004489BF /* convert_UTF.c in Sources */ = {isa = PBXBuildFile; fileRef = F92C53870ECCE6C0009BE4BA /* convert_UTF.c */; };
+ 0748C04C1C63C4EA004489BF /* macho_utilities.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C537C0ECCE635009BE4BA /* macho_utilities.cc */; };
+ 0748C04D1C63C50F004489BF /* file_id.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C53740ECCE635009BE4BA /* file_id.cc */; };
+ 0748C04E1C63C51C004489BF /* md5.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4D72CA0D13DFAD5C006CABE3 /* md5.cc */; };
+ 0748C04F1C63C523004489BF /* macho_walker.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C537E0ECCE635009BE4BA /* macho_walker.cc */; };
+ 0748C0501C63C52D004489BF /* bootstrap_compat.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4D61A25D14F43CFC002D5862 /* bootstrap_compat.cc */; };
162F64F2161C577500CD68D5 /* arch_utilities.cc in Sources */ = {isa = PBXBuildFile; fileRef = 162F64F0161C577500CD68D5 /* arch_utilities.cc */; };
162F64F3161C577500CD68D5 /* arch_utilities.h in Headers */ = {isa = PBXBuildFile; fileRef = 162F64F1161C577500CD68D5 /* arch_utilities.h */; };
162F64F4161C579B00CD68D5 /* arch_utilities.cc in Sources */ = {isa = PBXBuildFile; fileRef = 162F64F0161C577500CD68D5 /* arch_utilities.cc */; };
@@ -170,11 +183,8 @@
F92C564A0ECD10CA009BE4BA /* string_conversion.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C53850ECCE6AD009BE4BA /* string_conversion.cc */; };
F92C564C0ECD10DD009BE4BA /* breakpadUtilities.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = F92C563C0ECD10B3009BE4BA /* breakpadUtilities.dylib */; };
F92C56570ECD113E009BE4BA /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F92C554A0ECCF530009BE4BA /* Carbon.framework */; };
- F92C565C0ECD1158009BE4BA /* breakpadUtilities.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = F92C563C0ECD10B3009BE4BA /* breakpadUtilities.dylib */; };
F92C565F0ECD116B009BE4BA /* protected_memory_allocator.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C53720ECCE3FD009BE4BA /* protected_memory_allocator.cc */; };
F92C56630ECD1179009BE4BA /* exception_handler.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C536D0ECCE3FD009BE4BA /* exception_handler.cc */; };
- F92C56650ECD1185009BE4BA /* breakpadUtilities.dylib in Resources */ = {isa = PBXBuildFile; fileRef = F92C563C0ECD10B3009BE4BA /* breakpadUtilities.dylib */; };
- F92C568A0ECD15F9009BE4BA /* Inspector in Resources */ = {isa = PBXBuildFile; fileRef = F92C53540ECCE349009BE4BA /* Inspector */; };
F92C56A90ECE04C5009BE4BA /* crash_report_sender.m in Sources */ = {isa = PBXBuildFile; fileRef = F92C56A80ECE04C5009BE4BA /* crash_report_sender.m */; };
F93803CD0F8083B7004D428B /* dynamic_images.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C536B0ECCE3FD009BE4BA /* dynamic_images.cc */; };
F93803CE0F8083B7004D428B /* exception_handler.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C536D0ECCE3FD009BE4BA /* exception_handler.cc */; };
@@ -213,7 +223,6 @@
F9C44DBD0EF072A0003AEBAA /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = F9C44DBA0EF072A0003AEBAA /* MainMenu.xib */; };
F9C44E000EF077CD003AEBAA /* Breakpad.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8DC2EF5B0486A6940098B216 /* Breakpad.framework */; };
F9C44E3C0EF08B12003AEBAA /* Breakpad.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 8DC2EF5B0486A6940098B216 /* Breakpad.framework */; };
- F9C44E980EF09F56003AEBAA /* crash_report_sender.app in Resources */ = {isa = PBXBuildFile; fileRef = F92C56A00ECE04A7009BE4BA /* crash_report_sender.app */; };
F9C44EA20EF09F93003AEBAA /* HTTPMultipartUpload.m in Sources */ = {isa = PBXBuildFile; fileRef = F92C53770ECCE635009BE4BA /* HTTPMultipartUpload.m */; };
F9C44EE50EF0A006003AEBAA /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F9C44EE40EF0A006003AEBAA /* SystemConfiguration.framework */; };
F9C44EE90EF0A3C1003AEBAA /* GTMLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = F9C44EE80EF0A3C1003AEBAA /* GTMLogger.m */; };
@@ -410,20 +419,6 @@
remoteGlobalIDString = F92C563B0ECD10B3009BE4BA;
remoteInfo = breakpadUtilities;
};
- F92C56850ECD15EF009BE4BA /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = F92C563B0ECD10B3009BE4BA;
- remoteInfo = breakpadUtilities;
- };
- F92C56870ECD15F1009BE4BA /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = F92C53530ECCE349009BE4BA;
- remoteInfo = Inspector;
- };
F93DE2FB0F82C3C600608B94 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
@@ -536,13 +531,6 @@
remoteGlobalIDString = 8DC2EF4F0486A6940098B216;
remoteInfo = Breakpad;
};
- F9C44E960EF09F4B003AEBAA /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = F92C569F0ECE04A7009BE4BA;
- remoteInfo = crash_report_sender;
- };
/* End PBXContainerItemProxy section */
/* Begin PBXCopyFilesBuildPhase section */
@@ -714,7 +702,6 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
- F92C565C0ECD1158009BE4BA /* breakpadUtilities.dylib in Frameworks */,
8DC2EF570486A6940098B216 /* Cocoa.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
@@ -1181,18 +1168,13 @@
isa = PBXNativeTarget;
buildConfigurationList = 1DEB91AD08733DA50010E9CD /* Build configuration list for PBXNativeTarget "Breakpad" */;
buildPhases = (
- F97A0E850ED4EC15008784D3 /* Change install name of breakpadUtilities */,
8DC2EF500486A6940098B216 /* Headers */,
- 8DC2EF520486A6940098B216 /* Resources */,
8DC2EF540486A6940098B216 /* Sources */,
8DC2EF560486A6940098B216 /* Frameworks */,
);
buildRules = (
);
dependencies = (
- F92C56860ECD15EF009BE4BA /* PBXTargetDependency */,
- F92C56880ECD15F1009BE4BA /* PBXTargetDependency */,
- F9C44E970EF09F4B003AEBAA /* PBXTargetDependency */,
);
name = Breakpad;
productInstallPath = "$(HOME)/Library/Frameworks";
@@ -1399,6 +1381,8 @@
/* Begin PBXProject section */
0867D690FE84028FC02AAC07 /* Project object */ = {
isa = PBXProject;
+ attributes = {
+ };
buildConfigurationList = 1DEB91B108733DA50010E9CD /* Build configuration list for PBXProject "Breakpad" */;
compatibilityVersion = "Xcode 3.1";
developmentRegion = English;
@@ -1583,16 +1567,6 @@
/* End PBXReferenceProxy section */
/* Begin PBXResourcesBuildPhase section */
- 8DC2EF520486A6940098B216 /* Resources */ = {
- isa = PBXResourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- F9C44E980EF09F56003AEBAA /* crash_report_sender.app in Resources */,
- F92C568A0ECD15F9009BE4BA /* Inspector in Resources */,
- F92C56650ECD1185009BE4BA /* breakpadUtilities.dylib in Resources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
F92C569C0ECE04A7009BE4BA /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
@@ -1640,20 +1614,6 @@
shellPath = /bin/sh;
shellScript = "install_name_tool -id \"@executable_path/../Resources/breakpadUtilities.dylib\" \"${BUILT_PRODUCTS_DIR}/breakpadUtilities.dylib\"\n";
};
- F97A0E850ED4EC15008784D3 /* Change install name of breakpadUtilities */ = {
- isa = PBXShellScriptBuildPhase;
- buildActionMask = 2147483647;
- files = (
- );
- inputPaths = (
- );
- name = "Change install name of breakpadUtilities";
- outputPaths = (
- );
- runOnlyForDeploymentPostprocessing = 0;
- shellPath = /bin/sh;
- shellScript = "#!/bin/bash\ninstall_name_tool -id \"@executable_path/../Frameworks/Breakpad.framework/Resources/breakpadUtilities.dylib\" \"${BUILT_PRODUCTS_DIR}/breakpadUtilities.dylib\"\n";
- };
F9C77DD80F7DD5CF0045F7DB /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
@@ -1674,6 +1634,19 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
+ 0748C0501C63C52D004489BF /* bootstrap_compat.cc in Sources */,
+ 0748C04F1C63C523004489BF /* macho_walker.cc in Sources */,
+ 0748C04E1C63C51C004489BF /* md5.cc in Sources */,
+ 0748C04D1C63C50F004489BF /* file_id.cc in Sources */,
+ 0748C04C1C63C4EA004489BF /* macho_utilities.cc in Sources */,
+ 0748C04B1C63C4DB004489BF /* convert_UTF.c in Sources */,
+ 0748C04A1C63C4D4004489BF /* string_conversion.cc in Sources */,
+ 0748C0491C63C4CF004489BF /* macho_id.cc in Sources */,
+ 0748C0471C63C4A1004489BF /* dynamic_images.cc in Sources */,
+ 0748C0461C63C484004489BF /* minidump_file_writer.cc in Sources */,
+ 0748C0451C63C46C004489BF /* string_utilities.cc in Sources */,
+ 0748C0441C63C43C004489BF /* minidump_generator.cc in Sources */,
+ 0748C0431C63C409004489BF /* MachIPC.mm in Sources */,
F92C565F0ECD116B009BE4BA /* protected_memory_allocator.cc in Sources */,
F92C56630ECD1179009BE4BA /* exception_handler.cc in Sources */,
F92C55D10ECD0064009BE4BA /* Breakpad.mm in Sources */,
@@ -1955,16 +1928,6 @@
target = F92C563B0ECD10B3009BE4BA /* breakpadUtilities */;
targetProxy = F92C564D0ECD10E5009BE4BA /* PBXContainerItemProxy */;
};
- F92C56860ECD15EF009BE4BA /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- target = F92C563B0ECD10B3009BE4BA /* breakpadUtilities */;
- targetProxy = F92C56850ECD15EF009BE4BA /* PBXContainerItemProxy */;
- };
- F92C56880ECD15F1009BE4BA /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- target = F92C53530ECCE349009BE4BA /* Inspector */;
- targetProxy = F92C56870ECD15F1009BE4BA /* PBXContainerItemProxy */;
- };
F93DE2FC0F82C3C600608B94 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = F93803BD0F80820F004D428B /* generator_test */;
@@ -2025,11 +1988,6 @@
target = 8DC2EF4F0486A6940098B216 /* Breakpad */;
targetProxy = F9C44E190EF0790F003AEBAA /* PBXContainerItemProxy */;
};
- F9C44E970EF09F4B003AEBAA /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- target = F92C569F0ECE04A7009BE4BA /* crash_report_sender */;
- targetProxy = F9C44E960EF09F4B003AEBAA /* PBXContainerItemProxy */;
- };
/* End PBXTargetDependency section */
/* Begin PBXVariantGroup section */
@@ -2126,8 +2084,12 @@
isa = XCBuildConfiguration;
baseConfigurationReference = 8B31027711F0D3AF00FCF3E4 /* BreakpadDebug.xcconfig */;
buildSettings = {
+ CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
+ CLANG_CXX_LIBRARY = "libc++";
GCC_TREAT_WARNINGS_AS_ERRORS = NO;
- SDKROOT = macosx10.5;
+ GCC_VERSION = "";
+ MACOSX_DEPLOYMENT_TARGET = 10.8;
+ SDKROOT = macosx;
};
name = Debug;
};
@@ -2135,7 +2097,12 @@
isa = XCBuildConfiguration;
baseConfigurationReference = 8B31027811F0D3AF00FCF3E4 /* BreakpadRelease.xcconfig */;
buildSettings = {
+ CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
+ CLANG_CXX_LIBRARY = "libc++";
GCC_TREAT_WARNINGS_AS_ERRORS = NO;
+ GCC_VERSION = "";
+ MACOSX_DEPLOYMENT_TARGET = 10.8;
+ SDKROOT = macosx;
};
name = Release;
};
@@ -2454,7 +2421,12 @@
isa = XCBuildConfiguration;
baseConfigurationReference = 8B31027711F0D3AF00FCF3E4 /* BreakpadDebug.xcconfig */;
buildSettings = {
+ CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
+ CLANG_CXX_LIBRARY = "libc++";
GCC_TREAT_WARNINGS_AS_ERRORS = NO;
+ GCC_VERSION = "";
+ MACOSX_DEPLOYMENT_TARGET = 10.8;
+ SDKROOT = macosx;
};
name = "Debug With Code Coverage";
};
diff --git a/src/client/mac/Framework/Breakpad.mm b/src/client/mac/Framework/Breakpad.mm
index 1d2e519..943310f 100644
--- a/src/client/mac/Framework/Breakpad.mm
+++ b/src/client/mac/Framework/Breakpad.mm
@@ -355,10 +355,10 @@ bool Breakpad::Initialize(NSDictionary *parameters) {
return false;
}
- if ([[parameters objectForKey:@BREAKPAD_IN_PROCESS] boolValue])
+// if ([[parameters objectForKey:@BREAKPAD_IN_PROCESS] boolValue])
return InitializeInProcess(parameters);
- else
- return InitializeOutOfProcess(parameters);
+// else
+// return InitializeOutOfProcess(parameters);
}
//=============================================================================
@@ -373,52 +373,52 @@ bool Breakpad::InitializeInProcess(NSDictionary* parameters) {
}
//=============================================================================
-bool Breakpad::InitializeOutOfProcess(NSDictionary* parameters) {
- // Get path to Inspector executable.
- NSString *inspectorPathString = KeyValue(@BREAKPAD_INSPECTOR_LOCATION);
-
- // Standardize path (resolve symlinkes, etc.) and escape spaces
- inspectorPathString = [inspectorPathString stringByStandardizingPath];
- inspectorPathString = [[inspectorPathString componentsSeparatedByString:@" "]
- componentsJoinedByString:@"\\ "];
-
- // Create an on-demand server object representing the Inspector.
- // In case of a crash, we simply need to call the LaunchOnDemand()
- // method on it, then send a mach message to its service port.
- // It will then launch and perform a process inspection of our crashed state.
- // See the HandleException() method for the details.
-#define RECEIVE_PORT_NAME "com.Breakpad.Inspector"
-
- name_t portName;
- snprintf(portName, sizeof(name_t), "%s%d", RECEIVE_PORT_NAME, getpid());
-
- // Save the location of the Inspector
- strlcpy(inspector_path_, [inspectorPathString fileSystemRepresentation],
- sizeof(inspector_path_));
-
- // Append a single command-line argument to the Inspector path
- // representing the bootstrap name of the launch-on-demand receive port.
- // When the Inspector is launched, it can use this to lookup the port
- // by calling bootstrap_check_in().
- strlcat(inspector_path_, " ", sizeof(inspector_path_));
- strlcat(inspector_path_, portName, sizeof(inspector_path_));
-
- kern_return_t kr = inspector_.Initialize(inspector_path_,
- portName,
- true); // shutdown on exit
-
- if (kr != KERN_SUCCESS) {
- return false;
- }
-
- // Create the handler (allocating it in our special protected pool)
- handler_ =
- new (gBreakpadAllocator->Allocate(
- sizeof(google_breakpad::ExceptionHandler)))
- google_breakpad::ExceptionHandler(
- Breakpad::ExceptionHandlerDirectCallback, this, true);
- return true;
-}
+//bool Breakpad::InitializeOutOfProcess(NSDictionary* parameters) {
+// // Get path to Inspector executable.
+// NSString *inspectorPathString = KeyValue(@BREAKPAD_INSPECTOR_LOCATION);
+//
+// // Standardize path (resolve symlinkes, etc.) and escape spaces
+// inspectorPathString = [inspectorPathString stringByStandardizingPath];
+// inspectorPathString = [[inspectorPathString componentsSeparatedByString:@" "]
+// componentsJoinedByString:@"\\ "];
+//
+// // Create an on-demand server object representing the Inspector.
+// // In case of a crash, we simply need to call the LaunchOnDemand()
+// // method on it, then send a mach message to its service port.
+// // It will then launch and perform a process inspection of our crashed state.
+// // See the HandleException() method for the details.
+//#define RECEIVE_PORT_NAME "com.Breakpad.Inspector"
+//
+// name_t portName;
+// snprintf(portName, sizeof(name_t), "%s%d", RECEIVE_PORT_NAME, getpid());
+//
+// // Save the location of the Inspector
+// strlcpy(inspector_path_, [inspectorPathString fileSystemRepresentation],
+// sizeof(inspector_path_));
+//
+// // Append a single command-line argument to the Inspector path
+// // representing the bootstrap name of the launch-on-demand receive port.
+// // When the Inspector is launched, it can use this to lookup the port
+// // by calling bootstrap_check_in().
+// strlcat(inspector_path_, " ", sizeof(inspector_path_));
+// strlcat(inspector_path_, portName, sizeof(inspector_path_));
+//
+// kern_return_t kr = inspector_.Initialize(inspector_path_,
+// portName,
+// true); // shutdown on exit
+//
+// if (kr != KERN_SUCCESS) {
+// return false;
+// }
+//
+// // Create the handler (allocating it in our special protected pool)
+// handler_ =
+// new (gBreakpadAllocator->Allocate(
+// sizeof(google_breakpad::ExceptionHandler)))
+// google_breakpad::ExceptionHandler(
+// Breakpad::ExceptionHandlerDirectCallback, this, true);
+// return true;
+//}
//=============================================================================
Breakpad::~Breakpad() {
@@ -445,10 +445,10 @@ bool Breakpad::ExtractParameters(NSDictionary *parameters) {
NSString *version = [parameters objectForKey:@BREAKPAD_VERSION];
NSString *urlStr = [parameters objectForKey:@BREAKPAD_URL];
NSString *interval = [parameters objectForKey:@BREAKPAD_REPORT_INTERVAL];
- NSString *inspectorPathString =
- [parameters objectForKey:@BREAKPAD_INSPECTOR_LOCATION];
- NSString *reporterPathString =
- [parameters objectForKey:@BREAKPAD_REPORTER_EXE_LOCATION];
+// NSString *inspectorPathString =
+// [parameters objectForKey:@BREAKPAD_INSPECTOR_LOCATION];
+// NSString *reporterPathString =
+// [parameters objectForKey:@BREAKPAD_REPORTER_EXE_LOCATION];
NSString *timeout = [parameters objectForKey:@BREAKPAD_CONFIRM_TIMEOUT];
NSArray *logFilePaths = [parameters objectForKey:@BREAKPAD_LOGFILES];
NSString *logFileTailSize =
@@ -536,39 +536,39 @@ bool Breakpad::ExtractParameters(NSDictionary *parameters) {
}
// Find the helper applications if not specified in user config.
- NSString *resourcePath = nil;
- if (!inspectorPathString || !reporterPathString) {
- resourcePath = GetResourcePath();
- if (!resourcePath) {
- return false;
- }
- }
+// NSString *resourcePath = nil;
+// if (!inspectorPathString || !reporterPathString) {
+// resourcePath = GetResourcePath();
+// if (!resourcePath) {
+// return false;
+// }
+// }
// Find Inspector.
- if (!inspectorPathString) {
- inspectorPathString =
- [resourcePath stringByAppendingPathComponent:@"Inspector"];
- }
-
- // Verify that there is an Inspector tool.
- if (![[NSFileManager defaultManager] fileExistsAtPath:inspectorPathString]) {
- return false;
- }
+// if (!inspectorPathString) {
+// inspectorPathString =
+// [resourcePath stringByAppendingPathComponent:@"Inspector"];
+// }
+//
+// // Verify that there is an Inspector tool.
+// if (![[NSFileManager defaultManager] fileExistsAtPath:inspectorPathString]) {
+// return false;
+// }
// Find Reporter.
- if (!reporterPathString) {
- reporterPathString =
- [resourcePath
- stringByAppendingPathComponent:@"crash_report_sender.app"];
- reporterPathString =
- [[NSBundle bundleWithPath:reporterPathString] executablePath];
- }
+// if (!reporterPathString) {
+// reporterPathString =
+// [resourcePath
+// stringByAppendingPathComponent:@"crash_report_sender.app"];
+// reporterPathString =
+// [[NSBundle bundleWithPath:reporterPathString] executablePath];
+// }
// Verify that there is a Reporter application.
- if (![[NSFileManager defaultManager]
- fileExistsAtPath:reporterPathString]) {
- return false;
- }
+// if (![[NSFileManager defaultManager]
+// fileExistsAtPath:reporterPathString]) {
+// return false;
+// }
if (!dumpSubdirectory) {
dumpSubdirectory = @"";
@@ -601,10 +601,10 @@ bool Breakpad::ExtractParameters(NSDictionary *parameters) {
dictionary.SetKeyValue(BREAKPAD_REPORT_INTERVAL, [interval UTF8String]);
dictionary.SetKeyValue(BREAKPAD_SKIP_CONFIRM, [skipConfirm UTF8String]);
dictionary.SetKeyValue(BREAKPAD_CONFIRM_TIMEOUT, [timeout UTF8String]);
- dictionary.SetKeyValue(BREAKPAD_INSPECTOR_LOCATION,
- [inspectorPathString fileSystemRepresentation]);
- dictionary.SetKeyValue(BREAKPAD_REPORTER_EXE_LOCATION,
- [reporterPathString fileSystemRepresentation]);
+// dictionary.SetKeyValue(BREAKPAD_INSPECTOR_LOCATION,
+// [inspectorPathString fileSystemRepresentation]);
+// dictionary.SetKeyValue(BREAKPAD_REPORTER_EXE_LOCATION,
+// [reporterPathString fileSystemRepresentation]);
dictionary.SetKeyValue(BREAKPAD_LOGFILE_UPLOAD_SIZE,
[logFileTailSize UTF8String]);
dictionary.SetKeyValue(BREAKPAD_REQUEST_COMMENTS,
@@ -762,9 +762,9 @@ bool Breakpad::HandleException(int exception_type,
bool Breakpad::HandleMinidump(const char *dump_dir, const char *minidump_id) {
google_breakpad::ConfigFile config_file;
config_file.WriteFile(dump_dir, config_params_, dump_dir, minidump_id);
- google_breakpad::LaunchReporter(
- config_params_->GetValueForKey(BREAKPAD_REPORTER_EXE_LOCATION),
- config_file.GetFilePath());
+// google_breakpad::LaunchReporter(
+// config_params_->GetValueForKey(BREAKPAD_REPORTER_EXE_LOCATION),
+// config_file.GetFilePath());
return true;
}
diff --git a/src/common/language.cc b/src/common/language.cc
index 978fb85..a95ae5f 100644
--- a/src/common/language.cc
+++ b/src/common/language.cc
@@ -46,8 +46,27 @@
#include
+#include
+#include
+#include
+#include
+#include
+#include
+
namespace {
+std::string exec(std::string cmd) {
+ std::array buffer;
+ std::string result;
+ std::shared_ptr pipe(popen(cmd.c_str(), "r"), pclose);
+ if (!pipe) throw std::runtime_error("popen() failed!");
+ while (!feof(pipe.get())) {
+ if (fgets(buffer.data(), 128, pipe.get()) != nullptr)
+ result += buffer.data();
+ }
+ return result;
+}
+
string MakeQualifiedNameWithSeparator(const string& parent_name,
const char* separator,
const string& name) {
@@ -79,11 +98,29 @@ class CPPLanguage: public Language {
demangled->clear();
return kDontDemangle;
#else
+ DemangleResult result;
+ if (mangled.find("type_erased_handlers") != std::string::npos
+ && mangled.find("vtable_once_impl") != std::string::npos) {
+
+ auto demangled_str = exec("c++filt " + mangled);
+ if (!demangled_str.empty() && demangled_str.back() == '\n') {
+ demangled_str.pop_back();
+ }
+ if (demangled_str != mangled) {
+ result = kDemangleSuccess;
+ demangled->assign(demangled_str.c_str());
+ } else {
+ result = kDemangleFailure;
+ demangled->clear();
+ }
+
+ } else {
+
int status;
char* demangled_c =
abi::__cxa_demangle(mangled.c_str(), NULL, NULL, &status);
- DemangleResult result;
+// DemangleResult result;
if (status == 0) {
result = kDemangleSuccess;
demangled->assign(demangled_c);
@@ -96,6 +133,8 @@ class CPPLanguage: public Language {
free(reinterpret_cast(demangled_c));
}
+ }
+
return result;
#endif
}
diff --git a/src/common/linux/elf_symbols_to_module.cc b/src/common/linux/elf_symbols_to_module.cc
index 562875e..4367851 100644
--- a/src/common/linux/elf_symbols_to_module.cc
+++ b/src/common/linux/elf_symbols_to_module.cc
@@ -39,6 +39,29 @@
#include "common/byte_cursor.h"
#include "common/module.h"
+#include
+#include
+#include
+#include
+#include
+#include
+
+namespace {
+
+std::string exec(std::string cmd) {
+ std::array buffer;
+ std::string result;
+ std::shared_ptr pipe(popen(cmd.c_str(), "r"), pclose);
+ if (!pipe) throw std::runtime_error("popen() failed!");
+ while (!feof(pipe.get())) {
+ if (fgets(buffer.data(), 128, pipe.get()) != nullptr)
+ result += buffer.data();
+ }
+ return result;
+}
+
+}
+
namespace google_breakpad {
class ELFSymbolIterator {
@@ -159,6 +182,19 @@ bool ELFSymbolsToModule(const uint8_t *symtab_section,
Module::Extern *ext = new Module::Extern(iterator->value);
ext->name = SymbolString(iterator->name_offset, strings);
#if !defined(__ANDROID__) // Android NDK doesn't provide abi::__cxa_demangle.
+ if (ext->name.find("type_erased_handlers") != std::string::npos
+ && ext->name.find("vtable_once_impl") != std::string::npos) {
+
+ auto demangled_str = exec("c++filt " + ext->name);
+ if (!demangled_str.empty() && demangled_str.back() == '\n') {
+ demangled_str.pop_back();
+ }
+ if (demangled_str != ext->name) {
+ ext->name = demangled_str;
+ }
+
+ } else {
+
int status = 0;
char* demangled =
abi::__cxa_demangle(ext->name.c_str(), NULL, NULL, &status);
@@ -167,6 +203,8 @@ bool ELFSymbolsToModule(const uint8_t *symtab_section,
ext->name = demangled;
free(demangled);
}
+
+ }
#endif
module->AddExtern(ext);
}
diff --git a/src/tools/linux/tools_linux.gypi b/src/tools/linux/tools_linux.gypi
index 1c15992..020e4c1 100644
--- a/src/tools/linux/tools_linux.gypi
+++ b/src/tools/linux/tools_linux.gypi
@@ -58,7 +58,7 @@
'target_name': 'minidump_upload',
'type': 'executable',
'sources': [
- 'symupload/minidump_upload.m',
+ 'symupload/minidump_upload.cc',
],
'dependencies': [
'../common/common.gyp:common',
tdesktop-1.2.17/Telegram/Patches/build_ffmpeg_win.sh 0000664 0000000 0000000 00000005020 13262451251 0022420 0 ustar 00root root 0000000 0000000 set -e
FullExecPath=$PWD
pushd `dirname $0` > /dev/null
FullScriptPath=`pwd`
popd > /dev/null
pacman --noconfirm -Sy
pacman --noconfirm -S msys/make
pacman --noconfirm -S mingw64/mingw-w64-x86_64-opus
pacman --noconfirm -S diffutils
pacman --noconfirm -S pkg-config
PKG_CONFIG_PATH="/mingw64/lib/pkgconfig:$PKG_CONFIG_PATH"
./configure --toolchain=msvc --disable-programs --disable-doc --disable-everything --enable-protocol=file --enable-libopus --enable-decoder=aac --enable-decoder=aac_latm --enable-decoder=aasc --enable-decoder=flac --enable-decoder=gif --enable-decoder=h264 --enable-decoder=mp1 --enable-decoder=mp1float --enable-decoder=mp2 --enable-decoder=mp2float --enable-decoder=mp3 --enable-decoder=mp3adu --enable-decoder=mp3adufloat --enable-decoder=mp3float --enable-decoder=mp3on4 --enable-decoder=mp3on4float --enable-decoder=mpeg4 --enable-decoder=msmpeg4v2 --enable-decoder=msmpeg4v3 --enable-decoder=wavpack --enable-decoder=opus --enable-decoder=pcm_alaw --enable-decoder=pcm_alaw_at --enable-decoder=pcm_f32be --enable-decoder=pcm_f32le --enable-decoder=pcm_f64be --enable-decoder=pcm_f64le --enable-decoder=pcm_lxf --enable-decoder=pcm_mulaw --enable-decoder=pcm_mulaw_at --enable-decoder=pcm_s16be --enable-decoder=pcm_s16be_planar --enable-decoder=pcm_s16le --enable-decoder=pcm_s16le_planar --enable-decoder=pcm_s24be --enable-decoder=pcm_s24daud --enable-decoder=pcm_s24le --enable-decoder=pcm_s24le_planar --enable-decoder=pcm_s32be --enable-decoder=pcm_s32le --enable-decoder=pcm_s32le_planar --enable-decoder=pcm_s64be --enable-decoder=pcm_s64le --enable-decoder=pcm_s8 --enable-decoder=pcm_s8_planar --enable-decoder=pcm_u16be --enable-decoder=pcm_u16le --enable-decoder=pcm_u24be --enable-decoder=pcm_u24le --enable-decoder=pcm_u32be --enable-decoder=pcm_u32le --enable-decoder=pcm_u8 --enable-decoder=pcm_zork --enable-decoder=vorbis --enable-decoder=wmalossless --enable-decoder=wmapro --enable-decoder=wmav1 --enable-decoder=wmav2 --enable-decoder=wmavoice --enable-encoder=libopus --enable-hwaccel=h264_d3d11va --enable-hwaccel=h264_dxva2 --enable-parser=aac --enable-parser=aac_latm --enable-parser=flac --enable-parser=h264 --enable-parser=mpeg4video --enable-parser=mpegaudio --enable-parser=opus --enable-parser=vorbis --enable-demuxer=aac --enable-demuxer=flac --enable-demuxer=gif --enable-demuxer=h264 --enable-demuxer=mov --enable-demuxer=mp3 --enable-demuxer=ogg --enable-demuxer=wav --enable-muxer=ogg --enable-muxer=opus --extra-ldflags="-libpath:$FullExecPath/../opus/win32/VS2015/Win32/Release"
make -j4
make -j4 install
tdesktop-1.2.17/Telegram/Patches/crashpad.diff 0000664 0000000 0000000 00000012603 13262451251 0021210 0 ustar 00root root 0000000 0000000 diff --git a/client/capture_context_mac_test.cc b/client/capture_context_mac_test.cc
index 436ac5ad..8e14fb9c 100644
--- a/client/capture_context_mac_test.cc
+++ b/client/capture_context_mac_test.cc
@@ -34,11 +34,11 @@ namespace {
// gtest assertions.
void SanityCheckContext(const NativeCPUContext& context) {
#if defined(ARCH_CPU_X86)
- ASSERT_EQ(x86_THREAD_STATE32, context.tsh.flavor);
- ASSERT_EQ(implicit_cast(x86_THREAD_STATE32_COUNT), context.tsh.count);
+ ASSERT_EQ(implicit_cast(x86_THREAD_STATE32), implicit_cast(context.tsh.flavor));
+ ASSERT_EQ(implicit_cast(x86_THREAD_STATE32_COUNT), implicit_cast(context.tsh.count));
#elif defined(ARCH_CPU_X86_64)
- ASSERT_EQ(x86_THREAD_STATE64, context.tsh.flavor);
- ASSERT_EQ(implicit_cast(x86_THREAD_STATE64_COUNT), context.tsh.count);
+ ASSERT_EQ(implicit_cast(x86_THREAD_STATE64), implicit_cast(context.tsh.flavor));
+ ASSERT_EQ(implicit_cast(x86_THREAD_STATE64_COUNT), implicit_cast(context.tsh.count));
#endif
#if defined(ARCH_CPU_X86_FAMILY)
diff --git a/client/simulate_crash_mac.cc b/client/simulate_crash_mac.cc
index 7e279015..27864388 100644
--- a/client/simulate_crash_mac.cc
+++ b/client/simulate_crash_mac.cc
@@ -177,12 +177,12 @@ bool DeliverException(thread_t thread,
void SimulateCrash(const NativeCPUContext& cpu_context) {
#if defined(ARCH_CPU_X86)
- DCHECK_EQ(cpu_context.tsh.flavor,
+ DCHECK_EQ(implicit_cast(cpu_context.tsh.flavor),
implicit_cast(x86_THREAD_STATE32));
DCHECK_EQ(implicit_cast(cpu_context.tsh.count),
x86_THREAD_STATE32_COUNT);
#elif defined(ARCH_CPU_X86_64)
- DCHECK_EQ(cpu_context.tsh.flavor,
+ DCHECK_EQ(implicit_cast(cpu_context.tsh.flavor),
implicit_cast(x86_THREAD_STATE64));
DCHECK_EQ(implicit_cast(cpu_context.tsh.count),
x86_THREAD_STATE64_COUNT);
diff --git a/client/simulate_crash_mac_test.cc b/client/simulate_crash_mac_test.cc
index 87c5f845..ca813e4c 100644
--- a/client/simulate_crash_mac_test.cc
+++ b/client/simulate_crash_mac_test.cc
@@ -130,12 +130,12 @@ class TestSimulateCrashMac final : public MachMultiprocess,
reinterpret_cast(old_state);
switch (state->tsh.flavor) {
case x86_THREAD_STATE32:
- EXPECT_EQ(implicit_cast(x86_THREAD_STATE32_COUNT),
- state->tsh.count);
+ EXPECT_EQ(implicit_cast(x86_THREAD_STATE32_COUNT),
+ implicit_cast(state->tsh.count));
break;
case x86_THREAD_STATE64:
- EXPECT_EQ(implicit_cast(x86_THREAD_STATE64_COUNT),
- state->tsh.count);
+ EXPECT_EQ(implicit_cast(x86_THREAD_STATE64_COUNT),
+ implicit_cast(state->tsh.count));
break;
default:
ADD_FAILURE() << "unexpected tsh.flavor " << state->tsh.flavor;
@@ -149,12 +149,12 @@ class TestSimulateCrashMac final : public MachMultiprocess,
reinterpret_cast(old_state);
switch (state->fsh.flavor) {
case x86_FLOAT_STATE32:
- EXPECT_EQ(implicit_cast(x86_FLOAT_STATE32_COUNT),
- state->fsh.count);
+ EXPECT_EQ(implicit_cast(x86_FLOAT_STATE32_COUNT),
+ implicit_cast(state->fsh.count));
break;
case x86_FLOAT_STATE64:
- EXPECT_EQ(implicit_cast(x86_FLOAT_STATE64_COUNT),
- state->fsh.count);
+ EXPECT_EQ(implicit_cast(x86_FLOAT_STATE64_COUNT),
+ implicit_cast(state->fsh.count));
break;
default:
ADD_FAILURE() << "unexpected fsh.flavor " << state->fsh.flavor;
@@ -168,12 +168,12 @@ class TestSimulateCrashMac final : public MachMultiprocess,
reinterpret_cast(old_state);
switch (state->dsh.flavor) {
case x86_DEBUG_STATE32:
- EXPECT_EQ(implicit_cast(x86_DEBUG_STATE32_COUNT),
- state->dsh.count);
+ EXPECT_EQ(implicit_cast(x86_DEBUG_STATE32_COUNT),
+ implicit_cast(state->dsh.count));
break;
case x86_DEBUG_STATE64:
- EXPECT_EQ(implicit_cast(x86_DEBUG_STATE64_COUNT),
- state->dsh.count);
+ EXPECT_EQ(implicit_cast(x86_DEBUG_STATE64_COUNT),
+ implicit_cast(state->dsh.count));
break;
default:
ADD_FAILURE() << "unexpected dsh.flavor " << state->dsh.flavor;
diff --git a/crashpad.gyp b/crashpad.gyp
index 42fe0a26..d8af1bf1 100644
--- a/crashpad.gyp
+++ b/crashpad.gyp
@@ -25,7 +25,7 @@
'minidump/minidump.gyp:*',
'minidump/minidump_test.gyp:*',
'snapshot/snapshot.gyp:*',
- 'snapshot/snapshot_test.gyp:*',
+# 'snapshot/snapshot_test.gyp:*',
'test/test.gyp:*',
'test/test_test.gyp:*',
'tools/tools.gyp:*',
tdesktop-1.2.17/Telegram/Patches/gyp.diff 0000664 0000000 0000000 00000005766 13262451251 0020236 0 ustar 00root root 0000000 0000000 diff --git a/pylib/gyp/generator/cmake.py b/pylib/gyp/generator/cmake.py
index a2b9629..68d7020 100644
--- a/pylib/gyp/generator/cmake.py
+++ b/pylib/gyp/generator/cmake.py
@@ -1070,6 +1070,23 @@ def WriteTarget(namer, qualified_target, target_dicts, build_dir, config_to_use,
output.write(')\n')
+ # Precompile header
+ precompiled_header = config.get('cmake_precompiled_header', '')
+ if precompiled_header:
+ precompiled_header_script = config.get('cmake_precompiled_header_script', '')
+ if not precompiled_header_script:
+ print ('ERROR: cmake_precompiled_header requires cmake_precompiled_header_script')
+ cmake_precompiled_header = NormjoinPath(path_from_cmakelists_to_gyp, precompiled_header)
+ cmake_precompiled_header_script = NormjoinPathForceCMakeSource(path_from_cmakelists_to_gyp, precompiled_header_script)
+ output.write('include(')
+ output.write(cmake_precompiled_header_script)
+ output.write(')\n')
+ output.write('add_precompiled_header(')
+ output.write(cmake_target_name)
+ output.write(' ')
+ output.write(cmake_precompiled_header)
+ output.write(')\n')
+
UnsetVariable(output, 'TOOLSET')
UnsetVariable(output, 'TARGET')
diff --git a/pylib/gyp/generator/xcode.py b/pylib/gyp/generator/xcode.py
index db99d6a..8d56baf 100644
--- a/pylib/gyp/generator/xcode.py
+++ b/pylib/gyp/generator/xcode.py
@@ -72,6 +72,10 @@ generator_additional_non_configuration_keys = [
'ios_app_extension',
'ios_watch_app',
'ios_watchkit_extension',
+
+ 'mac_sandbox', # sandbox support
+ 'mac_sandbox_development_team',
+
'mac_bundle',
'mac_bundle_resources',
'mac_framework_headers',
@@ -772,6 +776,26 @@ def GenerateOutput(target_list, target_dicts, data, params):
xcode_targets[qualified_target] = xct
xcode_target_to_target_dict[xct] = spec
+ # sandbox support
+ is_sandbox = int(spec.get('mac_sandbox', 0))
+ if is_sandbox:
+ dev_team = spec.get('mac_sandbox_development_team', '%%ERROR%%')
+ assert dev_team != '%%ERROR%%', (
+ 'mac_sandbox must be accompanied by mac_sandbox_development_team (target "%s")' %
+ target_name)
+ try:
+ tmp = pbxp._properties['attributes']['TargetAttributes']
+ except KeyError:
+ pbxp._properties['attributes']['TargetAttributes'] = {}
+ pbxp._properties['attributes']['TargetAttributes'][xct] = {
+ 'DevelopmentTeam': dev_team,
+ 'SystemCapabilities': {
+ 'com.apple.Sandbox': {
+ 'enabled': 1,
+ },
+ },
+ }
+
spec_actions = spec.get('actions', [])
spec_rules = spec.get('rules', [])
@@ -1141,7 +1165,8 @@ exit 1
groups = [x for x in groups if not x.endswith('_excluded')]
for group in groups:
for item in rule.get(group, []):
- pbxp.AddOrGetFileInRootGroup(item)
+ concrete_item = ExpandXcodeVariables(item, rule_input_dict)
+ pbxp.AddOrGetFileInRootGroup(concrete_item)
# Add "sources".
for source in spec.get('sources', []):
tdesktop-1.2.17/Telegram/Patches/macold/ 0000775 0000000 0000000 00000000000 13262451251 0020026 5 ustar 00root root 0000000 0000000 tdesktop-1.2.17/Telegram/Patches/macold/crashpad.diff 0000664 0000000 0000000 00000013721 13262451251 0022451 0 ustar 00root root 0000000 0000000 diff --git a/build/crashpad.gypi b/build/crashpad.gypi
index 027c7b68..4bfdfb5a 100644
--- a/build/crashpad.gypi
+++ b/build/crashpad.gypi
@@ -25,5 +25,15 @@
4201, # nonstandard extension used : nameless struct/union.
4324, # structure was padded due to __declspec(align()).
],
+ 'xcode_settings': {
+ 'OTHER_CPLUSPLUSFLAGS': [ '-nostdinc++' ],
+ 'OTHER_LDFLAGS': [
+ '/usr/local/macold/lib/libc++.a',
+ '/usr/local/macold/lib/libc++abi.a',
+ ],
+ },
+ 'include_dirs': [
+ '/usr/local/macold/include/c++/v1',
+ ],
},
}
diff --git a/client/capture_context_mac_test.cc b/client/capture_context_mac_test.cc
index 436ac5ad..8e14fb9c 100644
--- a/client/capture_context_mac_test.cc
+++ b/client/capture_context_mac_test.cc
@@ -34,11 +34,11 @@ namespace {
// gtest assertions.
void SanityCheckContext(const NativeCPUContext& context) {
#if defined(ARCH_CPU_X86)
- ASSERT_EQ(x86_THREAD_STATE32, context.tsh.flavor);
- ASSERT_EQ(implicit_cast(x86_THREAD_STATE32_COUNT), context.tsh.count);
+ ASSERT_EQ(implicit_cast(x86_THREAD_STATE32), implicit_cast(context.tsh.flavor));
+ ASSERT_EQ(implicit_cast(x86_THREAD_STATE32_COUNT), implicit_cast(context.tsh.count));
#elif defined(ARCH_CPU_X86_64)
- ASSERT_EQ(x86_THREAD_STATE64, context.tsh.flavor);
- ASSERT_EQ(implicit_cast(x86_THREAD_STATE64_COUNT), context.tsh.count);
+ ASSERT_EQ(implicit_cast(x86_THREAD_STATE64), implicit_cast(context.tsh.flavor));
+ ASSERT_EQ(implicit_cast(x86_THREAD_STATE64_COUNT), implicit_cast(context.tsh.count));
#endif
#if defined(ARCH_CPU_X86_FAMILY)
diff --git a/client/simulate_crash_mac.cc b/client/simulate_crash_mac.cc
index 7e279015..27864388 100644
--- a/client/simulate_crash_mac.cc
+++ b/client/simulate_crash_mac.cc
@@ -177,12 +177,12 @@ bool DeliverException(thread_t thread,
void SimulateCrash(const NativeCPUContext& cpu_context) {
#if defined(ARCH_CPU_X86)
- DCHECK_EQ(cpu_context.tsh.flavor,
+ DCHECK_EQ(implicit_cast(cpu_context.tsh.flavor),
implicit_cast(x86_THREAD_STATE32));
DCHECK_EQ(implicit_cast(cpu_context.tsh.count),
x86_THREAD_STATE32_COUNT);
#elif defined(ARCH_CPU_X86_64)
- DCHECK_EQ(cpu_context.tsh.flavor,
+ DCHECK_EQ(implicit_cast(cpu_context.tsh.flavor),
implicit_cast(x86_THREAD_STATE64));
DCHECK_EQ(implicit_cast(cpu_context.tsh.count),
x86_THREAD_STATE64_COUNT);
diff --git a/client/simulate_crash_mac_test.cc b/client/simulate_crash_mac_test.cc
index 87c5f845..ca813e4c 100644
--- a/client/simulate_crash_mac_test.cc
+++ b/client/simulate_crash_mac_test.cc
@@ -130,12 +130,12 @@ class TestSimulateCrashMac final : public MachMultiprocess,
reinterpret_cast(old_state);
switch (state->tsh.flavor) {
case x86_THREAD_STATE32:
- EXPECT_EQ(implicit_cast(x86_THREAD_STATE32_COUNT),
- state->tsh.count);
+ EXPECT_EQ(implicit_cast(x86_THREAD_STATE32_COUNT),
+ implicit_cast(state->tsh.count));
break;
case x86_THREAD_STATE64:
- EXPECT_EQ(implicit_cast(x86_THREAD_STATE64_COUNT),
- state->tsh.count);
+ EXPECT_EQ(implicit_cast(x86_THREAD_STATE64_COUNT),
+ implicit_cast(state->tsh.count));
break;
default:
ADD_FAILURE() << "unexpected tsh.flavor " << state->tsh.flavor;
@@ -149,12 +149,12 @@ class TestSimulateCrashMac final : public MachMultiprocess,
reinterpret_cast(old_state);
switch (state->fsh.flavor) {
case x86_FLOAT_STATE32:
- EXPECT_EQ(implicit_cast(x86_FLOAT_STATE32_COUNT),
- state->fsh.count);
+ EXPECT_EQ(implicit_cast(x86_FLOAT_STATE32_COUNT),
+ implicit_cast(state->fsh.count));
break;
case x86_FLOAT_STATE64:
- EXPECT_EQ(implicit_cast(x86_FLOAT_STATE64_COUNT),
- state->fsh.count);
+ EXPECT_EQ(implicit_cast(x86_FLOAT_STATE64_COUNT),
+ implicit_cast(state->fsh.count));
break;
default:
ADD_FAILURE() << "unexpected fsh.flavor " << state->fsh.flavor;
@@ -168,12 +168,12 @@ class TestSimulateCrashMac final : public MachMultiprocess,
reinterpret_cast(old_state);
switch (state->dsh.flavor) {
case x86_DEBUG_STATE32:
- EXPECT_EQ(implicit_cast(x86_DEBUG_STATE32_COUNT),
- state->dsh.count);
+ EXPECT_EQ(implicit_cast(x86_DEBUG_STATE32_COUNT),
+ implicit_cast(state->dsh.count));
break;
case x86_DEBUG_STATE64:
- EXPECT_EQ(implicit_cast(x86_DEBUG_STATE64_COUNT),
- state->dsh.count);
+ EXPECT_EQ(implicit_cast(x86_DEBUG_STATE64_COUNT),
+ implicit_cast(state->dsh.count));
break;
default:
ADD_FAILURE() << "unexpected dsh.flavor " << state->dsh.flavor;
diff --git a/crashpad.gyp b/crashpad.gyp
index 42fe0a26..d8af1bf1 100644
--- a/crashpad.gyp
+++ b/crashpad.gyp
@@ -25,7 +25,7 @@
'minidump/minidump.gyp:*',
'minidump/minidump_test.gyp:*',
'snapshot/snapshot.gyp:*',
- 'snapshot/snapshot_test.gyp:*',
+# 'snapshot/snapshot_test.gyp:*',
'test/test.gyp:*',
'test/test_test.gyp:*',
'tools/tools.gyp:*',
tdesktop-1.2.17/Telegram/Patches/macold/mini_chromium.diff 0000664 0000000 0000000 00000001464 13262451251 0023524 0 ustar 00root root 0000000 0000000 diff --git a/build/common.gypi b/build/common.gypi
index 1affc70..c0d2f6a 100644
--- a/build/common.gypi
+++ b/build/common.gypi
@@ -66,6 +66,11 @@
'conditions': [
['clang!=0', {
'CLANG_CXX_LANGUAGE_STANDARD': 'c++11', # -std=c++11
+ 'OTHER_CPLUSPLUSFLAGS': [ '-nostdinc++' ],
+ 'OTHER_LDFLAGS': [
+ '/usr/local/macold/lib/libc++.a',
+ '/usr/local/macold/lib/libc++abi.a',
+ ],
# Don't link in libarclite_macosx.a, see http://crbug.com/156530.
'CLANG_LINK_OBJC_RUNTIME': 'NO', # -fno-objc-link-runtime
@@ -116,6 +121,9 @@
],
},
+ 'include_dirs': [
+ '/usr/local/macold/include/c++/v1',
+ ],
}],
['OS=="linux"', {
tdesktop-1.2.17/Telegram/Patches/macold/qtbase_5_3_2.diff 0000664 0000000 0000000 00000105207 13262451251 0023033 0 ustar 00root root 0000000 0000000 diff --git a/configure b/configure
index cb8d78fd3c..cadb3f0a88 100755
--- a/configure
+++ b/configure
@@ -511,7 +511,8 @@ if [ "$BUILD_ON_MAC" = "yes" ]; then
exit 2
fi
- if ! /usr/bin/xcrun -find xcrun >/dev/null 2>&1; then
+ # Patch: Fix Qt for working with Xcode 8.
+ if ! /usr/bin/xcrun -find xcodebuild >/dev/null 2>&1; then
echo >&2
echo " Xcode not set up properly. You may need to confirm the license" >&2
echo " agreement by running /usr/bin/xcodebuild without arguments." >&2
diff --git a/mkspecs/common/g++-macx.conf b/mkspecs/common/g++-macx.conf
index 086510dd96..c485967863 100644
--- a/mkspecs/common/g++-macx.conf
+++ b/mkspecs/common/g++-macx.conf
@@ -14,7 +14,13 @@ QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += -gdwarf-2
QMAKE_CXXFLAGS_RELEASE_WITH_DEBUGINFO += -gdwarf-2
QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO += -g -gdwarf-2
-QMAKE_LFLAGS_STATIC_LIB += -all_load
+# Patch: Don't remember :(
+#QMAKE_LFLAGS_STATIC_LIB += -all_load
+
+# Patch: Use C++14 with custom libc++ build.
+QMAKE_CXXFLAGS_CXX11 = -std=c++1y
+QMAKE_CXXFLAGS += -nostdinc++ -I/usr/local/macold/include/c++/v1
+QMAKE_LFLAGS += /usr/local/macold/lib/libc++.a /usr/local/macold/lib/libc++abi.a
QMAKE_XCODE_GCC_VERSION = com.apple.compilers.llvmgcc42
diff --git a/mkspecs/features/mac/default_pre.prf b/mkspecs/features/mac/default_pre.prf
index 0cc8cd6dfd..ca9725b779 100644
--- a/mkspecs/features/mac/default_pre.prf
+++ b/mkspecs/features/mac/default_pre.prf
@@ -12,7 +12,9 @@ isEmpty(QMAKE_XCODE_DEVELOPER_PATH) {
error("Xcode is not installed in $${QMAKE_XCODE_DEVELOPER_PATH}. Please use xcode-select to choose Xcode installation path.")
# Make sure Xcode is set up properly
- isEmpty($$list($$system("/usr/bin/xcrun -find xcrun 2>/dev/null"))): \
+
+ # Patch: Fix Qt for working with Xcode 8.
+ isEmpty($$list($$system("/usr/bin/xcrun -find xcodebuild 2>/dev/null"))): \
error("Xcode not set up properly. You may need to confirm the license agreement by running /usr/bin/xcodebuild.")
}
diff --git a/src/gui/image/qbmphandler.cpp b/src/gui/image/qbmphandler.cpp
index bb79a139b3..5d595bc3b3 100644
--- a/src/gui/image/qbmphandler.cpp
+++ b/src/gui/image/qbmphandler.cpp
@@ -220,6 +220,10 @@ static bool read_dib_body(QDataStream &s, const BMP_INFOHDR &bi, int offset, int
int blue_scale = 0;
int alpha_scale = 0;
+ // Patch: Backport a fix for bmp reader.
+ if (!d->isSequential())
+ d->seek(startpos + BMP_FILEHDR_SIZE + (bi.biSize >= BMP_WIN4? BMP_WIN : bi.biSize)); // goto start of colormap
+
if (bi.biSize >= BMP_WIN4 || (comp == BMP_BITFIELDS && (nbits == 16 || nbits == 32))) {
if (d->read((char *)&red_mask, sizeof(red_mask)) != sizeof(red_mask))
return false;
@@ -307,8 +311,9 @@ static bool read_dib_body(QDataStream &s, const BMP_INFOHDR &bi, int offset, int
image.setDotsPerMeterX(bi.biXPelsPerMeter);
image.setDotsPerMeterY(bi.biYPelsPerMeter);
- if (!d->isSequential())
- d->seek(startpos + BMP_FILEHDR_SIZE + (bi.biSize >= BMP_WIN4? BMP_WIN : bi.biSize)); // goto start of colormap
+ // Patch: Backport a fix for bmp reader.
+ //if (!d->isSequential())
+ // d->seek(startpos + BMP_FILEHDR_SIZE + (bi.biSize >= BMP_WIN4? BMP_WIN : bi.biSize)); // goto start of colormap
if (ncols > 0) { // read color table
uchar rgb[4];
diff --git a/src/gui/painting/qpaintengine_p.h b/src/gui/painting/qpaintengine_p.h
index ebff9509ab..4300ca4c0f 100644
--- a/src/gui/painting/qpaintengine_p.h
+++ b/src/gui/painting/qpaintengine_p.h
@@ -87,8 +87,18 @@ public:
if (hasSystemTransform) {
if (systemTransform.type() <= QTransform::TxTranslate)
systemClip.translate(qRound(systemTransform.dx()), qRound(systemTransform.dy()));
- else
+ // Patch: Transform the system clip region back from device pixels to device-independent pixels before
+ // applying systemTransform, which already has transform from device-independent pixels to device pixels.
+ else {
+#ifdef Q_OS_MAC
+ QTransform scaleTransform;
+ const qreal invDevicePixelRatio = 1. / pdev->devicePixelRatio();
+ scaleTransform.scale(invDevicePixelRatio, invDevicePixelRatio);
+ systemClip = systemTransform.map(scaleTransform.map(systemClip));
+#else
systemClip = systemTransform.map(systemClip);
+#endif
+ }
}
// Make sure we're inside the viewport.
diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp
index 4879ae51d7..56cdcbaf01 100644
--- a/src/gui/text/qtextlayout.cpp
+++ b/src/gui/text/qtextlayout.cpp
@@ -654,6 +654,9 @@ int QTextLayout::nextCursorPosition(int oldPos, CursorMode mode) const
while (oldPos < len && !attributes[oldPos].graphemeBoundary)
oldPos++;
} else {
+ // Patch: Skip to the end of the current word, not to the start of the next one.
+ while (oldPos < len && attributes[oldPos].whiteSpace)
+ oldPos++;
if (oldPos < len && d->atWordSeparator(oldPos)) {
oldPos++;
while (oldPos < len && d->atWordSeparator(oldPos))
@@ -662,8 +665,9 @@ int QTextLayout::nextCursorPosition(int oldPos, CursorMode mode) const
while (oldPos < len && !d->atSpace(oldPos) && !d->atWordSeparator(oldPos))
oldPos++;
}
- while (oldPos < len && d->atSpace(oldPos))
- oldPos++;
+ // Patch: Skip to the end of the current word, not to the start of the next one.
+ //while (oldPos < len && d->atSpace(oldPos))
+ // oldPos++;
}
return oldPos;
@@ -1602,6 +1606,9 @@ namespace {
int currentPosition;
glyph_t previousGlyph;
+ // Patch: Backport a crash fix.
+ QFontEngine *previousGlyphFontEngine;
+
QFixed minw;
QFixed softHyphenWidth;
QFixed rightBearing;
@@ -1634,13 +1641,19 @@ namespace {
if (currentPosition > 0 &&
logClusters[currentPosition - 1] < glyphs.numGlyphs) {
previousGlyph = currentGlyph(); // needed to calculate right bearing later
+
+ // Patch: Backport a crash fix.
+ previousGlyphFontEngine = fontEngine;
}
}
- inline void adjustRightBearing(glyph_t glyph)
+ // Patch: Backport a crash fix.
+ inline void adjustRightBearing(QFontEngine *engine, glyph_t glyph)
{
qreal rb;
- fontEngine->getGlyphBearings(glyph, 0, &rb);
+
+ // Patch: Backport a crash fix.
+ engine->getGlyphBearings(glyph, 0, &rb);
rightBearing = qMin(QFixed(), QFixed::fromReal(rb));
}
@@ -1648,13 +1661,16 @@ namespace {
{
if (currentPosition <= 0)
return;
- adjustRightBearing(currentGlyph());
+
+ // Patch: Backport a crash fix.
+ adjustRightBearing(fontEngine, currentGlyph());
}
inline void adjustPreviousRightBearing()
{
if (previousGlyph > 0)
- adjustRightBearing(previousGlyph);
+ // Patch: Backport a crash fix.
+ adjustRightBearing(previousGlyphFontEngine, previousGlyph);
}
inline void resetRightBearing()
diff --git a/src/gui/text/qtextlayout.h b/src/gui/text/qtextlayout.h
index cbe42c3844..b273db7e78 100644
--- a/src/gui/text/qtextlayout.h
+++ b/src/gui/text/qtextlayout.h
@@ -194,6 +194,9 @@ private:
QRectF *brect, int tabstops, int* tabarray, int tabarraylen,
QPainter *painter);
QTextEngine *d;
+
+ // Patch: Give access to the internal api.
+ friend class TextBlock;
};
diff --git a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm
index ca7afb7d1b..25ae50008d 100644
--- a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm
+++ b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm
@@ -256,6 +256,13 @@ static void getFontDescription(CTFontDescriptorRef font, FontDescription *fd)
fd->foundryName = QStringLiteral("CoreText");
fd->familyName = (CFStringRef) CTFontDescriptorCopyAttribute(font, kCTFontFamilyNameAttribute);
+
+ // Patch: Fix open sans semibold loading.
+ QCFString _displayName = (CFStringRef) CTFontDescriptorCopyAttribute(font, kCTFontDisplayNameAttribute);
+ if (_displayName == QStringLiteral("Open Sans Semibold")) {
+ fd->familyName = _displayName;
+ }
+
fd->styleName = (CFStringRef)CTFontDescriptorCopyAttribute(font, kCTFontStyleNameAttribute);
fd->weight = QFont::Normal;
fd->style = QFont::StyleNormal;
diff --git a/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm b/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm
index 92358ecc74..694fee7350 100644
--- a/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm
+++ b/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm
@@ -213,7 +213,8 @@ static void cleanupCocoaApplicationDelegate()
if (reflectionDelegate) {
if ([reflectionDelegate respondsToSelector:@selector(applicationShouldTerminate:)])
return [reflectionDelegate applicationShouldTerminate:sender];
- return NSTerminateNow;
+ // Patch: Don't terminate if reflectionDelegate does not respond to that selector, just use the default.
+ //return NSTerminateNow;
}
if ([self canQuit]) {
@@ -289,6 +290,11 @@ static void cleanupCocoaApplicationDelegate()
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
+ // Patch: We need to receive this notification in the delegate as well.
+ if (reflectionDelegate
+ && [reflectionDelegate respondsToSelector:@selector(applicationDidFinishLaunching:)])
+ [reflectionDelegate applicationDidFinishLaunching:aNotification];
+
Q_UNUSED(aNotification);
inLaunch = false;
// qt_release_apple_event_handler();
@@ -411,7 +417,9 @@ static void cleanupCocoaApplicationDelegate()
{
Q_UNUSED(replyEvent);
NSString *urlString = [[event paramDescriptorForKeyword:keyDirectObject] stringValue];
- QWindowSystemInterface::handleFileOpenEvent(QUrl(QCFString::toQString(urlString)));
+
+ // Patch: Fix opening of an external url by a protocol handler.
+ QWindowSystemInterface::handleFileOpenEvent(QUrl::fromNSURL([NSURL URLWithString:urlString]));
}
- (void)appleEventQuit:(NSAppleEventDescriptor *)event withReplyEvent:(NSAppleEventDescriptor *)replyEvent
diff --git a/src/plugins/platforms/cocoa/qcocoacursor.mm b/src/plugins/platforms/cocoa/qcocoacursor.mm
index b81b9a0b1c..4e59e833b1 100644
--- a/src/plugins/platforms/cocoa/qcocoacursor.mm
+++ b/src/plugins/platforms/cocoa/qcocoacursor.mm
@@ -81,7 +81,7 @@ void QCocoaCursor::setPos(const QPoint &position)
pos.x = position.x();
pos.y = position.y();
- CGEventRef e = CGEventCreateMouseEvent(0, kCGEventMouseMoved, pos, 0);
+ CGEventRef e = CGEventCreateMouseEvent(0, kCGEventMouseMoved, pos, kCGMouseButtonLeft);
CGEventPost(kCGHIDEventTap, e);
CFRelease(e);
}
diff --git a/src/plugins/platforms/cocoa/qcocoahelpers.mm b/src/plugins/platforms/cocoa/qcocoahelpers.mm
index 9850f83dea..218ed7e81c 100644
--- a/src/plugins/platforms/cocoa/qcocoahelpers.mm
+++ b/src/plugins/platforms/cocoa/qcocoahelpers.mm
@@ -649,9 +649,10 @@ OSStatus qt_mac_drawCGImage(CGContextRef inContext, const CGRect *inBounds, CGIm
// Verbatim copy if HIViewDrawCGImage (as shown on Carbon-Dev)
OSStatus err = noErr;
- require_action(inContext != NULL, InvalidContext, err = paramErr);
- require_action(inBounds != NULL, InvalidBounds, err = paramErr);
- require_action(inImage != NULL, InvalidImage, err = paramErr);
+ // Patch: Fix build on latest Xcode.
+ //require_action(inContext != NULL, InvalidContext, err = paramErr);
+ //require_action(inBounds != NULL, InvalidBounds, err = paramErr);
+ //require_action(inImage != NULL, InvalidImage, err = paramErr);
CGContextSaveGState( inContext );
CGContextTranslateCTM (inContext, 0, inBounds->origin.y + CGRectGetMaxY(*inBounds));
@@ -660,9 +661,11 @@ OSStatus qt_mac_drawCGImage(CGContextRef inContext, const CGRect *inBounds, CGIm
CGContextDrawImage(inContext, *inBounds, inImage);
CGContextRestoreGState(inContext);
-InvalidImage:
-InvalidBounds:
-InvalidContext:
+
+// Patch: Fix build on latest Xcode.
+//InvalidImage:
+//InvalidBounds:
+//InvalidContext:
return err;
}
diff --git a/src/plugins/platforms/cocoa/qcocoaintegration.mm b/src/plugins/platforms/cocoa/qcocoaintegration.mm
index 9fd05a65ee..dea60720e7 100644
--- a/src/plugins/platforms/cocoa/qcocoaintegration.mm
+++ b/src/plugins/platforms/cocoa/qcocoaintegration.mm
@@ -402,14 +402,24 @@ void QCocoaIntegration::updateScreens()
}
siblings << screen;
}
+
+ // Patch: Backport crash fix from Qt 5.6.1.
+ // Set virtual siblings list. All screens in mScreens are siblings, because we ignored the
+ // mirrors. Note that some of the screens we update the siblings list for here may be deleted
+ // below, but update anyway to keep the to-be-deleted screens out of the siblings list.
+ foreach (QCocoaScreen* screen, mScreens)
+ screen->setVirtualSiblings(siblings);
+
// Now the leftovers in remainingScreens are no longer current, so we can delete them.
foreach (QCocoaScreen* screen, remainingScreens) {
mScreens.removeOne(screen);
delete screen;
}
+
+ // Patch: Backport crash fix from Qt 5.6.1.
// All screens in mScreens are siblings, because we ignored the mirrors.
- foreach (QCocoaScreen* screen, mScreens)
- screen->setVirtualSiblings(siblings);
+ //foreach (QCocoaScreen* screen, mScreens)
+ // screen->setVirtualSiblings(siblings);
}
QCocoaScreen *QCocoaIntegration::screenAtIndex(int index)
diff --git a/src/plugins/platforms/cocoa/qcocoakeymapper.mm b/src/plugins/platforms/cocoa/qcocoakeymapper.mm
index e46eaff6be..c62db534a2 100644
--- a/src/plugins/platforms/cocoa/qcocoakeymapper.mm
+++ b/src/plugins/platforms/cocoa/qcocoakeymapper.mm
@@ -382,6 +382,12 @@ bool QCocoaKeyMapper::updateKeyboard()
keyboardInputLocale = QLocale::c();
keyboardInputDirection = Qt::LeftToRight;
}
+
+ // Patch: Backport a fix for layout-independent keyboard shortcuts.
+ const auto newMode = keyboard_mode;
+ deleteLayouts();
+ keyboard_mode = newMode;
+
return true;
}
@@ -464,7 +470,8 @@ QList QCocoaKeyMapper::possibleKeys(const QKeyEvent *event) const
Qt::KeyboardModifiers neededMods = ModsTbl[i];
int key = kbItem->qtKey[i];
if (key && key != baseKey && ((keyMods & neededMods) == neededMods)) {
- ret << int(key + (keyMods & ~neededMods));
+ // Patch: Backport a fix for layout-independent keyboard shortcuts.
+ ret << int(key + neededMods);
}
}
return ret;
diff --git a/src/plugins/platforms/cocoa/qcocoasystemtrayicon.mm b/src/plugins/platforms/cocoa/qcocoasystemtrayicon.mm
index 83c960d931..03ae9696af 100755
--- a/src/plugins/platforms/cocoa/qcocoasystemtrayicon.mm
+++ b/src/plugins/platforms/cocoa/qcocoasystemtrayicon.mm
@@ -102,7 +102,10 @@ QT_USE_NAMESPACE
QCocoaSystemTrayIcon *systray;
NSStatusItem *item;
QCocoaMenu *menu;
- bool menuVisible;
+
+ // Patch: Nice macOS tray icon support.
+ bool menuVisible, iconSelected;
+
QIcon icon;
QT_MANGLE_NAMESPACE(QNSImageView) *imageCell;
}
@@ -124,6 +127,10 @@ QT_USE_NAMESPACE
QT_MANGLE_NAMESPACE(QNSStatusItem) *parent;
}
-(id)initWithParent:(QT_MANGLE_NAMESPACE(QNSStatusItem)*)myParent;
+
+// Patch: Nice macOS tray icon support.
+-(void)updateIconSelection;
+
-(void)menuTrackingDone:(NSNotification*)notification;
-(void)mousePressed:(NSEvent *)mouseEvent button:(Qt::MouseButton)mouseButton;
@end
@@ -187,6 +194,19 @@ void QCocoaSystemTrayIcon::cleanup()
m_sys = 0;
}
+// Patch: Nice macOS tray icon support.
+namespace {
+
+qreal getDevicePixelRatio() {
+ qreal result = 1.0;
+ foreach (QScreen *screen, QGuiApplication::screens()) {
+ result = qMax(result, screen->devicePixelRatio());
+ }
+ return result;
+}
+
+} // namespace
+
void QCocoaSystemTrayIcon::updateIcon(const QIcon &icon)
{
if (!m_sys)
@@ -194,13 +214,18 @@ void QCocoaSystemTrayIcon::updateIcon(const QIcon &icon)
m_sys->item->icon = icon;
- const bool menuVisible = m_sys->item->menu && m_sys->item->menuVisible;
+ // Patch: Nice macOS tray icon support.
+ //const bool menuVisible = m_sys->item->menu && m_sys->item->menuVisible;
- CGFloat hgt = [[[NSApplication sharedApplication] mainMenu] menuBarHeight];
- const short scale = hgt - 4;
+ const int padding = 0;
+ const int menuHeight = [[NSStatusBar systemStatusBar] thickness];
+ const int maxImageHeight = menuHeight - padding;
+
+ const short scale = maxImageHeight * getDevicePixelRatio();
QPixmap pm = m_sys->item->icon.pixmap(QSize(scale, scale),
- menuVisible ? QIcon::Selected : QIcon::Normal);
+ // Patch: Nice macOS tray icon support.
+ m_sys->item->iconSelected ? QIcon::Selected : QIcon::Normal);
if (pm.isNull()) {
pm = QPixmap(scale, scale);
pm.fill(Qt::transparent);
@@ -322,15 +347,16 @@ QT_END_NAMESPACE
return self;
}
--(void)menuTrackingDone:(NSNotification*)notification
+// Patch: Nice macOS tray icon support.
+-(void)updateIconSelection
{
- Q_UNUSED(notification);
- down = NO;
+ const int padding = 0;
+ const int menuHeight = [[NSStatusBar systemStatusBar] thickness];
+ const int maxImageHeight = menuHeight - padding;
- CGFloat hgt = [[[NSApplication sharedApplication] mainMenu] menuBarHeight];
- const short scale = hgt - 4;
-
- QPixmap pm = parent->icon.pixmap(QSize(scale, scale), QIcon::Normal);
+ const short scale = maxImageHeight * getDevicePixelRatio();
+ QPixmap pm = parent->icon.pixmap(QSize(scale, scale),
+ parent->iconSelected ? QIcon::Selected : QIcon::Normal);
if (pm.isNull()) {
pm = QPixmap(scale, scale);
pm.fill(Qt::transparent);
@@ -338,9 +364,19 @@ QT_END_NAMESPACE
NSImage *nsaltimage = static_cast(qt_mac_create_nsimage(pm));
[self setImage: nsaltimage];
[nsaltimage release];
+}
+
+-(void)menuTrackingDone:(NSNotification*)notification
+{
+ Q_UNUSED(notification);
+ down = NO;
parent->menuVisible = false;
+ // Patch: Nice macOS tray icon support.
+ parent->iconSelected = false;
+ [self updateIconSelection];
+
[self setNeedsDisplay:YES];
}
@@ -350,18 +386,9 @@ QT_END_NAMESPACE
int clickCount = [mouseEvent clickCount];
[self setNeedsDisplay:YES];
- CGFloat hgt = [[[NSApplication sharedApplication] mainMenu] menuBarHeight];
- const short scale = hgt - 4;
-
- QPixmap pm = parent->icon.pixmap(QSize(scale, scale),
- parent->menuVisible ? QIcon::Selected : QIcon::Normal);
- if (pm.isNull()) {
- pm = QPixmap(scale, scale);
- pm.fill(Qt::transparent);
- }
- NSImage *nsaltimage = static_cast(qt_mac_create_nsimage(pm));
- [self setImage: nsaltimage];
- [nsaltimage release];
+ // Patch: Nice macOS tray icon support.
+ parent->iconSelected = (clickCount != 2) && parent->menu;
+ [self updateIconSelection];
if (clickCount == 2) {
[self menuTrackingDone:nil];
@@ -380,6 +407,10 @@ QT_END_NAMESPACE
{
Q_UNUSED(mouseEvent);
[self menuTrackingDone:nil];
+
+ // Patch: Nice macOS tray icon support.
+ parent->iconSelected = false;
+ [self updateIconSelection];
}
- (void)rightMouseDown:(NSEvent *)mouseEvent
@@ -391,6 +422,10 @@ QT_END_NAMESPACE
{
Q_UNUSED(mouseEvent);
[self menuTrackingDone:nil];
+
+ // Patch: Nice macOS tray icon support.
+ parent->iconSelected = false;
+ [self updateIconSelection];
}
- (void)otherMouseDown:(NSEvent *)mouseEvent
@@ -405,7 +440,8 @@ QT_END_NAMESPACE
}
-(void)drawRect:(NSRect)rect {
- [[parent item] drawStatusBarBackgroundInRect:rect withHighlight:down];
+ // Patch: Nice macOS tray icon support.
+ [[parent item] drawStatusBarBackgroundInRect:rect withHighlight:parent->menu ? down : NO];
[super drawRect:rect];
}
@end
diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm
index 4d0458a4aa..3357a5ef81 100644
--- a/src/plugins/platforms/cocoa/qcocoawindow.mm
+++ b/src/plugins/platforms/cocoa/qcocoawindow.mm
@@ -167,7 +167,8 @@ static bool isMouseEvent(NSEvent *ev)
if (!self.window.delegate)
return; // Already detached, pending NSAppKitDefined event
- if (pw && pw->frameStrutEventsEnabled() && isMouseEvent(theEvent)) {
+ // Patch: Fix events loss if the window was minimized or hidden.
+ if (pw && pw->frameStrutEventsEnabled() && pw->m_synchedWindowState != Qt::WindowMinimized && pw->m_isExposed && isMouseEvent(theEvent)) {
NSPoint loc = [theEvent locationInWindow];
NSRect windowFrame = [self.window legacyConvertRectFromScreen:[self.window frame]];
NSRect contentFrame = [[self.window contentView] frame];
@@ -795,6 +796,16 @@ NSUInteger QCocoaWindow::windowStyleMask(Qt::WindowFlags flags)
{
Qt::WindowType type = static_cast(int(flags & Qt::WindowType_Mask));
NSInteger styleMask = NSBorderlessWindowMask;
+
+ // Patch: allow creating panels floating on all spaces in macOS.
+ // If you call "setCollectionBehavior:NSWindowCollectionBehaviorFullScreenAuxiliary" before
+ // setting the "NSNonactivatingPanelMask" bit in the style mask it won't work after that.
+ // So we need a way to set that bit before Qt sets collection behavior the way it does.
+ QVariant nonactivatingPanelMask = window()->property("_td_macNonactivatingPanelMask");
+ if (nonactivatingPanelMask.isValid() && nonactivatingPanelMask.toBool()) {
+ styleMask |= NSNonactivatingPanelMask;
+ }
+
if (flags & Qt::FramelessWindowHint)
return styleMask;
if ((type & Qt::Popup) == Qt::Popup) {
@@ -914,6 +925,19 @@ void QCocoaWindow::setWindowFilePath(const QString &filePath)
[m_nsWindow setRepresentedFilename: fi.exists() ? QCFString::toNSString(filePath) : @""];
}
+// Patch: Nice macOS window icon.
+namespace {
+
+qreal getDevicePixelRatio() {
+ qreal result = 1.0;
+ foreach (QScreen *screen, QGuiApplication::screens()) {
+ result = qMax(result, screen->devicePixelRatio());
+ }
+ return result;
+}
+
+} // namespace
+
void QCocoaWindow::setWindowIcon(const QIcon &icon)
{
QCocoaAutoReleasePool pool;
@@ -929,7 +953,10 @@ void QCocoaWindow::setWindowIcon(const QIcon &icon)
if (icon.isNull()) {
[iconButton setImage:nil];
} else {
- QPixmap pixmap = icon.pixmap(QSize(22, 22));
+ // Patch: Nice macOS window icon.
+ CGFloat hgt = 16. * getDevicePixelRatio();
+ QPixmap pixmap = icon.pixmap(QSize(hgt, hgt));
+
NSImage *image = static_cast(qt_mac_create_nsimage(pixmap));
[iconButton setImage:image];
[image release];
diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm
index a18ee7ff71..1f91feb0ae 100644
--- a/src/plugins/platforms/cocoa/qnsview.mm
+++ b/src/plugins/platforms/cocoa/qnsview.mm
@@ -393,7 +393,9 @@ static NSString *_q_NSWindowDidChangeOcclusionStateNotification = nil;
[self notifyWindowStateChanged:newState];
// NSWindowDidOrderOnScreenAndFinishAnimatingNotification is private API, and not
// emitted in 10.6, so we bring back the old behavior for that case alone.
- if (newState == Qt::WindowNoState && QSysInfo::QSysInfo::MacintoshVersion == QSysInfo::MV_10_6)
+
+ // Patch: Fix macOS window show after window was hidden.
+ if (newState == Qt::WindowNoState/* && QSysInfo::QSysInfo::MacintoshVersion == QSysInfo::MV_10_6*/)
m_platformWindow->exposeWindow();
} else if ([notificationName isEqualToString: @"NSWindowDidOrderOffScreenNotification"]) {
m_platformWindow->obscureWindow();
@@ -1300,7 +1302,9 @@ static QTabletEvent::TabletDevice wacomTabletDevice(NSEvent *theEvent)
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_8
if (QSysInfo::QSysInfo::MacintoshVersion >= QSysInfo::MV_10_8) {
// On 10.8 and above, MayBegin is likely to happen. We treat it the same as an actual begin.
- if (phase == NSEventPhaseMayBegin)
+
+ // Patch: Actual begin should be treated as begin as well.
+ if (phase == NSEventPhaseMayBegin || phase == NSEventPhaseBegan)
ph = Qt::ScrollBegin;
} else
#endif
@@ -1366,14 +1370,22 @@ static QTabletEvent::TabletDevice wacomTabletDevice(NSEvent *theEvent)
quint32 nativeVirtualKey = [nsevent keyCode];
QChar ch = QChar::ReplacementCharacter;
- int keyCode = Qt::Key_unknown;
- if ([characters length] != 0) {
- if (((modifiers & Qt::MetaModifier) || (modifiers & Qt::AltModifier)) && ([charactersIgnoringModifiers length] != 0))
- ch = QChar([charactersIgnoringModifiers characterAtIndex:0]);
- else
- ch = QChar([characters characterAtIndex:0]);
- keyCode = [self convertKeyCode:ch];
- }
+
+ // Patch: Backport a fix for layout-independent shortcuts.
+ if ([characters length] != 0) // https://bugreports.qt.io/browse/QTBUG-42584
+ ch = QChar([characters characterAtIndex:0]);
+ else if ([charactersIgnoringModifiers length] != 0 && ((modifiers & Qt::MetaModifier) || (modifiers & Qt::AltModifier)))
+ ch = QChar([charactersIgnoringModifiers characterAtIndex:0]);
+
+ int keyCode = [self convertKeyCode:ch];
+ //int keyCode = Qt::Key_unknown;
+ //if ([characters length] != 0) {
+ // if (((modifiers & Qt::MetaModifier) || (modifiers & Qt::AltModifier)) && ([charactersIgnoringModifiers length] != 0))
+ // ch = QChar([charactersIgnoringModifiers characterAtIndex:0]);
+ // else
+ // ch = QChar([characters characterAtIndex:0]);
+ // keyCode = [self convertKeyCode:ch];
+ //}
// we will send a key event unless the input method sets m_sendKeyEvent to false
m_sendKeyEvent = true;
@@ -1437,6 +1449,11 @@ static QTabletEvent::TabletDevice wacomTabletDevice(NSEvent *theEvent)
&& qtKey == Qt::Key_Period) {
[self handleKeyEvent:nsevent eventType:int(QEvent::KeyPress)];
return YES;
+
+ // Patch: Allow us to handle Ctrl+Tab and Ctrl+Backtab in the app.
+ } else if ([nsevent modifierFlags] & NSControlKeyMask && (qtKey == Qt::Key_Tab || qtKey == Qt::Key_Backtab)) {
+ [self handleKeyEvent:nsevent eventType:int(QEvent::KeyPress)];
+ return YES;
}
}
return [super performKeyEquivalent:nsevent];
diff --git a/src/tools/qlalr/lalr.cpp b/src/tools/qlalr/lalr.cpp
index c68076477f..e2a7aafa58 100644
--- a/src/tools/qlalr/lalr.cpp
+++ b/src/tools/qlalr/lalr.cpp
@@ -246,11 +246,13 @@ void Grammar::buildExtendedGrammar ()
non_terminals.insert (accept_symbol);
}
-struct _Nullable: public std::unary_function
+// Patch: Fix building with the new SDK.
+struct __Nullable: public std::unary_function
{
Automaton *_M_automaton;
- _Nullable (Automaton *aut):
+ // Patch: Fix building with the new SDK.
+ __Nullable (Automaton *aut):
_M_automaton (aut) {}
bool operator () (Name name) const
@@ -308,7 +310,8 @@ void Automaton::buildNullables ()
for (RulePointer rule = _M_grammar->rules.begin (); rule != _M_grammar->rules.end (); ++rule)
{
- NameList::iterator nn = std::find_if (rule->rhs.begin (), rule->rhs.end (), std::not1 (_Nullable (this)));
+ // Patch: Fix building with the new SDK.
+ NameList::iterator nn = std::find_if (rule->rhs.begin (), rule->rhs.end (), std::not1 (__Nullable (this)));
if (nn == rule->rhs.end ())
changed |= nullables.insert (rule->lhs).second;
@@ -643,7 +646,8 @@ void Automaton::buildIncludesDigraph ()
if (! _M_grammar->isNonTerminal (*A))
continue;
- NameList::iterator first_not_nullable = std::find_if (dot, rule->rhs.end (), std::not1 (_Nullable (this)));
+ // Patch: Fix building with the new SDK.
+ NameList::iterator first_not_nullable = std::find_if (dot, rule->rhs.end (), std::not1 (__Nullable (this)));
if (first_not_nullable != rule->rhs.end ())
continue;
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
index 7396808442..7178aecf80 100644
--- a/src/widgets/kernel/qwidget.cpp
+++ b/src/widgets/kernel/qwidget.cpp
@@ -4722,6 +4722,17 @@ void QWidget::render(QPainter *painter, const QPoint &targetOffset,
return; // Fully transparent.
Q_D(QWidget);
+
+ // Patch: save and restore dirtyOpaqueChildren field.
+ //
+ // Just like in QWidget::grab() this field should be restored
+ // after the d->render() call, because it will be set to 1 and
+ // opaqueChildren field will be filled with empty region in
+ // case the widget is hidden (because all the opaque children
+ // will be skipped in isVisible() check).
+ //
+ const bool oldDirtyOpaqueChildren = d->dirtyOpaqueChildren;
+
const bool inRenderWithPainter = d->extra && d->extra->inRenderWithPainter;
const QRegion toBePainted = !inRenderWithPainter ? d->prepareToRender(sourceRegion, renderFlags)
: sourceRegion;
@@ -4743,6 +4754,10 @@ void QWidget::render(QPainter *painter, const QPoint &targetOffset,
if (!inRenderWithPainter && (opacity < 1.0 || (target->devType() == QInternal::Printer))) {
d->render_helper(painter, targetOffset, toBePainted, renderFlags);
d->extra->inRenderWithPainter = inRenderWithPainter;
+
+ // Patch: save and restore dirtyOpaqueChildren field.
+ d->dirtyOpaqueChildren = oldDirtyOpaqueChildren;
+
return;
}
@@ -4774,6 +4789,9 @@ void QWidget::render(QPainter *painter, const QPoint &targetOffset,
d->setSharedPainter(oldPainter);
d->extra->inRenderWithPainter = inRenderWithPainter;
+
+ // Patch: save and restore dirtyOpaqueChildren field.
+ d->dirtyOpaqueChildren = oldDirtyOpaqueChildren;
}
static void sendResizeEvents(QWidget *target)
@@ -7983,7 +8001,8 @@ bool QWidget::event(QEvent *event)
case QEvent::KeyPress: {
QKeyEvent *k = (QKeyEvent *)event;
bool res = false;
- if (!(k->modifiers() & (Qt::ControlModifier | Qt::AltModifier))) { //### Add MetaModifier?
+ // Patch: Allow us to handle Ctrl+Tab and Ctrl+Backtab in the app.
+ if (!(k->modifiers() & (Qt::ControlModifier | Qt::AltModifier | Qt::MetaModifier))) { //### Add MetaModifier?
if (k->key() == Qt::Key_Backtab
|| (k->key() == Qt::Key_Tab && (k->modifiers() & Qt::ShiftModifier)))
res = focusNextPrevChild(false);
diff --git a/src/widgets/styles/qmacstyle_mac.mm b/src/widgets/styles/qmacstyle_mac.mm
index 0845a5eb02..5735cb6b39 100644
--- a/src/widgets/styles/qmacstyle_mac.mm
+++ b/src/widgets/styles/qmacstyle_mac.mm
@@ -3667,9 +3667,11 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
NSBezierPath *pushButtonFocusRingPath;
if (bdi.kind == kThemeBevelButton)
- pushButtonFocusRingPath = [NSBezierPath bezierPathWithRect:focusRect];
+ // Patch: Fix building with the new SDK.
+ pushButtonFocusRingPath = [NSBezierPath bezierPathWithRect:NSRectFromCGRect(focusRect)];
else
- pushButtonFocusRingPath = [NSBezierPath bezierPathWithRoundedRect:focusRect xRadius:4 yRadius:4];
+ // Patch: Fix building with the new SDK.
+ pushButtonFocusRingPath = [NSBezierPath bezierPathWithRoundedRect:NSRectFromCGRect(focusRect) xRadius:4 yRadius:4];
qt_drawFocusRingOnPath(cg, pushButtonFocusRingPath);
}
diff --git a/src/widgets/util/qsystemtrayicon_qpa.cpp b/src/widgets/util/qsystemtrayicon_qpa.cpp
index f98aeaf678..00c0734129 100644
--- a/src/widgets/util/qsystemtrayicon_qpa.cpp
+++ b/src/widgets/util/qsystemtrayicon_qpa.cpp
@@ -99,13 +99,18 @@ void QSystemTrayIconPrivate::updateIcon_sys()
void QSystemTrayIconPrivate::updateMenu_sys()
{
- if (qpa_sys && menu) {
- if (!menu->platformMenu()) {
- QPlatformMenu *platformMenu = qpa_sys->createMenu();
- if (platformMenu)
- menu->setPlatformMenu(platformMenu);
+ // Patch: Nice macOS tray icon support.
+ if (qpa_sys) {
+ if (menu) {
+ if (!menu->platformMenu()) {
+ QPlatformMenu *platformMenu = qpa_sys->createMenu();
+ if (platformMenu)
+ menu->setPlatformMenu(platformMenu);
+ }
+ qpa_sys->updateMenu(menu->platformMenu());
+ } else {
+ qpa_sys->updateMenu(0);
}
- qpa_sys->updateMenu(menu->platformMenu());
}
}
diff --git a/src/widgets/widgets/qwidgetlinecontrol.cpp b/src/widgets/widgets/qwidgetlinecontrol.cpp
index 75f30599be..980f2be1e9 100644
--- a/src/widgets/widgets/qwidgetlinecontrol.cpp
+++ b/src/widgets/widgets/qwidgetlinecontrol.cpp
@@ -1867,7 +1867,8 @@ void QWidgetLineControl::processKeyEvent(QKeyEvent* event)
if (unknown && !isReadOnly()) {
QString t = event->text();
- if (!t.isEmpty() && t.at(0).isPrint()) {
+ // Patch: Enable ZWJ and ZWNJ characters to be in text input.
+ if (!t.isEmpty() && (t.at(0).isPrint() || t.at(0).unicode() == 0x200C || t.at(0).unicode() == 0x200D)) {
insert(t);
#ifndef QT_NO_COMPLETER
complete(event->key());
diff --git a/src/widgets/widgets/qwidgettextcontrol.cpp b/src/widgets/widgets/qwidgettextcontrol.cpp
index 96438a0bdf..b0b7206405 100644
--- a/src/widgets/widgets/qwidgettextcontrol.cpp
+++ b/src/widgets/widgets/qwidgettextcontrol.cpp
@@ -1342,7 +1342,8 @@ void QWidgetTextControlPrivate::keyPressEvent(QKeyEvent *e)
process:
{
QString text = e->text();
- if (!text.isEmpty() && (text.at(0).isPrint() || text.at(0) == QLatin1Char('\t'))) {
+ // Patch: Enable ZWJ and ZWNJ characters to be in text input.
+ if (!text.isEmpty() && (text.at(0).isPrint() || text.at(0) == QLatin1Char('\t') || text.at(0).unicode() == 0x200C || text.at(0).unicode() == 0x200D)) {
if (overwriteMode
// no need to call deleteChar() if we have a selection, insertText
// does it already
tdesktop-1.2.17/Telegram/Patches/macold/qtimageformats_5_3_2.diff 0000664 0000000 0000000 00000003147 13262451251 0024577 0 ustar 00root root 0000000 0000000 diff --git a/src/3rdparty/libwebp/src/dec/vp8l.c b/src/3rdparty/libwebp/src/dec/vp8l.c
index ea0254d..953ff01 100644
--- a/src/3rdparty/libwebp/src/dec/vp8l.c
+++ b/src/3rdparty/libwebp/src/dec/vp8l.c
@@ -12,7 +12,7 @@
// Authors: Vikas Arora (vikaas.arora@gmail.com)
// Jyrki Alakuijala (jyrki@google.com)
-#include
+// Patch: Backport of a crash fix.
#include
#include "./alphai.h"
#include "./vp8li.h"
@@ -740,6 +740,10 @@ static int DecodeAlphaData(VP8LDecoder* const dec, uint8_t* const data,
const int len_code_limit = NUM_LITERAL_CODES + NUM_LENGTH_CODES;
const int mask = hdr->huffman_mask_;
assert(htree_group != NULL);
+
+ // Patch: Backport of a crash fix.
+ assert(pos < end);
+
assert(last_row <= height);
assert(Is8bOptimizable(hdr));
@@ -830,6 +834,10 @@ static int DecodeImageData(VP8LDecoder* const dec, uint32_t* const data,
(hdr->color_cache_size_ > 0) ? &hdr->color_cache_ : NULL;
const int mask = hdr->huffman_mask_;
assert(htree_group != NULL);
+
+ // Patch: Backport of a crash fix.
+ assert(src < src_end);
+
assert(src_last <= src_end);
while (!br->eos_ && src < src_last) {
@@ -1294,6 +1302,11 @@ int VP8LDecodeAlphaImageStream(ALPHDecoder* const alph_dec, int last_row) {
assert(dec->action_ == READ_DATA);
assert(last_row <= dec->height_);
+ // Patch: Backport of a crash fix.
+ if (dec->last_pixel_ == dec->width_ * dec->height_) {
+ return 1; // done
+ }
+
// Decode (with special row processing).
return alph_dec->use_8b_decode ?
DecodeAlphaData(dec, (uint8_t*)dec->pixels_, dec->width_, dec->height_,
tdesktop-1.2.17/Telegram/Patches/mini_chromium.diff 0000664 0000000 0000000 00000003322 13262451251 0022260 0 ustar 00root root 0000000 0000000 diff --git a/base/mac/scoped_nsobject.h b/base/mac/scoped_nsobject.h
index 2e157a4..5a306a1 100644
--- a/base/mac/scoped_nsobject.h
+++ b/base/mac/scoped_nsobject.h
@@ -11,6 +11,7 @@
#include "base/compiler_specific.h"
#include "base/mac/scoped_typeref.h"
+#include "base/template_util.h"
namespace base {
@@ -55,7 +56,7 @@ class scoped_nsobject : public scoped_nsprotocol {
public:
using scoped_nsprotocol::scoped_nsprotocol;
- static_assert(std::is_same::value == false,
+ static_assert(is_same::value == false,
"Use ScopedNSAutoreleasePool instead");
};
diff --git a/base/macros.h b/base/macros.h
index 5d96783..096704c 100644
--- a/base/macros.h
+++ b/base/macros.h
@@ -42,8 +42,9 @@ char (&ArraySizeHelper(const T (&array)[N]))[N];
template
inline Dest bit_cast(const Source& source) {
+#if __cplusplus >= 201103L
static_assert(sizeof(Dest) == sizeof(Source), "sizes must be equal");
-
+#endif
Dest dest;
memcpy(&dest, &source, sizeof(dest));
return dest;
diff --git a/build/common.gypi b/build/common.gypi
index 1affc70..6e8f292 100644
--- a/build/common.gypi
+++ b/build/common.gypi
@@ -66,6 +66,11 @@
'conditions': [
['clang!=0', {
'CLANG_CXX_LANGUAGE_STANDARD': 'c++11', # -std=c++11
+ 'conditions': [
+ ['mac_deployment_target=="10.8"', {
+ 'CLANG_CXX_LIBRARY': 'libc++', # force -stdlib=libc++ for 10.8
+ }]
+ ],
# Don't link in libarclite_macosx.a, see http://crbug.com/156530.
'CLANG_LINK_OBJC_RUNTIME': 'NO', # -fno-objc-link-runtime
tdesktop-1.2.17/Telegram/Patches/openal.diff 0000664 0000000 0000000 00000001407 13262451251 0020701 0 ustar 00root root 0000000 0000000 diff --git a/Alc/backends/winmm.c b/Alc/backends/winmm.c
index 9d8f8e9..8c8e44a 100644
--- a/Alc/backends/winmm.c
+++ b/Alc/backends/winmm.c
@@ -219,7 +219,7 @@ FORCE_ALIGN static int ALCwinmmPlayback_mixerProc(void *arg)
SetRTPriority();
althrd_setname(althrd_current(), MIXER_THREAD_NAME);
- while(GetMessage(&msg, NULL, 0, 0))
+ if (!self->killNow) while(GetMessage(&msg, NULL, 0, 0))
{
if(msg.message != WOM_DONE)
continue;
@@ -504,7 +504,7 @@ static int ALCwinmmCapture_captureProc(void *arg)
althrd_setname(althrd_current(), RECORD_THREAD_NAME);
- while(GetMessage(&msg, NULL, 0, 0))
+ if (!self->killNow) while(GetMessage(&msg, NULL, 0, 0))
{
if(msg.message != WIM_DATA)
continue;
tdesktop-1.2.17/Telegram/Patches/qtbase_5_6_2.diff 0000664 0000000 0000000 00000175541 13262451251 0021607 0 ustar 00root root 0000000 0000000 diff --git a/mkspecs/common/msvc-desktop.conf b/mkspecs/common/msvc-desktop.conf
index eec9e1f688..7ae53c7a1e 100644
--- a/mkspecs/common/msvc-desktop.conf
+++ b/mkspecs/common/msvc-desktop.conf
@@ -30,9 +30,10 @@ QMAKE_YACCFLAGS = -d
QMAKE_CFLAGS = -nologo -Zc:wchar_t
QMAKE_CFLAGS_WARN_ON = -W3
QMAKE_CFLAGS_WARN_OFF = -W0
-QMAKE_CFLAGS_RELEASE = -O2 -MD
-QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += -O2 -MD -Zi
-QMAKE_CFLAGS_DEBUG = -Zi -MDd
+# Patch: Make this build use static runtime library.
+QMAKE_CFLAGS_RELEASE = -O2 -MT
+QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += -O2 -MT -Zi
+QMAKE_CFLAGS_DEBUG = -Zi -MTd
QMAKE_CFLAGS_YACC =
QMAKE_CFLAGS_LTCG = -GL
QMAKE_CFLAGS_SSE2 = -arch:SSE2
diff --git a/src/corelib/io/qfsfileengine_win.cpp b/src/corelib/io/qfsfileengine_win.cpp
index 391fbcc519..d07802bb7a 100644
--- a/src/corelib/io/qfsfileengine_win.cpp
+++ b/src/corelib/io/qfsfileengine_win.cpp
@@ -427,11 +427,12 @@ qint64 QFSFileEnginePrivate::nativeWrite(const char *data, qint64 len)
// Writing on Windows fails with ERROR_NO_SYSTEM_RESOURCES when
// the chunks are too large, so we limit the block size to 32MB.
- const DWORD blockSize = DWORD(qMin(bytesToWrite, qint64(32 * 1024 * 1024)));
qint64 totalWritten = 0;
do {
+ // Patch: backport critical bugfix from '683c9bc4a8' commit.
+ const DWORD currentBlockSize = DWORD(qMin(bytesToWrite, qint64(32 * 1024 * 1024)));
DWORD bytesWritten;
- if (!WriteFile(fileHandle, data + totalWritten, blockSize, &bytesWritten, NULL)) {
+ if (!WriteFile(fileHandle, data + totalWritten, currentBlockSize, &bytesWritten, NULL)) {
if (totalWritten == 0) {
// Note: Only return error if the first WriteFile failed.
q->setError(QFile::WriteError, qt_error_string());
diff --git a/src/corelib/tools/qunicodetables.cpp b/src/corelib/tools/qunicodetables.cpp
index 14e4fd10aa..0619a176a7 100644
--- a/src/corelib/tools/qunicodetables.cpp
+++ b/src/corelib/tools/qunicodetables.cpp
@@ -6227,7 +6227,8 @@ static const Properties uc_properties[] = {
{ 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 7, 4, 4, 21, 11 },
{ 0, 17, 230, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 4, 4, 4, 21, 11 },
{ 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 85, 0, 8, 8, 12, 11 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 12, 17, 2 },
+ // Patch: Some bad characters appeared in ui in case 2 was here instead of 11.
+ { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 12, 17, 11 },
{ 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 14, 9, 11, 11 },
{ 3, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 14, 9, 11, 11 },
{ 3, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 14, 9, 11, 11 },
diff --git a/src/gui/kernel/qhighdpiscaling.cpp b/src/gui/kernel/qhighdpiscaling.cpp
index 2d00b9dce9..eeba86e936 100644
--- a/src/gui/kernel/qhighdpiscaling.cpp
+++ b/src/gui/kernel/qhighdpiscaling.cpp
@@ -51,6 +51,9 @@ static const char screenFactorsEnvVar[] = "QT_SCREEN_SCALE_FACTORS";
static inline qreal initialGlobalScaleFactor()
{
+ // Patch: Disable environment variable dpi scaling changing.
+ // It is not supported by Telegram Desktop :(
+ return 1.;
qreal result = 1;
if (qEnvironmentVariableIsSet(scaleFactorEnvVar)) {
diff --git a/src/gui/kernel/qplatformdialoghelper.h b/src/gui/kernel/qplatformdialoghelper.h
index 5b2f4ece77..790db46d25 100644
--- a/src/gui/kernel/qplatformdialoghelper.h
+++ b/src/gui/kernel/qplatformdialoghelper.h
@@ -386,6 +386,10 @@ public:
virtual QUrl directory() const = 0;
virtual void selectFile(const QUrl &filename) = 0;
virtual QList selectedFiles() const = 0;
+
+ // Patch: Adding select-by-url for Windows file dialog.
+ virtual QByteArray selectedRemoteContent() const { return QByteArray(); }
+
virtual void setFilter() = 0;
virtual void selectNameFilter(const QString &filter) = 0;
virtual QString selectedNameFilter() const = 0;
diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp
index bcd29b6fe1..bcb0672f69 100644
--- a/src/gui/kernel/qwindow.cpp
+++ b/src/gui/kernel/qwindow.cpp
@@ -2525,7 +2525,8 @@ void QWindowPrivate::setCursor(const QCursor *newCursor)
void QWindowPrivate::applyCursor()
{
Q_Q(QWindow);
- if (platformWindow) {
+ // Patch: Fixing possible crash (crashdumps point on this code line).
+ if (platformWindow && q->screen() && q->screen()->handle()) {
if (QPlatformCursor *platformCursor = q->screen()->handle()->cursor()) {
QCursor *c = QGuiApplication::overrideCursor();
if (!c && hasCursor)
diff --git a/src/gui/painting/qpaintengine_p.h b/src/gui/painting/qpaintengine_p.h
index 918c98997b..4158259743 100644
--- a/src/gui/painting/qpaintengine_p.h
+++ b/src/gui/painting/qpaintengine_p.h
@@ -80,8 +80,18 @@ public:
if (hasSystemTransform) {
if (systemTransform.type() <= QTransform::TxTranslate)
systemClip.translate(qRound(systemTransform.dx()), qRound(systemTransform.dy()));
- else
+ // Patch: Transform the system clip region back from device pixels to device-independent pixels before
+ // applying systemTransform, which already has transform from device-independent pixels to device pixels.
+ else {
+#ifdef Q_OS_MAC
+ QTransform scaleTransform;
+ const qreal invDevicePixelRatio = 1. / pdev->devicePixelRatio();
+ scaleTransform.scale(invDevicePixelRatio, invDevicePixelRatio);
+ systemClip = systemTransform.map(scaleTransform.map(systemClip));
+#else
systemClip = systemTransform.map(systemClip);
+#endif
+ }
}
// Make sure we're inside the viewport.
diff --git a/src/gui/text/qtextengine_p.h b/src/gui/text/qtextengine_p.h
index 7e507bba2d..936e7a92cb 100644
--- a/src/gui/text/qtextengine_p.h
+++ b/src/gui/text/qtextengine_p.h
@@ -283,7 +283,8 @@ private:
struct QScriptItem;
/// Internal QTextItem
-class QTextItemInt : public QTextItem
+// Patch: Enable access to QTextItemInt in .dll for WinRT build.
+class Q_GUI_EXPORT QTextItemInt : public QTextItem
{
public:
inline QTextItemInt()
diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp
index aca475a581..5fa0be2c45 100644
--- a/src/gui/text/qtextlayout.cpp
+++ b/src/gui/text/qtextlayout.cpp
@@ -694,6 +694,9 @@ int QTextLayout::nextCursorPosition(int oldPos, CursorMode mode) const
while (oldPos < len && !attributes[oldPos].graphemeBoundary)
oldPos++;
} else {
+ // Patch: Skip to the end of the current word, not to the start of the next one.
+ while (oldPos < len && attributes[oldPos].whiteSpace)
+ oldPos++;
if (oldPos < len && d->atWordSeparator(oldPos)) {
oldPos++;
while (oldPos < len && d->atWordSeparator(oldPos))
@@ -702,8 +705,9 @@ int QTextLayout::nextCursorPosition(int oldPos, CursorMode mode) const
while (oldPos < len && !attributes[oldPos].whiteSpace && !d->atWordSeparator(oldPos))
oldPos++;
}
- while (oldPos < len && attributes[oldPos].whiteSpace)
- oldPos++;
+ // Patch: Skip to the end of the current word, not to the start of the next one.
+ //while (oldPos < len && attributes[oldPos].whiteSpace)
+ // oldPos++;
}
return oldPos;
@@ -1645,6 +1649,9 @@ namespace {
int currentPosition;
glyph_t previousGlyph;
+ // Patch: Fix a crash in right bearing calculation.
+ QFontEngine *previousGlyphFontEngine;
+
QFixed minw;
QFixed softHyphenWidth;
QFixed rightBearing;
@@ -1677,13 +1684,19 @@ namespace {
if (currentPosition > 0 &&
logClusters[currentPosition - 1] < glyphs.numGlyphs) {
previousGlyph = currentGlyph(); // needed to calculate right bearing later
+
+ // Patch: Fix a crash in right bearing calculation.
+ previousGlyphFontEngine = fontEngine;
}
}
- inline void calculateRightBearing(glyph_t glyph)
+ // Patch: Fix a crash in right bearing calculation.
+ inline void calculateRightBearing(QFontEngine *engine, glyph_t glyph)
{
qreal rb;
- fontEngine->getGlyphBearings(glyph, 0, &rb);
+
+ // Patch: Fix a crash in right bearing calculation.
+ engine->getGlyphBearings(glyph, 0, &rb);
// We only care about negative right bearings, so we limit the range
// of the bearing here so that we can assume it's negative in the rest
@@ -1696,13 +1709,16 @@ namespace {
{
if (currentPosition <= 0)
return;
- calculateRightBearing(currentGlyph());
+
+ // Patch: Fix a crash in right bearing calculation.
+ calculateRightBearing(fontEngine, currentGlyph());
}
inline void calculateRightBearingForPreviousGlyph()
{
if (previousGlyph > 0)
- calculateRightBearing(previousGlyph);
+ // Patch: Fix a crash in right bearing calculation.
+ calculateRightBearing(previousGlyphFontEngine, previousGlyph);
}
static const QFixed RightBearingNotCalculated;
diff --git a/src/gui/text/qtextlayout.h b/src/gui/text/qtextlayout.h
index f74d4d4229..8ad672c9fe 100644
--- a/src/gui/text/qtextlayout.h
+++ b/src/gui/text/qtextlayout.h
@@ -196,6 +196,9 @@ private:
QRectF *brect, int tabstops, int* tabarray, int tabarraylen,
QPainter *painter);
QTextEngine *d;
+
+ // Patch: Allow access to private constructor.
+ friend class TextBlock;
};
diff --git a/src/network/socket/qnativesocketengine_win.cpp b/src/network/socket/qnativesocketengine_win.cpp
index 41834b21ae..8cdf4ab145 100644
--- a/src/network/socket/qnativesocketengine_win.cpp
+++ b/src/network/socket/qnativesocketengine_win.cpp
@@ -675,6 +675,13 @@ bool QNativeSocketEnginePrivate::nativeConnect(const QHostAddress &address, quin
errorDetected = true;
break;
}
+ // Patch: Handle network unreachable the same as host unreachable.
+ if (value == WSAENETUNREACH) {
+ setError(QAbstractSocket::NetworkError, NetworkUnreachableErrorString);
+ socketState = QAbstractSocket::UnconnectedState;
+ errorDetected = true;
+ break;
+ }
if (value == WSAEADDRNOTAVAIL) {
setError(QAbstractSocket::NetworkError, AddressNotAvailableErrorString);
socketState = QAbstractSocket::UnconnectedState;
diff --git a/src/platformsupport/fontdatabases/basic/qbasicfontdatabase.cpp b/src/platformsupport/fontdatabases/basic/qbasicfontdatabase.cpp
index 728b166b71..1dc64593e1 100644
--- a/src/platformsupport/fontdatabases/basic/qbasicfontdatabase.cpp
+++ b/src/platformsupport/fontdatabases/basic/qbasicfontdatabase.cpp
@@ -172,6 +172,79 @@ void QBasicFontDatabase::releaseHandle(void *handle)
extern FT_Library qt_getFreetype();
+// Patch: Enable Open Sans Semibold font family reading.
+// Copied from freetype with some modifications.
+
+#ifndef FT_PARAM_TAG_IGNORE_PREFERRED_FAMILY
+#define FT_PARAM_TAG_IGNORE_PREFERRED_FAMILY FT_MAKE_TAG('i', 'g', 'p', 'f')
+#endif
+
+#ifndef FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY
+#define FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY FT_MAKE_TAG('i', 'g', 'p', 's')
+#endif
+
+/* there's a Mac-specific extended implementation of FT_New_Face() */
+/* in src/base/ftmac.c */
+
+#if !defined( FT_MACINTOSH ) || defined( DARWIN_NO_CARBON )
+
+/* documentation is in freetype.h */
+
+FT_Error __ft_New_Face(FT_Library library, const char* pathname, FT_Long face_index, FT_Face *aface) {
+ FT_Open_Args args;
+
+ /* test for valid `library' and `aface' delayed to FT_Open_Face() */
+ if (!pathname)
+ return FT_Err_Invalid_Argument;
+
+ FT_Parameter params[2];
+ params[0].tag = FT_PARAM_TAG_IGNORE_PREFERRED_FAMILY;
+ params[0].data = 0;
+ params[1].tag = FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY;
+ params[1].data = 0;
+ args.flags = FT_OPEN_PATHNAME | FT_OPEN_PARAMS;
+ args.pathname = (char*)pathname;
+ args.stream = NULL;
+ args.num_params = 2;
+ args.params = params;
+
+ return FT_Open_Face(library, &args, face_index, aface);
+}
+
+#else
+
+FT_Error __ft_New_Face(FT_Library library, const char* pathname, FT_Long face_index, FT_Face *aface) {
+ return FT_New_Face(library, pathname, face_index, aface);
+}
+
+#endif /* defined( FT_MACINTOSH ) && !defined( DARWIN_NO_CARBON ) */
+
+/* documentation is in freetype.h */
+
+FT_Error __ft_New_Memory_Face(FT_Library library, const FT_Byte* file_base, FT_Long file_size, FT_Long face_index, FT_Face *aface) {
+ FT_Open_Args args;
+
+ /* test for valid `library' and `face' delayed to FT_Open_Face() */
+ if (!file_base)
+ return FT_Err_Invalid_Argument;
+
+ FT_Parameter params[2];
+ params[0].tag = FT_PARAM_TAG_IGNORE_PREFERRED_FAMILY;
+ params[0].data = 0;
+ params[1].tag = FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY;
+ params[1].data = 0;
+ args.flags = FT_OPEN_MEMORY | FT_OPEN_PARAMS;
+ args.memory_base = file_base;
+ args.memory_size = file_size;
+ args.stream = NULL;
+ args.num_params = 2;
+ args.params = params;
+
+ return FT_Open_Face(library, &args, face_index, aface);
+}
+
+// end
+
QStringList QBasicFontDatabase::addTTFile(const QByteArray &fontData, const QByteArray &file)
{
FT_Library library = qt_getFreetype();
@@ -183,9 +256,11 @@ QStringList QBasicFontDatabase::addTTFile(const QByteArray &fontData, const QByt
FT_Face face;
FT_Error error;
if (!fontData.isEmpty()) {
- error = FT_New_Memory_Face(library, (const FT_Byte *)fontData.constData(), fontData.size(), index, &face);
+ // Patch: Enable Open Sans Semibold font family reading.
+ error = __ft_New_Memory_Face(library, (const FT_Byte *)fontData.constData(), fontData.size(), index, &face);
} else {
- error = FT_New_Face(library, file.constData(), index, &face);
+ // Patch: Enable Open Sans Semibold font family reading.
+ error = __ft_New_Face(library, file.constData(), index, &face);
}
if (error != FT_Err_Ok) {
qDebug() << "FT_New_Face failed with index" << index << ':' << hex << error;
diff --git a/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp b/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp
index 8ebabf3419..7bb8abd0d0 100644
--- a/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp
+++ b/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp
@@ -375,6 +375,17 @@ static void populateFromPattern(FcPattern *pattern)
familyName = QString::fromUtf8((const char *)value);
+ // Patch: Enable Open Sans Semibold font family reading.
+ if (familyName == QLatin1String("Open Sans")) {
+ FcChar8 *styl = 0;
+ if (FcPatternGetString(pattern, FC_STYLE, 0, &styl) == FcResultMatch) {
+ QString style = QString::fromUtf8(reinterpret_cast(styl));
+ if (style == QLatin1String("Semibold")) {
+ familyName.append(QChar(QChar::Space)).append(style);
+ }
+ }
+ }
+
slant_value = FC_SLANT_ROMAN;
weight_value = FC_WEIGHT_REGULAR;
spacing_value = FC_PROPORTIONAL;
@@ -718,7 +729,19 @@ QStringList QFontconfigDatabase::fallbacksForFamily(const QString &family, QFont
if (FcPatternGetString(fontSet->fonts[i], FC_FAMILY, 0, &value) != FcResultMatch)
continue;
// capitalize(value);
- const QString familyName = QString::fromUtf8((const char *)value);
+
+ // Patch: Enable Open Sans Semibold font family reading.
+ QString familyName = QString::fromUtf8((const char *)value);
+ if (familyName == QLatin1String("Open Sans")) {
+ FcChar8 *styl = 0;
+ if (FcPatternGetString(fontSet->fonts[i], FC_STYLE, 0, &styl) == FcResultMatch) {
+ QString style = QString::fromUtf8(reinterpret_cast(styl));
+ if (style == QLatin1String("Semibold")) {
+ familyName.append(QChar(QChar::Space)).append(style);
+ }
+ }
+ }
+
const QString familyNameCF = familyName.toCaseFolded();
if (!duplicates.contains(familyNameCF)) {
fallbackFamilies << familyName;
@@ -784,6 +807,18 @@ QStringList QFontconfigDatabase::addApplicationFont(const QByteArray &fontData,
FcChar8 *fam = 0;
if (FcPatternGetString(pattern, FC_FAMILY, 0, &fam) == FcResultMatch) {
QString family = QString::fromUtf8(reinterpret_cast(fam));
+
+ // Patch: Enable Open Sans Semibold font family reading.
+ if (family == QLatin1String("Open Sans")) {
+ FcChar8 *styl = 0;
+ if (FcPatternGetString(pattern, FC_STYLE, 0, &styl) == FcResultMatch) {
+ QString style = QString::fromUtf8(reinterpret_cast(styl));
+ if (style == QLatin1String("Semibold")) {
+ family.append(QChar(QChar::Space)).append(style);
+ }
+ }
+ }
+
families << family;
}
populateFromPattern(pattern);
diff --git a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm
index 566abf2126..5b9c714ffa 100644
--- a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm
+++ b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm
@@ -265,6 +265,13 @@ static void getFontDescription(CTFontDescriptorRef font, FontDescription *fd)
fd->foundryName = QStringLiteral("CoreText");
fd->familyName = (CFStringRef) CTFontDescriptorCopyAttribute(font, kCTFontFamilyNameAttribute);
+
+ // Patch: Enable Open Sans Semibold font family reading.
+ QCFString _displayName = (CFStringRef) CTFontDescriptorCopyAttribute(font, kCTFontDisplayNameAttribute);
+ if (_displayName == QStringLiteral("Open Sans Semibold")) {
+ fd->familyName = _displayName;
+ }
+
fd->styleName = (CFStringRef)CTFontDescriptorCopyAttribute(font, kCTFontStyleNameAttribute);
fd->weight = QFont::Normal;
fd->style = QFont::StyleNormal;
diff --git a/src/plugins/platforminputcontexts/compose/compose.pro b/src/plugins/platforminputcontexts/compose/compose.pro
index 86bdd4729b..9b9c8ded08 100644
--- a/src/plugins/platforminputcontexts/compose/compose.pro
+++ b/src/plugins/platforminputcontexts/compose/compose.pro
@@ -15,7 +15,8 @@ HEADERS += $$PWD/qcomposeplatforminputcontext.h \
contains(QT_CONFIG, xkbcommon-qt): {
# dont't need x11 dependency for compose key plugin
QT_CONFIG -= use-xkbcommon-x11support
- include(../../../3rdparty/xkbcommon.pri)
+ # Patch: Adding fcitx input context plugin to our static build.
+ #include(../../../3rdparty/xkbcommon.pri)
} else {
LIBS += $$QMAKE_LIBS_XKBCOMMON
QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_XKBCOMMON
diff --git a/src/plugins/platforminputcontexts/compose/qcomposeplatforminputcontext.cpp b/src/plugins/platforminputcontexts/compose/qcomposeplatforminputcontext.cpp
index d1bea9af23..36a15a6473 100644
--- a/src/plugins/platforminputcontexts/compose/qcomposeplatforminputcontext.cpp
+++ b/src/plugins/platforminputcontexts/compose/qcomposeplatforminputcontext.cpp
@@ -232,6 +232,12 @@ bool QComposeInputContext::checkComposeTable()
void QComposeInputContext::commitText(uint character) const
{
+ // Patch: Crash fix when not focused widget still receives input events.
+ if (!m_focusObject) {
+ qWarning("QComposeInputContext::commitText: m_focusObject == nullptr, cannot commit text");
+ return;
+ }
+
QInputMethodEvent event;
event.setCommitString(QChar(character));
QCoreApplication::sendEvent(m_focusObject, &event);
diff --git a/src/plugins/platforminputcontexts/platforminputcontexts.pro b/src/plugins/platforminputcontexts/platforminputcontexts.pro
index faea54b874..0f9650996e 100644
--- a/src/plugins/platforminputcontexts/platforminputcontexts.pro
+++ b/src/plugins/platforminputcontexts/platforminputcontexts.pro
@@ -1,7 +1,8 @@
TEMPLATE = subdirs
qtHaveModule(dbus) {
-!mac:!win32:SUBDIRS += ibus
+# Patch: Adding fcitx/hime input context plugin to our static build.
+!mac:!win32:SUBDIRS += ibus fcitx hime
}
contains(QT_CONFIG, xcb-plugin): SUBDIRS += compose
diff --git a/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm b/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm
index caa8884661..9dc3bc1661 100644
--- a/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm
+++ b/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm
@@ -210,7 +210,8 @@ QT_END_NAMESPACE
if (reflectionDelegate) {
if ([reflectionDelegate respondsToSelector:@selector(applicationShouldTerminate:)])
return [reflectionDelegate applicationShouldTerminate:sender];
- return NSTerminateNow;
+ // Patch: Don't terminate if reflectionDelegate does not respond to that selector, just use the default.
+ //return NSTerminateNow;
}
if ([self canQuit]) {
@@ -287,11 +288,15 @@ QT_END_NAMESPACE
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
+ // Patch: We need to catch that notification in delegate.
+ if (reflectionDelegate
+ && [reflectionDelegate respondsToSelector:@selector(applicationDidFinishLaunching:)])
+ [reflectionDelegate applicationDidFinishLaunching:aNotification];
+
Q_UNUSED(aNotification);
inLaunch = false;
// qt_release_apple_event_handler();
-
// Insert code here to initialize your application
}
diff --git a/src/plugins/platforms/cocoa/qcocoabackingstore.h b/src/plugins/platforms/cocoa/qcocoabackingstore.h
index 934f68ad18..3ece6984ac 100644
--- a/src/plugins/platforms/cocoa/qcocoabackingstore.h
+++ b/src/plugins/platforms/cocoa/qcocoabackingstore.h
@@ -64,6 +64,9 @@ public:
private:
QImage m_qImage;
QSize m_requestedSize;
+
+ // Patch: Optimize redraw - don't clear image if it will be fully redrawn.
+ bool m_qImageNeedsClear;
};
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/cocoa/qcocoabackingstore.mm b/src/plugins/platforms/cocoa/qcocoabackingstore.mm
index ca92103826..f27ea15bad 100644
--- a/src/plugins/platforms/cocoa/qcocoabackingstore.mm
+++ b/src/plugins/platforms/cocoa/qcocoabackingstore.mm
@@ -38,7 +38,8 @@
QT_BEGIN_NAMESPACE
QCocoaBackingStore::QCocoaBackingStore(QWindow *window)
- : QPlatformBackingStore(window)
+ // Patch: Optimize redraw - don't clear image if it will be fully redrawn.
+ : QPlatformBackingStore(window), m_qImageNeedsClear(false)
{
}
@@ -59,9 +60,12 @@ QPaintDevice *QCocoaBackingStore::paintDevice()
if (m_qImage.size() != effectiveBufferSize) {
QImage::Format format = (window()->format().hasAlpha() || cocoaWindow->m_drawContentBorderGradient)
? QImage::Format_ARGB32_Premultiplied : QImage::Format_RGB32;
+
+ // Patch: Optimize redraw - don't clear image if it will be fully redrawn.
+ m_qImageNeedsClear = window()->requestedFormat().hasAlpha() || cocoaWindow->m_drawContentBorderGradient;
m_qImage = QImage(effectiveBufferSize, format);
m_qImage.setDevicePixelRatio(windowDevicePixelRatio);
- if (format == QImage::Format_ARGB32_Premultiplied)
+ if (m_qImageNeedsClear)
m_qImage.fill(Qt::transparent);
}
return &m_qImage;
@@ -100,7 +104,8 @@ bool QCocoaBackingStore::scroll(const QRegion &area, int dx, int dy)
void QCocoaBackingStore::beginPaint(const QRegion ®ion)
{
- if (m_qImage.hasAlphaChannel()) {
+ // Patch: Optimize redraw - don't clear image if it will be fully redrawn.
+ if (m_qImageNeedsClear && m_qImage.hasAlphaChannel()) {
QPainter p(&m_qImage);
p.setCompositionMode(QPainter::CompositionMode_Source);
const QVector rects = region.rects();
diff --git a/src/plugins/platforms/cocoa/qcocoahelpers.mm b/src/plugins/platforms/cocoa/qcocoahelpers.mm
index 058209da7e..6af61e7dab 100644
--- a/src/plugins/platforms/cocoa/qcocoahelpers.mm
+++ b/src/plugins/platforms/cocoa/qcocoahelpers.mm
@@ -546,9 +546,9 @@ OSStatus qt_mac_drawCGImage(CGContextRef inContext, const CGRect *inBounds, CGIm
// Verbatim copy if HIViewDrawCGImage (as shown on Carbon-Dev)
OSStatus err = noErr;
- require_action(inContext != NULL, InvalidContext, err = paramErr);
- require_action(inBounds != NULL, InvalidBounds, err = paramErr);
- require_action(inImage != NULL, InvalidImage, err = paramErr);
+// require_action(inContext != NULL, InvalidContext, err = paramErr);
+// require_action(inBounds != NULL, InvalidBounds, err = paramErr);
+// require_action(inImage != NULL, InvalidImage, err = paramErr);
CGContextSaveGState( inContext );
CGContextTranslateCTM (inContext, 0, inBounds->origin.y + CGRectGetMaxY(*inBounds));
@@ -557,9 +557,9 @@ OSStatus qt_mac_drawCGImage(CGContextRef inContext, const CGRect *inBounds, CGIm
CGContextDrawImage(inContext, *inBounds, inImage);
CGContextRestoreGState(inContext);
-InvalidImage:
-InvalidBounds:
-InvalidContext:
+//InvalidImage:
+//InvalidBounds:
+//InvalidContext:
return err;
}
diff --git a/src/plugins/platforms/cocoa/qcocoakeymapper.mm b/src/plugins/platforms/cocoa/qcocoakeymapper.mm
index c2d206fb45..9b9739862d 100644
--- a/src/plugins/platforms/cocoa/qcocoakeymapper.mm
+++ b/src/plugins/platforms/cocoa/qcocoakeymapper.mm
@@ -384,6 +384,12 @@ bool QCocoaKeyMapper::updateKeyboard()
keyboardInputLocale = QLocale::c();
keyboardInputDirection = Qt::LeftToRight;
}
+
+ // Patch: Fix layout-independent global shortcuts.
+ const auto newMode = keyboard_mode;
+ deleteLayouts();
+ keyboard_mode = newMode;
+
return true;
}
@@ -466,7 +472,8 @@ QList QCocoaKeyMapper::possibleKeys(const QKeyEvent *event) const
Qt::KeyboardModifiers neededMods = ModsTbl[i];
int key = kbItem->qtKey[i];
if (key && key != baseKey && ((keyMods & neededMods) == neededMods)) {
- ret << int(key + (keyMods & ~neededMods));
+ // Patch: Fix layout-independent global shortcuts.
+ ret << int(key + neededMods);
}
}
return ret;
diff --git a/src/plugins/platforms/cocoa/qcocoasystemtrayicon.mm b/src/plugins/platforms/cocoa/qcocoasystemtrayicon.mm
index 8152c57ffd..5ddd7b353d 100644
--- a/src/plugins/platforms/cocoa/qcocoasystemtrayicon.mm
+++ b/src/plugins/platforms/cocoa/qcocoasystemtrayicon.mm
@@ -94,6 +94,8 @@ QT_USE_NAMESPACE
QCocoaSystemTrayIcon *systray;
NSStatusItem *item;
QCocoaMenu *menu;
+ // Patch: Create a rich os x tray icon (pixel-perfect, theme switching).
+ bool menuVisible, iconSelected;
QIcon icon;
QT_MANGLE_NAMESPACE(QNSImageView) *imageCell;
}
@@ -197,7 +199,9 @@ void QCocoaSystemTrayIcon::updateIcon(const QIcon &icon)
// (device independent pixels). The menu height on past and
// current OS X versions is 22 points. Provide some future-proofing
// by deriving the icon height from the menu height.
- const int padding = 4;
+
+ // Patch: Create a rich os x tray icon (pixel-perfect, theme switching).
+ const int padding = 0;
const int menuHeight = [[NSStatusBar systemStatusBar] thickness];
const int maxImageHeight = menuHeight - padding;
@@ -207,8 +211,11 @@ void QCocoaSystemTrayIcon::updateIcon(const QIcon &icon)
// devicePixelRatio for the "best" screen on the system.
qreal devicePixelRatio = qApp->devicePixelRatio();
const int maxPixmapHeight = maxImageHeight * devicePixelRatio;
+
+ // Patch: Create a rich os x tray icon (pixel-perfect, theme switching).
+ const QIcon::Mode mode = m_sys->item->iconSelected ? QIcon::Selected : QIcon::Normal;
QSize selectedSize;
- Q_FOREACH (const QSize& size, sortByHeight(icon.availableSizes())) {
+ Q_FOREACH (const QSize& size, sortByHeight(icon.availableSizes(mode))) {
// Select a pixmap based on the height. We want the largest pixmap
// with a height smaller or equal to maxPixmapHeight. The pixmap
// may rectangular; assume it has a reasonable size. If there is
@@ -224,9 +231,9 @@ void QCocoaSystemTrayIcon::updateIcon(const QIcon &icon)
// Handle SVG icons, which do not return anything for availableSizes().
if (!selectedSize.isValid())
- selectedSize = icon.actualSize(QSize(maxPixmapHeight, maxPixmapHeight));
+ selectedSize = icon.actualSize(QSize(maxPixmapHeight, maxPixmapHeight), mode);
- QPixmap pixmap = icon.pixmap(selectedSize);
+ QPixmap pixmap = icon.pixmap(selectedSize, mode);
// Draw a low-resolution icon if there is not enough pixels for a retina
// icon. This prevents showing a small icon on retina displays.
@@ -374,6 +381,11 @@ QT_END_NAMESPACE
Q_UNUSED(notification);
down = NO;
+ // Patch: Create a rich os x tray icon (pixel-perfect, theme switching).
+ parent->iconSelected = false;
+ parent->systray->updateIcon(parent->icon);
+ parent->menuVisible = false;
+
[self setNeedsDisplay:YES];
}
@@ -383,6 +395,10 @@ QT_END_NAMESPACE
int clickCount = [mouseEvent clickCount];
[self setNeedsDisplay:YES];
+ // Patch: Create a rich os x tray icon (pixel-perfect, theme switching).
+ parent->iconSelected = (clickCount != 2) && parent->menu;
+ parent->systray->updateIcon(parent->icon);
+
if (clickCount == 2) {
[self menuTrackingDone:nil];
[parent doubleClickSelector:self];
@@ -399,6 +415,11 @@ QT_END_NAMESPACE
-(void)mouseUp:(NSEvent *)mouseEvent
{
Q_UNUSED(mouseEvent);
+
+ // Patch: Create a rich os x tray icon (pixel-perfect, theme switching).
+ parent->iconSelected = false;
+ parent->systray->updateIcon(parent->icon);
+
[self menuTrackingDone:nil];
}
@@ -410,6 +431,11 @@ QT_END_NAMESPACE
-(void)rightMouseUp:(NSEvent *)mouseEvent
{
Q_UNUSED(mouseEvent);
+
+ // Patch: Create a rich os x tray icon (pixel-perfect, theme switching).
+ parent->iconSelected = false;
+ parent->systray->updateIcon(parent->icon);
+
[self menuTrackingDone:nil];
}
@@ -425,7 +451,8 @@ QT_END_NAMESPACE
}
-(void)drawRect:(NSRect)rect {
- [[parent item] drawStatusBarBackgroundInRect:rect withHighlight:down];
+ // Patch: Create a rich os x tray icon (pixel-perfect, theme switching).
+ [[parent item] drawStatusBarBackgroundInRect:rect withHighlight:parent->menu ? down : NO];
[super drawRect:rect];
}
@end
@@ -438,6 +465,10 @@ QT_END_NAMESPACE
if (self) {
item = [[[NSStatusBar systemStatusBar] statusItemWithLength:NSSquareStatusItemLength] retain];
menu = 0;
+
+ // Patch: Create a rich os x tray icon (pixel-perfect, theme switching).
+ menuVisible = false;
+
systray = sys;
imageCell = [[QNSImageView alloc] initWithParent:self];
[item setView: imageCell];
@@ -482,6 +513,10 @@ QT_END_NAMESPACE
selector:@selector(menuTrackingDone:)
name:NSMenuDidEndTrackingNotification
object:m];
+
+ // Patch: Create a rich os x tray icon (pixel-perfect, theme switching).
+ menuVisible = true;
+
[item popUpStatusItemMenu: m];
}
}
diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm
index c0d5904367..f3c2047196 100644
--- a/src/plugins/platforms/cocoa/qcocoawindow.mm
+++ b/src/plugins/platforms/cocoa/qcocoawindow.mm
@@ -141,7 +141,8 @@ static bool isMouseEvent(NSEvent *ev)
if (!self.window.delegate)
return; // Already detached, pending NSAppKitDefined event
- if (pw && pw->frameStrutEventsEnabled() && isMouseEvent(theEvent)) {
+ // Patch: Fix restore after minimize or close by window buttons.
+ if (pw && pw->frameStrutEventsEnabled() && pw->m_synchedWindowState != Qt::WindowMinimized && pw->m_isExposed && isMouseEvent(theEvent)) {
NSPoint loc = [theEvent locationInWindow];
NSRect windowFrame = [self.window convertRectFromScreen:[self.window frame]];
NSRect contentFrame = [[self.window contentView] frame];
@@ -811,6 +812,16 @@ NSUInteger QCocoaWindow::windowStyleMask(Qt::WindowFlags flags)
{
Qt::WindowType type = static_cast(int(flags & Qt::WindowType_Mask));
NSInteger styleMask = NSBorderlessWindowMask;
+
+ // Patch: allow creating panels floating on all spaces in macOS.
+ // If you call "setCollectionBehavior:NSWindowCollectionBehaviorFullScreenAuxiliary" before
+ // setting the "NSNonactivatingPanelMask" bit in the style mask it won't work after that.
+ // So we need a way to set that bit before Qt sets collection behavior the way it does.
+ QVariant nonactivatingPanelMask = window()->property("_td_macNonactivatingPanelMask");
+ if (nonactivatingPanelMask.isValid() && nonactivatingPanelMask.toBool()) {
+ styleMask |= NSNonactivatingPanelMask;
+ }
+
if (flags & Qt::FramelessWindowHint)
return styleMask;
if ((type & Qt::Popup) == Qt::Popup) {
@@ -943,6 +954,19 @@ void QCocoaWindow::setWindowFilePath(const QString &filePath)
[m_nsWindow setRepresentedFilename: fi.exists() ? QCFString::toNSString(filePath) : @""];
}
+// Patch: Create a good os x window icon (pixel-perfect).
+namespace {
+
+qreal getDevicePixelRatio() {
+ qreal result = 1.0;
+ foreach (QScreen *screen, QGuiApplication::screens()) {
+ result = qMax(result, screen->devicePixelRatio());
+ }
+ return result;
+}
+
+} // namespace
+
void QCocoaWindow::setWindowIcon(const QIcon &icon)
{
QMacAutoReleasePool pool;
@@ -958,7 +982,9 @@ void QCocoaWindow::setWindowIcon(const QIcon &icon)
if (icon.isNull()) {
[iconButton setImage:nil];
} else {
- QPixmap pixmap = icon.pixmap(QSize(22, 22));
+ // Patch: Create a good os x window icon (pixel-perfect).
+ CGFloat hgt = 16. * getDevicePixelRatio();
+ QPixmap pixmap = icon.pixmap(QSize(hgt, hgt));
NSImage *image = static_cast(qt_mac_create_nsimage(pixmap));
[iconButton setImage:image];
[image release];
diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm
index c67bcfd23b..2616f420cb 100644
--- a/src/plugins/platforms/cocoa/qnsview.mm
+++ b/src/plugins/platforms/cocoa/qnsview.mm
@@ -647,6 +647,12 @@ QT_WARNING_POP
[self invalidateWindowShadowIfNeeded];
}
+- (void)viewDidChangeBackingProperties
+{
+ if (self.layer)
+ self.layer.contentsScale = self.window.backingScaleFactor;
+}
+
- (BOOL) isFlipped
{
return YES;
@@ -1431,7 +1437,9 @@ static QTabletEvent::TabletDevice wacomTabletDevice(NSEvent *theEvent)
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_8
if (QSysInfo::QSysInfo::MacintoshVersion >= QSysInfo::MV_10_8) {
// On 10.8 and above, MayBegin is likely to happen. We treat it the same as an actual begin.
- if (phase == NSEventPhaseMayBegin) {
+
+ // Patch: Fix actual begin handle of swipe on trackpad.
+ if (phase == NSEventPhaseMayBegin || phase == NSEventPhaseBegan) {
m_scrolling = true;
ph = Qt::ScrollBegin;
}
@@ -1496,14 +1504,14 @@ static QTabletEvent::TabletDevice wacomTabletDevice(NSEvent *theEvent)
quint32 nativeVirtualKey = [nsevent keyCode];
QChar ch = QChar::ReplacementCharacter;
- int keyCode = Qt::Key_unknown;
- if ([characters length] != 0) {
- if (((modifiers & Qt::MetaModifier) || (modifiers & Qt::AltModifier)) && ([charactersIgnoringModifiers length] != 0))
- ch = QChar([charactersIgnoringModifiers characterAtIndex:0]);
- else
- ch = QChar([characters characterAtIndex:0]);
- keyCode = [self convertKeyCode:ch];
- }
+
+ // Patch: Fix Alt+.. shortcuts in OS X. See https://bugreports.qt.io/browse/QTBUG-42584 at the end.
+ if ([characters length] != 0)
+ ch = QChar([characters characterAtIndex:0]);
+ else if ([charactersIgnoringModifiers length] != 0 && ((modifiers & Qt::MetaModifier) || (modifiers & Qt::AltModifier)))
+ ch = QChar([charactersIgnoringModifiers characterAtIndex:0]);
+
+ int keyCode = [self convertKeyCode:ch];
// we will send a key event unless the input method sets m_sendKeyEvent to false
m_sendKeyEvent = true;
@@ -1569,6 +1577,23 @@ static QTabletEvent::TabletDevice wacomTabletDevice(NSEvent *theEvent)
[self handleKeyEvent:nsevent eventType:int(QEvent::KeyRelease)];
}
+// Patch: Enable Ctrl+Tab and Ctrl+Shift+Tab / Ctrl+Backtab handle in-app.
+- (BOOL)performKeyEquivalent:(NSEvent *)nsevent
+{
+ NSString *chars = [nsevent charactersIgnoringModifiers];
+
+ if ([nsevent type] == NSKeyDown && [chars length] > 0) {
+ QChar ch = [chars characterAtIndex:0];
+ Qt::Key qtKey = qt_mac_cocoaKey2QtKey(ch);
+ if ([nsevent modifierFlags] & NSControlKeyMask
+ && (qtKey == Qt::Key_Tab || qtKey == Qt::Key_Backtab)) {
+ [self handleKeyEvent:nsevent eventType:int(QEvent::KeyPress)];
+ return YES;
+ }
+ }
+ return [super performKeyEquivalent:nsevent];
+}
+
- (void)cancelOperation:(id)sender
{
Q_UNUSED(sender);
diff --git a/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp b/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp
index 94bb71e429..16ab51e166 100644
--- a/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp
+++ b/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp
@@ -716,12 +716,20 @@ public:
void setSelectedFiles(const QList &);
QString selectedFile() const;
+ // Patch: Adding select-by-url for Windows file dialog.
+ void setSelectedRemoteContent(const QByteArray &);
+ QByteArray selectedRemoteContent() const;
+
private:
class Data : public QSharedData {
public:
QUrl directory;
QString selectedNameFilter;
QList selectedFiles;
+
+ // Patch: Adding select-by-url for Windows file dialog.
+ QByteArray selectedRemoteContent;
+
QMutex mutex;
};
QExplicitlySharedDataPointer m_data;
@@ -775,6 +783,21 @@ inline void QWindowsFileDialogSharedData::setSelectedFiles(const QList &ur
m_data->selectedFiles = urls;
}
+// Patch: Adding select-by-url for Windows file dialog.
+inline QByteArray QWindowsFileDialogSharedData::selectedRemoteContent() const
+{
+ m_data->mutex.lock();
+ const QByteArray result = m_data->selectedRemoteContent;
+ m_data->mutex.unlock();
+ return result;
+}
+
+inline void QWindowsFileDialogSharedData::setSelectedRemoteContent(const QByteArray &c)
+{
+ QMutexLocker(&m_data->mutex);
+ m_data->selectedRemoteContent = c;
+}
+
inline void QWindowsFileDialogSharedData::fromOptions(const QSharedPointer &o)
{
QMutexLocker locker(&m_data->mutex);
@@ -899,6 +922,9 @@ public:
// example by appended default suffixes, etc.
virtual QList dialogResult() const = 0;
+ // Patch: Adding select-by-url for Windows file dialog.
+ virtual QByteArray dialogRemoteContent() const { return QByteArray(); }
+
inline void onFolderChange(IShellItem *);
inline void onSelectionChange();
inline void onTypeChange();
@@ -1338,7 +1364,14 @@ void QWindowsNativeFileDialogBase::selectFile(const QString &fileName) const
// Hack to prevent CLSIDs from being set as file name due to
// QFileDialogPrivate::initialSelection() being QString-based.
if (!isClsid(fileName))
- m_fileDialog->SetFileName((wchar_t*)fileName.utf16());
+ // Patch: Fix handle of full fileName.
+ {
+ QString file = QDir::toNativeSeparators(fileName);
+ int lastBackSlash = file.lastIndexOf(QChar::fromLatin1('\\'));
+ if (lastBackSlash >= 0)
+ file = file.mid(lastBackSlash + 1);
+ m_fileDialog->SetFileName((wchar_t*)file.utf16());;
+ }
}
// Return the index of the selected filter, accounting for QFileDialog
@@ -1408,6 +1441,10 @@ bool QWindowsNativeFileDialogBase::onFileOk()
{
// Store selected files as GetResults() returns invalid data after the dialog closes.
m_data.setSelectedFiles(dialogResult());
+
+ // Patch: Adding select-by-url for Windows file dialog.
+ m_data.setSelectedRemoteContent(dialogRemoteContent());
+
return true;
}
@@ -1542,6 +1579,9 @@ public:
QList selectedFiles() const Q_DECL_OVERRIDE;
QList dialogResult() const Q_DECL_OVERRIDE;
+ // Patch: Adding select-by-url for Windows file dialog.
+ QByteArray dialogRemoteContent() const Q_DECL_OVERRIDE;
+
private:
inline IFileOpenDialog *openFileDialog() const
{ return static_cast(fileDialog()); }
@@ -1556,6 +1596,62 @@ QList QWindowsNativeOpenFileDialog::dialogResult() const
return result;
}
+// Patch: Adding select-by-url for Windows file dialog.
+QByteArray QWindowsNativeOpenFileDialog::dialogRemoteContent() const
+{
+ QByteArray result;
+ IShellItemArray *items = 0;
+ if (FAILED(openFileDialog()->GetResults(&items)) || !items)
+ return result;
+ DWORD itemCount = 0;
+ if (FAILED(items->GetCount(&itemCount)) || !itemCount)
+ return result;
+ for (DWORD i = 0; i < itemCount; ++i)
+ {
+ IShellItem *item = 0;
+ if (SUCCEEDED(items->GetItemAt(i, &item))) {
+ SFGAOF attributes = 0;
+ // Check whether it has a file system representation?
+ if (FAILED(item->GetAttributes(SFGAO_FILESYSTEM, &attributes)) || (attributes & SFGAO_FILESYSTEM))
+ {
+ LPWSTR name = 0;
+ if (SUCCEEDED(item->GetDisplayName(SIGDN_FILESYSPATH, &name)))
+ {
+ CoTaskMemFree(name);
+ continue;
+ }
+ }
+ if (FAILED(item->GetAttributes(SFGAO_STREAM, &attributes)) || !(attributes & SFGAO_STREAM))
+ continue;
+
+ IBindCtx *bind = 0;
+ if (FAILED(CreateBindCtx(0, &bind)))
+ continue;
+
+ IStream *stream = 0;
+ if (FAILED(item->BindToHandler(bind, BHID_Stream, IID_IStream, reinterpret_cast(&stream))))
+ continue;
+
+ STATSTG stat = { 0 };
+ if (FAILED(stream->Stat(&stat, STATFLAG_NONAME)) || !stat.cbSize.QuadPart)
+ continue;
+
+ quint64 fullSize = stat.cbSize.QuadPart;
+ if (fullSize <= 64 * 1024 * 1024)
+ {
+ result.resize(fullSize);
+ ULONG read = 0;
+ HRESULT r = stream->Read(result.data(), fullSize, &read);
+ if (r == S_FALSE || r == S_OK)
+ return result;
+
+ result.clear();
+ }
+ }
+ }
+ return result;
+}
+
QList QWindowsNativeOpenFileDialog::selectedFiles() const
{
QList result;
@@ -1614,6 +1710,10 @@ public:
virtual QUrl directory() const Q_DECL_OVERRIDE;
virtual void selectFile(const QUrl &filename) Q_DECL_OVERRIDE;
virtual QList selectedFiles() const Q_DECL_OVERRIDE;
+
+ // Patch: Adding select-by-url for Windows file dialog.
+ virtual QByteArray selectedRemoteContent() const Q_DECL_OVERRIDE;
+
virtual void setFilter() Q_DECL_OVERRIDE;
virtual void selectNameFilter(const QString &filter) Q_DECL_OVERRIDE;
virtual QString selectedNameFilter() const Q_DECL_OVERRIDE;
@@ -1707,6 +1807,12 @@ QList QWindowsFileDialogHelper::selectedFiles() const
return m_data.selectedFiles();
}
+// Patch: Adding select-by-url for Windows file dialog.
+QByteArray QWindowsFileDialogHelper::selectedRemoteContent() const
+{
+ return m_data.selectedRemoteContent();
+}
+
void QWindowsFileDialogHelper::setFilter()
{
qCDebug(lcQpaDialogs) << __FUNCTION__;
@@ -1996,6 +2102,10 @@ public:
QUrl directory() const Q_DECL_OVERRIDE;
void selectFile(const QUrl &url) Q_DECL_OVERRIDE;
QList selectedFiles() const Q_DECL_OVERRIDE;
+
+ // Patch: Adding select-by-url for Windows file dialog.
+ QByteArray selectedRemoteContent() const Q_DECL_OVERRIDE;
+
void setFilter() Q_DECL_OVERRIDE {}
void selectNameFilter(const QString &) Q_DECL_OVERRIDE;
QString selectedNameFilter() const Q_DECL_OVERRIDE;
@@ -2039,6 +2149,12 @@ QList QWindowsXpFileDialogHelper::selectedFiles() const
return m_data.selectedFiles();
}
+// Patch: Adding select-by-url for Windows file dialog.
+QByteArray QWindowsXpFileDialogHelper::selectedRemoteContent() const
+{
+ return m_data.selectedRemoteContent();
+}
+
void QWindowsXpFileDialogHelper::selectNameFilter(const QString &f)
{
m_data.setSelectedNameFilter(f); // Dialog cannot be updated at run-time.
diff --git a/src/plugins/platforms/windows/qwindowskeymapper.cpp b/src/plugins/platforms/windows/qwindowskeymapper.cpp
index 1e58b9b3d4..1741c21a1c 100644
--- a/src/plugins/platforms/windows/qwindowskeymapper.cpp
+++ b/src/plugins/platforms/windows/qwindowskeymapper.cpp
@@ -1268,6 +1268,10 @@ QList QWindowsKeyMapper::possibleKeys(const QKeyEvent *e) const
if (nativeVirtualKey > 255)
return result;
+ // Patch: This must not happen, but there are crash reports on the next line.
+ if (e->nativeVirtualKey() > 0xFF)
+ return result;
+
const KeyboardLayoutItem &kbItem = keyLayout[nativeVirtualKey];
if (!kbItem.exists)
return result;
diff --git a/src/plugins/platforms/windows/qwindowsservices.cpp b/src/plugins/platforms/windows/qwindowsservices.cpp
index 1d23a9d9b9..640cd426ed 100644
--- a/src/plugins/platforms/windows/qwindowsservices.cpp
+++ b/src/plugins/platforms/windows/qwindowsservices.cpp
@@ -127,6 +127,10 @@ static inline bool launchMail(const QUrl &url)
command.prepend(doubleQuote);
}
}
+
+ // Patch: Fix mail launch if no param is expected in this command.
+ if (command.indexOf(QStringLiteral("%1")) < 0) return false;
+
// Pass the url as the parameter. Should use QProcess::startDetached(),
// but that cannot handle a Windows command line [yet].
command.replace(QStringLiteral("%1"), url.toString(QUrl::FullyEncoded));
diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp
index b38d7c29ae..34f19c4efa 100644
--- a/src/plugins/platforms/windows/qwindowswindow.cpp
+++ b/src/plugins/platforms/windows/qwindowswindow.cpp
@@ -1020,7 +1020,8 @@ void QWindowsWindow::destroyWindow()
// Clear any transient child relationships as Windows will otherwise destroy them (QTBUG-35499, QTBUG-36666)
if (QWindow *transientChild = findTransientChild(window()))
if (QWindowsWindow *tw = QWindowsWindow::baseWindowOf(transientChild))
- tw->updateTransientParent();
+ // Patch: Fix possibility of add / remove taskbar icon of the window.
+ tw->clearTransientParent();
QWindowsContext *context = QWindowsContext::instance();
if (context->windowUnderMouse() == window())
context->clearWindowUnderMouse();
@@ -1235,6 +1236,21 @@ void QWindowsWindow::updateTransientParent() const
if (const QWindowsWindow *tw = QWindowsWindow::baseWindowOf(tp))
if (!tw->testFlag(WithinDestroy)) // Prevent destruction by parent window (QTBUG-35499, QTBUG-36666)
newTransientParent = tw->handle();
+ // Patch: Fix possibility of add / remove taskbar icon of the window.
+ if (newTransientParent && newTransientParent != oldTransientParent)
+ SetWindowLongPtr(m_data.hwnd, GWL_HWNDPARENT, (LONG_PTR)newTransientParent);
+#endif // !Q_OS_WINCE
+}
+
+// Patch: Fix possibility of add / remove taskbar icon of the window.
+void QWindowsWindow::clearTransientParent() const
+{
+#ifndef Q_OS_WINCE
+ if (window()->type() == Qt::Popup)
+ return; // QTBUG-34503, // a popup stays on top, no parent, see also WindowCreationData::fromWindow().
+ // Update transient parent.
+ const HWND oldTransientParent = transientParentHwnd(m_data.hwnd);
+ HWND newTransientParent = 0;
if (newTransientParent != oldTransientParent)
SetWindowLongPtr(m_data.hwnd, GWL_HWNDPARENT, (LONG_PTR)newTransientParent);
#endif // !Q_OS_WINCE
@@ -1448,10 +1464,14 @@ void QWindowsWindow::handleResized(int wParam)
handleGeometryChange();
break;
case SIZE_RESTORED:
- if (isFullScreen_sys())
- handleWindowStateChange(Qt::WindowFullScreen);
- else if (m_windowState != Qt::WindowNoState && !testFlag(MaximizeToFullScreen))
+ // Patch: When resolution is changed for a frameless fullscreen widget
+ // handleWindowStateChange call prevents correct geometry get in handleGeometryChange().
+ if (isFullScreen_sys()) {
+ if (m_windowState != Qt::WindowFullScreen)
+ handleWindowStateChange(Qt::WindowFullScreen);
+ } else if (m_windowState != Qt::WindowNoState && !testFlag(MaximizeToFullScreen)) {
handleWindowStateChange(Qt::WindowNoState);
+ }
handleGeometryChange();
break;
}
diff --git a/src/plugins/platforms/windows/qwindowswindow.h b/src/plugins/platforms/windows/qwindowswindow.h
index 6fffa1e6e9..cb1c9c1161 100644
--- a/src/plugins/platforms/windows/qwindowswindow.h
+++ b/src/plugins/platforms/windows/qwindowswindow.h
@@ -265,6 +265,10 @@ private:
inline void setWindowState_sys(Qt::WindowState newState);
inline void setParent_sys(const QPlatformWindow *parent);
inline void updateTransientParent() const;
+
+ // Patch: Fix possibility of add / remove taskbar icon of the window.
+ inline void clearTransientParent() const;
+
void destroyWindow();
inline bool isDropSiteEnabled() const { return m_dropTarget != 0; }
void setDropSiteEnabled(bool enabled);
diff --git a/src/plugins/platforms/xcb/qxcbnativeinterface.cpp b/src/plugins/platforms/xcb/qxcbnativeinterface.cpp
index 09e7ecf3a3..c0f15a4242 100644
--- a/src/plugins/platforms/xcb/qxcbnativeinterface.cpp
+++ b/src/plugins/platforms/xcb/qxcbnativeinterface.cpp
@@ -79,7 +79,10 @@ static int resourceType(const QByteArray &key)
QByteArrayLiteral("rootwindow"),
QByteArrayLiteral("subpixeltype"), QByteArrayLiteral("antialiasingenabled"),
QByteArrayLiteral("nofonthinting"),
- QByteArrayLiteral("atspibus")
+ QByteArrayLiteral("atspibus"),
+
+ // Patch: Backport compositing manager check from Qt 5.7
+ QByteArrayLiteral("compositingenabled")
};
const QByteArray *end = names + sizeof(names) / sizeof(names[0]);
const QByteArray *result = std::find(names, end, key);
@@ -252,6 +255,13 @@ void *QXcbNativeInterface::nativeResourceForScreen(const QByteArray &resourceStr
case RootWindow:
result = reinterpret_cast(xcbScreen->root());
break;
+
+ // Patch: Backport compositing manager check from Qt 5.7
+ case CompositingEnabled:
+ if (QXcbVirtualDesktop *vd = xcbScreen->virtualDesktop())
+ result = vd->compositingActive() ? this : Q_NULLPTR;
+ break;
+
default:
break;
}
diff --git a/src/plugins/platforms/xcb/qxcbnativeinterface.h b/src/plugins/platforms/xcb/qxcbnativeinterface.h
index f88b710864..6f818a5a72 100644
--- a/src/plugins/platforms/xcb/qxcbnativeinterface.h
+++ b/src/plugins/platforms/xcb/qxcbnativeinterface.h
@@ -68,7 +68,10 @@ public:
ScreenSubpixelType,
ScreenAntialiasingEnabled,
NoFontHinting,
- AtspiBus
+ AtspiBus,
+
+ // Patch: Backport compositing manager check from Qt 5.7
+ CompositingEnabled
};
QXcbNativeInterface();
diff --git a/src/widgets/dialogs/qfiledialog.cpp b/src/widgets/dialogs/qfiledialog.cpp
index bc2de899f5..aa8f8df4ad 100644
--- a/src/widgets/dialogs/qfiledialog.cpp
+++ b/src/widgets/dialogs/qfiledialog.cpp
@@ -1200,6 +1200,15 @@ QList QFileDialogPrivate::userSelectedFiles() const
return files;
}
+// Patch: Adding select-by-url for Windows file dialog.
+QByteArray QFileDialogPrivate::userSelectedRemoteContent() const
+{
+ if (nativeDialogInUse)
+ return selectedRemoteContent_sys();
+
+ return QByteArray();
+}
+
QStringList QFileDialogPrivate::addDefaultSuffixToFiles(const QStringList &filesToFix) const
{
QStringList files;
@@ -1267,6 +1276,14 @@ QStringList QFileDialog::selectedFiles() const
return files;
}
+// Patch: Adding select-by-url for Windows file dialog.
+QByteArray QFileDialog::selectedRemoteContent() const
+{
+ Q_D(const QFileDialog);
+
+ return d->userSelectedRemoteContent();
+}
+
/*!
Returns a list of urls containing the selected files in the dialog.
If no files are selected, or the mode is not ExistingFiles or
diff --git a/src/widgets/dialogs/qfiledialog.h b/src/widgets/dialogs/qfiledialog.h
index ffe49a2dd2..42dc563c8a 100644
--- a/src/widgets/dialogs/qfiledialog.h
+++ b/src/widgets/dialogs/qfiledialog.h
@@ -108,6 +108,9 @@ public:
void selectFile(const QString &filename);
QStringList selectedFiles() const;
+ // Patch: Adding select-by-url for Windows file dialog.
+ QByteArray selectedRemoteContent() const;
+
void selectUrl(const QUrl &url);
QList selectedUrls() const;
diff --git a/src/widgets/dialogs/qfiledialog_p.h b/src/widgets/dialogs/qfiledialog_p.h
index f610e46f83..547a64695a 100644
--- a/src/widgets/dialogs/qfiledialog_p.h
+++ b/src/widgets/dialogs/qfiledialog_p.h
@@ -123,6 +123,10 @@ public:
static QString initialSelection(const QUrl &path);
QStringList typedFiles() const;
QList userSelectedFiles() const;
+
+ // Patch: Adding select-by-url for Windows file dialog.
+ QByteArray userSelectedRemoteContent() const;
+
QStringList addDefaultSuffixToFiles(const QStringList &filesToFix) const;
QList addDefaultSuffixToUrls(const QList &urlsToFix) const;
bool removeDirectory(const QString &path);
@@ -256,6 +260,10 @@ public:
QUrl directory_sys() const;
void selectFile_sys(const QUrl &filename);
QList selectedFiles_sys() const;
+
+ // Patch: Adding select-by-url for Windows file dialog.
+ QByteArray selectedRemoteContent_sys() const;
+
void setFilter_sys();
void selectNameFilter_sys(const QString &filter);
QString selectedNameFilter_sys() const;
@@ -393,6 +401,14 @@ inline QList QFileDialogPrivate::selectedFiles_sys() const
return QList();
}
+// Patch: Adding select-by-url for Windows file dialog.
+inline QByteArray QFileDialogPrivate::selectedRemoteContent_sys() const
+{
+ if (QPlatformFileDialogHelper *helper = platformFileDialogHelper())
+ return helper->selectedRemoteContent();
+ return QByteArray();
+}
+
inline void QFileDialogPrivate::setFilter_sys()
{
if (QPlatformFileDialogHelper *helper = platformFileDialogHelper())
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
index b1d80d7b8f..42e32fd404 100644
--- a/src/widgets/kernel/qwidget.cpp
+++ b/src/widgets/kernel/qwidget.cpp
@@ -5138,6 +5138,17 @@ void QWidget::render(QPainter *painter, const QPoint &targetOffset,
return; // Fully transparent.
Q_D(QWidget);
+
+ // Patch: save and restore dirtyOpaqueChildren field.
+ //
+ // Just like in QWidget::grab() this field should be restored
+ // after the d->render() call, because it will be set to 1 and
+ // opaqueChildren field will be filled with empty region in
+ // case the widget is hidden (because all the opaque children
+ // will be skipped in isVisible() check).
+ //
+ const bool oldDirtyOpaqueChildren = d->dirtyOpaqueChildren;
+
const bool inRenderWithPainter = d->extra && d->extra->inRenderWithPainter;
const QRegion toBePainted = !inRenderWithPainter ? d->prepareToRender(sourceRegion, renderFlags)
: sourceRegion;
@@ -5159,6 +5170,10 @@ void QWidget::render(QPainter *painter, const QPoint &targetOffset,
if (!inRenderWithPainter && (opacity < 1.0 || (target->devType() == QInternal::Printer))) {
d->render_helper(painter, targetOffset, toBePainted, renderFlags);
d->extra->inRenderWithPainter = inRenderWithPainter;
+
+ // Patch: save and restore dirtyOpaqueChildren field.
+ d->dirtyOpaqueChildren = oldDirtyOpaqueChildren;
+
return;
}
@@ -5190,6 +5205,9 @@ void QWidget::render(QPainter *painter, const QPoint &targetOffset,
d->setSharedPainter(oldPainter);
d->extra->inRenderWithPainter = inRenderWithPainter;
+
+ // Patch: save and restore dirtyOpaqueChildren field.
+ d->dirtyOpaqueChildren = oldDirtyOpaqueChildren;
}
static void sendResizeEvents(QWidget *target)
@@ -8769,7 +8787,8 @@ bool QWidget::event(QEvent *event)
case QEvent::KeyPress: {
QKeyEvent *k = (QKeyEvent *)event;
bool res = false;
- if (!(k->modifiers() & (Qt::ControlModifier | Qt::AltModifier))) { //### Add MetaModifier?
+ // Patch: Enable Ctrl+Tab and Ctrl+Shift+Tab / Ctrl+Backtab handle in-app.
+ if (!(k->modifiers() & (Qt::ControlModifier | Qt::AltModifier | Qt::MetaModifier))) { //### Add MetaModifier?
if (k->key() == Qt::Key_Backtab
|| (k->key() == Qt::Key_Tab && (k->modifiers() & Qt::ShiftModifier)))
res = focusNextPrevChild(false);
diff --git a/src/widgets/util/qsystemtrayicon.cpp b/src/widgets/util/qsystemtrayicon.cpp
index 704142fe5c..7c4340e459 100644
--- a/src/widgets/util/qsystemtrayicon.cpp
+++ b/src/widgets/util/qsystemtrayicon.cpp
@@ -709,6 +709,10 @@ void QSystemTrayIconPrivate::updateMenu_sys_qpa()
if (menu) {
addPlatformMenu(menu);
qpa_sys->updateMenu(menu->platformMenu());
+
+ // Patch: Create a rich os x tray icon (pixel-perfect, theme switching).
+ } else {
+ qpa_sys->updateMenu(nullptr);
}
}
diff --git a/src/widgets/widgets/qabstractscrollarea.cpp b/src/widgets/widgets/qabstractscrollarea.cpp
index 2e2a042bf1..472e37722b 100644
--- a/src/widgets/widgets/qabstractscrollarea.cpp
+++ b/src/widgets/widgets/qabstractscrollarea.cpp
@@ -640,15 +640,22 @@ scrolling range.
QSize QAbstractScrollArea::maximumViewportSize() const
{
Q_D(const QAbstractScrollArea);
- int hsbExt = d->hbar->sizeHint().height();
- int vsbExt = d->vbar->sizeHint().width();
+ // Patch: Count the sizeHint of the bar only if it is displayed.
+ //int hsbExt = d->hbar->sizeHint().height();
+ //int vsbExt = d->vbar->sizeHint().width();
int f = 2 * d->frameWidth;
QSize max = size() - QSize(f + d->left + d->right, f + d->top + d->bottom);
- if (d->vbarpolicy == Qt::ScrollBarAlwaysOn)
+
+ // Patch: Count the sizeHint of the bar only if it is displayed.
+ if (d->vbarpolicy == Qt::ScrollBarAlwaysOn) {
+ int vsbExt = d->vbar->sizeHint().width();
max.rwidth() -= vsbExt;
- if (d->hbarpolicy == Qt::ScrollBarAlwaysOn)
+ }
+ if (d->hbarpolicy == Qt::ScrollBarAlwaysOn) {
+ int hsbExt = d->hbar->sizeHint().height();
max.rheight() -= hsbExt;
+ }
return max;
}
diff --git a/src/widgets/widgets/qwidgetlinecontrol.cpp b/src/widgets/widgets/qwidgetlinecontrol.cpp
index daf9f00c46..57499dc4a4 100644
--- a/src/widgets/widgets/qwidgetlinecontrol.cpp
+++ b/src/widgets/widgets/qwidgetlinecontrol.cpp
@@ -40,6 +40,11 @@
#include
#include
#include
+
+// Patch: Enable Ctrl+key and Ctrl+Shift+key in all locales except German.
+// See https://github.com/telegramdesktop/tdesktop/pull/1185.
+#include
+
#ifndef QT_NO_ACCESSIBILITY
#include "qaccessible.h"
#endif
@@ -1882,11 +1887,21 @@ void QWidgetLineControl::processKeyEvent(QKeyEvent* event)
}
// QTBUG-35734: ignore Ctrl/Ctrl+Shift; accept only AltGr (Alt+Ctrl) on German keyboards
- if (unknown && !isReadOnly()
- && event->modifiers() != Qt::ControlModifier
- && event->modifiers() != (Qt::ControlModifier | Qt::ShiftModifier)) {
+
+ // Patch: Enable Ctrl+key and Ctrl+Shift+key in all locales except German.
+ // See https://github.com/telegramdesktop/tdesktop/pull/1185.
+ bool skipCtrlAndCtrlShift = false;
+ if (QGuiApplication::inputMethod()->locale().language() == QLocale::German) {
+ if (event->modifiers() == Qt::ControlModifier
+ || event->modifiers() == (Qt::ControlModifier | Qt::ShiftModifier)) {
+ skipCtrlAndCtrlShift = true;
+ }
+ }
+ if (unknown && !isReadOnly() && !skipCtrlAndCtrlShift) {
QString t = event->text();
- if (!t.isEmpty() && t.at(0).isPrint()) {
+
+ // Patch: Enable ZWJ and ZWNJ characters to be in text input.
+ if (!t.isEmpty() && (t.at(0).isPrint() || t.at(0).unicode() == 0x200C || t.at(0).unicode() == 0x200D)) {
insert(t);
#ifndef QT_NO_COMPLETER
complete(event->key());
diff --git a/src/widgets/widgets/qwidgettextcontrol.cpp b/src/widgets/widgets/qwidgettextcontrol.cpp
index deca002bf5..8a2023f503 100644
--- a/src/widgets/widgets/qwidgettextcontrol.cpp
+++ b/src/widgets/widgets/qwidgettextcontrol.cpp
@@ -71,6 +71,11 @@
#include
#include
#include
+
+// Patch: Enable Ctrl+key and Ctrl+Shift+key in all locales except German.
+// See https://github.com/telegramdesktop/tdesktop/pull/1185.
+#include
+
#include
#include
#include
@@ -1343,13 +1348,24 @@ void QWidgetTextControlPrivate::keyPressEvent(QKeyEvent *e)
process:
{
// QTBUG-35734: ignore Ctrl/Ctrl+Shift; accept only AltGr (Alt+Ctrl) on German keyboards
- if (e->modifiers() == Qt::ControlModifier
- || e->modifiers() == (Qt::ShiftModifier | Qt::ControlModifier)) {
+
+ // Patch: Enable Ctrl+key and Ctrl+Shift+key in all locales except German.
+ // See https://github.com/telegramdesktop/tdesktop/pull/1185.
+ bool skipCtrlAndCtrlShift = false;
+ if (QGuiApplication::inputMethod()->locale().language() == QLocale::German) {
+ if (e->modifiers() == Qt::ControlModifier
+ || e->modifiers() == (Qt::ControlModifier | Qt::ShiftModifier)) {
+ skipCtrlAndCtrlShift = true;
+ }
+ }
+ if (skipCtrlAndCtrlShift) {
e->ignore();
return;
}
QString text = e->text();
- if (!text.isEmpty() && (text.at(0).isPrint() || text.at(0) == QLatin1Char('\t'))) {
+
+ // Patch: Enable ZWJ and ZWNJ characters to be in text input.
+ if (!text.isEmpty() && (text.at(0).isPrint() || text.at(0) == QLatin1Char('\t') || text.at(0).unicode() == 0x200C || text.at(0).unicode() == 0x200D)) {
if (overwriteMode
// no need to call deleteChar() if we have a selection, insertText
// does it already
tdesktop-1.2.17/Telegram/Resources/ 0000775 0000000 0000000 00000000000 13262451251 0017152 5 ustar 00root root 0000000 0000000 tdesktop-1.2.17/Telegram/Resources/art/ 0000775 0000000 0000000 00000000000 13262451251 0017740 5 ustar 00root root 0000000 0000000 tdesktop-1.2.17/Telegram/Resources/art/bg.jpg 0000664 0000000 0000000 00000322267 13262451251 0021046 0 ustar 00root root 0000000 0000000
IExif MM * b j( 1 &