diff --git a/windoweffects.cpp b/windoweffects.cpp index b394cf482..ce411760c 100644 --- a/windoweffects.cpp +++ b/windoweffects.cpp @@ -99,7 +99,7 @@ void slideWindow(WId id, Plasma::Location location, int offset) #ifdef Q_WS_X11 Display *dpy = QX11Info::display(); Atom atom = XInternAtom( dpy, "_KDE_SLIDE", False ); - QVarLengthArray data(2); + QVarLengthArray data(2); data[0] = offset; @@ -133,7 +133,7 @@ void slideWindow(QWidget *widget, Plasma::Location location) #ifdef Q_WS_X11 Display *dpy = QX11Info::display(); Atom atom = XInternAtom( dpy, "_KDE_SLIDE", False ); - QVarLengthArray data(2); + QVarLengthArray data(2); switch (location) { case LeftEdge: @@ -197,7 +197,8 @@ void showWindowThumbnails(WId parent, const QList &windows, const QList data(1 + (6 * numWindows)); + // 64 is enough for 10 windows and is a nice base 2 number + QVarLengthArray data(1 + (6 * numWindows)); data[0] = numWindows; QList::const_iterator windowsIt; @@ -252,7 +253,7 @@ void presentWindows(WId controller, const QList &ids) void presentWindows(WId controller, int desktop) { #ifdef Q_WS_X11 - QVarLengthArray data(1); + QVarLengthArray data(1); data[0] = desktop; Display *dpy = QX11Info::display(); Atom atom = XInternAtom(dpy, "_KDE_PRESENT_WINDOWS_DESKTOP", False); @@ -298,12 +299,11 @@ void overrideShadow(WId window, bool override) #ifdef Q_WS_X11 Display *dpy = QX11Info::display(); Atom atom = XInternAtom( dpy, "_KDE_SHADOW_OVERRIDE", False ); - QVarLengthArray data(1); - data[0] = 1; - if (!override) { XDeleteProperty(dpy, window, atom); } else { + QVarLengthArray data(1); + data[0] = 1; XChangeProperty(dpy, window, atom, atom, 32, PropModeReplace, reinterpret_cast(data.data()), data.size()); }