Track Wayland changes
The wl_display_get_xxxx_visual() functions have been removed, and are replaced by a compositor event. Reviewed-by: Samuel
This commit is contained in:
parent
44be214a78
commit
6e99936502
@ -81,17 +81,17 @@ struct wl_buffer *QWaylandDisplay::createShmBuffer(int fd,
|
||||
|
||||
struct wl_visual *QWaylandDisplay::rgbVisual()
|
||||
{
|
||||
return wl_display_get_rgb_visual(mDisplay);
|
||||
return rgb_visual;
|
||||
}
|
||||
|
||||
struct wl_visual *QWaylandDisplay::argbVisual()
|
||||
{
|
||||
return wl_display_get_argb_visual(mDisplay);
|
||||
return argb_visual;
|
||||
}
|
||||
|
||||
struct wl_visual *QWaylandDisplay::argbPremultipliedVisual()
|
||||
{
|
||||
return wl_display_get_premultiplied_argb_visual(mDisplay);
|
||||
return premultiplied_argb_visual;
|
||||
}
|
||||
|
||||
#ifdef QT_WAYLAND_GL_SUPPORT
|
||||
@ -127,6 +127,7 @@ const struct wl_shell_listener QWaylandDisplay::shellListener = {
|
||||
};
|
||||
|
||||
QWaylandDisplay::QWaylandDisplay(void)
|
||||
: argb_visual(0), premultiplied_argb_visual(0), rgb_visual(0)
|
||||
{
|
||||
mDisplay = wl_display_connect(NULL);
|
||||
if (mDisplay == NULL) {
|
||||
@ -243,6 +244,11 @@ const struct wl_output_listener QWaylandDisplay::outputListener = {
|
||||
QWaylandDisplay::outputHandleGeometry
|
||||
};
|
||||
|
||||
const struct wl_compositor_listener QWaylandDisplay::compositorListener = {
|
||||
QWaylandDisplay::handleVisual,
|
||||
};
|
||||
|
||||
|
||||
void QWaylandDisplay::waitForScreens()
|
||||
{
|
||||
flushRequests();
|
||||
@ -271,6 +277,8 @@ void QWaylandDisplay::displayHandleGlobal(uint32_t id,
|
||||
wl_output_add_listener(output, &outputListener, this);
|
||||
} else if (interface == "wl_compositor") {
|
||||
mCompositor = wl_compositor_create(mDisplay, id, 1);
|
||||
wl_compositor_add_listener(mCompositor,
|
||||
&compositorListener, this);
|
||||
} else if (interface == "wl_shm") {
|
||||
mShm = wl_shm_create(mDisplay, id, 1);
|
||||
} else if (interface == "wl_shell"){
|
||||
@ -286,3 +294,23 @@ void QWaylandDisplay::displayHandleGlobal(uint32_t id,
|
||||
clipboard->createSelectionOffer(id);
|
||||
}
|
||||
}
|
||||
|
||||
void QWaylandDisplay::handleVisual(void *data,
|
||||
struct wl_compositor *compositor,
|
||||
uint32_t id, uint32_t token)
|
||||
{
|
||||
QWaylandDisplay *self = static_cast<QWaylandDisplay *>(data);
|
||||
|
||||
switch (token) {
|
||||
case WL_COMPOSITOR_VISUAL_ARGB32:
|
||||
self->argb_visual = wl_visual_create(self->mDisplay, id, 1);
|
||||
break;
|
||||
case WL_COMPOSITOR_VISUAL_PREMULTIPLIED_ARGB32:
|
||||
self->premultiplied_argb_visual =
|
||||
wl_visual_create(self->mDisplay, id, 1);
|
||||
break;
|
||||
case WL_COMPOSITOR_VISUAL_XRGB32:
|
||||
self->rgb_visual = wl_visual_create(self->mDisplay, id, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -116,7 +116,10 @@ private:
|
||||
|
||||
uint32_t mSocketMask;
|
||||
|
||||
struct wl_visual *argb_visual, *premultiplied_argb_visual, *rgb_visual;
|
||||
|
||||
static const struct wl_output_listener outputListener;
|
||||
static const struct wl_compositor_listener compositorListener;
|
||||
static int sourceUpdate(uint32_t mask, void *data);
|
||||
static void displayHandleGlobal(struct wl_display *display,
|
||||
uint32_t id,
|
||||
@ -127,6 +130,9 @@ private:
|
||||
int32_t x, int32_t y,
|
||||
int32_t width, int32_t height);
|
||||
|
||||
static void handleVisual(void *data,
|
||||
struct wl_compositor *compositor,
|
||||
uint32_t id, uint32_t token);
|
||||
#ifdef QT_WAYLAND_GL_SUPPORT
|
||||
QWaylandGLIntegration *mEglIntegration;
|
||||
#endif
|
||||
|
3
src/plugins/platforms/wayland/wayland_sha1.txt
Normal file
3
src/plugins/platforms/wayland/wayland_sha1.txt
Normal file
@ -0,0 +1,3 @@
|
||||
This version of the Qt Wayland plugin is checked against the following sha1
|
||||
from the Wayland repository:
|
||||
eff7fc0d99be2e51eaa351785030c8d374ac71de
|
Loading…
Reference in New Issue
Block a user