2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-09-01 06:55:58 +00:00

pausing of mtp while animating, fixed message field while animating

This commit is contained in:
John Preston
2015-10-15 12:18:24 +02:00
parent 1c28d59ed2
commit f12f21b16b
15 changed files with 99 additions and 2 deletions

View File

@@ -352,6 +352,8 @@ namespace {
return false;
}
bool _paused = false;
}
namespace _mtp_internal {
@@ -371,6 +373,10 @@ namespace _mtp_internal {
sessions.insert(dcWithShift, result);
return result;
}
bool paused() {
return _paused;
}
void registerRequest(mtpRequestId requestId, int32 dcWithShift) {
{
@@ -643,6 +649,7 @@ namespace MTP {
(*i)->restart();
}
}
void restart(int32 dcMask) {
if (!_started) return;
@@ -654,6 +661,19 @@ namespace MTP {
}
}
void pause() {
if (!_started) return;
_paused = true;
}
void unpause() {
if (!_started) return;
_paused = false;
for (Sessions::const_iterator i = sessions.cbegin(), e = sessions.cend(); i != e; ++i) {
(*i)->unpaused();
}
}
void configure(int32 dc, int32 user) {
if (_started) return;
mtpSetDC(dc);