mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-18 07:07:08 +02:00
parent
c6f49486ee
commit
8c5db25476
3 changed files with 15 additions and 1 deletions
Telegram/SourceFiles
|
@ -159,6 +159,10 @@ void EmojiStatusPanel::show(Descriptor &&descriptor) {
|
|||
_panel->toggleAnimated();
|
||||
}
|
||||
|
||||
bool EmojiStatusPanel::hasFocus() const {
|
||||
return _panel && Ui::InFocusChain(_panel.get());
|
||||
}
|
||||
|
||||
void EmojiStatusPanel::repaint() {
|
||||
_panel->selector()->update();
|
||||
}
|
||||
|
|
|
@ -46,6 +46,7 @@ public:
|
|||
not_null<Window::SessionController*> controller,
|
||||
not_null<QWidget*> button,
|
||||
Data::CustomEmojiSizeTag animationSizeTag = {});
|
||||
[[nodiscard]] bool hasFocus() const;
|
||||
|
||||
struct Descriptor {
|
||||
not_null<Window::SessionController*> controller;
|
||||
|
|
|
@ -174,7 +174,16 @@ Cover::Cover(
|
|||
}, _name->lifetime());
|
||||
}
|
||||
|
||||
Cover::~Cover() = default;
|
||||
Cover::~Cover() {
|
||||
if (_emojiStatusPanel.hasFocus()) {
|
||||
// Panel will try to return focus to the layer widget, the problem is
|
||||
// we are destroying the layer widget probably right now and focusing
|
||||
// it will lead to a crash, because it destroys its children (how we
|
||||
// got here) after it clears focus out of itself. So if you return
|
||||
// the focus inside a child destructor, it won't be cleared at all.
|
||||
window()->setFocus();
|
||||
}
|
||||
}
|
||||
|
||||
void Cover::setupChildGeometry() {
|
||||
using namespace rpl::mappers;
|
||||
|
|
Loading…
Add table
Reference in a new issue