diff --git a/.travis/build.sh b/.travis/build.sh
index 99ca6d464..6e0a0ae0d 100755
--- a/.travis/build.sh
+++ b/.travis/build.sh
@@ -108,7 +108,7 @@ build() {
 	cd "$srcdir/Libraries/qt${_qtver}"
 	./configure -prefix "$srcdir/qt" -release -opensource -confirm-license -qt-zlib \
 	            -qt-libpng -qt-libjpeg -qt-freetype -qt-harfbuzz -qt-pcre -qt-xcb \
-	            -qt-xkbcommon-x11 -no-opengl -static -nomake examples -nomake tests
+	            -qt-xkbcommon-x11 -no-opengl -no-gtkstyle -static -nomake examples -nomake tests
 	make --silent -j4
 	make --silent -j4 install
 
diff --git a/Telegram/Resources/basic.style b/Telegram/Resources/basic.style
index 36cd767e9..502bed5d8 100644
--- a/Telegram/Resources/basic.style
+++ b/Telegram/Resources/basic.style
@@ -123,6 +123,7 @@ defaultBoxButton: RoundButton {
 	padding: margins(0px, 0px, 0px, 0px);
 
 	textTop: 8px;
+	downTextTop: 9px;
 
 	font: boxButtonFont;
 	duration: 200;
@@ -284,9 +285,9 @@ solidScroll: flatScroll {
 	barOverColor: #3f729734;
 	bgOverColor: #214f751a;
 
-	round: 0px;
 	minHeight: 20px;
 
+	round: 2px;
 	deltax: 5px;
 	width: 14px;
 	deltat: 6px;
@@ -345,6 +346,7 @@ defaultTooltip: Tooltip {
 
 almostTransparent: #ffffff0d;
 boxScroll: flatScroll(solidScroll) {
+	round: 3px;
 	width: 18px;
 	deltax: 6px;
 }
@@ -647,7 +649,7 @@ scrollDef: flatScroll {
 	barOverColor: rgba(0, 0, 0, 122);
 	bgOverColor: rgba(0, 0, 0, 44);
 
-	round: 0px;
+	round: 2px;
 
 	width: 10px;
 	minHeight: 20px;
@@ -663,7 +665,9 @@ scrollDef: flatScroll {
 	hiding: 1000;
 }
 
-msgRadius: 3px;
+msgRadius: 16px;
+serviceMsgRadius: 10px;
+buttonRadius: 3px;
 
 scrollCountries: flatScroll(scrollDef) {
 	topsh: 0px;
@@ -732,7 +736,7 @@ btnIntroNext: flatButton(btnDefNext, btnDefBig) {
 	overFont: font(17px);
 
 	width: 300px;
-	radius: msgRadius;
+	radius: buttonRadius;
 }
 
 boxShadow: sprite(363px, 50px, 15px, 15px);
@@ -999,6 +1003,7 @@ topBarButton: RoundButton {
 	padding: margins(0px, 14px, 12px, 12px);
 
 	textTop: 6px;
+	downTextTop: 7px;
 
 	font: font(fsize);
 	duration: 200;
@@ -1009,7 +1014,7 @@ defaultActiveButton: RoundButton {
 	secondaryTextFg: #cceeff;
 	secondaryTextFgOver: #cceeff;
 	textBg: windowActiveBg;
-	textBgOver: windowActiveBg;
+	textBgOver: #46b4eb;
 
 	secondarySkip: 7px;
 
@@ -1018,6 +1023,7 @@ defaultActiveButton: RoundButton {
 	padding: margins(0px, 0px, 0px, 0px);
 
 	textTop: 8px;
+	downTextTop: 9px;
 
 	font: semiboldFont;
 	duration: 200;
@@ -1486,7 +1492,7 @@ historyScroll: flatScroll(scrollDef) {
 	barOverColor: #89a0b4bc;
 	bgOverColor: #89a0b46b;
 
-	round: 0px;
+	round: 3px;
 
 	width: 12px;
 	deltax: 3px;
@@ -1829,6 +1835,7 @@ stickersMaxHeight: 440px;
 stickersPadding: margins(19px, 17px, 19px, 17px);
 stickersSize: size(64px, 64px);
 stickersScroll: flatScroll(boxScroll) {
+	round: 2px;
 	deltax: 7px;
 	deltat: 23px;
 	deltab: 9px;
@@ -2016,6 +2023,7 @@ switchPmButton: RoundButton(defaultBoxButton) {
 	width: 320px;
 	height: 34px;
 	textTop: 7px;
+	downTextTop: 8px;
 }
 
 minPhotoSize: 100px;
@@ -2205,6 +2213,7 @@ langsButton: Radiobutton(defaultRadiobutton) {
 backgroundPadding: 10px;
 backgroundSize: size(108px, 193px);
 backgroundScroll: flatScroll(boxScroll) {
+	round: 2px;
 	width: 10px;
 	deltax: 3px;
 	deltat: 10px;
@@ -2243,6 +2252,7 @@ mentionFgActive: #0080c0;
 mentionFgOverActive: #0077b3;
 
 sessionsScroll: flatScroll(boxScroll) {
+	round: 2px;
 	deltax: 5px;
 	width: 14px;
 }
diff --git a/Telegram/Resources/basic_types.style b/Telegram/Resources/basic_types.style
index ca5392b13..dbcba52d6 100644
--- a/Telegram/Resources/basic_types.style
+++ b/Telegram/Resources/basic_types.style
@@ -326,6 +326,7 @@ RoundButton {
 	padding: margins;
 
 	textTop: pixels;
+	downTextTop: pixels;
 
 	icon: icon;
 
diff --git a/Telegram/SourceFiles/app.cpp b/Telegram/SourceFiles/app.cpp
index 256421f30..707a37b51 100644
--- a/Telegram/SourceFiles/app.cpp
+++ b/Telegram/SourceFiles/app.cpp
@@ -103,7 +103,7 @@ namespace {
 	CornersPixmaps corners[RoundCornersCount];
 	typedef QMap<uint32, CornersPixmaps> CornersMap;
 	CornersMap cornersMap;
-	QImage *cornersMask[4] = { 0 };
+	QImage *cornersMaskLarge[4] = { 0 }, *cornersMaskSmall[4] = { 0 };
 
 	typedef QMap<uint64, QPixmap> EmojiMap;
 	EmojiMap mainEmojiMap;
@@ -2062,7 +2062,7 @@ namespace {
 		cors[1] = rect.copy(r * 2, 0, r, r);
 		cors[2] = rect.copy(0, r * 2, r, r + (shadow ? s : 0));
 		cors[3] = rect.copy(r * 2, r * 2, r, r + (shadow ? s : 0));
-		if (index != NoneCorners) {
+		if (index != SmallMaskCorners && index != LargeMaskCorners) {
 			for (int i = 0; i < 4; ++i) {
 				::corners[index].p[i] = new QPixmap(QPixmap::fromImage(cors[i], Qt::ColorOnly));
 				::corners[index].p[i]->setDevicePixelRatio(cRetinaFactor());
@@ -2101,33 +2101,38 @@ namespace {
 		}
 
 		QImage mask[4];
-		prepareCorners(NoneCorners, st::msgRadius, st::white, 0, mask);
+		prepareCorners(LargeMaskCorners, st::msgRadius, st::white, 0, mask);
 		for (int i = 0; i < 4; ++i) {
-			::cornersMask[i] = new QImage(mask[i].convertToFormat(QImage::Format_ARGB32_Premultiplied));
-			::cornersMask[i]->setDevicePixelRatio(cRetinaFactor());
+			::cornersMaskLarge[i] = new QImage(mask[i].convertToFormat(QImage::Format_ARGB32_Premultiplied));
+			::cornersMaskLarge[i]->setDevicePixelRatio(cRetinaFactor());
 		}
-		prepareCorners(BlackCorners, st::msgRadius, st::black);
-		prepareCorners(WhiteCorners, st::msgRadius, st::white);
-		prepareCorners(ServiceCorners, st::msgRadius, st::msgServiceBg);
-		prepareCorners(ServiceSelectedCorners, st::msgRadius, st::msgServiceSelectBg);
-		prepareCorners(SelectedOverlayCorners, st::msgRadius, st::msgSelectOverlay);
-		prepareCorners(DateCorners, st::msgRadius, st::msgDateImgBg);
-		prepareCorners(DateSelectedCorners, st::msgRadius, st::msgDateImgBgSelected);
+		prepareCorners(SmallMaskCorners, st::buttonRadius, st::white, 0, mask);
+		for (int i = 0; i < 4; ++i) {
+			::cornersMaskSmall[i] = new QImage(mask[i].convertToFormat(QImage::Format_ARGB32_Premultiplied));
+			::cornersMaskSmall[i]->setDevicePixelRatio(cRetinaFactor());
+		}
+		prepareCorners(WhiteCorners, st::buttonRadius, st::white);
+		prepareCorners(ServiceCorners, st::serviceMsgRadius, st::msgServiceBg);
+		prepareCorners(ServiceSelectedCorners, st::serviceMsgRadius, st::msgServiceSelectBg);
+		prepareCorners(SelectedOverlaySmallCorners, st::buttonRadius, st::msgSelectOverlay);
+		prepareCorners(SelectedOverlayLargeCorners, st::msgRadius, st::msgSelectOverlay);
+		prepareCorners(DateCorners, st::serviceMsgRadius, st::msgDateImgBg);
+		prepareCorners(DateSelectedCorners, st::serviceMsgRadius, st::msgDateImgBgSelected);
 		prepareCorners(InShadowCorners, st::msgRadius, st::msgInShadow);
 		prepareCorners(InSelectedShadowCorners, st::msgRadius, st::msgInShadowSelected);
 		prepareCorners(ForwardCorners, st::msgRadius, st::forwardBg);
 		prepareCorners(MediaviewSaveCorners, st::msgRadius, st::medviewSaveMsg);
-		prepareCorners(EmojiHoverCorners, st::msgRadius, st::emojiPanHover);
-		prepareCorners(StickerHoverCorners, st::msgRadius, st::emojiPanHover);
-		prepareCorners(BotKeyboardCorners, st::msgRadius, st::botKbBg);
-		prepareCorners(BotKeyboardOverCorners, st::msgRadius, st::botKbOverBg);
-		prepareCorners(BotKeyboardDownCorners, st::msgRadius, st::botKbDownBg);
-		prepareCorners(PhotoSelectOverlayCorners, st::msgRadius, st::overviewPhotoSelectOverlay);
+		prepareCorners(EmojiHoverCorners, st::buttonRadius, st::emojiPanHover);
+		prepareCorners(StickerHoverCorners, st::buttonRadius, st::emojiPanHover);
+		prepareCorners(BotKeyboardCorners, st::buttonRadius, st::botKbBg);
+		prepareCorners(BotKeyboardOverCorners, st::buttonRadius, st::botKbOverBg);
+		prepareCorners(BotKeyboardDownCorners, st::buttonRadius, st::botKbDownBg);
+		prepareCorners(PhotoSelectOverlayCorners, st::buttonRadius, st::overviewPhotoSelectOverlay);
 
-		prepareCorners(DocBlueCorners, st::msgRadius, st::msgFileBlueColor);
-		prepareCorners(DocGreenCorners, st::msgRadius, st::msgFileGreenColor);
-		prepareCorners(DocRedCorners, st::msgRadius, st::msgFileRedColor);
-		prepareCorners(DocYellowCorners, st::msgRadius, st::msgFileYellowColor);
+		prepareCorners(DocBlueCorners, st::buttonRadius, st::msgFileBlueColor);
+		prepareCorners(DocGreenCorners, st::buttonRadius, st::msgFileGreenColor);
+		prepareCorners(DocRedCorners, st::buttonRadius, st::msgFileRedColor);
+		prepareCorners(DocYellowCorners, st::buttonRadius, st::msgFileYellowColor);
 
 		prepareCorners(MessageInCorners, st::msgRadius, st::msgInBg, &st::msgInShadow);
 		prepareCorners(MessageInSelectedCorners, st::msgRadius, st::msgInBgSelected, &st::msgInShadowSelected);
@@ -2156,9 +2161,10 @@ namespace {
 		::emojiLarge = 0;
 		for (int32 j = 0; j < 4; ++j) {
 			for (int32 i = 0; i < RoundCornersCount; ++i) {
-				delete ::corners[i].p[j]; ::corners[i].p[j] = 0;
+				delete ::corners[i].p[j]; ::corners[i].p[j] = nullptr;
 			}
-			delete ::cornersMask[j]; ::cornersMask[j] = 0;
+			delete ::cornersMaskSmall[j]; ::cornersMaskSmall[j] = nullptr;
+			delete ::cornersMaskLarge[j]; ::cornersMaskLarge[j] = nullptr;
 		}
 		for (CornersMap::const_iterator i = ::cornersMap.cbegin(), e = ::cornersMap.cend(); i != e; ++i) {
 			for (int32 j = 0; j < 4; ++j) {
@@ -2552,8 +2558,13 @@ namespace {
 #endif
 	}
 
-	QImage **cornersMask() {
-		return ::cornersMask;
+	QImage **cornersMask(ImageRoundRadius radius) {
+		switch (radius) {
+		case ImageRoundRadius::Large: return ::cornersMaskLarge;
+		case ImageRoundRadius::Small:
+		default: break;
+		}
+		return ::cornersMaskSmall;
 	}
 	void roundRect(Painter &p, int32 x, int32 y, int32 w, int32 h, const style::color &bg, const CornersPixmaps &c, const style::color *sh) {
 		int32 cw = c.p[0]->width() / cIntRetinaFactor(), ch = c.p[0]->height() / cIntRetinaFactor();
@@ -2586,12 +2597,15 @@ namespace {
 		p.drawPixmap(x + w - cw, y + h - ch + st::msgShadow, *c.p[3]);
 	}
 
-	void roundRect(Painter &p, int32 x, int32 y, int32 w, int32 h, const style::color &bg) {
+	void roundRect(Painter &p, int32 x, int32 y, int32 w, int32 h, const style::color &bg, ImageRoundRadius radius) {
 		uint32 colorKey = ((uint32(bg->c.alpha()) & 0xFF) << 24) | ((uint32(bg->c.red()) & 0xFF) << 16) | ((uint32(bg->c.green()) & 0xFF) << 8) | ((uint32(bg->c.blue()) & 0xFF) << 24);
 		CornersMap::const_iterator i = cornersMap.find(colorKey);
 		if (i == cornersMap.cend()) {
 			QImage images[4];
-			prepareCorners(NoneCorners, st::msgRadius, bg, 0, images);
+			switch (radius) {
+			case ImageRoundRadius::Small: prepareCorners(SmallMaskCorners, st::buttonRadius, bg, 0, images); break;
+			case ImageRoundRadius::Large: prepareCorners(LargeMaskCorners, st::msgRadius, bg, 0, images); break;
+			}
 
 			CornersPixmaps pixmaps;
 			for (int j = 0; j < 4; ++j) {
@@ -2754,8 +2768,8 @@ namespace {
 		uchar bsel = snap(qRound(((1. - alphaSel) * b + addSel) / alphaSel), 0, 0xFF);
 		_msgServiceSelectBg = style::color(r, g, b, qRound(alphaSel * 0xFF));
 
-		prepareCorners(ServiceCorners, st::msgRadius, _msgServiceBg);
-		prepareCorners(ServiceSelectedCorners, st::msgRadius, _msgServiceSelectBg);
+		prepareCorners(ServiceCorners, st::serviceMsgRadius, _msgServiceBg);
+		prepareCorners(ServiceSelectedCorners, st::serviceMsgRadius, _msgServiceSelectBg);
 
 		uchar rScroll = uchar(componentsScroll[0]), gScroll = uchar(componentsScroll[1]), bScroll = uchar(componentsScroll[2]);
 		_historyScrollBarColor = style::color(rScroll, gScroll, bScroll, qRound(st::historyScroll.barColor->c.alphaF() * 0xFF));
diff --git a/Telegram/SourceFiles/app.h b/Telegram/SourceFiles/app.h
index fef9fcbd1..9bdb14fdf 100644
--- a/Telegram/SourceFiles/app.h
+++ b/Telegram/SourceFiles/app.h
@@ -269,7 +269,7 @@ namespace App {
 #endif
 	void setProxySettings(QTcpSocket &socket);
 
-	QImage **cornersMask();
+	QImage **cornersMask(ImageRoundRadius radius);
 	void roundRect(Painter &p, int32 x, int32 y, int32 w, int32 h, const style::color &bg, RoundCorners index, const style::color *sh = 0);
 	inline void roundRect(Painter &p, const QRect &rect, const style::color &bg, RoundCorners index, const style::color *sh = 0) {
 		return roundRect(p, rect.x(), rect.y(), rect.width(), rect.height(), bg, index, sh);
@@ -278,9 +278,9 @@ namespace App {
 	inline void roundShadow(Painter &p, const QRect &rect, const style::color &sh, RoundCorners index) {
 		return roundShadow(p, rect.x(), rect.y(), rect.width(), rect.height(), sh, index);
 	}
-	void roundRect(Painter &p, int32 x, int32 y, int32 w, int32 h, const style::color &bg);
-	inline void roundRect(Painter &p, const QRect &rect, const style::color &bg) {
-		return roundRect(p, rect.x(), rect.y(), rect.width(), rect.height(), bg);
+	void roundRect(Painter &p, int32 x, int32 y, int32 w, int32 h, const style::color &bg, ImageRoundRadius radius);
+	inline void roundRect(Painter &p, const QRect &rect, const style::color &bg, ImageRoundRadius radius) {
+		return roundRect(p, rect.x(), rect.y(), rect.width(), rect.height(), bg, radius);
 	}
 
 	void initBackground(int32 id = DefaultChatBackground, const QImage &p = QImage(), bool nowrite = false);
diff --git a/Telegram/SourceFiles/boxes/photosendbox.cpp b/Telegram/SourceFiles/boxes/photosendbox.cpp
index 073c917fd..7148a89c4 100644
--- a/Telegram/SourceFiles/boxes/photosendbox.cpp
+++ b/Telegram/SourceFiles/boxes/photosendbox.cpp
@@ -123,7 +123,7 @@ PhotoSendBox::PhotoSendBox(const FileLoadResultPtr &file) : AbstractBox(st::boxW
 			} else {
 				_thumbw = st::msgFileThumbSize;
 			}
-			_thumb = imagePix(_thumb.toImage(), _thumbw * cIntRetinaFactor(), 0, ImagePixSmooth | ImagePixRounded, st::msgFileThumbSize, st::msgFileThumbSize);
+			_thumb = imagePix(_thumb.toImage(), _thumbw * cIntRetinaFactor(), 0, ImagePixSmooth | ImagePixRoundedSmall, st::msgFileThumbSize, st::msgFileThumbSize);
 		}
 
 		_name.setText(st::semiboldFont, _file->filename, _textNameOptions);
@@ -427,7 +427,7 @@ EditCaptionBox::EditCaptionBox(HistoryItem *msg) : AbstractBox(st::boxWideWidth)
 			} else {
 				_thumbw = st::msgFileThumbSize;
 			}
-			_thumb = imagePix(image->pix().toImage(), _thumbw * cIntRetinaFactor(), 0, ImagePixSmooth | ImagePixRounded, st::msgFileThumbSize, st::msgFileThumbSize);
+			_thumb = imagePix(image->pix().toImage(), _thumbw * cIntRetinaFactor(), 0, ImagePixSmooth | ImagePixRoundedSmall, st::msgFileThumbSize, st::msgFileThumbSize);
 		}
 
 		if (doc) {
@@ -462,7 +462,7 @@ EditCaptionBox::EditCaptionBox(HistoryItem *msg) : AbstractBox(st::boxWideWidth)
 		} else {
 			maxW = dimensions.width();
 			maxH = dimensions.height();
-			_thumb = image->pixNoCache(maxW * cIntRetinaFactor(), maxH * cIntRetinaFactor(), ImagePixSmooth | ImagePixRounded, maxW, maxH);
+			_thumb = image->pixNoCache(maxW * cIntRetinaFactor(), maxH * cIntRetinaFactor(), ImagePixSmooth, maxW, maxH);
 		}
 		int32 tw = _thumb.width(), th = _thumb.height();
 		if (!tw || !th) {
diff --git a/Telegram/SourceFiles/boxes/stickersetbox.cpp b/Telegram/SourceFiles/boxes/stickersetbox.cpp
index 2510a7cd6..b71a9634e 100644
--- a/Telegram/SourceFiles/boxes/stickersetbox.cpp
+++ b/Telegram/SourceFiles/boxes/stickersetbox.cpp
@@ -233,7 +233,7 @@ void StickerSetInner::paintEvent(QPaintEvent *e) {
 				}
 			}
 
-			float64 coef = qMin((st::stickersSize.width() - st::msgRadius * 2) / float64(doc->dimensions.width()), (st::stickersSize.height() - st::msgRadius * 2) / float64(doc->dimensions.height()));
+			float64 coef = qMin((st::stickersSize.width() - st::buttonRadius * 2) / float64(doc->dimensions.width()), (st::stickersSize.height() - st::buttonRadius * 2) / float64(doc->dimensions.height()));
 			if (coef > 1) coef = 1;
 			int32 w = qRound(coef * doc->dimensions.width()), h = qRound(coef * doc->dimensions.height());
 			if (w < 1) w = 1;
diff --git a/Telegram/SourceFiles/core/basic_types.h b/Telegram/SourceFiles/core/basic_types.h
index c4cc892e4..6ab0e5192 100644
--- a/Telegram/SourceFiles/core/basic_types.h
+++ b/Telegram/SourceFiles/core/basic_types.h
@@ -777,7 +777,7 @@ inline QString strMakeFromLetters(const uint32 *letters, int32 len) {
 	QString result;
 	result.reserve(len);
 	for (int32 i = 0; i < len; ++i) {
-		result.push_back(QChar((((letters[i] << 16) & 0xFF) >> 8) | (letters[i] & 0xFF)));
+		result.push_back(QChar((((letters[i] >> 16) & 0xFF) << 8) | (letters[i] & 0xFF)));
 	}
 	return result;
 }
diff --git a/Telegram/SourceFiles/dialogs/dialogs.style b/Telegram/SourceFiles/dialogs/dialogs.style
index cc9afe6d6..daae49132 100644
--- a/Telegram/SourceFiles/dialogs/dialogs.style
+++ b/Telegram/SourceFiles/dialogs/dialogs.style
@@ -85,6 +85,10 @@ dialogsTextStyleActive: textStyle(dialogsTextStyle) {
 	linkFg: dialogsTextFgActive;
 	linkFgDown: dialogsTextFgActive;
 }
+dialogsTextStyleDraftActive: textStyle(dialogsTextStyle) {
+	linkFg: #ffd6d6;
+	linkFgDown: #ffd6d6;
+}
 
 dialogsNewChatIcon: icon {
 	{ "dialogs_new_chat", #b7b7b7, point(9px, 10px) }
@@ -94,6 +98,9 @@ dialogsNewChatButton: RoundButton {
 	height: 36px;
 	icon: dialogsNewChatIcon;
 
+	textTop: 5px;
+	downTextTop: 6px;
+
 	textFg: transparent;
 	textFgOver: transparent;
 	secondaryTextFg: transparent;
diff --git a/Telegram/SourceFiles/dialogs/dialogs_layout.cpp b/Telegram/SourceFiles/dialogs/dialogs_layout.cpp
index 8591ea74e..8e8843ac6 100644
--- a/Telegram/SourceFiles/dialogs/dialogs_layout.cpp
+++ b/Telegram/SourceFiles/dialogs/dialogs_layout.cpp
@@ -92,7 +92,7 @@ void paintRow(Painter &p, History *history, HistoryItem *item, Data::Draft *draf
 				auto draftText = lng_dialogs_text_with_from(lt_from_part, draftWrapped, lt_message, textClean(draft->textWithTags.text));
 				history->cloudDraftTextCache.setText(st::dialogsTextFont, draftText, _textDlgOptions);
 			}
-			textstyleSet(&(active ? st::dialogsTextStyleActive : st::dialogsTextStyleDraft));
+			textstyleSet(&(active ? st::dialogsTextStyleDraftActive : st::dialogsTextStyleDraft));
 			p.setFont(st::dialogsTextFont);
 			p.setPen(active ? st::dialogsTextFgActive : st::dialogsTextFg);
 			history->cloudDraftTextCache.drawElided(p, nameleft, texttop, namewidth, 1);
diff --git a/Telegram/SourceFiles/dropdown.cpp b/Telegram/SourceFiles/dropdown.cpp
index d862a660d..b96b1a1d3 100644
--- a/Telegram/SourceFiles/dropdown.cpp
+++ b/Telegram/SourceFiles/dropdown.cpp
@@ -948,9 +948,9 @@ void EmojiPanInner::onShowPicker() {
 			int32 size = (c == tab) ? (sel - (sel % EmojiPanPerRow)) : _counts[c], rows = (size / EmojiPanPerRow) + ((size % EmojiPanPerRow) ? 1 : 0);
 			y += st::emojiPanHeader + (rows * st::emojiPanSize.height());
 		}
-		y -= _picker.height() - st::msgRadius + _top;
+		y -= _picker.height() - st::buttonRadius + _top;
 		if (y < 0) {
-			y += _picker.height() - st::msgRadius + st::emojiPanSize.height() - st::msgRadius;
+			y += _picker.height() - st::buttonRadius + st::emojiPanSize.height() - st::buttonRadius;
 		}
 		int xmax = width() - _picker.width();
 		float64 coef = float64(sel % EmojiPanPerRow) / float64(EmojiPanPerRow - 1);
@@ -1406,7 +1406,7 @@ void StickerPanInner::paintStickers(Painter &p, const QRect &r) {
 					sticker->checkSticker();
 				}
 
-				float64 coef = qMin((st::stickerPanSize.width() - st::msgRadius * 2) / float64(sticker->dimensions.width()), (st::stickerPanSize.height() - st::msgRadius * 2) / float64(sticker->dimensions.height()));
+				float64 coef = qMin((st::stickerPanSize.width() - st::buttonRadius * 2) / float64(sticker->dimensions.width()), (st::stickerPanSize.height() - st::buttonRadius * 2) / float64(sticker->dimensions.height()));
 				if (coef > 1) coef = 1;
 				int32 w = qRound(coef * sticker->dimensions.width()), h = qRound(coef * sticker->dimensions.height());
 				if (w < 1) w = 1;
diff --git a/Telegram/SourceFiles/facades.cpp b/Telegram/SourceFiles/facades.cpp
index 4a3597d48..8ba195c17 100644
--- a/Telegram/SourceFiles/facades.cpp
+++ b/Telegram/SourceFiles/facades.cpp
@@ -534,6 +534,8 @@ struct Data {
 	Dialogs::Mode DialogsMode = Dialogs::Mode::All;
 	bool ModerateModeEnabled = false;
 
+	bool ScreenIsLocked = false;
+
 	int32 DebugLoggingFlags = 0;
 
 	// config
@@ -600,6 +602,8 @@ DefineVar(Global, bool, DialogsModeEnabled);
 DefineVar(Global, Dialogs::Mode, DialogsMode);
 DefineVar(Global, bool, ModerateModeEnabled);
 
+DefineVar(Global, bool, ScreenIsLocked);
+
 DefineVar(Global, int32, DebugLoggingFlags);
 
 // config
diff --git a/Telegram/SourceFiles/facades.h b/Telegram/SourceFiles/facades.h
index ab621be03..a95629dd3 100644
--- a/Telegram/SourceFiles/facades.h
+++ b/Telegram/SourceFiles/facades.h
@@ -213,6 +213,8 @@ DeclareVar(bool, DialogsModeEnabled);
 DeclareVar(Dialogs::Mode, DialogsMode);
 DeclareVar(bool, ModerateModeEnabled);
 
+DeclareVar(bool, ScreenIsLocked);
+
 DeclareVar(int32, DebugLoggingFlags);
 
 // config
diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp
index 2665065c4..c9d69b6a9 100644
--- a/Telegram/SourceFiles/history.cpp
+++ b/Telegram/SourceFiles/history.cpp
@@ -3407,14 +3407,14 @@ void HistoryPhoto::draw(Painter &p, const QRect &r, TextSelection selection, uin
 
 	QPixmap pix;
 	if (loaded) {
-		pix = _data->full->pixSingle(_pixw, _pixh, width, height);
+		pix = _data->full->pixSingle(ImageRoundRadius::Large, _pixw, _pixh, width, height);
 	} else {
-		pix = _data->thumb->pixBlurredSingle(_pixw, _pixh, width, height);
+		pix = _data->thumb->pixBlurredSingle(ImageRoundRadius::Large, _pixw, _pixh, width, height);
 	}
 	QRect rthumb(rtlrect(skipx, skipy, width, height, _width));
 	p.drawPixmap(rthumb.topLeft(), pix);
 	if (selected) {
-		App::roundRect(p, rthumb, textstyleCurrent()->selectOverlay, SelectedOverlayCorners);
+		App::roundRect(p, rthumb, textstyleCurrent()->selectOverlay, SelectedOverlayLargeCorners);
 	}
 
 	if (notChild && (radial || (!loaded && !_data->loading()))) {
@@ -3736,9 +3736,9 @@ void HistoryVideo::draw(Painter &p, const QRect &r, TextSelection selection, uin
 	}
 
 	QRect rthumb(rtlrect(skipx, skipy, width, height, _width));
-	p.drawPixmap(rthumb.topLeft(), _data->thumb->pixBlurredSingle(_thumbw, 0, width, height));
+	p.drawPixmap(rthumb.topLeft(), _data->thumb->pixBlurredSingle(ImageRoundRadius::Large, _thumbw, 0, width, height));
 	if (selected) {
-		App::roundRect(p, rthumb, textstyleCurrent()->selectOverlay, SelectedOverlayCorners);
+		App::roundRect(p, rthumb, textstyleCurrent()->selectOverlay, SelectedOverlayLargeCorners);
 	}
 
 	QRect inner(rthumb.x() + (rthumb.width() - st::msgFileSize) / 2, rthumb.y() + (rthumb.height() - st::msgFileSize) / 2, st::msgFileSize, st::msgFileSize);
@@ -4074,10 +4074,10 @@ void HistoryDocument::draw(Painter &p, const QRect &r, TextSelection selection,
 		bottom = st::msgFileThumbPadding.top() + st::msgFileThumbSize + st::msgFileThumbPadding.bottom();
 
 		QRect rthumb(rtlrect(st::msgFileThumbPadding.left(), st::msgFileThumbPadding.top(), st::msgFileThumbSize, st::msgFileThumbSize, _width));
-		QPixmap thumb = loaded ? _data->thumb->pixSingle(thumbed->_thumbw, 0, st::msgFileThumbSize, st::msgFileThumbSize) : _data->thumb->pixBlurredSingle(thumbed->_thumbw, 0, st::msgFileThumbSize, st::msgFileThumbSize);
+		QPixmap thumb = loaded ? _data->thumb->pixSingle(ImageRoundRadius::Small, thumbed->_thumbw, 0, st::msgFileThumbSize, st::msgFileThumbSize) : _data->thumb->pixBlurredSingle(ImageRoundRadius::Small, thumbed->_thumbw, 0, st::msgFileThumbSize, st::msgFileThumbSize);
 		p.drawPixmap(rthumb.topLeft(), thumb);
 		if (selected) {
-			App::roundRect(p, rthumb, textstyleCurrent()->selectOverlay, SelectedOverlayCorners);
+			App::roundRect(p, rthumb, textstyleCurrent()->selectOverlay, SelectedOverlaySmallCorners);
 		}
 
 		if (radial || (!loaded && !_data->loading())) {
@@ -4695,10 +4695,10 @@ void HistoryGif::draw(Painter &p, const QRect &r, TextSelection selection, uint6
 	if (animating) {
 		p.drawPixmap(rthumb.topLeft(), _gif->current(_thumbw, _thumbh, width, height, (Ui::isLayerShown() || Ui::isMediaViewShown() || Ui::isInlineItemBeingChosen()) ? 0 : ms));
 	} else {
-		p.drawPixmap(rthumb.topLeft(), _data->thumb->pixBlurredSingle(_thumbw, _thumbh, width, height));
+		p.drawPixmap(rthumb.topLeft(), _data->thumb->pixBlurredSingle(ImageRoundRadius::Large, _thumbw, _thumbh, width, height));
 	}
 	if (selected) {
-		App::roundRect(p, rthumb, textstyleCurrent()->selectOverlay, SelectedOverlayCorners);
+		App::roundRect(p, rthumb, textstyleCurrent()->selectOverlay, SelectedOverlayLargeCorners);
 	}
 
 	if (radial || (!_gif && ((!loaded && !_data->loading()) || !cAutoPlayGif())) || (_gif == BadClipReader)) {
@@ -5272,7 +5272,7 @@ void HistoryContact::draw(Painter &p, const QRect &r, TextSelection selection, u
 			p.drawPixmap(rthumb.topLeft(), userDefPhoto(qAbs(_userId) % UserColorsCount)->pixCircled(st::msgFileThumbSize, st::msgFileThumbSize));
 		}
 		if (selected) {
-			App::roundRect(p, rthumb, textstyleCurrent()->selectOverlay, SelectedOverlayCorners);
+			App::roundRect(p, rthumb, textstyleCurrent()->selectOverlay, SelectedOverlaySmallCorners);
 		}
 
 		bool over = ClickHandler::showAsActive(_linkl);
@@ -5664,13 +5664,13 @@ void HistoryWebPage::draw(Painter &p, const QRect &r, TextSelection selection, u
 			pixw = qRound(pixw * coef);
 		}
 		if (full) {
-			pix = _data->photo->medium->pixSingle(pixw, pixh, pw, ph);
+			pix = _data->photo->medium->pixSingle(ImageRoundRadius::Small, pixw, pixh, pw, ph);
 		} else {
-			pix = _data->photo->thumb->pixBlurredSingle(pixw, pixh, pw, ph);
+			pix = _data->photo->thumb->pixBlurredSingle(ImageRoundRadius::Small, pixw, pixh, pw, ph);
 		}
 		p.drawPixmapLeft(lshift + width - pw, 0, _width, pix);
 		if (selected) {
-			App::roundRect(p, rtlrect(lshift + width - pw, 0, pw, _pixh, _width), textstyleCurrent()->selectOverlay, SelectedOverlayCorners);
+			App::roundRect(p, rtlrect(lshift + width - pw, 0, pw, _pixh, _width), textstyleCurrent()->selectOverlay, SelectedOverlaySmallCorners);
 		}
 		width -= pw + st::webPagePhotoDelta;
 	}
@@ -6194,20 +6194,20 @@ void HistoryLocation::draw(Painter &p, const QRect &r, TextSelection selection,
 		int32 w = _data->thumb->width(), h = _data->thumb->height();
 		QPixmap pix;
 		if (width * h == height * w || (w == fullWidth() && h == fullHeight())) {
-			pix = _data->thumb->pixSingle(width, height, width, height);
+			pix = _data->thumb->pixSingle(ImageRoundRadius::Large, width, height, width, height);
 		} else if (width * h > height * w) {
 			int32 nw = height * w / h;
-			pix = _data->thumb->pixSingle(nw, height, width, height);
+			pix = _data->thumb->pixSingle(ImageRoundRadius::Large, nw, height, width, height);
 		} else {
 			int32 nh = width * h / w;
-			pix = _data->thumb->pixSingle(width, nh, width, height);
+			pix = _data->thumb->pixSingle(ImageRoundRadius::Large, width, nh, width, height);
 		}
 		p.drawPixmap(QPoint(skipx, skipy), pix);
 	} else {
 		App::roundRect(p, skipx, skipy, width, height, st::white, MessageInCorners);
 	}
 	if (selected) {
-		App::roundRect(p, skipx, skipy, width, height, textstyleCurrent()->selectOverlay, SelectedOverlayCorners);
+		App::roundRect(p, skipx, skipy, width, height, textstyleCurrent()->selectOverlay, SelectedOverlayLargeCorners);
 	}
 
 	if (_parent->getMedia() == this) {
@@ -6511,9 +6511,9 @@ void HistoryMessageReply::paint(Painter &p, const HistoryItem *holder, int x, in
 				ImagePtr replyPreview = replyToMsg->getMedia()->replyPreview();
 				if (!replyPreview->isNull()) {
 					QRect to(rtlrect(x + st::msgReplyBarSkip, y + st::msgReplyPadding.top() + st::msgReplyBarPos.y(), st::msgReplyBarSize.height(), st::msgReplyBarSize.height(), w + 2 * x));
-					p.drawPixmap(to.x(), to.y(), replyPreview->pixSingle(replyPreview->width() / cIntRetinaFactor(), replyPreview->height() / cIntRetinaFactor(), to.width(), to.height()));
+					p.drawPixmap(to.x(), to.y(), replyPreview->pixSingle(ImageRoundRadius::Small, replyPreview->width() / cIntRetinaFactor(), replyPreview->height() / cIntRetinaFactor(), to.width(), to.height()));
 					if (selected) {
-						App::roundRect(p, to, textstyleCurrent()->selectOverlay, SelectedOverlayCorners);
+						App::roundRect(p, to, textstyleCurrent()->selectOverlay, SelectedOverlaySmallCorners);
 					}
 				}
 			}
diff --git a/Telegram/SourceFiles/history/field_autocomplete.cpp b/Telegram/SourceFiles/history/field_autocomplete.cpp
index 2fd38b1e8..c59f1d64f 100644
--- a/Telegram/SourceFiles/history/field_autocomplete.cpp
+++ b/Telegram/SourceFiles/history/field_autocomplete.cpp
@@ -580,7 +580,7 @@ void FieldAutocompleteInner::paintEvent(QPaintEvent *e) {
 					sticker->checkSticker();
 				}
 
-				float64 coef = qMin((st::stickerPanSize.width() - st::msgRadius * 2) / float64(sticker->dimensions.width()), (st::stickerPanSize.height() - st::msgRadius * 2) / float64(sticker->dimensions.height()));
+				float64 coef = qMin((st::stickerPanSize.width() - st::buttonRadius * 2) / float64(sticker->dimensions.width()), (st::stickerPanSize.height() - st::buttonRadius * 2) / float64(sticker->dimensions.height()));
 				if (coef > 1) coef = 1;
 				int32 w = qRound(coef * sticker->dimensions.width()), h = qRound(coef * sticker->dimensions.height());
 				if (w < 1) w = 1;
diff --git a/Telegram/SourceFiles/history/history.style b/Telegram/SourceFiles/history/history.style
index 59a20ef43..fdd6ab9cb 100644
--- a/Telegram/SourceFiles/history/history.style
+++ b/Telegram/SourceFiles/history/history.style
@@ -33,6 +33,7 @@ historyToDownPaddingTop: 10px;
 membersInnerScroll: flatScroll(solidScroll) {
 	deltat: 3px;
 	deltab: 3px;
+	round: 1px;
 	width: 8px;
 	deltax: 3px;
 }
diff --git a/Telegram/SourceFiles/history/history_service_layout.cpp b/Telegram/SourceFiles/history/history_service_layout.cpp
index eb057f295..2bc307901 100644
--- a/Telegram/SourceFiles/history/history_service_layout.cpp
+++ b/Telegram/SourceFiles/history/history_service_layout.cpp
@@ -58,14 +58,14 @@ void createCircleMasks() {
 	serviceMessageStyle.createIfNull();
 	if (!serviceMessageStyle->circle[NormalMask].isNull()) return;
 
-	int size = st::msgRadius * 2;
+	int size = st::serviceMsgRadius * 2;
 	serviceMessageStyle->circle[NormalMask] = style::createCircleMask(size);
 	serviceMessageStyle->circle[InvertedMask] = style::createInvertedCircleMask(size);
 }
 
 QPixmap circleCorner(int corner) {
 	if (serviceMessageStyle->corners[corner].isNull()) {
-		int size = st::msgRadius * cIntRetinaFactor();
+		int size = st::serviceMsgRadius * cIntRetinaFactor();
 
 		int xoffset = 0, yoffset = 0;
 		if (corner & CornerRight) {
@@ -120,7 +120,7 @@ void paintBubblePart(Painter &p, int x, int y, int width, int height, SideStyle
 		y += skip;
 		height -= skip;
 	}
-	if (int skip = paintBubbleSide(p, x, y + height - st::msgRadius, width, bottomStyle, CornerBottom)) {
+	if (int skip = paintBubbleSide(p, x, y + height - st::serviceMsgRadius, width, bottomStyle, CornerBottom)) {
 		height -= skip;
 	}
 
@@ -258,7 +258,7 @@ QVector<int> ServiceMessagePainter::countLineWidths(const Text &text, const QRec
 	lineWidths.reserve(linesCount);
 	text.countLineWidths(textRect.width(), &lineWidths);
 
-	int minDelta = 4 * st::msgRadius;
+	int minDelta = 4 * st::serviceMsgRadius;
 	for (int i = 0, count = lineWidths.size(); i < count; ++i) {
 		int width = qMax(lineWidths.at(i), 0);
 		if (i > 0) {
diff --git a/Telegram/SourceFiles/historywidget.cpp b/Telegram/SourceFiles/historywidget.cpp
index c0c23cef0..6ab44da55 100644
--- a/Telegram/SourceFiles/historywidget.cpp
+++ b/Telegram/SourceFiles/historywidget.cpp
@@ -8268,7 +8268,7 @@ void HistoryWidget::drawField(Painter &p, const QRect &rect) {
 					ImagePtr replyPreview = drawMsgText->getMedia()->replyPreview();
 					if (!replyPreview->isNull()) {
 						QRect to(replyLeft, backy + st::msgReplyPadding.top(), st::msgReplyBarSize.height(), st::msgReplyBarSize.height());
-						p.drawPixmap(to.x(), to.y(), replyPreview->pixSingle(replyPreview->width() / cIntRetinaFactor(), replyPreview->height() / cIntRetinaFactor(), to.width(), to.height()));
+						p.drawPixmap(to.x(), to.y(), replyPreview->pixSingle(ImageRoundRadius::Small, replyPreview->width() / cIntRetinaFactor(), replyPreview->height() / cIntRetinaFactor(), to.width(), to.height()));
 					}
 					replyLeft += st::msgReplyBarSize.height() + st::msgReplyBarSkip - st::msgReplyBarSize.width() - st::msgReplyBarPos.x();
 				}
@@ -8429,7 +8429,7 @@ void HistoryWidget::drawPinnedBar(Painter &p) {
 			ImagePtr replyPreview = _pinnedBar->msg->getMedia()->replyPreview();
 			if (!replyPreview->isNull()) {
 				QRect to(left, st::msgReplyPadding.top(), st::msgReplyBarSize.height(), st::msgReplyBarSize.height());
-				p.drawPixmap(to.x(), to.y(), replyPreview->pixSingle(replyPreview->width() / cIntRetinaFactor(), replyPreview->height() / cIntRetinaFactor(), to.width(), to.height()));
+				p.drawPixmap(to.x(), to.y(), replyPreview->pixSingle(ImageRoundRadius::Small, replyPreview->width() / cIntRetinaFactor(), replyPreview->height() / cIntRetinaFactor(), to.width(), to.height()));
 			}
 			left += st::msgReplyBarSize.height() + st::msgReplyBarSkip - st::msgReplyBarSize.width() - st::msgReplyBarPos.x();
 		}
diff --git a/Telegram/SourceFiles/inline_bots/inline_bot_layout_internal.cpp b/Telegram/SourceFiles/inline_bots/inline_bot_layout_internal.cpp
index c3fa01dd6..655988b11 100644
--- a/Telegram/SourceFiles/inline_bots/inline_bot_layout_internal.cpp
+++ b/Telegram/SourceFiles/inline_bots/inline_bot_layout_internal.cpp
@@ -420,8 +420,8 @@ void Sticker::clickHandlerActiveChanged(const ClickHandlerPtr &p, bool active) {
 
 QSize Sticker::getThumbSize() const {
 	int width = qMax(content_width(), 1), height = qMax(content_height(), 1);
-	float64 coefw = (st::stickerPanSize.width() - st::msgRadius * 2) / float64(width);
-	float64 coefh = (st::stickerPanSize.height() - st::msgRadius * 2) / float64(height);
+	float64 coefw = (st::stickerPanSize.width() - st::buttonRadius * 2) / float64(width);
+	float64 coefh = (st::stickerPanSize.height() - st::buttonRadius * 2) / float64(height);
 	float64 coef = qMin(qMin(coefw, coefh), 1.);
 	int w = qRound(coef * content_width()), h = qRound(coef * content_height());
 	return QSize(qMax(w, 1), qMax(h, 1));
diff --git a/Telegram/SourceFiles/layout.h b/Telegram/SourceFiles/layout.h
index 7ac05fdeb..6aa64f268 100644
--- a/Telegram/SourceFiles/layout.h
+++ b/Telegram/SourceFiles/layout.h
@@ -29,12 +29,14 @@ const TextParseOptions &itemTextOptions(History *h, PeerData *f);
 const TextParseOptions &itemTextNoMonoOptions(History *h, PeerData *f);
 
 enum RoundCorners {
-	NoneCorners = 0x00, // for images
-	BlackCorners,
+	SmallMaskCorners = 0x00, // for images
+	LargeMaskCorners,
+
 	WhiteCorners,
 	ServiceCorners,
 	ServiceSelectedCorners,
-	SelectedOverlayCorners,
+	SelectedOverlaySmallCorners,
+	SelectedOverlayLargeCorners,
 	DateCorners,
 	DateSelectedCorners,
 	ForwardCorners,
diff --git a/Telegram/SourceFiles/main.cpp b/Telegram/SourceFiles/main.cpp
index e010502d5..3fc2ce67a 100644
--- a/Telegram/SourceFiles/main.cpp
+++ b/Telegram/SourceFiles/main.cpp
@@ -44,21 +44,9 @@ int main(int argc, char *argv[]) {
 	Logs::start(); // must be started before Platform is started
 	Platform::start(); // must be started before QApplication is created
 
-	// prepare fake args to disable QT_STYLE_OVERRIDE env variable
-	// currently this is required in some desktop environments, including Xubuntu 15.10
-	// when we don't default style to "none" Qt dynamically loads GTK somehow internally and
-	// our own GTK dynamic load and usage leads GTK errors and freeze of the current main thread
-	// we can't disable our own GTK loading because it is required by libappindicator, which
-	// provides the tray icon for this system, because Qt tray icon is broken there
-	// see https://github.com/telegramdesktop/tdesktop/issues/1774
-	QByteArray args[] = { "-style=0" };
-	static const int a_cnt = sizeof(args) / sizeof(args[0]);
-	int a_argc = a_cnt + 1;
-	char *a_argv[a_cnt + 1] = { argv[0], args[0].data() };
-
 	int result = 0;
 	{
-		Application app(a_argc, a_argv);
+		Application app(argc, argv);
 		result = app.exec();
 	}
 
diff --git a/Telegram/SourceFiles/overview/overview_layout.cpp b/Telegram/SourceFiles/overview/overview_layout.cpp
index 59faa38b1..a3d05646c 100644
--- a/Telegram/SourceFiles/overview/overview_layout.cpp
+++ b/Telegram/SourceFiles/overview/overview_layout.cpp
@@ -1051,15 +1051,15 @@ void Link::paint(Painter &p, const QRect &clip, TextSelection selection, const P
 		if (_page && _page->photo) {
 			QPixmap pix;
 			if (_page->photo->medium->loaded()) {
-				pix = _page->photo->medium->pixSingle(_pixw, _pixh, st::linksPhotoSize, st::linksPhotoSize);
+				pix = _page->photo->medium->pixSingle(ImageRoundRadius::Small, _pixw, _pixh, st::linksPhotoSize, st::linksPhotoSize);
 			} else if (_page->photo->loaded()) {
-				pix = _page->photo->full->pixSingle(_pixw, _pixh, st::linksPhotoSize, st::linksPhotoSize);
+				pix = _page->photo->full->pixSingle(ImageRoundRadius::Small, _pixw, _pixh, st::linksPhotoSize, st::linksPhotoSize);
 			} else {
-				pix = _page->photo->thumb->pixSingle(_pixw, _pixh, st::linksPhotoSize, st::linksPhotoSize);
+				pix = _page->photo->thumb->pixSingle(ImageRoundRadius::Small, _pixw, _pixh, st::linksPhotoSize, st::linksPhotoSize);
 			}
 			p.drawPixmapLeft(0, top, _width, pix);
 		} else if (_page && _page->document && !_page->document->thumb->isNull()) {
-			p.drawPixmapLeft(0, top, _width, _page->document->thumb->pixSingle(_pixw, _pixh, st::linksPhotoSize, st::linksPhotoSize));
+			p.drawPixmapLeft(0, top, _width, _page->document->thumb->pixSingle(ImageRoundRadius::Small, _pixw, _pixh, st::linksPhotoSize, st::linksPhotoSize));
 		} else {
 			int32 index = _letter.isEmpty() ? 0 : (_letter.at(0).unicode() % 4);
 			switch (index) {
diff --git a/Telegram/SourceFiles/platform/linux/file_dialog_linux.cpp b/Telegram/SourceFiles/platform/linux/file_dialog_linux.cpp
index 9a2577c4e..f47e871c6 100644
--- a/Telegram/SourceFiles/platform/linux/file_dialog_linux.cpp
+++ b/Telegram/SourceFiles/platform/linux/file_dialog_linux.cpp
@@ -115,20 +115,17 @@ bool Get(QStringList &files, QByteArray &remoteContent, const QString &caption,
 
 namespace internal {
 
-QGtkDialog::QGtkDialog(GtkWidget *gtkWidget) : gtkWidget(gtkWidget)
-{
-    g_signal_connect_swapped(G_OBJECT(gtkWidget), "response", G_CALLBACK(onResponse), this);
-    g_signal_connect(G_OBJECT(gtkWidget), "delete-event", G_CALLBACK(Libs::gtk_widget_hide_on_delete), NULL);
+QGtkDialog::QGtkDialog(GtkWidget *gtkWidget) : gtkWidget(gtkWidget) {
+    Libs::g_signal_connect_swapped_helper(Libs::g_object_cast(gtkWidget), "response", GCallback(onResponse), this);
+    Libs::g_signal_connect_helper(Libs::g_object_cast(gtkWidget), "delete-event", GCallback(Libs::gtk_widget_hide_on_delete), NULL);
 }
 
-QGtkDialog::~QGtkDialog()
-{
+QGtkDialog::~QGtkDialog() {
     Libs::gtk_clipboard_store(Libs::gtk_clipboard_get(GDK_SELECTION_CLIPBOARD));
     Libs::gtk_widget_destroy(gtkWidget);
 }
 
-GtkDialog *QGtkDialog::gtkDialog() const
-{
+GtkDialog *QGtkDialog::gtkDialog() const {
     return Libs::gtk_dialog_cast(gtkWidget);
 }
 
@@ -183,8 +180,7 @@ void QGtkDialog::onResponse(QGtkDialog *dialog, int response) {
         emit dialog->reject();
 }
 
-void QGtkDialog::onParentWindowDestroyed()
-{
+void QGtkDialog::onParentWindowDestroyed() {
     // The Gtk*DialogHelper classes own this object. Make sure the parent doesn't delete it.
     setParent(nullptr);
 }
@@ -224,8 +220,8 @@ GtkFileDialog::GtkFileDialog(QWidget *parent, const QString &caption, const QStr
     connect(d.data(), SIGNAL(accept()), this, SLOT(onAccepted()));
     connect(d.data(), SIGNAL(reject()), this, SLOT(onRejected()));
 
-    g_signal_connect(Libs::gtk_file_chooser_cast(d->gtkDialog()), "selection-changed", G_CALLBACK(onSelectionChanged), this);
-    g_signal_connect_swapped(Libs::gtk_file_chooser_cast(d->gtkDialog()), "current-folder-changed", G_CALLBACK(onCurrentFolderChanged), this);
+    Libs::g_signal_connect_helper(Libs::gtk_file_chooser_cast(d->gtkDialog()), "selection-changed", G_CALLBACK(onSelectionChanged), this);
+    Libs::g_signal_connect_swapped_helper(Libs::gtk_file_chooser_cast(d->gtkDialog()), "current-folder-changed", G_CALLBACK(onCurrentFolderChanged), this);
 }
 
 GtkFileDialog::~GtkFileDialog() {
@@ -313,7 +309,7 @@ QDir GtkFileDialog::directory() const {
     gchar *folder = Libs::gtk_file_chooser_get_current_folder(Libs::gtk_file_chooser_cast(gtkDialog));
     if (folder) {
         ret = QString::fromUtf8(folder);
-        g_free(folder);
+        Libs::g_free(folder);
     }
     return QDir(ret);
 }
@@ -334,7 +330,7 @@ QStringList GtkFileDialog::selectedFiles() const {
     GSList *filenames = Libs::gtk_file_chooser_get_filenames(Libs::gtk_file_chooser_cast(gtkDialog));
     for (GSList *it  = filenames; it; it = it->next)
         selection += QString::fromUtf8((const char*)it->data);
-    g_slist_free(filenames);
+    Libs::g_slist_free(filenames);
     return selection;
 }
 
diff --git a/Telegram/SourceFiles/platform/linux/linux_gdk_helper.cpp b/Telegram/SourceFiles/platform/linux/linux_gdk_helper.cpp
index 80d29af2d..17e93b860 100644
--- a/Telegram/SourceFiles/platform/linux/linux_gdk_helper.cpp
+++ b/Telegram/SourceFiles/platform/linux/linux_gdk_helper.cpp
@@ -51,19 +51,15 @@ using f_gdk_x11_drawable_get_xid = XID(*)(GdkDrawable*);
 f_gdk_x11_drawable_get_xid gdk_x11_drawable_get_xid = nullptr;
 
 // Gtk 3
-
-// To be able to compile with gtk-2.0 headers as well
-#ifndef GDK_TYPE_X11_WINDOW
-#define GDK_TYPE_X11_WINDOW (gdk_x11_window_get_type())
-#endif // GDK_TYPE_X11_WINDOW
-
-#ifndef GDK_IS_X11_WINDOW
-#define GDK_IS_X11_WINDOW(object) (G_TYPE_CHECK_INSTANCE_TYPE((object), GDK_TYPE_X11_WINDOW))
-#endif // GDK_IS_X11_WINDOW
-
 using f_gdk_x11_window_get_type = GType (*)(void);
 f_gdk_x11_window_get_type gdk_x11_window_get_type = nullptr;
 
+// To be able to compile with gtk-2.0 headers as well
+template <typename Object>
+inline bool gdk_is_x11_window_check(Object *obj) {
+	return Libs::g_type_cit_helper(obj, gdk_x11_window_get_type());
+}
+
 using f_gdk_window_get_display = GdkDisplay*(*)(GdkWindow *window);
 f_gdk_window_get_display gdk_window_get_display = nullptr;
 
@@ -106,7 +102,7 @@ void XSetTransientForHint(GdkWindow *window, quintptr winId) {
 							   gdk_x11_drawable_get_xid(window),
 							   winId);
 	} else if (gdk_helper_loaded == GtkLoaded::Gtk3) {
-		if (GDK_IS_X11_WINDOW(window)) {
+		if (gdk_is_x11_window_check(window)) {
 			::XSetTransientForHint(gdk_x11_display_get_xdisplay(gdk_window_get_display(window)),
 								   gdk_x11_window_get_xid(window),
 								   winId);
diff --git a/Telegram/SourceFiles/platform/linux/linux_libs.cpp b/Telegram/SourceFiles/platform/linux/linux_libs.cpp
index 3311ddca3..484b6c534 100644
--- a/Telegram/SourceFiles/platform/linux/linux_libs.cpp
+++ b/Telegram/SourceFiles/platform/linux/linux_libs.cpp
@@ -90,10 +90,13 @@ bool setupGtkBase(QLibrary &lib_gtk) {
 	if (!load(lib_gtk, "gtk_dialog_run", gtk_dialog_run)) return false;
 
 	if (!load(lib_gtk, "g_type_check_instance_cast", g_type_check_instance_cast)) return false;
+	if (!load(lib_gtk, "g_type_check_instance_is_a", g_type_check_instance_is_a)) return false;
 	if (!load(lib_gtk, "g_signal_connect_data", g_signal_connect_data)) return false;
 
 	if (!load(lib_gtk, "g_object_ref_sink", g_object_ref_sink)) return false;
 	if (!load(lib_gtk, "g_object_unref", g_object_unref)) return false;
+	if (!load(lib_gtk, "g_free", g_free)) return false;
+	if (!load(lib_gtk, "g_slist_free", g_slist_free)) return false;
 
 	DEBUG_LOG(("Library gtk functions loaded!"));
 	if (!gtk_init_check(0, 0)) {
@@ -164,6 +167,7 @@ f_gdk_window_focus gdk_window_focus = nullptr;
 f_gtk_dialog_get_type gtk_dialog_get_type = nullptr;
 f_gtk_dialog_run gtk_dialog_run = nullptr;
 f_g_type_check_instance_cast g_type_check_instance_cast = nullptr;
+f_g_type_check_instance_is_a g_type_check_instance_is_a = nullptr;
 f_g_signal_connect_data g_signal_connect_data = nullptr;
 f_app_indicator_new app_indicator_new = nullptr;
 f_app_indicator_set_status app_indicator_set_status = nullptr;
@@ -186,6 +190,8 @@ f_gtk_get_current_event_time gtk_get_current_event_time = nullptr;
 f_g_object_ref_sink g_object_ref_sink = nullptr;
 f_g_object_unref g_object_unref = nullptr;
 f_g_idle_add g_idle_add = nullptr;
+f_g_free g_free = nullptr;
+f_g_slist_free g_slist_free = nullptr;
 #ifndef TDESKTOP_DISABLE_UNITY_INTEGRATION
 f_unity_launcher_entry_set_count unity_launcher_entry_set_count = nullptr;
 f_unity_launcher_entry_set_count_visible unity_launcher_entry_set_count_visible = nullptr;
diff --git a/Telegram/SourceFiles/platform/linux/linux_libs.h b/Telegram/SourceFiles/platform/linux/linux_libs.h
index b83214be5..d51db1c67 100644
--- a/Telegram/SourceFiles/platform/linux/linux_libs.h
+++ b/Telegram/SourceFiles/platform/linux/linux_libs.h
@@ -198,6 +198,11 @@ inline GtkDialog *gtk_dialog_cast(Object *obj) {
 	return g_type_cic_helper<GtkDialog, Object>(obj, gtk_dialog_get_type());
 }
 
+template <typename Object>
+inline GObject *g_object_cast(Object *obj) {
+	return g_type_cic_helper<GObject, Object>(obj, G_TYPE_OBJECT);
+}
+
 typedef GType (*f_gtk_file_chooser_get_type)(void) G_GNUC_CONST;
 extern f_gtk_file_chooser_get_type gtk_file_chooser_get_type;
 
@@ -222,15 +227,34 @@ inline GtkWindow *gtk_window_cast(Object *obj) {
 	return g_type_cic_helper<GtkWindow, Object>(obj, gtk_window_get_type());
 }
 
+typedef gboolean (*f_g_type_check_instance_is_a)(GTypeInstance *instance, GType iface_type) G_GNUC_PURE;
+extern f_g_type_check_instance_is_a g_type_check_instance_is_a;
+
+template <typename Object>
+inline bool g_type_cit_helper(Object *instance, GType iface_type) {
+	if (!instance) return false;
+
+	auto ginstance = reinterpret_cast<GTypeInstance*>(instance);
+	if (ginstance->g_class && ginstance->g_class->g_type == iface_type) {
+		return true;
+	}
+    return g_type_check_instance_is_a(ginstance, iface_type);
+}
+
 typedef gint (*f_gtk_dialog_run)(GtkDialog *dialog);
 extern f_gtk_dialog_run gtk_dialog_run;
 
 typedef gulong (*f_g_signal_connect_data)(gpointer instance, const gchar *detailed_signal, GCallback c_handler, gpointer data, GClosureNotify destroy_data, GConnectFlags connect_flags);
 extern f_g_signal_connect_data g_signal_connect_data;
+
 inline gulong g_signal_connect_helper(gpointer instance, const gchar *detailed_signal, GCallback c_handler, gpointer data) {
 	return g_signal_connect_data(instance, detailed_signal, c_handler, data, NULL, (GConnectFlags)0);
 }
 
+inline gulong g_signal_connect_swapped_helper(gpointer instance, const gchar *detailed_signal, GCallback c_handler, gpointer data) {
+	return g_signal_connect_data(instance, detailed_signal, c_handler, data, NULL, G_CONNECT_SWAPPED);
+}
+
 typedef AppIndicator* (*f_app_indicator_new)(const gchar *id, const gchar *icon_name, AppIndicatorCategory category);
 extern f_app_indicator_new app_indicator_new;
 
@@ -294,6 +318,12 @@ extern f_g_object_unref g_object_unref;
 typedef guint (*f_g_idle_add)(GSourceFunc function, gpointer data);
 extern f_g_idle_add g_idle_add;
 
+typedef void (*f_g_free)(gpointer mem);
+extern f_g_free g_free;
+
+typedef void (*f_g_slist_free)(GSList *list);
+extern f_g_slist_free g_slist_free;
+
 #ifndef TDESKTOP_DISABLE_UNITY_INTEGRATION
 typedef void (*f_unity_launcher_entry_set_count)(UnityLauncherEntry* self, gint64 value);
 extern f_unity_launcher_entry_set_count unity_launcher_entry_set_count;
diff --git a/Telegram/SourceFiles/platform/mac/main_window_mac.mm b/Telegram/SourceFiles/platform/mac/main_window_mac.mm
index d493c9cf7..8738a9ffe 100644
--- a/Telegram/SourceFiles/platform/mac/main_window_mac.mm
+++ b/Telegram/SourceFiles/platform/mac/main_window_mac.mm
@@ -484,12 +484,12 @@ void MainWindow::psNotifyShown(NotifyWindow *w) {
 }
 
 void MainWindow::psPlatformNotify(HistoryItem *item, int32 fwdCount) {
-	QString title = (!App::passcoded() && cNotifyView() <= dbinvShowName) ? item->history()->peer->name : qsl("Telegram Desktop");
-	QString subtitle = (!App::passcoded() && cNotifyView() <= dbinvShowName) ? item->notificationHeader() : QString();
-	QPixmap pix = (!App::passcoded() && cNotifyView() <= dbinvShowName) ? item->history()->peer->genUserpic(st::notifyMacPhotoSize) : QPixmap();
-	QString msg = (!App::passcoded() && cNotifyView() <= dbinvShowPreview) ? (fwdCount < 2 ? item->notificationText() : lng_forward_messages(lt_count, fwdCount)) : lang(lng_notification_preview);
+	QString title = (!App::passcoded() && cNotifyView() <= dbinvShowName && !Global::ScreenIsLocked()) ? item->history()->peer->name : qsl("Telegram Desktop");
+	QString subtitle = (!App::passcoded() && cNotifyView() <= dbinvShowName && !Global::ScreenIsLocked()) ? item->notificationHeader() : QString();
+	QPixmap pix = (!App::passcoded() && cNotifyView() <= dbinvShowName && !Global::ScreenIsLocked()) ? item->history()->peer->genUserpic(st::notifyMacPhotoSize) : QPixmap();
+	QString msg = (!App::passcoded() && cNotifyView() <= dbinvShowPreview && !Global::ScreenIsLocked()) ? (fwdCount < 2 ? item->notificationText() : lng_forward_messages(lt_count, fwdCount)) : lang(lng_notification_preview);
 
-	bool withReply = !App::passcoded() && (cNotifyView() <= dbinvShowPreview) && item->history()->peer->canWrite();
+	bool withReply = !App::passcoded() && (cNotifyView() <= dbinvShowPreview && !Global::ScreenIsLocked()) && item->history()->peer->canWrite();
 
 	_private.showNotify(item->history()->peer->id, item->id, pix, title, subtitle, msg, withReply);
 }
diff --git a/Telegram/SourceFiles/pspecific_mac.cpp b/Telegram/SourceFiles/pspecific_mac.cpp
index dc7761b14..f6d20fe50 100644
--- a/Telegram/SourceFiles/pspecific_mac.cpp
+++ b/Telegram/SourceFiles/pspecific_mac.cpp
@@ -471,17 +471,27 @@ bool psLaunchMaps(const LocationCoords &coords) {
 }
 
 QString strNotificationAboutThemeChange() {
-	const uint32 letters[] = { 0xE9005541, 0x5600DC70, 0x88001570, 0xF500D86C, 0x8100E165, 0xEE005949, 0x2900526E, 0xAE00FB74, 0x96000865, 0x7000CD72, 0x3B001566, 0x5F007361, 0xAE00B663, 0x74009A65, 0x29003054, 0xC6002668, 0x98003865, 0xFA00336D, 0xA3007A65, 0x93001443, 0xBB007868, 0xE100E561, 0x3500366E, 0xC0007A67, 0x200CA65, 0xBE00DF64, 0xE300BB4E, 0x2900D26F, 0xD500D374, 0xE900E269, 0x86008F66, 0xC4006669, 0x1C00A863, 0xE600A761, 0x8E00EE74, 0xB300B169, 0xCF00B36F, 0xE600D36E };
+	const uint32 letters[] = { 0xE9005541, 0x5600DC70, 0x88001570, 0xF500D86C, 0x8100E165, 0xEE005949, 0x2900526E, 0xAE00FB74, 0x96000865, 0x7000CD72, 0x3B001566, 0x5F007361, 0xAE00B663, 0x74009A65, 0x29003054, 0xC6002668, 0x98003865, 0xFA00336D, 0xA3007A65, 0x93001443, 0xBB007868, 0xE100E561, 0x3500366E, 0xC0007A67, 0x0200CA65, 0xBE00DF64, 0xE300BB4E, 0x2900D26F, 0xD500D374, 0xE900E269, 0x86008F66, 0xC4006669, 0x1C00A863, 0xE600A761, 0x8E00EE74, 0xB300B169, 0xCF00B36F, 0xE600D36E };
 	return strMakeFromLetters(letters, sizeof(letters) / sizeof(letters[0]));
 }
 
+QString strNotificationAboutScreenLocked() {
+	const uint32 letters[] = { 0x22008263, 0x0800DB6F, 0x45004F6D, 0xCC00972E, 0x0E00A861, 0x9700D970, 0xA100D570, 0x8900686C, 0xB300B365, 0xFE00DE2E, 0x76009B73, 0xFA00BF63, 0xE000A772, 0x9C009F65, 0x4E006065, 0xD900426E, 0xB7007849, 0x64006473, 0x6700824C, 0xE300706F, 0x7C00A063, 0x8F00D76B, 0x04001C65, 0x1C00A664 };
+	return strMakeFromLetters(letters, arraysize(letters));
+}
+
+QString strNotificationAboutScreenUnlocked() {
+	const uint32 letters[] = { 0x9200D763, 0xC8003C6F, 0xD2003F6D, 0x6000012E, 0x36004061, 0x4400E570, 0xA500BF70, 0x2E00796C, 0x4A009E65, 0x2E00612E, 0xC8001D73, 0x57002263, 0xF0005872, 0x49000765, 0xE5008D65, 0xE600D76E, 0xE8007049, 0x19005C73, 0x34009455, 0xB800B36E, 0xF300CA6C, 0x4C00806F, 0x5300A763, 0xD1003B6B, 0x63003565, 0xF800F264 };
+	return strMakeFromLetters(letters, arraysize(letters));
+}
+
 QString strStyleOfInterface() {
-	const uint32 letters[] = { 0xEF004041, 0x4C007F70, 0x1F007A70, 0x9E00A76C, 0x8500D165, 0x2E003749, 0x7B00526E, 0x3400E774, 0x3C00FA65, 0x6200B172, 0xF7001D66, 0xB002961, 0x71008C63, 0x86005465, 0xA3006F53, 0x11006174, 0xCD001779, 0x8200556C, 0x6C009B65 };
+	const uint32 letters[] = { 0xEF004041, 0x4C007F70, 0x1F007A70, 0x9E00A76C, 0x8500D165, 0x2E003749, 0x7B00526E, 0x3400E774, 0x3C00FA65, 0x6200B172, 0xF7001D66, 0x0B002961, 0x71008C63, 0x86005465, 0xA3006F53, 0x11006174, 0xCD001779, 0x8200556C, 0x6C009B65 };
 	return strMakeFromLetters(letters, sizeof(letters) / sizeof(letters[0]));
 }
 
 QString strNeedToReload() {
-	const uint32 letters[] = { 0x82007746, 0xBB00C649, 0x7E00235F, 0x9A00FE54, 0x4C004542, 0x91001772, 0x8A00D76F, 0xC700B977, 0x7F005F73, 0x34003665, 0x2300D572, 0x72002E54, 0x18001461, 0x14004A62, 0x5100CC6C, 0x83002365, 0x5A002C56, 0xA5004369, 0x26004265, 0xD006577 };
+	const uint32 letters[] = { 0x82007746, 0xBB00C649, 0x7E00235F, 0x9A00FE54, 0x4C004542, 0x91001772, 0x8A00D76F, 0xC700B977, 0x7F005F73, 0x34003665, 0x2300D572, 0x72002E54, 0x18001461, 0x14004A62, 0x5100CC6C, 0x83002365, 0x5A002C56, 0xA5004369, 0x26004265, 0x0D006577 };
 	return strMakeFromLetters(letters, sizeof(letters) / sizeof(letters[0]));
 }
 
@@ -491,6 +501,6 @@ QString strNeedToRefresh1() {
 }
 
 QString strNeedToRefresh2() {
-	const uint32 letters[] = { 0x8F001546, 0xAF007A49, 0xB8002B5F, 0x1A000B54, 0xD003E49, 0xE0003663, 0x4900796F, 0x500836E, 0x9A00D156, 0x5E00FF69, 0x5900C765, 0x3D00D177 };
+	const uint32 letters[] = { 0x8F001546, 0xAF007A49, 0xB8002B5F, 0x1A000B54, 0x0D003E49, 0xE0003663, 0x4900796F, 0x0500836E, 0x9A00D156, 0x5E00FF69, 0x5900C765, 0x3D00D177 };
 	return strMakeFromLetters(letters, sizeof(letters) / sizeof(letters[0]));
 }
diff --git a/Telegram/SourceFiles/pspecific_mac.h b/Telegram/SourceFiles/pspecific_mac.h
index 700d115b9..e62729e9a 100644
--- a/Telegram/SourceFiles/pspecific_mac.h
+++ b/Telegram/SourceFiles/pspecific_mac.h
@@ -108,6 +108,8 @@ private:
 };
 
 QString strNotificationAboutThemeChange();
+QString strNotificationAboutScreenLocked();
+QString strNotificationAboutScreenUnlocked();
 QString strStyleOfInterface();
 QString strNeedToReload();
 QString strNeedToRefresh1();
diff --git a/Telegram/SourceFiles/pspecific_mac_p.mm b/Telegram/SourceFiles/pspecific_mac_p.mm
index f60aa9644..2fc1b06f8 100644
--- a/Telegram/SourceFiles/pspecific_mac_p.mm
+++ b/Telegram/SourceFiles/pspecific_mac_p.mm
@@ -127,6 +127,8 @@ QString objcString(NSString *str) {
 - (id) init:(PsMacWindowPrivate *)aWnd;
 - (void) activeSpaceDidChange:(NSNotification *)aNotification;
 - (void) darkModeChanged:(NSNotification *)aNotification;
+- (void) screenIsLocked:(NSNotification *)aNotification;
+- (void) screenIsUnlocked:(NSNotification *)aNotification;
 
 @end
 
@@ -195,6 +197,14 @@ public:
 	wnd->darkModeChanged();
 }
 
+- (void) screenIsLocked:(NSNotification *)aNotification {
+	Global::SetScreenIsLocked(true);
+}
+
+- (void) screenIsUnlocked:(NSNotification *)aNotification {
+	Global::SetScreenIsLocked(false);
+}
+
 @end
 
 @implementation NotifyHandler {
@@ -232,6 +242,8 @@ public:
 PsMacWindowPrivate::PsMacWindowPrivate() : data(new PsMacWindowData(this)) {
     [[[NSWorkspace sharedWorkspace] notificationCenter] addObserver:data->observerHelper selector:@selector(activeSpaceDidChange:) name:NSWorkspaceActiveSpaceDidChangeNotification object:nil];
 	[[NSDistributedNotificationCenter defaultCenter] addObserver:data->observerHelper selector:@selector(darkModeChanged:) name:QNSString(strNotificationAboutThemeChange()).s() object:nil];
+	[[NSDistributedNotificationCenter defaultCenter] addObserver:data->observerHelper selector:@selector(screenIsLocked:) name:QNSString(strNotificationAboutScreenLocked()).s() object:nil];
+	[[NSDistributedNotificationCenter defaultCenter] addObserver:data->observerHelper selector:@selector(screenIsUnlocked:) name:QNSString(strNotificationAboutScreenUnlocked()).s() object:nil];
 }
 
 void PsMacWindowPrivate::setWindowBadge(const QString &str) {
diff --git a/Telegram/SourceFiles/structs.cpp b/Telegram/SourceFiles/structs.cpp
index fa6da44b7..3aed68e40 100644
--- a/Telegram/SourceFiles/structs.cpp
+++ b/Telegram/SourceFiles/structs.cpp
@@ -186,11 +186,11 @@ StorageKey PeerData::userpicUniqueKey() const {
 }
 
 void PeerData::saveUserpic(const QString &path, int size) const {
-	currentUserpic()->pixRounded(size, size).save(path, "PNG");
+	currentUserpic()->pixRounded(ImageRoundRadius::Small, size, size).save(path, "PNG");
 }
 
 QPixmap PeerData::genUserpic(int size) const {
-	return currentUserpic()->pixRounded(size, size);
+	return currentUserpic()->pixRounded(ImageRoundRadius::Small, size, size);
 }
 
 const Text &BotCommand::descriptionText() const {
diff --git a/Telegram/SourceFiles/ui/animation.cpp b/Telegram/SourceFiles/ui/animation.cpp
index 03b194fe9..7c10d9b78 100644
--- a/Telegram/SourceFiles/ui/animation.cpp
+++ b/Telegram/SourceFiles/ui/animation.cpp
@@ -230,7 +230,7 @@ QPixmap _prepareFrame(const ClipFrameRequest &request, const QImage &original, b
 			}
 		}
 		if (request.rounded) {
-			imageRound(cache);
+			imageRound(cache, ImageRoundRadius::Large);
 		}
 		return QPixmap::fromImage(cache, Qt::ColorOnly);
 	}
diff --git a/Telegram/SourceFiles/ui/buttons/round_button.cpp b/Telegram/SourceFiles/ui/buttons/round_button.cpp
index 947167c06..7dea05a67 100644
--- a/Telegram/SourceFiles/ui/buttons/round_button.cpp
+++ b/Telegram/SourceFiles/ui/buttons/round_button.cpp
@@ -102,12 +102,12 @@ void RoundButton::paintEvent(QPaintEvent *e) {
 	if (_fullWidthOverride < 0) {
 		rounded = QRect(0, rounded.top(), innerWidth - _fullWidthOverride, rounded.height());
 	}
-	App::roundRect(p, rounded, _st.textBg);
+	App::roundRect(p, rounded, _st.textBg, ImageRoundRadius::Small);
 
 	auto o = a_textBgOverOpacity.current();
 	if (o > 0) {
 		p.setOpacity(o);
-		App::roundRect(p, rounded, _st.textBgOver);
+		App::roundRect(p, rounded, _st.textBgOver, ImageRoundRadius::Small);
 		p.setOpacity(1);
 	}
 
@@ -116,7 +116,8 @@ void RoundButton::paintEvent(QPaintEvent *e) {
 	if (_fullWidthOverride < 0) {
 		textLeft = -_fullWidthOverride / 2;
 	}
-	int textTop = _st.padding.top() + _st.textTop;
+	int textTopDelta = (_state & StateDown) ? (_st.downTextTop - _st.textTop) : 0;
+	int textTop = _st.padding.top() + _st.textTop + textTopDelta;
 	if (!_text.isEmpty()) {
 		if (o > 0) {
 			p.setPen(a_textFg.current());
@@ -134,7 +135,7 @@ void RoundButton::paintEvent(QPaintEvent *e) {
 		}
 		p.drawTextLeft(textLeft, textTop, width(), _secondaryText);
 	}
-	_st.icon.paint(p, QPoint(_st.padding.left(), _st.padding.right()), width());
+	_st.icon.paint(p, QPoint(_st.padding.left(), _st.padding.right() + textTopDelta), width());
 }
 
 void RoundButton::step_over(float64 ms, bool timer) {
diff --git a/Telegram/SourceFiles/ui/countryinput.cpp b/Telegram/SourceFiles/ui/countryinput.cpp
index 49dd6b6d4..ae979b787 100644
--- a/Telegram/SourceFiles/ui/countryinput.cpp
+++ b/Telegram/SourceFiles/ui/countryinput.cpp
@@ -117,7 +117,7 @@ void CountryInput::paintEvent(QPaintEvent *e) {
 	p.setRenderHint(QPainter::HighQualityAntialiasing);
 	p.setBrush(_st.bgColor);
 	p.setPen(Qt::NoPen);
-	p.drawRoundedRect(_inner, st::msgRadius, st::msgRadius);
+	p.drawRoundedRect(_inner, st::buttonRadius, st::buttonRadius);
 	p.setRenderHint(QPainter::HighQualityAntialiasing, false);
 
 	p.drawPixmap(_arrowRect.x(), _arrowRect.top(), _arrow);
diff --git a/Telegram/SourceFiles/ui/flatbutton.cpp b/Telegram/SourceFiles/ui/flatbutton.cpp
index 8443ba011..365e5297e 100644
--- a/Telegram/SourceFiles/ui/flatbutton.cpp
+++ b/Telegram/SourceFiles/ui/flatbutton.cpp
@@ -371,14 +371,16 @@ void BoxButton::paintEvent(QPaintEvent *e) {
 	float64 o = a_textBgOverOpacity.current();
 	if (o > 0) {
 		p.setOpacity(o);
-		App::roundRect(p, rect(), _st.textBgOver);
+		App::roundRect(p, rect(), _st.textBgOver, ImageRoundRadius::Small);
 		p.setOpacity(1);
 		p.setPen(a_textFg.current());
 	} else {
 		p.setPen(_st.textFg);
 	}
 	p.setFont(_st.font);
-	p.drawText((width() - _textWidth) / 2, _st.textTop + _st.font->ascent, _text);
+
+	auto textTop = (_state & StateDown) ? _st.downTextTop : _st.textTop;
+	p.drawText((width() - _textWidth) / 2, textTop + _st.font->ascent, _text);
 }
 
 void BoxButton::step_over(float64 ms, bool timer) {
diff --git a/Telegram/SourceFiles/ui/flatcheckbox.cpp b/Telegram/SourceFiles/ui/flatcheckbox.cpp
index 8792f4b00..631a484b9 100644
--- a/Telegram/SourceFiles/ui/flatcheckbox.cpp
+++ b/Telegram/SourceFiles/ui/flatcheckbox.cpp
@@ -347,7 +347,7 @@ void Checkbox::paintEvent(QPaintEvent *e) {
 		} else {
 			p.setBrush(st::white);
 		}
-		p.drawRoundedRect(QRectF(_checkRect).marginsRemoved(QMarginsF(_st.thickness / 2., _st.thickness / 2., _st.thickness / 2., _st.thickness / 2.)), st::msgRadius - (_st.thickness / 2.), st::msgRadius - (_st.thickness / 2.));
+		p.drawRoundedRect(QRectF(_checkRect).marginsRemoved(QMarginsF(_st.thickness / 2., _st.thickness / 2., _st.thickness / 2., _st.thickness / 2.)), st::buttonRadius - (_st.thickness / 2.), st::buttonRadius - (_st.thickness / 2.));
 		p.setRenderHint(QPainter::HighQualityAntialiasing, false);
 
 		if (checked > 0) {
diff --git a/Telegram/SourceFiles/ui/flatinput.cpp b/Telegram/SourceFiles/ui/flatinput.cpp
index 55e088fda..8dbdb173e 100644
--- a/Telegram/SourceFiles/ui/flatinput.cpp
+++ b/Telegram/SourceFiles/ui/flatinput.cpp
@@ -180,7 +180,7 @@ void FlatInput::paintEvent(QPaintEvent *e) {
 	pen.setWidth(_st.borderWidth);
 	p.setPen(pen);
 	p.setBrush(QBrush(a_bgColor.current()));
-	p.drawRoundedRect(QRectF(0, 0, width(), height()).marginsRemoved(QMarginsF(_st.borderWidth / 2., _st.borderWidth / 2., _st.borderWidth / 2., _st.borderWidth / 2.)), st::msgRadius - (_st.borderWidth / 2.), st::msgRadius - (_st.borderWidth / 2.));
+	p.drawRoundedRect(QRectF(0, 0, width(), height()).marginsRemoved(QMarginsF(_st.borderWidth / 2., _st.borderWidth / 2., _st.borderWidth / 2., _st.borderWidth / 2.)), st::buttonRadius - (_st.borderWidth / 2.), st::buttonRadius - (_st.borderWidth / 2.));
 	p.setRenderHint(QPainter::HighQualityAntialiasing, false);
 
 	if (_st.imgRect.pxWidth()) {
diff --git a/Telegram/SourceFiles/ui/images.cpp b/Telegram/SourceFiles/ui/images.cpp
index 3d7d1c14b..2cc1e8b30 100644
--- a/Telegram/SourceFiles/ui/images.cpp
+++ b/Telegram/SourceFiles/ui/images.cpp
@@ -117,7 +117,7 @@ const QPixmap &Image::pix(int32 w, int32 h) const {
 	return i.value();
 }
 
-const QPixmap &Image::pixRounded(int32 w, int32 h) const {
+const QPixmap &Image::pixRounded(ImageRoundRadius radius, int32 w, int32 h) const {
 	checkload();
 
 	if (w <= 0 || !width() || !height()) {
@@ -129,7 +129,8 @@ const QPixmap &Image::pixRounded(int32 w, int32 h) const {
 	uint64 k = RoundedCacheSkip | (uint64(w) << 32) | uint64(h);
 	Sizes::const_iterator i = _sizesCache.constFind(k);
 	if (i == _sizesCache.cend()) {
-		QPixmap p(pixNoCache(w, h, ImagePixSmooth | ImagePixRounded));
+		auto options = ImagePixSmooth | (radius == ImageRoundRadius::Large ? ImagePixRoundedLarge : ImagePixRoundedSmall);
+		QPixmap p(pixNoCache(w, h, options));
 		if (cRetina()) p.setDevicePixelRatio(cRetinaFactor());
 		i = _sizesCache.insert(k, p);
 		if (!p.isNull()) {
@@ -227,7 +228,7 @@ const QPixmap &Image::pixBlurredColored(const style::color &add, int32 w, int32
 	return i.value();
 }
 
-const QPixmap &Image::pixSingle(int32 w, int32 h, int32 outerw, int32 outerh) const {
+const QPixmap &Image::pixSingle(ImageRoundRadius radius, int32 w, int32 h, int32 outerw, int32 outerh) const {
 	checkload();
 
 	if (w <= 0 || !width() || !height()) {
@@ -242,7 +243,8 @@ const QPixmap &Image::pixSingle(int32 w, int32 h, int32 outerw, int32 outerh) co
 		if (i != _sizesCache.cend()) {
 			globalAcquiredSize -= int64(i->width()) * i->height() * 4;
 		}
-		QPixmap p(pixNoCache(w, h, ImagePixSmooth | ImagePixRounded, outerw, outerh));
+		auto options = ImagePixSmooth | (radius == ImageRoundRadius::Large ? ImagePixRoundedLarge : ImagePixRoundedSmall);
+		QPixmap p(pixNoCache(w, h, options, outerw, outerh));
 		if (cRetina()) p.setDevicePixelRatio(cRetinaFactor());
 		i = _sizesCache.insert(k, p);
 		if (!p.isNull()) {
@@ -252,7 +254,7 @@ const QPixmap &Image::pixSingle(int32 w, int32 h, int32 outerw, int32 outerh) co
 	return i.value();
 }
 
-const QPixmap &Image::pixBlurredSingle(int w, int h, int32 outerw, int32 outerh) const {
+const QPixmap &Image::pixBlurredSingle(ImageRoundRadius radius, int w, int h, int32 outerw, int32 outerh) const {
 	checkload();
 
 	if (w <= 0 || !width() || !height()) {
@@ -267,7 +269,8 @@ const QPixmap &Image::pixBlurredSingle(int w, int h, int32 outerw, int32 outerh)
 		if (i != _sizesCache.cend()) {
 			globalAcquiredSize -= int64(i->width()) * i->height() * 4;
 		}
-		QPixmap p(pixNoCache(w, h, ImagePixSmooth | ImagePixBlurred | ImagePixRounded, outerw, outerh));
+		auto options = ImagePixSmooth | ImagePixBlurred | (radius == ImageRoundRadius::Large ? ImagePixRoundedLarge : ImagePixRoundedSmall);
+		QPixmap p(pixNoCache(w, h, options, outerw, outerh));
 		if (cRetina()) p.setDevicePixelRatio(cRetinaFactor());
 		i = _sizesCache.insert(k, p);
 		if (!p.isNull()) {
@@ -435,17 +438,20 @@ void imageCircle(QImage &img) {
 	p.drawPixmap(0, 0, mask);
 }
 
-void imageRound(QImage &img) {
+void imageRound(QImage &img, ImageRoundRadius radius) {
 	t_assert(!img.isNull());
 
 	img.setDevicePixelRatio(cRetinaFactor());
 	img = img.convertToFormat(QImage::Format_ARGB32_Premultiplied);
 	t_assert(!img.isNull());
 
-	QImage **masks = App::cornersMask();
+	QImage **masks = App::cornersMask(radius);
 	int32 w = masks[0]->width(), h = masks[0]->height();
 	int32 tw = img.width(), th = img.height();
 	if (tw < 2 * w || th < 2 * h) {
+		if (radius == ImageRoundRadius::Large) {
+			return imageRound(img, ImageRoundRadius::Small);
+		}
 		return;
 	}
 
@@ -530,9 +536,11 @@ QPixmap imagePix(QImage img, int32 w, int32 h, ImagePixOptions options, int32 ou
 	if (options.testFlag(ImagePixCircled)) {
 		imageCircle(img);
 		t_assert(!img.isNull());
-	} else if (options.testFlag(ImagePixRounded)) {
-		imageRound(img);
+	} else if (options.testFlag(ImagePixRoundedLarge)) {
+		imageRound(img, ImageRoundRadius::Large);
 		t_assert(!img.isNull());
+	} else if (options.testFlag(ImagePixRoundedSmall)) {
+		imageRound(img, ImageRoundRadius::Small);
 	}
 	img.setDevicePixelRatio(cRetinaFactor());
 	return QPixmap::fromImage(img, Qt::ColorOnly);
@@ -571,8 +579,10 @@ QPixmap Image::pixNoCache(int w, int h, ImagePixOptions options, int outerw, int
 
 		if (options.testFlag(ImagePixCircled)) {
 			imageCircle(result);
-		} else if (options.testFlag(ImagePixRounded)) {
-			imageRound(result);
+		} else if (options.testFlag(ImagePixRoundedLarge)) {
+			imageRound(result, ImageRoundRadius::Large);
+		} else if (options.testFlag(ImagePixRoundedSmall)) {
+			imageRound(result, ImageRoundRadius::Small);
 		}
 		return QPixmap::fromImage(result, Qt::ColorOnly);
 	}
diff --git a/Telegram/SourceFiles/ui/images.h b/Telegram/SourceFiles/ui/images.h
index 3cc8f1f3b..8596dbfc4 100644
--- a/Telegram/SourceFiles/ui/images.h
+++ b/Telegram/SourceFiles/ui/images.h
@@ -22,8 +22,13 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
 
 #include "mtproto/file_download.h"
 
+enum class ImageRoundRadius {
+	Large,
+	Small,
+};
+
 QImage imageBlur(QImage img);
-void imageRound(QImage &img);
+void imageRound(QImage &img, ImageRoundRadius radius);
 
 inline uint32 packInt(int32 a) {
 	return (a < 0) ? uint32(int64(a) + 0x100000000LL) : uint32(a);
@@ -110,8 +115,9 @@ inline bool operator!=(const StorageImageLocation &a, const StorageImageLocation
 enum ImagePixOption {
 	ImagePixSmooth = 0x01,
 	ImagePixBlurred = 0x02,
-	ImagePixRounded = 0x04,
-	ImagePixCircled = 0x08,
+	ImagePixCircled = 0x04,
+	ImagePixRoundedLarge = 0x08,
+	ImagePixRoundedSmall = 0x10,
 };
 Q_DECLARE_FLAGS(ImagePixOptions, ImagePixOption);
 Q_DECLARE_OPERATORS_FOR_FLAGS(ImagePixOptions);
@@ -152,13 +158,13 @@ public:
 	}
 
 	const QPixmap &pix(int32 w = 0, int32 h = 0) const;
-	const QPixmap &pixRounded(int32 w = 0, int32 h = 0) const;
+	const QPixmap &pixRounded(ImageRoundRadius radius, int32 w = 0, int32 h = 0) const;
 	const QPixmap &pixCircled(int32 w = 0, int32 h = 0) const;
 	const QPixmap &pixBlurred(int32 w = 0, int32 h = 0) const;
 	const QPixmap &pixColored(const style::color &add, int32 w = 0, int32 h = 0) const;
 	const QPixmap &pixBlurredColored(const style::color &add, int32 w = 0, int32 h = 0) const;
-	const QPixmap &pixSingle(int32 w, int32 h, int32 outerw, int32 outerh) const;
-	const QPixmap &pixBlurredSingle(int32 w, int32 h, int32 outerw, int32 outerh) const;
+	const QPixmap &pixSingle(ImageRoundRadius radius, int32 w, int32 h, int32 outerw, int32 outerh) const;
+	const QPixmap &pixBlurredSingle(ImageRoundRadius radius, int32 w, int32 h, int32 outerw, int32 outerh) const;
 	QPixmap pixNoCache(int w = 0, int h = 0, ImagePixOptions options = 0, int outerw = -1, int outerh = -1) const;
 	QPixmap pixColoredNoCache(const style::color &add, int32 w = 0, int32 h = 0, bool smooth = false) const;
 	QPixmap pixBlurredColoredNoCache(const style::color &add, int32 w, int32 h = 0) const;
diff --git a/Telegram/SourceFiles/ui/scrollarea.cpp b/Telegram/SourceFiles/ui/scrollarea.cpp
index 1e5dc1637..9ebd5d32b 100644
--- a/Telegram/SourceFiles/ui/scrollarea.cpp
+++ b/Telegram/SourceFiles/ui/scrollarea.cpp
@@ -140,10 +140,12 @@ void ScrollBar::paintEvent(QPaintEvent *e) {
 	int32 deltat = _vertical ? 0 : _st->deltax, deltab = _vertical ? 0 : _st->deltax;
 	p.setPen(Qt::NoPen);
 	if (_st->round) {
+		p.setRenderHint(QPainter::HighQualityAntialiasing, true);
 		p.setBrush(a_bg.current());
 		p.drawRoundedRect(QRect(deltal, deltat, width() - deltal - deltar, height() - deltat - deltab), _st->round, _st->round);
 		p.setBrush(a_bar.current());
 		p.drawRoundedRect(_bar, _st->round, _st->round);
+		p.setRenderHint(QPainter::HighQualityAntialiasing, false);
 	} else {
 		p.fillRect(QRect(deltal, deltat, width() - deltal - deltar, height() - deltat - deltab), a_bg.current());
 		p.fillRect(_bar, a_bar.current());
diff --git a/Telegram/SourceFiles/ui/toast/toast_widget.cpp b/Telegram/SourceFiles/ui/toast/toast_widget.cpp
index 69c98ebda..f8af6c05e 100644
--- a/Telegram/SourceFiles/ui/toast/toast_widget.cpp
+++ b/Telegram/SourceFiles/ui/toast/toast_widget.cpp
@@ -51,7 +51,7 @@ void Widget::paintEvent(QPaintEvent *e) {
 	Painter p(this);
 
 	p.setOpacity(_shownLevel);
-	App::roundRect(p, rect(), st::toastBg);
+	App::roundRect(p, rect(), st::toastBg, ImageRoundRadius::Large);
 
 	p.setPen(st::toastFg);
 	textstyleSet(&st::defaultTextStyle);
diff --git a/doc/building-qmake.md b/doc/building-qmake.md
index 55bf8c53b..ffeb1832b 100644
--- a/doc/building-qmake.md
+++ b/doc/building-qmake.md
@@ -72,7 +72,7 @@ Building
     cd "$srcdir/Libraries/QtStatic"
     ./configure -prefix "$srcdir/qt" -release -opensource -confirm-license -qt-zlib \
                 -qt-libpng -qt-libjpeg -qt-freetype -qt-harfbuzz -qt-pcre -qt-xcb \
-                -qt-xkbcommon-x11 -no-opengl -static -nomake examples -nomake tests
+                -qt-xkbcommon-x11 -no-opengl -no-gtkstyle -static -nomake examples -nomake tests
     make module-qtbase module-qtimageformats
     make module-qtbase-install_subtargets module-qtimageformats-install_subtargets
 
diff --git a/doc/building-qtcreator.md b/doc/building-qtcreator.md
index eb605ed15..18695f128 100644
--- a/doc/building-qtcreator.md
+++ b/doc/building-qtcreator.md
@@ -147,7 +147,7 @@ Install some packages for Qt (see **/home/user/TBuild/Libraries/qt5_6_0/qtbase/s
 
 In Terminal go to **/home/user/TBuild/Libraries/qt5_6_0** and there run
 
-    OPENSSL_LIBS='-L/usr/local/ssl/lib -lssl -lcrypto' ./configure -prefix "/usr/local/tdesktop/Qt-5.6.0" -release -force-debug-info -opensource -confirm-license -qt-zlib -qt-libpng -qt-libjpeg -qt-freetype -qt-harfbuzz -qt-pcre -qt-xcb -qt-xkbcommon-x11 -no-opengl -static -openssl-linked -nomake examples -nomake tests
+    OPENSSL_LIBS='-L/usr/local/ssl/lib -lssl -lcrypto' ./configure -prefix "/usr/local/tdesktop/Qt-5.6.0" -release -force-debug-info -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 -openssl-linked -nomake examples -nomake tests
     make -j4
     sudo make install