Revert "Allow buffer size overrides on Wayland EGL"
This reverts commit 303947c78c.
This commit is contained in:
parent
48ce68751a
commit
16708fd4f4
2 changed files with 4 additions and 83 deletions
|
|
@ -12,11 +12,9 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "waylandshells/xdg_shell.h"
|
#include "waylandshells/xdg_shell.h"
|
||||||
#include "qwayland-xdg-shell.h"
|
#include "qwayland-xdg-shell.h"
|
||||||
|
|
||||||
#include <QtCore/QtPlugin>
|
|
||||||
#include <QtGui/QGuiApplication>
|
#include <QtGui/QGuiApplication>
|
||||||
#include <QtGui/QWindow>
|
#include <QtGui/QWindow>
|
||||||
#include <qpa/qplatformnativeinterface.h>
|
#include <qpa/qplatformnativeinterface.h>
|
||||||
#include <wayland-client.h>
|
|
||||||
|
|
||||||
// private QtWaylandClient headers are using keywords :(
|
// private QtWaylandClient headers are using keywords :(
|
||||||
#ifdef QT_NO_KEYWORDS
|
#ifdef QT_NO_KEYWORDS
|
||||||
|
|
@ -24,24 +22,15 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#define slots Q_SLOTS
|
#define slots Q_SLOTS
|
||||||
#endif // QT_NO_KEYWORDS
|
#endif // QT_NO_KEYWORDS
|
||||||
|
|
||||||
#ifndef QT_STATICPLUGIN
|
|
||||||
#define QT_STATICPLUGIN
|
|
||||||
#endif // !QT_STATICPLUGIN
|
|
||||||
|
|
||||||
#include <private/qwaylanddisplay_p.h>
|
#include <private/qwaylanddisplay_p.h>
|
||||||
#include <private/qwaylandwindow_p.h>
|
#include <private/qwaylandwindow_p.h>
|
||||||
#include <private/qwaylandinputdevice_p.h>
|
#include <private/qwaylandinputdevice_p.h>
|
||||||
#include <private/qwaylandclientbufferintegrationplugin_p.h>
|
|
||||||
#include <private/qwaylandeglclientbufferintegration_p.h>
|
#include <wayland-client.h>
|
||||||
#include <private/qwaylandeglwindow_p.h>
|
|
||||||
#include <private/qwidgetwindow_p.h>
|
|
||||||
#include <private/qwidget_p.h>
|
|
||||||
|
|
||||||
Q_DECLARE_METATYPE(QMargins);
|
Q_DECLARE_METATYPE(QMargins);
|
||||||
|
|
||||||
Q_IMPORT_PLUGIN(DesktopAppWaylandEglClientBufferPlugin)
|
using QtWaylandClient::QWaylandWindow;
|
||||||
|
|
||||||
using namespace QtWaylandClient;
|
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
namespace Platform {
|
namespace Platform {
|
||||||
|
|
@ -59,64 +48,6 @@ struct WlCallbackDeleter {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class DesktopAppWaylandEglWindow : public QWaylandEglWindow {
|
|
||||||
public:
|
|
||||||
using QWaylandEglWindow::QWaylandEglWindow;
|
|
||||||
|
|
||||||
void ensureSize() override {
|
|
||||||
_settingGeometry = false;
|
|
||||||
QWaylandEglWindow::ensureSize();
|
|
||||||
}
|
|
||||||
|
|
||||||
QRect geometry() const override {
|
|
||||||
if (!_settingGeometry) {
|
|
||||||
if (const auto widgetWindow = qobject_cast<const QWidgetWindow*>(
|
|
||||||
window())) {
|
|
||||||
return widgetWindow->widget()->geometry();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return QWaylandEglWindow::geometry();
|
|
||||||
}
|
|
||||||
|
|
||||||
void setGeometry(const QRect &rect) override {
|
|
||||||
_settingGeometry = true;
|
|
||||||
QWaylandEglWindow::setGeometry(rect);
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
|
||||||
bool _settingGeometry = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
class DesktopAppWaylandEglClientBufferIntegration
|
|
||||||
: public QWaylandEglClientBufferIntegration {
|
|
||||||
public:
|
|
||||||
void initialize(QWaylandDisplay *display) override {
|
|
||||||
m_display = display;
|
|
||||||
QWaylandEglClientBufferIntegration::initialize(display);
|
|
||||||
}
|
|
||||||
|
|
||||||
QWaylandWindow *createEglWindow(QWindow *window) override {
|
|
||||||
return new DesktopAppWaylandEglWindow(window, m_display);
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
|
||||||
QWaylandDisplay *m_display = nullptr;
|
|
||||||
};
|
|
||||||
|
|
||||||
class DesktopAppWaylandEglClientBufferPlugin
|
|
||||||
: public QWaylandClientBufferIntegrationPlugin {
|
|
||||||
Q_OBJECT
|
|
||||||
Q_PLUGIN_METADATA(
|
|
||||||
IID QWaylandClientBufferIntegrationFactoryInterface_iid
|
|
||||||
FILE "wayland-egl.json")
|
|
||||||
public:
|
|
||||||
QWaylandClientBufferIntegration *create(
|
|
||||||
const QString&,
|
|
||||||
const QStringList&) override {
|
|
||||||
return new DesktopAppWaylandEglClientBufferIntegration();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
struct WaylandIntegration::Private {
|
struct WaylandIntegration::Private {
|
||||||
|
|
@ -281,15 +212,8 @@ void WaylandIntegration::showWindowMenu(
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
xdg_toplevel_show_window_menu(
|
xdg_toplevel_show_window_menu(toplevel, seat, *serial, point.x(), point.y());
|
||||||
toplevel,
|
|
||||||
seat,
|
|
||||||
*serial,
|
|
||||||
point.x(),
|
|
||||||
point.y());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Platform
|
} // namespace Platform
|
||||||
} // namespace Ui
|
} // namespace Ui
|
||||||
|
|
||||||
#include "ui/platform/linux/ui_linux_wayland_integration.moc"
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
{
|
|
||||||
"Keys": [ "desktop-app-wayland-egl" ]
|
|
||||||
}
|
|
||||||
Loading…
Add table
Reference in a new issue