Fix build on Linux.

This commit is contained in:
John Preston 2020-05-18 18:24:20 +04:00
parent 71040464c5
commit b703f4e555
5 changed files with 46 additions and 32 deletions

View file

@ -102,17 +102,17 @@ endif()
target_link_libraries(Telegram
PRIVATE
tdesktop::lib_tgvoip
tdesktop::lib_mtproto
tdesktop::lib_scheme
tdesktop::lib_export
tdesktop::lib_tgvoip
desktop-app::lib_webrtc
desktop-app::lib_base
desktop-app::lib_crl
desktop-app::lib_ui
desktop-app::lib_tl
desktop-app::lib_storage
desktop-app::lib_lottie
desktop-app::lib_webrtc
desktop-app::lib_qr
desktop-app::lib_ffmpeg
desktop-app::external_lz4
@ -1226,6 +1226,18 @@ elseif (APPLE)
)
endif()
endif()
elseif (LINUX)
if (NOT TDESKTOP_DISABLE_GTK_INTEGRATION)
find_package(PkgConfig REQUIRED)
pkg_search_module(GTK REQUIRED gtk+-2.0 gtk+-3.0)
target_include_directories(Telegram PRIVATE ${GTK_INCLUDE_DIRS})
if (DESKTOP_APP_USE_PACKAGED)
find_library(X11_LIBRARY X11)
target_link_libraries(Telegram PRIVATE ${X11_LIBRARY})
endif()
endif()
endif()
if (build_macstore)

View file

@ -66,6 +66,7 @@ public:
void sendPaths();
QImage iconWithCounter(int size, int count, style::color bg, style::color fg, bool smallIcon) override;
void placeSmallCounter(QImage &img, int size, int count, style::color bg, const QPoint &shift, style::color color) override;
bool contentOverlapped(const QRect &globalRect);
bool contentOverlapped(QWidget *w, QPaintEvent *e) {
@ -139,7 +140,6 @@ private:
QPixmap grabInner();
void placeSmallCounter(QImage &img, int size, int count, style::color bg, const QPoint &shift, style::color color) override;
QImage icon16, icon32, icon64, iconbig16, iconbig32, iconbig64;
crl::time _lastTrayClickTime = 0;

View file

@ -197,9 +197,12 @@ QIcon TrayIconGen(int counter, bool muted) {
if (!qEnvironmentVariableIsSet(kDisableTrayCounter.utf8())
&& counter > 0) {
QPainter p(&iconImage);
int32 layerSize = -16;
const auto &bg = muted
? st::trayCounterBgMute
: st::trayCounterBg;
const auto &fg = st::trayCounterFg;
if (iconSize >= 22) {
auto layerSize = -16;
if (iconSize >= 48) {
layerSize = -32;
} else if (iconSize >= 36) {
@ -207,24 +210,21 @@ QIcon TrayIconGen(int counter, bool muted) {
} else if (iconSize >= 32) {
layerSize = -20;
}
auto &bg = muted
? st::trayCounterBgMute
: st::trayCounterBg;
auto &fg = st::trayCounterFg;
auto layer = App::wnd()->iconWithCounter(
const auto layer = App::wnd()->iconWithCounter(
layerSize,
counter,
bg,
fg,
false);
QPainter p(&iconImage);
p.drawImage(
iconImage.width() - layer.width() - 1,
iconImage.height() - layer.height() - 1,
layer);
} else {
App::wnd()->placeSmallCounter(iconImage, 16, counter, bg, QPoint(), fg);
}
}
result.addPixmap(App::pixmapFromImageInPlace(

View file

@ -176,9 +176,8 @@ else()
target_link_libraries(lib_tgvoip
PRIVATE
desktop-app::external_openssl
desktop-app::external_opus
desktop-app::external_webrtc
desktop-app::external_opus
)
if (LINUX)

View file

@ -68,14 +68,14 @@ Go to ***BuildPath*** and run
git clone https://github.com/01org/libva.git
cd libva
./autogen.sh --enable-static
CFLAGS=-fPIC CPPFLAGS=-fPIC LDFLAGS=-fPIC ./autogen.sh --enable-static
make $MAKE_THREADS_CNT
sudo make install
cd ..
git clone https://gitlab.freedesktop.org/vdpau/libvdpau.git --depth=1 -b libvdpau-1.2
cd libvdpau
./autogen.sh --enable-static
CFLAGS=-fPIC CPPFLAGS=-fPIC LDFLAGS=-fPIC ./autogen.sh --enable-static
make $MAKE_THREADS_CNT
sudo make install
cd ..
@ -85,6 +85,9 @@ Go to ***BuildPath*** and run
git checkout release/3.4
./configure \
--extra-cflags="-fPIC" \
--extra-cxxflags="-fPIC" \
--extra-ldflags="-fPIC" \
--disable-programs \
--disable-doc \
--disable-network \