From 2867b84101ca1e836c2a0fe61321c50b2b19012f Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Wed, 4 Nov 2015 17:32:53 +0100 Subject: [PATCH] address last comments of review 125871 --- src/wayland/plasmawindowmanagement_interface.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/wayland/plasmawindowmanagement_interface.cpp b/src/wayland/plasmawindowmanagement_interface.cpp index 7042ab095b..3afd546863 100644 --- a/src/wayland/plasmawindowmanagement_interface.cpp +++ b/src/wayland/plasmawindowmanagement_interface.cpp @@ -88,7 +88,7 @@ private: static void setStateCallback(wl_client *client, wl_resource *resource, uint32_t flags, uint32_t state); static void setVirtualDesktopCallback(wl_client *client, wl_resource *resource, uint32_t number); static void closeCallback(wl_client *client, wl_resource *resource); - static void setTaskGeometryCallback(wl_client *client, wl_resource *resource, wl_resource *panel, uint32_t x, uint32_t y, uint32_t width, uint32_t height); + static void setMinimizedGeometryCallback(wl_client *client, wl_resource *resource, wl_resource *panel, uint32_t x, uint32_t y, uint32_t width, uint32_t height); static void unsetMinimizedGeometryCallback(wl_client *client, wl_resource *resource, wl_resource *panel); static Private *cast(wl_resource *resource) { return reinterpret_cast(wl_resource_get_user_data(resource)); @@ -247,7 +247,7 @@ PlasmaWindowInterface *PlasmaWindowManagementInterface::createWindow(QObject *pa const struct org_kde_plasma_window_interface PlasmaWindowInterface::Private::s_interface = { setStateCallback, setVirtualDesktopCallback, - setTaskGeometryCallback, + setMinimizedGeometryCallback, unsetMinimizedGeometryCallback, closeCallback }; @@ -447,7 +447,7 @@ void PlasmaWindowInterface::Private::setStateCallback(wl_client *client, wl_reso } } -void PlasmaWindowInterface::Private::setTaskGeometryCallback(wl_client *client, wl_resource *resource, wl_resource *panel, uint32_t x, uint32_t y, uint32_t width, uint32_t height) +void PlasmaWindowInterface::Private::setMinimizedGeometryCallback(wl_client *client, wl_resource *resource, wl_resource *panel, uint32_t x, uint32_t y, uint32_t width, uint32_t height) { Q_UNUSED(client) Private *p = cast(resource); @@ -457,10 +457,14 @@ void PlasmaWindowInterface::Private::setTaskGeometryCallback(wl_client *client, return; } + if (p->minimizedGeometries.value(panelSurface) == QRect(x, y, width, height)) { + return; + } + p->minimizedGeometries[panelSurface] = QRect(x, y, width, height); emit p->q->minimizedGeometriesChanged(); connect(panelSurface, &QObject::destroyed, p->q, [p, panelSurface] () { - if (p->minimizedGeometries.remove(panelSurface)) {; + if (p->minimizedGeometries.remove(panelSurface)) { emit p->q->minimizedGeometriesChanged(); } }); @@ -475,6 +479,9 @@ void PlasmaWindowInterface::Private::unsetMinimizedGeometryCallback(wl_client *c if (!panelSurface) { return; } + if (!p->minimizedGeometries.contains(panelSurface)) { + return; + } p->minimizedGeometries.remove(panelSurface); emit p->q->minimizedGeometriesChanged(); }