Try using hide media viewer workaround on Linux.

This commit is contained in:
John Preston 2023-11-22 12:18:14 +04:00
parent 4696f731da
commit b60e50df10
5 changed files with 11 additions and 15 deletions

View file

@ -298,7 +298,7 @@ void OverlayWidget::RendererGL::paint(
} }
std::optional<QColor> OverlayWidget::RendererGL::clearColor() { std::optional<QColor> OverlayWidget::RendererGL::clearColor() {
if (Platform::IsWindows() && _owner->_hideWorkaround) { if (_owner->_hideWorkaround) {
return QColor(0, 0, 0, 0); return QColor(0, 0, 0, 0);
} else if (_owner->_fullScreenVideo) { } else if (_owner->_fullScreenVideo) {
return st::mediaviewVideoBg->c; return st::mediaviewVideoBg->c;
@ -308,9 +308,9 @@ std::optional<QColor> OverlayWidget::RendererGL::clearColor() {
} }
bool OverlayWidget::RendererGL::handleHideWorkaround(QOpenGLFunctions &f) { bool OverlayWidget::RendererGL::handleHideWorkaround(QOpenGLFunctions &f) {
// This is needed on Windows, // This is needed on Windows or Linux,
// because on reopen it blinks with the last shown content. // because on reopen it blinks with the last shown content.
return Platform::IsWindows() && _owner->_hideWorkaround; return _owner->_hideWorkaround != nullptr;
} }
void OverlayWidget::RendererGL::paintBackground() { void OverlayWidget::RendererGL::paintBackground() {

View file

@ -27,7 +27,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "ui/image/image.h" #include "ui/image/image.h"
#include "ui/layers/layer_manager.h" #include "ui/layers/layer_manager.h"
#include "ui/text/text_utilities.h" #include "ui/text/text_utilities.h"
#include "ui/platform/ui_platform_utility.h"
#include "ui/platform/ui_platform_window_title.h" #include "ui/platform/ui_platform_window_title.h"
#include "ui/toast/toast.h" #include "ui/toast/toast.h"
#include "ui/text/format_values.h" #include "ui/text/format_values.h"
@ -3584,11 +3583,6 @@ void OverlayWidget::displayFinished(anim::activation activation) {
if (isHidden()) { if (isHidden()) {
_helper->beforeShow(_fullscreen); _helper->beforeShow(_fullscreen);
moveToScreen(); moveToScreen();
//setAttribute(Qt::WA_DontShowOnScreen);
//OverlayParent::setVisibleHook(true);
//OverlayParent::setVisibleHook(false);
//setAttribute(Qt::WA_DontShowOnScreen, false);
//Ui::Platform::UpdateOverlayed(_window);
showAndActivate(); showAndActivate();
} else if (activation == anim::activation::background) { } else if (activation == anim::activation::background) {
return; return;
@ -6077,10 +6071,12 @@ void OverlayWidget::applyHideWindowWorkaround() {
}); });
}, raw->lifetime()); }, raw->lifetime());
raw->update(); raw->update();
_widget->update();
if (Platform::IsWindows()) { if (!Platform::IsMac()) {
Ui::Platform::UpdateOverlayed(_window); Ui::ForceFullRepaintSync(_window);
} }
_hideWorkaround = nullptr;
} }
} }
@ -6147,10 +6143,10 @@ void OverlayWidget::clearBeforeHide() {
_helper->setControlsOpacity(1.); _helper->setControlsOpacity(1.);
_groupThumbs = nullptr; _groupThumbs = nullptr;
_groupThumbsRect = QRect(); _groupThumbsRect = QRect();
_body->hide();
} }
void OverlayWidget::clearAfterHide() { void OverlayWidget::clearAfterHide() {
_body->hide();
clearStreaming(); clearStreaming();
destroyThemePreview(); destroyThemePreview();
_radial.stop(); _radial.stop();

View file

@ -192,7 +192,7 @@ void Preview::toggle(ScalePreviewShow show, int scale, int sliderX) {
updateToScale(scale); updateToScale(scale);
updateGlobalPosition(sliderX); updateGlobalPosition(sliderX);
if (_widget.isHidden()) { if (_widget.isHidden()) {
Ui::Platform::UpdateOverlayed(&_widget); Ui::ForceFullRepaintSync(&_widget);
} }
toggleShown(true); toggleShown(true);
} }

View file

@ -582,7 +582,7 @@ void Widget::addToHeight(int add) {
auto newHeight = height() + add; auto newHeight = height() + add;
auto newPosition = computePosition(newHeight); auto newPosition = computePosition(newHeight);
updateGeometry(newPosition.x(), newPosition.y(), width(), newHeight); updateGeometry(newPosition.x(), newPosition.y(), width(), newHeight);
Ui::Platform::UpdateOverlayed(this); Ui::ForceFullRepaintSync(this);
} }
void Widget::updateGeometry(int x, int y, int width, int height) { void Widget::updateGeometry(int x, int y, int width, int height) {

@ -1 +1 @@
Subproject commit 69c8353746dbb36808b8349eff0cac0f057fa2f4 Subproject commit cd4e9d378cc98f590f814332900ec33863ffb98c