Use Q_OS_UNIX instead of Q_OS_LINUX since linux-specific code can be used also on *BSD/Haiku
This commit is contained in:
parent
56de3194ef
commit
dbad9fa73a
27 changed files with 87 additions and 85 deletions
|
@ -254,7 +254,7 @@ int main(int argc, char *argv[])
|
||||||
}
|
}
|
||||||
QByteArray inner = f.readAll();
|
QByteArray inner = f.readAll();
|
||||||
stream << name << quint32(inner.size()) << inner;
|
stream << name << quint32(inner.size()) << inner;
|
||||||
#if defined Q_OS_MAC || defined Q_OS_LINUX
|
#ifdef Q_OS_UNIX
|
||||||
stream << (QFileInfo(fullName).isExecutable() ? true : false);
|
stream << (QFileInfo(fullName).isExecutable() ? true : false);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -467,10 +467,12 @@ int main(int argc, char *argv[])
|
||||||
QString outName(QString("tupdate%1").arg(AlphaVersion ? AlphaVersion : version));
|
QString outName(QString("tupdate%1").arg(AlphaVersion ? AlphaVersion : version));
|
||||||
#elif defined Q_OS_MAC
|
#elif defined Q_OS_MAC
|
||||||
QString outName((targetosx ? QString("tosxupd%1") : QString("tmacupd%1")).arg(AlphaVersion ? AlphaVersion : version));
|
QString outName((targetosx ? QString("tosxupd%1") : QString("tmacupd%1")).arg(AlphaVersion ? AlphaVersion : version));
|
||||||
#elif defined Q_OS_LINUX32
|
#elif defined Q_OS_UNIX
|
||||||
|
#ifndef _LP64
|
||||||
QString outName(QString("tlinux32upd%1").arg(AlphaVersion ? AlphaVersion : version));
|
QString outName(QString("tlinux32upd%1").arg(AlphaVersion ? AlphaVersion : version));
|
||||||
#elif defined Q_OS_LINUX64
|
#else
|
||||||
QString outName(QString("tlinuxupd%1").arg(AlphaVersion ? AlphaVersion : version));
|
QString outName(QString("tlinuxupd%1").arg(AlphaVersion ? AlphaVersion : version));
|
||||||
|
#endif
|
||||||
#else
|
#else
|
||||||
#error Unknown platform!
|
#error Unknown platform!
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -773,11 +773,11 @@ void Application::notifyFileDialogShown(bool shown) {
|
||||||
}
|
}
|
||||||
|
|
||||||
QWidget *Application::getModalParent() {
|
QWidget *Application::getModalParent() {
|
||||||
#ifdef Q_OS_LINUX
|
#if defined Q_OS_UNIX && !defined Q_OS_MAC
|
||||||
return Platform::IsWayland()
|
return Platform::IsWayland()
|
||||||
? App::wnd()
|
? App::wnd()
|
||||||
: nullptr;
|
: nullptr;
|
||||||
#endif // Q_OS_LINUX
|
#endif // Q_OS_UNIX && !Q_OS_MAC
|
||||||
|
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,7 +39,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "client/crashpad_client.h"
|
#include "client/crashpad_client.h"
|
||||||
#endif // else for MAC_USE_BREAKPAD
|
#endif // else for MAC_USE_BREAKPAD
|
||||||
|
|
||||||
#elif defined Q_OS_LINUX64 || defined Q_OS_LINUX32 // Q_OS_MAC
|
#elif defined Q_OS_UNIX // Q_OS_MAC
|
||||||
|
|
||||||
#include <execinfo.h>
|
#include <execinfo.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
|
@ -47,7 +47,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
|
|
||||||
#include "client/linux/handler/exception_handler.h"
|
#include "client/linux/handler/exception_handler.h"
|
||||||
|
|
||||||
#endif // Q_OS_LINUX64 || Q_OS_LINUX32
|
#endif // Q_OS_UNIX
|
||||||
|
|
||||||
#endif // !DESKTOP_APP_DISABLE_CRASH_REPORTS
|
#endif // !DESKTOP_APP_DISABLE_CRASH_REPORTS
|
||||||
|
|
||||||
|
@ -140,7 +140,7 @@ QMutex ReportingMutex;
|
||||||
const char *BreakpadDumpPath = nullptr;
|
const char *BreakpadDumpPath = nullptr;
|
||||||
const wchar_t *BreakpadDumpPathW = nullptr;
|
const wchar_t *BreakpadDumpPathW = nullptr;
|
||||||
|
|
||||||
#if defined Q_OS_MAC || defined Q_OS_LINUX32 || defined Q_OS_LINUX64
|
#ifdef Q_OS_UNIX
|
||||||
struct sigaction SIG_def[32];
|
struct sigaction SIG_def[32];
|
||||||
|
|
||||||
void SignalHandler(int signum, siginfo_t *info, void *ucontext) {
|
void SignalHandler(int signum, siginfo_t *info, void *ucontext) {
|
||||||
|
@ -148,9 +148,9 @@ void SignalHandler(int signum, siginfo_t *info, void *ucontext) {
|
||||||
sigaction(signum, &SIG_def[signum], 0);
|
sigaction(signum, &SIG_def[signum], 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
#else // Q_OS_MAC || Q_OS_LINUX32 || Q_OS_LINUX64
|
#else // Q_OS_UNIX
|
||||||
void SignalHandler(int signum) {
|
void SignalHandler(int signum) {
|
||||||
#endif // else for Q_OS_MAC || Q_OS_LINUX || Q_OS_LINUX64
|
#endif // else for Q_OS_UNIX
|
||||||
|
|
||||||
const char* name = 0;
|
const char* name = 0;
|
||||||
switch (signum) {
|
switch (signum) {
|
||||||
|
@ -212,7 +212,7 @@ void SignalHandler(int signum) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// see https://github.com/benbjohnson/bandicoot
|
// see https://github.com/benbjohnson/bandicoot
|
||||||
#if defined Q_OS_MAC || defined Q_OS_LINUX32 || defined Q_OS_LINUX64
|
#ifdef Q_OS_UNIX
|
||||||
ucontext_t *uc = (ucontext_t*)ucontext;
|
ucontext_t *uc = (ucontext_t*)ucontext;
|
||||||
|
|
||||||
void *caller = 0;
|
void *caller = 0;
|
||||||
|
@ -276,9 +276,9 @@ void SignalHandler(int signum) {
|
||||||
|
|
||||||
backtrace_symbols_fd(addresses, size, ReportFileNo);
|
backtrace_symbols_fd(addresses, size, ReportFileNo);
|
||||||
|
|
||||||
#else // Q_OS_MAC || Q_OS_LINUX32 || Q_OS_LINUX64
|
#else // Q_OS_UNIX
|
||||||
dump() << "\nBacktrace omitted.\n";
|
dump() << "\nBacktrace omitted.\n";
|
||||||
#endif // else for Q_OS_MAC || Q_OS_LINUX32 || Q_OS_LINUX64
|
#endif // else for Q_OS_UNIX
|
||||||
|
|
||||||
dump() << "\n";
|
dump() << "\n";
|
||||||
|
|
||||||
|
@ -294,9 +294,9 @@ google_breakpad::ExceptionHandler* BreakpadExceptionHandler = 0;
|
||||||
bool DumpCallback(const wchar_t* _dump_dir, const wchar_t* _minidump_id, void* context, EXCEPTION_POINTERS* exinfo, MDRawAssertionInfo* assertion, bool success)
|
bool DumpCallback(const wchar_t* _dump_dir, const wchar_t* _minidump_id, void* context, EXCEPTION_POINTERS* exinfo, MDRawAssertionInfo* assertion, bool success)
|
||||||
#elif defined Q_OS_MAC // Q_OS_WIN
|
#elif defined Q_OS_MAC // Q_OS_WIN
|
||||||
bool DumpCallback(const char* _dump_dir, const char* _minidump_id, void *context, bool success)
|
bool DumpCallback(const char* _dump_dir, const char* _minidump_id, void *context, bool success)
|
||||||
#elif defined Q_OS_LINUX64 || defined Q_OS_LINUX32 // Q_OS_MAC
|
#elif defined Q_OS_UNIX // Q_OS_MAC
|
||||||
bool DumpCallback(const google_breakpad::MinidumpDescriptor &md, void *context, bool success)
|
bool DumpCallback(const google_breakpad::MinidumpDescriptor &md, void *context, bool success)
|
||||||
#endif // Q_OS_LINUX64 || Q_OS_LINUX32
|
#endif // Q_OS_UNIX
|
||||||
{
|
{
|
||||||
if (CrashLogged) return success;
|
if (CrashLogged) return success;
|
||||||
CrashLogged = true;
|
CrashLogged = true;
|
||||||
|
@ -392,7 +392,7 @@ void StartCatching(not_null<Core::Launcher*> launcher) {
|
||||||
crashpad_client.UseHandler();
|
crashpad_client.UseHandler();
|
||||||
}
|
}
|
||||||
#endif // else for MAC_USE_BREAKPAD
|
#endif // else for MAC_USE_BREAKPAD
|
||||||
#elif defined Q_OS_LINUX64 || defined Q_OS_LINUX32
|
#elif defined Q_OS_UNIX
|
||||||
BreakpadExceptionHandler = new google_breakpad::ExceptionHandler(
|
BreakpadExceptionHandler = new google_breakpad::ExceptionHandler(
|
||||||
google_breakpad::MinidumpDescriptor(QFile::encodeName(dumpspath).toStdString()),
|
google_breakpad::MinidumpDescriptor(QFile::encodeName(dumpspath).toStdString()),
|
||||||
/*FilterCallback*/ 0,
|
/*FilterCallback*/ 0,
|
||||||
|
@ -401,7 +401,7 @@ void StartCatching(not_null<Core::Launcher*> launcher) {
|
||||||
true,
|
true,
|
||||||
-1
|
-1
|
||||||
);
|
);
|
||||||
#endif // Q_OS_LINUX64 || Q_OS_LINUX32
|
#endif // Q_OS_UNIX
|
||||||
#endif // !DESKTOP_APP_DISABLE_CRASH_REPORTS
|
#endif // !DESKTOP_APP_DISABLE_CRASH_REPORTS
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -291,7 +291,7 @@ void Launcher::init() {
|
||||||
|
|
||||||
QApplication::setApplicationName(qsl("TelegramDesktop"));
|
QApplication::setApplicationName(qsl("TelegramDesktop"));
|
||||||
|
|
||||||
#if defined(Q_OS_LINUX) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
|
#if defined Q_OS_UNIX && !defined Q_OS_MAC && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
|
||||||
QApplication::setDesktopFileName(Platform::GetLauncherFilename());
|
QApplication::setDesktopFileName(Platform::GetLauncherFilename());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -409,9 +409,9 @@ bool UnpackUpdate(const QString &filepath) {
|
||||||
bool executable = false;
|
bool executable = false;
|
||||||
|
|
||||||
stream >> relativeName >> fileSize >> fileInnerData;
|
stream >> relativeName >> fileSize >> fileInnerData;
|
||||||
#if defined Q_OS_MAC || defined Q_OS_LINUX
|
#ifdef Q_OS_UNIX
|
||||||
stream >> executable;
|
stream >> executable;
|
||||||
#endif // Q_OS_MAC || Q_OS_LINUX
|
#endif // Q_OS_UNIX
|
||||||
if (stream.status() != QDataStream::Ok) {
|
if (stream.status() != QDataStream::Ok) {
|
||||||
LOG(("Update Error: cant read file from downloaded stream, status: %1").arg(stream.status()));
|
LOG(("Update Error: cant read file from downloaded stream, status: %1").arg(stream.status()));
|
||||||
return false;
|
return false;
|
||||||
|
@ -1509,10 +1509,10 @@ bool checkReadyUpdate() {
|
||||||
#elif defined Q_OS_MAC // Q_OS_WIN
|
#elif defined Q_OS_MAC // Q_OS_WIN
|
||||||
QString curUpdater = (cExeDir() + cExeName() + qsl("/Contents/Frameworks/Updater"));
|
QString curUpdater = (cExeDir() + cExeName() + qsl("/Contents/Frameworks/Updater"));
|
||||||
QFileInfo updater(cWorkingDir() + qsl("tupdates/temp/Telegram.app/Contents/Frameworks/Updater"));
|
QFileInfo updater(cWorkingDir() + qsl("tupdates/temp/Telegram.app/Contents/Frameworks/Updater"));
|
||||||
#elif defined Q_OS_LINUX // Q_OS_MAC
|
#elif defined Q_OS_UNIX // Q_OS_MAC
|
||||||
QString curUpdater = (cExeDir() + qsl("Updater"));
|
QString curUpdater = (cExeDir() + qsl("Updater"));
|
||||||
QFileInfo updater(cWorkingDir() + qsl("tupdates/temp/Updater"));
|
QFileInfo updater(cWorkingDir() + qsl("tupdates/temp/Updater"));
|
||||||
#endif // Q_OS_LINUX
|
#endif // Q_OS_UNIX
|
||||||
if (!updater.exists()) {
|
if (!updater.exists()) {
|
||||||
QFileInfo current(curUpdater);
|
QFileInfo current(curUpdater);
|
||||||
if (!current.exists()) {
|
if (!current.exists()) {
|
||||||
|
@ -1546,12 +1546,12 @@ bool checkReadyUpdate() {
|
||||||
ClearAll();
|
ClearAll();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
#elif defined Q_OS_LINUX // Q_OS_MAC
|
#elif defined Q_OS_UNIX // Q_OS_MAC
|
||||||
if (!linuxMoveFile(QFile::encodeName(updater.absoluteFilePath()).constData(), QFile::encodeName(curUpdater).constData())) {
|
if (!linuxMoveFile(QFile::encodeName(updater.absoluteFilePath()).constData(), QFile::encodeName(curUpdater).constData())) {
|
||||||
ClearAll();
|
ClearAll();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
#endif // Q_OS_LINUX
|
#endif // Q_OS_UNIX
|
||||||
|
|
||||||
#ifdef Q_OS_MAC
|
#ifdef Q_OS_MAC
|
||||||
Platform::RemoveQuarantine(QFileInfo(curUpdater).absolutePath());
|
Platform::RemoveQuarantine(QFileInfo(curUpdater).absolutePath());
|
||||||
|
|
|
@ -1617,10 +1617,10 @@ bool IsExecutableName(const QString &filepath) {
|
||||||
qsl("\
|
qsl("\
|
||||||
applescript action app bin command csh osx workflow terminal url caction \
|
applescript action app bin command csh osx workflow terminal url caction \
|
||||||
mpkg pkg scpt scptd xhtm webarchive");
|
mpkg pkg scpt scptd xhtm webarchive");
|
||||||
#elif defined Q_OS_LINUX // Q_OS_MAC
|
#elif defined Q_OS_UNIX // Q_OS_MAC
|
||||||
qsl("bin csh deb desktop ksh out pet pkg pup rpm run sh shar \
|
qsl("bin csh deb desktop ksh out pet pkg pup rpm run sh shar \
|
||||||
slp zsh");
|
slp zsh");
|
||||||
#else // Q_OS_MAC || Q_OS_LINUX
|
#else // Q_OS_MAC || Q_OS_UNIX
|
||||||
qsl("\
|
qsl("\
|
||||||
ad ade adp app application appref-ms asp asx bas bat bin cdxml cer cfg chi \
|
ad ade adp app application appref-ms asp asx bas bat bin cdxml cer cfg chi \
|
||||||
chm cmd cnt com cpl crt csh der diagcab dll drv eml exe fon fxp gadget grp \
|
chm cmd cnt com cpl crt csh der diagcab dll drv eml exe fon fxp gadget grp \
|
||||||
|
@ -1633,7 +1633,7 @@ psm1 pssc pst py py3 pyc pyd pyi pyo pyw pywz pyz rb reg rgs scf scr sct \
|
||||||
search-ms settingcontent-ms shb shs slk sys t tmp u3p url vb vbe vbp vbs \
|
search-ms settingcontent-ms shb shs slk sys t tmp u3p url vb vbe vbp vbs \
|
||||||
vbscript vdx vsmacros vsd vsdm vsdx vss vssm vssx vst vstm vstx vsw vsx vtx \
|
vbscript vdx vsmacros vsd vsdm vsdx vss vssm vssx vst vstm vstx vsw vsx vtx \
|
||||||
website ws wsc wsf wsh xbap xll xnk xs");
|
website ws wsc wsf wsh xbap xll xnk xs");
|
||||||
#endif // !Q_OS_MAC && !Q_OS_LINUX
|
#endif // !Q_OS_MAC && !Q_OS_UNIX
|
||||||
const auto list = joined.split(' ');
|
const auto list = joined.split(' ');
|
||||||
return base::flat_set<QString>(list.begin(), list.end());
|
return base::flat_set<QString>(list.begin(), list.end());
|
||||||
}();
|
}();
|
||||||
|
|
|
@ -1484,13 +1484,13 @@ void InnerWidget::mouseActionFinish(const QPoint &screenPos, Qt::MouseButton but
|
||||||
_mouseSelectType = TextSelectType::Letters;
|
_mouseSelectType = TextSelectType::Letters;
|
||||||
//_widget->noSelectingScroll(); // TODO
|
//_widget->noSelectingScroll(); // TODO
|
||||||
|
|
||||||
#if defined Q_OS_LINUX32 || defined Q_OS_LINUX64
|
#if defined Q_OS_UNIX && !defined Q_OS_MAC
|
||||||
if (_selectedItem && _selectedText.from != _selectedText.to) {
|
if (_selectedItem && _selectedText.from != _selectedText.to) {
|
||||||
TextUtilities::SetClipboardText(
|
TextUtilities::SetClipboardText(
|
||||||
_selectedItem->selectedText(_selectedText),
|
_selectedItem->selectedText(_selectedText),
|
||||||
QClipboard::Selection);
|
QClipboard::Selection);
|
||||||
}
|
}
|
||||||
#endif // Q_OS_LINUX32 || Q_OS_LINUX64
|
#endif // Q_OS_UNIX && !Q_OS_MAC
|
||||||
}
|
}
|
||||||
|
|
||||||
void InnerWidget::updateSelected() {
|
void InnerWidget::updateSelected() {
|
||||||
|
|
|
@ -1427,7 +1427,7 @@ void HistoryInner::mouseActionFinish(
|
||||||
_widget->noSelectingScroll();
|
_widget->noSelectingScroll();
|
||||||
_widget->updateTopBarSelection();
|
_widget->updateTopBarSelection();
|
||||||
|
|
||||||
#if defined Q_OS_LINUX32 || defined Q_OS_LINUX64
|
#if defined Q_OS_UNIX && !defined Q_OS_MAC
|
||||||
if (!_selected.empty() && _selected.cbegin()->second != FullSelection) {
|
if (!_selected.empty() && _selected.cbegin()->second != FullSelection) {
|
||||||
const auto [item, selection] = *_selected.cbegin();
|
const auto [item, selection] = *_selected.cbegin();
|
||||||
if (const auto view = item->mainView()) {
|
if (const auto view = item->mainView()) {
|
||||||
|
@ -1436,7 +1436,7 @@ void HistoryInner::mouseActionFinish(
|
||||||
QClipboard::Selection);
|
QClipboard::Selection);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif // Q_OS_LINUX32 || Q_OS_LINUX64
|
#endif // Q_OS_UNIX && !Q_OS_MAC
|
||||||
}
|
}
|
||||||
|
|
||||||
void HistoryInner::mouseReleaseEvent(QMouseEvent *e) {
|
void HistoryInner::mouseReleaseEvent(QMouseEvent *e) {
|
||||||
|
|
|
@ -2085,7 +2085,7 @@ void ListWidget::mouseActionFinish(
|
||||||
_mouseSelectType = TextSelectType::Letters;
|
_mouseSelectType = TextSelectType::Letters;
|
||||||
//_widget->noSelectingScroll(); // #TODO select scroll
|
//_widget->noSelectingScroll(); // #TODO select scroll
|
||||||
|
|
||||||
#if defined Q_OS_LINUX32 || defined Q_OS_LINUX64
|
#if defined Q_OS_UNIX && !defined Q_OS_MAC
|
||||||
if (_selectedTextItem
|
if (_selectedTextItem
|
||||||
&& _selectedTextRange.from != _selectedTextRange.to) {
|
&& _selectedTextRange.from != _selectedTextRange.to) {
|
||||||
if (const auto view = viewForItem(_selectedTextItem)) {
|
if (const auto view = viewForItem(_selectedTextItem)) {
|
||||||
|
@ -2094,7 +2094,7 @@ void ListWidget::mouseActionFinish(
|
||||||
QClipboard::Selection);
|
QClipboard::Selection);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif // Q_OS_LINUX32 || Q_OS_LINUX64
|
#endif // Q_OS_UNIX && !Q_OS_MAC
|
||||||
}
|
}
|
||||||
|
|
||||||
void ListWidget::mouseActionUpdate() {
|
void ListWidget::mouseActionUpdate() {
|
||||||
|
|
|
@ -2107,11 +2107,11 @@ void ListWidget::mouseActionFinish(
|
||||||
//_widget->noSelectingScroll(); // #TODO scroll by drag
|
//_widget->noSelectingScroll(); // #TODO scroll by drag
|
||||||
//_widget->updateTopBarSelection();
|
//_widget->updateTopBarSelection();
|
||||||
|
|
||||||
#if defined Q_OS_LINUX32 || defined Q_OS_LINUX64
|
#if defined Q_OS_UNIX && !defined Q_OS_MAC
|
||||||
//if (hasSelectedText()) { // #TODO linux clipboard
|
//if (hasSelectedText()) { // #TODO linux clipboard
|
||||||
// TextUtilities::SetClipboardText(_selected.cbegin()->first->selectedText(_selected.cbegin()->second), QClipboard::Selection);
|
// TextUtilities::SetClipboardText(_selected.cbegin()->first->selectedText(_selected.cbegin()->second), QClipboard::Selection);
|
||||||
//}
|
//}
|
||||||
#endif // Q_OS_LINUX32 || Q_OS_LINUX64
|
#endif // Q_OS_UNIX && !Q_OS_MAC
|
||||||
}
|
}
|
||||||
|
|
||||||
void ListWidget::applyDragSelection() {
|
void ListWidget::applyDragSelection() {
|
||||||
|
|
|
@ -343,7 +343,7 @@ void start(not_null<Core::Launcher*> launcher) {
|
||||||
workingDirChosen = true;
|
workingDirChosen = true;
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
#if defined Q_OS_MAC || defined Q_OS_LINUX
|
#ifdef Q_OS_UNIX
|
||||||
|
|
||||||
if (!cWorkingDir().isEmpty()) {
|
if (!cWorkingDir().isEmpty()) {
|
||||||
// This value must come from TelegramForcePortable
|
// This value must come from TelegramForcePortable
|
||||||
|
@ -358,16 +358,16 @@ void start(not_null<Core::Launcher*> launcher) {
|
||||||
}
|
}
|
||||||
workingDirChosen = true;
|
workingDirChosen = true;
|
||||||
|
|
||||||
#if defined Q_OS_LINUX && !defined _DEBUG // fix first version
|
#if !defined Q_OS_MAC && !defined _DEBUG // fix first version
|
||||||
moveOldDataFrom = initialWorkingDir;
|
moveOldDataFrom = initialWorkingDir;
|
||||||
#endif // Q_OS_LINUX && !_DEBUG
|
#endif // !Q_OS_MAC && !_DEBUG
|
||||||
|
|
||||||
#elif defined Q_OS_WINRT // Q_OS_MAC || Q_OS_LINUX
|
#elif defined Q_OS_WINRT // Q_OS_UNIX
|
||||||
|
|
||||||
cForceWorkingDir(psAppDataPath());
|
cForceWorkingDir(psAppDataPath());
|
||||||
workingDirChosen = true;
|
workingDirChosen = true;
|
||||||
|
|
||||||
#elif defined OS_WIN_STORE // Q_OS_MAC || Q_OS_LINUX || Q_OS_WINRT
|
#elif defined OS_WIN_STORE // Q_OS_UNIX || Q_OS_WINRT
|
||||||
|
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
cForceWorkingDir(cExeDir());
|
cForceWorkingDir(cExeDir());
|
||||||
|
@ -385,7 +385,7 @@ void start(not_null<Core::Launcher*> launcher) {
|
||||||
workingDirChosen = true;
|
workingDirChosen = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // Q_OS_MAC || Q_OS_LINUX || Q_OS_WINRT || OS_WIN_STORE
|
#endif // Q_OS_UNIX || Q_OS_WINRT || OS_WIN_STORE
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -561,7 +561,7 @@ void writeDebug(const char *file, int32 line, const QString &v) {
|
||||||
//OutputDebugString(reinterpret_cast<const wchar_t *>(msg.utf16()));
|
//OutputDebugString(reinterpret_cast<const wchar_t *>(msg.utf16()));
|
||||||
#elif defined Q_OS_MAC
|
#elif defined Q_OS_MAC
|
||||||
//objc_outputDebugString(msg);
|
//objc_outputDebugString(msg);
|
||||||
#elif defined Q_OS_LINUX && defined _DEBUG
|
#elif defined Q_OS_UNIX && defined _DEBUG
|
||||||
//std::cout << msg.toUtf8().constData();
|
//std::cout << msg.toUtf8().constData();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
|
@ -353,11 +353,11 @@ OverlayWidget::OverlayWidget()
|
||||||
}
|
}
|
||||||
}, lifetime());
|
}, lifetime());
|
||||||
|
|
||||||
#ifdef Q_OS_LINUX
|
#if defined Q_OS_UNIX && !defined Q_OS_MAC
|
||||||
setWindowFlags(Qt::FramelessWindowHint | Qt::MaximizeUsingFullscreenGeometryHint);
|
setWindowFlags(Qt::FramelessWindowHint | Qt::MaximizeUsingFullscreenGeometryHint);
|
||||||
#else // Q_OS_LINUX
|
#else // Q_OS_UNIX && !Q_OS_MAC
|
||||||
setWindowFlags(Qt::FramelessWindowHint);
|
setWindowFlags(Qt::FramelessWindowHint);
|
||||||
#endif // Q_OS_LINUX
|
#endif // Q_OS_UNIX && !Q_OS_MAC
|
||||||
moveToScreen();
|
moveToScreen();
|
||||||
setAttribute(Qt::WA_NoSystemBackground, true);
|
setAttribute(Qt::WA_NoSystemBackground, true);
|
||||||
setAttribute(Qt::WA_TranslucentBackground, true);
|
setAttribute(Qt::WA_TranslucentBackground, true);
|
||||||
|
@ -2141,11 +2141,11 @@ void OverlayWidget::displayFinished() {
|
||||||
updateControls();
|
updateControls();
|
||||||
if (isHidden()) {
|
if (isHidden()) {
|
||||||
Ui::Platform::UpdateOverlayed(this);
|
Ui::Platform::UpdateOverlayed(this);
|
||||||
#ifdef Q_OS_LINUX
|
#if defined Q_OS_UNIX && !defined Q_OS_MAC
|
||||||
showFullScreen();
|
showFullScreen();
|
||||||
#else // Q_OS_LINUX
|
#else // Q_OS_UNIX && !Q_OS_MAC
|
||||||
show();
|
show();
|
||||||
#endif // Q_OS_LINUX
|
#endif // Q_OS_UNIX && !Q_OS_MAC
|
||||||
Ui::Platform::ShowOverAll(this);
|
Ui::Platform::ShowOverAll(this);
|
||||||
activateWindow();
|
activateWindow();
|
||||||
QApplication::setActiveWindow(this);
|
QApplication::setActiveWindow(this);
|
||||||
|
|
|
@ -19,7 +19,9 @@ void DeInit();
|
||||||
|
|
||||||
// Platform dependent implementations.
|
// Platform dependent implementations.
|
||||||
|
|
||||||
#if defined Q_OS_MAC || defined Q_OS_LINUX
|
#if defined Q_OS_WINRT || defined Q_OS_WIN
|
||||||
|
#include "platform/win/audio_win.h"
|
||||||
|
#else // Q_OS_WINRT || Q_OS_WIN
|
||||||
namespace Platform {
|
namespace Platform {
|
||||||
namespace Audio {
|
namespace Audio {
|
||||||
|
|
||||||
|
@ -31,6 +33,4 @@ inline void DeInit() {
|
||||||
|
|
||||||
} // namespace Audio
|
} // namespace Audio
|
||||||
} // namespace Platform
|
} // namespace Platform
|
||||||
#elif defined Q_OS_WINRT || defined Q_OS_WIN // Q_OS_MAC || Q_OS_LINUX
|
#endif // Q_OS_WINRT || Q_OS_WIN
|
||||||
#include "platform/win/audio_win.h"
|
|
||||||
#endif // Q_OS_MAC || Q_OS_LINUX || Q_OS_WINRT || Q_OS_WIN
|
|
||||||
|
|
|
@ -46,8 +46,8 @@ bool Get(
|
||||||
|
|
||||||
#ifdef Q_OS_MAC
|
#ifdef Q_OS_MAC
|
||||||
#include "platform/mac/file_utilities_mac.h"
|
#include "platform/mac/file_utilities_mac.h"
|
||||||
#elif defined Q_OS_LINUX // Q_OS_MAC
|
#elif defined Q_OS_UNIX // Q_OS_MAC
|
||||||
#include "platform/linux/file_utilities_linux.h"
|
#include "platform/linux/file_utilities_linux.h"
|
||||||
#elif defined Q_OS_WINRT || defined Q_OS_WIN // Q_OS_MAC || Q_OS_LINUX
|
#elif defined Q_OS_WINRT || defined Q_OS_WIN // Q_OS_MAC || Q_OS_UNIX
|
||||||
#include "platform/win/file_utilities_win.h"
|
#include "platform/win/file_utilities_win.h"
|
||||||
#endif // Q_OS_MAC || Q_OS_LINUX || Q_OS_WINRT || Q_OS_WIN
|
#endif // Q_OS_MAC || Q_OS_UNIX || Q_OS_WINRT || Q_OS_WIN
|
||||||
|
|
|
@ -23,8 +23,8 @@ namespace Platform {
|
||||||
|
|
||||||
#ifdef Q_OS_MAC
|
#ifdef Q_OS_MAC
|
||||||
#include "platform/mac/launcher_mac.h"
|
#include "platform/mac/launcher_mac.h"
|
||||||
#elif defined Q_OS_LINUX // Q_OS_MAC
|
#elif defined Q_OS_UNIX // Q_OS_MAC
|
||||||
#include "platform/linux/launcher_linux.h"
|
#include "platform/linux/launcher_linux.h"
|
||||||
#elif defined Q_OS_WINRT || defined Q_OS_WIN // Q_OS_MAC || Q_OS_LINUX
|
#elif defined Q_OS_WINRT || defined Q_OS_WIN // Q_OS_MAC || Q_OS_UNIX
|
||||||
#include "platform/win/launcher_win.h"
|
#include "platform/win/launcher_win.h"
|
||||||
#endif // Q_OS_MAC || Q_OS_LINUX || Q_OS_WINRT || Q_OS_WIN
|
#endif // Q_OS_MAC || Q_OS_UNIX || Q_OS_WINRT || Q_OS_WIN
|
||||||
|
|
|
@ -19,8 +19,8 @@ class MainWindow;
|
||||||
|
|
||||||
#ifdef Q_OS_MAC
|
#ifdef Q_OS_MAC
|
||||||
#include "platform/mac/main_window_mac.h"
|
#include "platform/mac/main_window_mac.h"
|
||||||
#elif defined Q_OS_LINUX // Q_OS_MAC
|
#elif defined Q_OS_UNIX // Q_OS_MAC
|
||||||
#include "platform/linux/main_window_linux.h"
|
#include "platform/linux/main_window_linux.h"
|
||||||
#elif defined Q_OS_WIN // Q_OS_MAC || Q_OS_LINUX
|
#elif defined Q_OS_WIN // Q_OS_MAC || Q_OS_UNIX
|
||||||
#include "platform/win/main_window_win.h"
|
#include "platform/win/main_window_win.h"
|
||||||
#endif // Q_OS_MAC || Q_OS_LINUX || Q_OS_WIN
|
#endif // Q_OS_MAC || Q_OS_UNIX || Q_OS_WIN
|
||||||
|
|
|
@ -27,8 +27,8 @@ namespace Notifications {
|
||||||
|
|
||||||
#ifdef Q_OS_MAC
|
#ifdef Q_OS_MAC
|
||||||
#include "platform/mac/notifications_manager_mac.h"
|
#include "platform/mac/notifications_manager_mac.h"
|
||||||
#elif defined Q_OS_LINUX // Q_OS_MAC
|
#elif defined Q_OS_UNIX // Q_OS_MAC
|
||||||
#include "platform/linux/notifications_manager_linux.h"
|
#include "platform/linux/notifications_manager_linux.h"
|
||||||
#elif defined Q_OS_WIN // Q_OS_MAC || Q_OS_LINUX
|
#elif defined Q_OS_WIN // Q_OS_MAC || Q_OS_UNIX
|
||||||
#include "platform/win/notifications_manager_win.h"
|
#include "platform/win/notifications_manager_win.h"
|
||||||
#endif // Q_OS_MAC || Q_OS_LINUX || Q_OS_WIN
|
#endif // Q_OS_MAC || Q_OS_UNIX || Q_OS_WIN
|
||||||
|
|
|
@ -52,8 +52,8 @@ void finish();
|
||||||
|
|
||||||
#ifdef Q_OS_MAC
|
#ifdef Q_OS_MAC
|
||||||
#include "platform/mac/specific_mac.h"
|
#include "platform/mac/specific_mac.h"
|
||||||
#elif defined Q_OS_LINUX // Q_OS_MAC
|
#elif defined Q_OS_UNIX // Q_OS_MAC
|
||||||
#include "platform/linux/specific_linux.h"
|
#include "platform/linux/specific_linux.h"
|
||||||
#elif defined Q_OS_WIN // Q_OS_MAC || Q_OS_LINUX
|
#elif defined Q_OS_WIN // Q_OS_MAC || Q_OS_UNIX
|
||||||
#include "platform/win/specific_win.h"
|
#include "platform/win/specific_win.h"
|
||||||
#endif // Q_OS_MAC || Q_OS_LINUX || Q_OS_WIN
|
#endif // Q_OS_MAC || Q_OS_UNIX || Q_OS_WIN
|
||||||
|
|
|
@ -26,7 +26,7 @@ void PreviewWindowFramePaint(QImage &preview, const style::palette &palette, QRe
|
||||||
#include "platform/mac/window_title_mac.h"
|
#include "platform/mac/window_title_mac.h"
|
||||||
#elif defined Q_OS_WIN // Q_OS_MAC
|
#elif defined Q_OS_WIN // Q_OS_MAC
|
||||||
#include "platform/win/window_title_win.h"
|
#include "platform/win/window_title_win.h"
|
||||||
#elif defined Q_OS_WINRT || defined Q_OS_LINUX // Q_OS_MAC || Q_OS_WIN
|
#elif defined Q_OS_WINRT || defined Q_OS_UNIX // Q_OS_MAC || Q_OS_WIN
|
||||||
|
|
||||||
namespace Platform {
|
namespace Platform {
|
||||||
|
|
||||||
|
@ -44,4 +44,4 @@ inline void PreviewWindowFramePaint(QImage &preview, const style::palette &palet
|
||||||
|
|
||||||
} // namespace Platform
|
} // namespace Platform
|
||||||
|
|
||||||
#endif // Q_OS_MAC || Q_OS_WIN || Q_OS_WINRT || Q_OS_LINUX
|
#endif // Q_OS_MAC || Q_OS_WIN || Q_OS_WINRT || Q_OS_UNIX
|
||||||
|
|
|
@ -20,7 +20,7 @@ Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin)
|
||||||
#elif defined Q_OS_MAC // Q_OS_WIN
|
#elif defined Q_OS_MAC // Q_OS_WIN
|
||||||
Q_IMPORT_PLUGIN(QCocoaIntegrationPlugin)
|
Q_IMPORT_PLUGIN(QCocoaIntegrationPlugin)
|
||||||
Q_IMPORT_PLUGIN(QGenericEnginePlugin)
|
Q_IMPORT_PLUGIN(QGenericEnginePlugin)
|
||||||
#elif defined Q_OS_LINUX // Q_OS_WIN | Q_OS_MAC
|
#elif defined Q_OS_UNIX // Q_OS_WIN | Q_OS_MAC
|
||||||
Q_IMPORT_PLUGIN(ShmServerBufferPlugin)
|
Q_IMPORT_PLUGIN(ShmServerBufferPlugin)
|
||||||
Q_IMPORT_PLUGIN(DmaBufServerBufferPlugin)
|
Q_IMPORT_PLUGIN(DmaBufServerBufferPlugin)
|
||||||
Q_IMPORT_PLUGIN(DrmEglServerBufferPlugin)
|
Q_IMPORT_PLUGIN(DrmEglServerBufferPlugin)
|
||||||
|
@ -44,10 +44,10 @@ Q_IMPORT_PLUGIN(QNetworkManagerEnginePlugin)
|
||||||
Q_IMPORT_PLUGIN(QIbusPlatformInputContextPlugin)
|
Q_IMPORT_PLUGIN(QIbusPlatformInputContextPlugin)
|
||||||
Q_IMPORT_PLUGIN(QXdgDesktopPortalThemePlugin)
|
Q_IMPORT_PLUGIN(QXdgDesktopPortalThemePlugin)
|
||||||
#endif // !TDESKTOP_DISABLE_DBUS_INTEGRATION
|
#endif // !TDESKTOP_DISABLE_DBUS_INTEGRATION
|
||||||
#endif // Q_OS_WIN | Q_OS_MAC | Q_OS_LINUX
|
#endif // Q_OS_WIN | Q_OS_MAC | Q_OS_UNIX
|
||||||
#endif // !DESKTOP_APP_USE_PACKAGED
|
#endif // !DESKTOP_APP_USE_PACKAGED
|
||||||
|
|
||||||
#ifdef Q_OS_LINUX
|
#if defined Q_OS_UNIX && !defined Q_OS_MAC
|
||||||
#if !defined DESKTOP_APP_USE_PACKAGED || defined DESKTOP_APP_USE_PACKAGED_LAZY
|
#if !defined DESKTOP_APP_USE_PACKAGED || defined DESKTOP_APP_USE_PACKAGED_LAZY
|
||||||
Q_IMPORT_PLUGIN(QWaylandMaterialDecorationPlugin)
|
Q_IMPORT_PLUGIN(QWaylandMaterialDecorationPlugin)
|
||||||
Q_IMPORT_PLUGIN(NimfInputContextPlugin)
|
Q_IMPORT_PLUGIN(NimfInputContextPlugin)
|
||||||
|
@ -69,4 +69,4 @@ Q_IMPORT_PLUGIN(Qt5CTStylePlugin)
|
||||||
Q_IMPORT_PLUGIN(LXQtPlatformThemePlugin)
|
Q_IMPORT_PLUGIN(LXQtPlatformThemePlugin)
|
||||||
#endif // !TDESKTOP_DISABLE_DBUS_INTEGRATION
|
#endif // !TDESKTOP_DISABLE_DBUS_INTEGRATION
|
||||||
#endif // DESKTOP_APP_USE_PACKAGED_LAZY_PLATFORMTHEMES
|
#endif // DESKTOP_APP_USE_PACKAGED_LAZY_PLATFORMTHEMES
|
||||||
#endif // Q_OS_LINUX
|
#endif // Q_OS_UNIX && !Q_OS_MAC
|
||||||
|
|
|
@ -499,11 +499,11 @@ void NotificationsCount::SampleWidget::destroyDelayed() {
|
||||||
_deleted = true;
|
_deleted = true;
|
||||||
|
|
||||||
// Ubuntu has a lag if deleteLater() called immediately.
|
// Ubuntu has a lag if deleteLater() called immediately.
|
||||||
#if defined Q_OS_LINUX32 || defined Q_OS_LINUX64
|
#if defined Q_OS_UNIX && !defined Q_OS_MAC
|
||||||
QTimer::singleShot(1000, [this] { delete this; });
|
QTimer::singleShot(1000, [this] { delete this; });
|
||||||
#else // Q_OS_LINUX32 || Q_OS_LINUX64
|
#else // Q_OS_UNIX && !Q_OS_MAC
|
||||||
deleteLater();
|
deleteLater();
|
||||||
#endif // Q_OS_LINUX32 || Q_OS_LINUX64
|
#endif // Q_OS_UNIX && !Q_OS_MAC
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetupAdvancedNotifications(
|
void SetupAdvancedNotifications(
|
||||||
|
|
|
@ -79,9 +79,9 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#endif // OS_MAC_OLD
|
#endif // OS_MAC_OLD
|
||||||
|
|
||||||
// Fix Google Breakpad build for Mac App Store and Linux version
|
// Fix Google Breakpad build for Mac App Store and Linux version
|
||||||
#if defined Q_OS_MAC || defined Q_OS_LINUX
|
#ifdef Q_OS_UNIX
|
||||||
#define __STDC_FORMAT_MACROS
|
#define __STDC_FORMAT_MACROS
|
||||||
#endif // Q_OS_MAC || Q_OS_LINUX
|
#endif // Q_OS_UNIX
|
||||||
|
|
||||||
#include <array>
|
#include <array>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
|
@ -117,7 +117,7 @@ QIcon CreateOfficialIcon(Main::Account *account) {
|
||||||
|
|
||||||
QIcon CreateIcon(Main::Account *account) {
|
QIcon CreateIcon(Main::Account *account) {
|
||||||
auto result = CreateOfficialIcon(account);
|
auto result = CreateOfficialIcon(account);
|
||||||
#ifdef Q_OS_LINUX
|
#if defined Q_OS_UNIX && !defined Q_OS_MAC
|
||||||
return QIcon::fromTheme(Platform::GetIconName(), result);
|
return QIcon::fromTheme(Platform::GetIconName(), result);
|
||||||
#endif
|
#endif
|
||||||
return result;
|
return result;
|
||||||
|
@ -603,7 +603,7 @@ bool MainWindow::minimizeToTray() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::reActivateWindow() {
|
void MainWindow::reActivateWindow() {
|
||||||
#if defined Q_OS_LINUX32 || defined Q_OS_LINUX64
|
#if defined Q_OS_UNIX && !defined Q_OS_MAC
|
||||||
const auto reActivate = [=] {
|
const auto reActivate = [=] {
|
||||||
if (const auto w = App::wnd()) {
|
if (const auto w = App::wnd()) {
|
||||||
if (auto f = QApplication::focusWidget()) {
|
if (auto f = QApplication::focusWidget()) {
|
||||||
|
@ -618,7 +618,7 @@ void MainWindow::reActivateWindow() {
|
||||||
};
|
};
|
||||||
crl::on_main(this, reActivate);
|
crl::on_main(this, reActivate);
|
||||||
base::call_delayed(200, this, reActivate);
|
base::call_delayed(200, this, reActivate);
|
||||||
#endif // Q_OS_LINUX32 || Q_OS_LINUX64
|
#endif // Q_OS_UNIX && !Q_OS_MAC
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::showRightColumn(object_ptr<TWidget> widget) {
|
void MainWindow::showRightColumn(object_ptr<TWidget> widget) {
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 486003d41751c1c775513598c8a4154cd294a136
|
Subproject commit 18868e1634d4f12727af93da1500108fc689981c
|
|
@ -1 +1 @@
|
||||||
Subproject commit 48865e514979b4e2610fe6ca22bbb145bcfab4ea
|
Subproject commit 1357837771a8b237c8a6ce90060f5a4f0fd5e339
|
|
@ -1 +1 @@
|
||||||
Subproject commit 5d2cb6bda4d24887a336caacf835b9143319f4eb
|
Subproject commit 538a72e5d3aedb660d3a399cc883067ada16e9cf
|
2
cmake
2
cmake
|
@ -1 +1 @@
|
||||||
Subproject commit eb97b772a330ee370ea37c753a54c6862ca96644
|
Subproject commit 03bde956c59b5344177f9ec9780058a9ba7304c8
|
Loading…
Reference in a new issue