mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-09-04 16:45:12 +00:00
Fix PiP window on macOS.
This commit is contained in:
@@ -706,7 +706,6 @@ void Panel::paintEvent(QPaintEvent *e) {
|
||||
finishAnimating();
|
||||
if (!_call || isHidden()) return;
|
||||
} else {
|
||||
Ui::Platform::StartTranslucentPaint(p, e);
|
||||
p.setOpacity(opacity);
|
||||
|
||||
PainterHighQualityEnabler hq(p);
|
||||
@@ -719,7 +718,6 @@ void Panel::paintEvent(QPaintEvent *e) {
|
||||
}
|
||||
|
||||
if (_useTransparency) {
|
||||
Ui::Platform::StartTranslucentPaint(p, e);
|
||||
p.drawPixmapLeft(0, 0, width(), _cache);
|
||||
} else {
|
||||
p.drawPixmapLeft(_padding.left(), _padding.top(), width(), _userPhoto);
|
||||
|
@@ -2522,6 +2522,9 @@ void OverlayWidget::switchToPip() {
|
||||
closeAndContinue,
|
||||
[=] { _pip = nullptr; });
|
||||
close();
|
||||
if (const auto window = Core::App().activeWindow()) {
|
||||
window->activate();
|
||||
}
|
||||
}
|
||||
|
||||
void OverlayWidget::playbackToggleFullScreen() {
|
||||
|
@@ -260,11 +260,11 @@ PipPanel::PipPanel(
|
||||
setAttribute(Qt::WA_MacAlwaysShowToolWindow);
|
||||
setAttribute(Qt::WA_NoSystemBackground);
|
||||
setAttribute(Qt::WA_TranslucentBackground);
|
||||
Ui::Platform::IgnoreAllActivation(this);
|
||||
Ui::Platform::InitOnTopPanel(this);
|
||||
setMouseTracking(true);
|
||||
resize(0, 0);
|
||||
show();
|
||||
//Ui::Platform::IgnoreAllActivation(this);
|
||||
}
|
||||
|
||||
void PipPanel::setAspectRatio(QSize ratio) {
|
||||
@@ -429,12 +429,12 @@ void PipPanel::paintEvent(QPaintEvent *e) {
|
||||
QPainter p(this);
|
||||
|
||||
if (_useTransparency) {
|
||||
Ui::Platform::StartTranslucentPaint(p, e);
|
||||
Ui::Platform::StartTranslucentPaint(p, e->region().rects());
|
||||
}
|
||||
|
||||
auto request = FrameRequest();
|
||||
const auto inner = rect().marginsRemoved(_padding);
|
||||
request.resize = request.outer = inner.size();
|
||||
request.resize = request.outer = inner.size() * style::DevicePixelRatio();
|
||||
request.corners = RectPart(0)
|
||||
| ((_attached & (RectPart::Left | RectPart::Top))
|
||||
? RectPart(0)
|
||||
@@ -728,7 +728,9 @@ void Pip::setupPanel() {
|
||||
) | rpl::filter([=](not_null<QEvent*> e) {
|
||||
return e->type() == QEvent::Close;
|
||||
}) | rpl::start_with_next([=] {
|
||||
crl::on_main(&_panel, [=] {
|
||||
_destroy();
|
||||
});
|
||||
}, _panel.lifetime());
|
||||
}
|
||||
|
||||
@@ -786,7 +788,7 @@ void Pip::setupStreaming() {
|
||||
|
||||
void Pip::paint(QPainter &p, FrameRequest request) {
|
||||
const auto image = videoFrameForDirectPaint(request);
|
||||
p.drawImage(0, 0, image);
|
||||
p.drawImage(QRect{ QPoint(), request.outer / style::DevicePixelRatio() }, image);
|
||||
if (_instance.player().ready()) {
|
||||
_instance.markFrameShown();
|
||||
}
|
||||
|
@@ -398,7 +398,6 @@ void SeparatePanel::paintEvent(QPaintEvent *e) {
|
||||
finishAnimating();
|
||||
if (isHidden()) return;
|
||||
} else {
|
||||
Ui::Platform::StartTranslucentPaint(p, e);
|
||||
p.setOpacity(opacity);
|
||||
|
||||
PainterHighQualityEnabler hq(p);
|
||||
@@ -419,7 +418,6 @@ void SeparatePanel::paintEvent(QPaintEvent *e) {
|
||||
}
|
||||
|
||||
if (_useTransparency) {
|
||||
Ui::Platform::StartTranslucentPaint(p, e);
|
||||
paintShadowBorder(p);
|
||||
} else {
|
||||
paintOpaqueBorder(p);
|
||||
|
Submodule Telegram/lib_ui updated: 8399f70ea0...33ea14969e
Reference in New Issue
Block a user