mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Remove old notification descturction workaround for old X11 systems
There seem to be no need in it anymore
This commit is contained in:
parent
e4d88f829c
commit
d79da3d884
3 changed files with 1 additions and 30 deletions
|
@ -28,7 +28,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "platform/platform_specific.h"
|
#include "platform/platform_specific.h"
|
||||||
#include "platform/platform_notifications_manager.h"
|
#include "platform/platform_notifications_manager.h"
|
||||||
#include "base/platform/base_platform_info.h"
|
#include "base/platform/base_platform_info.h"
|
||||||
#include "base/call_delayed.h"
|
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
#include "core/application.h"
|
#include "core/application.h"
|
||||||
#include "main/main_session.h"
|
#include "main/main_session.h"
|
||||||
|
@ -133,13 +132,10 @@ private:
|
||||||
void startAnimation();
|
void startAnimation();
|
||||||
void animationCallback();
|
void animationCallback();
|
||||||
|
|
||||||
void destroyDelayed();
|
|
||||||
|
|
||||||
NotificationsCount *_owner;
|
NotificationsCount *_owner;
|
||||||
QPixmap _cache;
|
QPixmap _cache;
|
||||||
Ui::Animations::Simple _opacity;
|
Ui::Animations::Simple _opacity;
|
||||||
bool _hiding = false;
|
bool _hiding = false;
|
||||||
bool _deleted = false;
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -665,18 +661,6 @@ void NotificationsCount::SampleWidget::animationCallback() {
|
||||||
_owner->removeSample(this);
|
_owner->removeSample(this);
|
||||||
}
|
}
|
||||||
hide();
|
hide();
|
||||||
destroyDelayed();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void NotificationsCount::SampleWidget::destroyDelayed() {
|
|
||||||
if (_deleted) return;
|
|
||||||
_deleted = true;
|
|
||||||
|
|
||||||
// Ubuntu has a lag if deleteLater() called immediately.
|
|
||||||
if constexpr (Platform::IsLinux()) {
|
|
||||||
base::call_delayed(1000, this, [this] { delete this; });
|
|
||||||
} else {
|
|
||||||
deleteLater();
|
deleteLater();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -496,22 +496,11 @@ Widget::Widget(
|
||||||
_a_opacity.start([this] { opacityAnimationCallback(); }, 0., 1., st::notifyFastAnim);
|
_a_opacity.start([this] { opacityAnimationCallback(); }, 0., 1., st::notifyFastAnim);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Widget::destroyDelayed() {
|
|
||||||
hide();
|
|
||||||
if (_deleted) return;
|
|
||||||
_deleted = true;
|
|
||||||
|
|
||||||
// Ubuntu has a lag if a fully transparent widget is destroyed immediately.
|
|
||||||
base::call_delayed(1000, this, [this] {
|
|
||||||
manager()->removeWidget(this);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
void Widget::opacityAnimationCallback() {
|
void Widget::opacityAnimationCallback() {
|
||||||
updateOpacity();
|
updateOpacity();
|
||||||
update();
|
update();
|
||||||
if (!_a_opacity.animating() && _hiding) {
|
if (!_a_opacity.animating() && _hiding) {
|
||||||
destroyDelayed();
|
manager()->removeWidget(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -171,7 +171,6 @@ protected:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void opacityAnimationCallback();
|
void opacityAnimationCallback();
|
||||||
void destroyDelayed();
|
|
||||||
void moveByShift();
|
void moveByShift();
|
||||||
void hideAnimated(float64 duration, const anim::transition &func);
|
void hideAnimated(float64 duration, const anim::transition &func);
|
||||||
bool shiftAnimationCallback(crl::time now);
|
bool shiftAnimationCallback(crl::time now);
|
||||||
|
@ -179,7 +178,6 @@ private:
|
||||||
const not_null<Manager*> _manager;
|
const not_null<Manager*> _manager;
|
||||||
|
|
||||||
bool _hiding = false;
|
bool _hiding = false;
|
||||||
bool _deleted = false;
|
|
||||||
base::binary_guard _hidingDelayed;
|
base::binary_guard _hidingDelayed;
|
||||||
Ui::Animations::Simple _a_opacity;
|
Ui::Animations::Simple _a_opacity;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue