Commit 759822f3 authored by Johan Klokkhammer Helsing's avatar Johan Klokkhammer Helsing Committed by Johan Helsing
Browse files

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: default avatarPaul Olav Tvete <paul.tvete@theqtcompany.com>
Showing with 4 additions and 6 deletions
......@@ -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)
{
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 aboutToFullScreen = false;
state = (uint32_t*) states->data;
for (uint32_t i = 0; i < states->size / sizeof(state) ; i++)
{
switch (*(state+i)) {
for (size_t i = 0; i < numStates; i++) {
switch (state[i]) {
case XDG_SURFACE_STATE_MAXIMIZED:
aboutToMaximize = ((width > 0) && (height > 0));
break;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment