Properly handle the expose event for QWindow.
This commit is contained in:
parent
3086f2098e
commit
3edff16c87
@ -327,6 +327,12 @@ QPlatformWindow *QWindow::handle() const
|
|||||||
return d->platformWindow;
|
return d->platformWindow;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QWindowSurface *QWindow::surface() const
|
||||||
|
{
|
||||||
|
Q_D(const QWindow);
|
||||||
|
return d->surface;
|
||||||
|
}
|
||||||
|
|
||||||
void QWindow::showMinimized()
|
void QWindow::showMinimized()
|
||||||
{
|
{
|
||||||
qDebug() << "unimplemented:" << __FILE__ << __LINE__;
|
qDebug() << "unimplemented:" << __FILE__ << __LINE__;
|
||||||
|
@ -66,6 +66,7 @@ class QWheelEvent;
|
|||||||
|
|
||||||
class QPlatformWindow;
|
class QPlatformWindow;
|
||||||
class QWindowContext;
|
class QWindowContext;
|
||||||
|
class QWindowSurface;
|
||||||
|
|
||||||
class Q_GUI_EXPORT QWindow : public QObject
|
class Q_GUI_EXPORT QWindow : public QObject
|
||||||
{
|
{
|
||||||
@ -132,6 +133,7 @@ public:
|
|||||||
void destroy();
|
void destroy();
|
||||||
|
|
||||||
QPlatformWindow *handle() const;
|
QPlatformWindow *handle() const;
|
||||||
|
QWindowSurface *surface() const;
|
||||||
|
|
||||||
public Q_SLOTS:
|
public Q_SLOTS:
|
||||||
inline void show() { setVisible(true); }
|
inline void show() { setVisible(true); }
|
||||||
@ -174,6 +176,7 @@ private:
|
|||||||
|
|
||||||
friend class QGuiApplication;
|
friend class QGuiApplication;
|
||||||
friend class QGuiApplicationPrivate;
|
friend class QGuiApplicationPrivate;
|
||||||
|
friend class QWindowSurface;
|
||||||
};
|
};
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
@ -62,13 +62,13 @@ public:
|
|||||||
, platformWindow(0)
|
, platformWindow(0)
|
||||||
, visible(false)
|
, visible(false)
|
||||||
, glContext(0)
|
, glContext(0)
|
||||||
|
, surface(0)
|
||||||
{
|
{
|
||||||
isWindow = true;
|
isWindow = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
~QWindowPrivate()
|
~QWindowPrivate()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Qt::WindowFlags windowFlags;
|
Qt::WindowFlags windowFlags;
|
||||||
@ -80,6 +80,7 @@ public:
|
|||||||
QString windowTitle;
|
QString windowTitle;
|
||||||
QRect geometry;
|
QRect geometry;
|
||||||
QWindowContext *glContext;
|
QWindowContext *glContext;
|
||||||
|
QWindowSurface *surface;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -116,6 +116,8 @@ public:
|
|||||||
QWindowSurface::QWindowSurface(QWindow *window, bool /*setDefaultSurface*/)
|
QWindowSurface::QWindowSurface(QWindow *window, bool /*setDefaultSurface*/)
|
||||||
: d_ptr(new QWindowSurfacePrivate(window))
|
: d_ptr(new QWindowSurfacePrivate(window))
|
||||||
{
|
{
|
||||||
|
if (window)
|
||||||
|
window->d_func()->surface = this;
|
||||||
#if 0
|
#if 0
|
||||||
if (!QApplicationPrivate::runtime_graphics_system) {
|
if (!QApplicationPrivate::runtime_graphics_system) {
|
||||||
if (setDefaultSurface && window)
|
if (setDefaultSurface && window)
|
||||||
|
@ -528,18 +528,12 @@ QPlatformGLContext *QXcbWindow::glContext() const
|
|||||||
|
|
||||||
void QXcbWindow::handleExposeEvent(const xcb_expose_event_t *event)
|
void QXcbWindow::handleExposeEvent(const xcb_expose_event_t *event)
|
||||||
{
|
{
|
||||||
#if 0
|
QWindowSurface *surface = window()->surface();
|
||||||
QWidget *widget = window()->widget();
|
|
||||||
if (!widget)
|
|
||||||
return;
|
|
||||||
|
|
||||||
QWindowSurface *surface = widget->windowSurface();
|
|
||||||
if (surface) {
|
if (surface) {
|
||||||
QRect rect(event->x, event->y, event->width, event->height);
|
QRect rect(event->x, event->y, event->width, event->height);
|
||||||
|
|
||||||
surface->flush(widget, rect, QPoint());
|
surface->flush(window(), rect, QPoint());
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void QXcbWindow::handleClientMessageEvent(const xcb_client_message_event_t *event)
|
void QXcbWindow::handleClientMessageEvent(const xcb_client_message_event_t *event)
|
||||||
|
Loading…
Reference in New Issue
Block a user