Enable screen sharing on Linux.

This commit is contained in:
John Preston 2021-05-10 16:20:13 +04:00
parent 9ca6d0d893
commit 6b10045b7b
2 changed files with 5 additions and 8 deletions

View File

@ -750,9 +750,7 @@ void Panel::refreshLeftButton() {
_screenShare.create(widget(), st::groupCallScreenShareSmall);
_screenShare->show();
_screenShare->setClickedCallback([=] {
#ifndef Q_OS_LINUX
Ui::DesktopCapture::ChooseSource(this);
#endif // Q_OS_LINUX
});
_screenShare->setText(tr::lng_group_call_screen_share());
_screenShare->setColorOverrides(

View File

@ -296,8 +296,11 @@ void ChooseSourceProcess::activate() {
}
void ChooseSourceProcess::setupPanel() {
#ifndef Q_OS_LINUX
_window->setAttribute(Qt::WA_OpaquePaintEvent);
#endif // Q_OS_LINUX
_window->setAttribute(Qt::WA_NoSystemBackground);
_window->setWindowIcon(QIcon(
QPixmap::fromImage(Image::Empty()->original(), Qt::ColorOnly)));
_window->setTitleStyle(st::desktopCaptureSourceTitle);
@ -318,7 +321,7 @@ void ChooseSourceProcess::setupPanel() {
+ (st::desktopCaptureSourceSize.height() / 2)
+ bottomHeight;
_window->setFixedSize({ width, height });
_window->setWindowFlags(Qt::WindowStaysOnTopHint);
_window->setWindowFlag(Qt::WindowStaysOnTopHint);
_window->body()->paintRequest(
) | rpl::start_with_next([=](QRect clip) {
@ -530,11 +533,7 @@ void ChooseSourceProcess::setupSourcesGeometry() {
void ChooseSourceProcess::setupGeometryWithParent(
not_null<QWidget*> parent) {
if (const auto handle = parent->windowHandle()) {
if (::Platform::IsLinux()) {
_window->windowHandle()->setTransientParent(
parent->windowHandle());
_window->setWindowModality(Qt::WindowModal);
}
_window->createWinId();
const auto parentScreen = handle->screen();
const auto myScreen = _window->windowHandle()->screen();
if (parentScreen && myScreen != parentScreen) {