mirror of https://github.com/procxx/kepka.git
Fix PiP window on macOS.
This commit is contained in:
parent
0fbd263562
commit
4d737b35da
|
@ -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([=] {
|
||||
_destroy();
|
||||
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);
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 8399f70ea0764ff8ebc4928474c311b6327da802
|
||||
Subproject commit 33ea14969edfbe2546726d82925a1a66ae49310e
|
Loading…
Reference in New Issue