Fix client xdg_surface not handling all states from configure event
The code used sizeof(state) when it should have been sizeof(*state). Change-Id: Id1714a5e90e6c58850023424726de26719a69046 Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
This commit is contained in:
parent
330e3a7869
commit
2414bb75bb
@ -173,15 +173,13 @@ void QWaylandXdgSurface::sendProperty(const QString &name, const QVariant &value
|
|||||||
|
|
||||||
void QWaylandXdgSurface::xdg_surface_configure(int32_t width, int32_t height, struct wl_array *states,uint32_t serial)
|
void QWaylandXdgSurface::xdg_surface_configure(int32_t width, int32_t height, struct wl_array *states,uint32_t serial)
|
||||||
{
|
{
|
||||||
uint32_t *state = 0;
|
uint32_t *state = reinterpret_cast<uint32_t*>(states->data);
|
||||||
|
size_t numStates = states->size / sizeof(uint32_t);
|
||||||
bool aboutToMaximize = false;
|
bool aboutToMaximize = false;
|
||||||
bool aboutToFullScreen = false;
|
bool aboutToFullScreen = false;
|
||||||
|
|
||||||
state = (uint32_t*) states->data;
|
for (size_t i = 0; i < numStates; i++) {
|
||||||
|
switch (state[i]) {
|
||||||
for (uint32_t i = 0; i < states->size / sizeof(state) ; i++)
|
|
||||||
{
|
|
||||||
switch (*(state+i)) {
|
|
||||||
case XDG_SURFACE_STATE_MAXIMIZED:
|
case XDG_SURFACE_STATE_MAXIMIZED:
|
||||||
aboutToMaximize = ((width > 0) && (height > 0));
|
aboutToMaximize = ((width > 0) && (height > 0));
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user