diff options
author | Jesse Barnes <jbarnes@virtuousgeek.org> | 2010-06-17 18:58:15 -0700 |
---|---|---|
committer | Jesse Barnes <jbarnes@virtuousgeek.org> | 2010-06-17 18:58:15 -0700 |
commit | ec12f217b8d9022ef9f70d510dbede9881d30289 (patch) | |
tree | 43841e6af5800f93674339bc357246ade10c704c | |
parent | be83e1b8f434c3b4f7557ecb6d374043df2954f0 (diff) |
Wayland: widgets have surfaces
Track the surface for a given widget using the WId.
-rw-r--r-- | src/gui/kernel/qwidget_wayland.cpp | 28 | ||||
-rw-r--r-- | src/gui/kernel/qwindowdefs.h | 2 |
2 files changed, 9 insertions, 21 deletions
diff --git a/src/gui/kernel/qwidget_wayland.cpp b/src/gui/kernel/qwidget_wayland.cpp index 4c0d64e2e1..92bb0b66c5 100644 --- a/src/gui/kernel/qwidget_wayland.cpp +++ b/src/gui/kernel/qwidget_wayland.cpp @@ -86,18 +86,9 @@ void QWidgetPrivate::create_sys(WId window, bool initializeWindow, bool desktop = (type == Qt::Desktop); bool tool = (type == Qt::Tool || type == Qt::SplashScreen || type == Qt::ToolTip || type == Qt::Drawer); - EGLDisplay dpy = qWayland->egl_display; - EGLImageKHR image; - GLuint texture; - EGLint image_attribs[] = { - EGL_WIDTH, 0, - EGL_HEIGHT, 0, - EGL_IMAGE_FORMAT_MESA, EGL_IMAGE_FORMAT_ARGB8888_MESA, - EGL_IMAGE_USE_MESA, EGL_IMAGE_USE_SCANOUT_MESA, - EGL_NONE - }; - - qWarning("wayland widget: %s\n", __func__); + struct wl_surface *surf; + + qWarning("wayland widget: %s(%d, %d, %d)\n", __func__, window, initializeWindow, destroyOldWindow); if (type == Qt::ToolTip) flags |= Qt::WindowStaysOnTopHint | Qt::FramelessWindowHint | Qt::X11BypassWindowManagerHint; @@ -124,14 +115,11 @@ void QWidgetPrivate::create_sys(WId window, bool initializeWindow, initializeWindow = true; if (topLevel || q->testAttribute(Qt::WA_NativeWindow) || paintOnScreen()) { - image_attribs[1] = data.crect.width(); - image_attribs[3] = data.crect.height(); - image = QEgl::eglCreateDRMImageMESA(dpy, image_attribs); - glGenTextures(1, &texture); - glBindTexture(GL_TEXTURE_2D, texture); - QEgl::glEGLImageTargetTexture(GL_TEXTURE_2D, image); - - setWinId(texture); + surf = wl_compositor_create_surface(qWayland->compositor); + if (!surf) + qWarning("failed to create compositor surface\n"); + setWinId(surf); + wl_compositor_commit(qWayland->compositor, 0); } } diff --git a/src/gui/kernel/qwindowdefs.h b/src/gui/kernel/qwindowdefs.h index 5b1b99e303..99f4dd6245 100644 --- a/src/gui/kernel/qwindowdefs.h +++ b/src/gui/kernel/qwindowdefs.h @@ -132,7 +132,7 @@ QT_END_HEADER #endif // Q_WS_QWS #if defined(Q_WS_WAYLAND) -typedef unsigned long WId; +typedef struct wl_surface *WId; #endif // Q_WS_WAYLAND #if defined(Q_OS_SYMBIAN) |