=== modified file 'libunity-2d-private/src/workspacesinfo.cpp' --- libunity-2d-private/src/workspacesinfo.cpp 2011-10-18 10:23:34 +0000 +++ libunity-2d-private/src/workspacesinfo.cpp 2011-11-03 08:35:55 +0000 @@ -90,6 +90,8 @@ Orientation orientation; Corner startingCorner; unsigned long *result; + unsigned long newvalues[4]; + bool updateX; /* First obtain the number of workspaces, that will be needed to also calculate some properties of the layout which could be missing @@ -143,26 +145,41 @@ startingCorner = WorkspacesInfo::CornerTopLeft; } + updateX = false; + /* Notify of changes, if any */ if (m_count != workspaceCount) { m_count = workspaceCount; Q_EMIT countChanged(m_count); + updateX = true; } if (m_rows != rows) { m_rows = rows; Q_EMIT rowsChanged(m_rows); + updateX = true; } if (m_columns != columns) { m_columns = columns; Q_EMIT columnsChanged(m_columns); + updateX = true; } if (m_orientation != orientation) { m_orientation = orientation; Q_EMIT orientationChanged(m_orientation); + updateX = true; } if (m_startingCorner != startingCorner) { m_startingCorner = startingCorner; Q_EMIT startingCornerChanged(m_startingCorner); + updateX = true; + } + + if (updateX) { + newvalues[0] = orientation; + newvalues[1] = columns; + newvalues[2] = rows; + newvalues[3] = startingCorner; + setX11IntProperty(_NET_DESKTOP_LAYOUT, (unsigned char*)newvalues, 4); } } @@ -233,4 +250,13 @@ return NULL; } +void WorkspacesInfo::setX11IntProperty(Atom property, unsigned char *data, long length) +{ + XChangeProperty(QX11Info::display(), QX11Info::appRootWindow(), + property, + XA_CARDINAL, 32, + PropModeReplace, + data, length); +} + #include "workspacesinfo.moc" === modified file 'libunity-2d-private/src/workspacesinfo.h' --- libunity-2d-private/src/workspacesinfo.h 2011-07-29 13:49:34 +0000 +++ libunity-2d-private/src/workspacesinfo.h 2011-11-03 07:52:55 +0000 @@ -55,6 +55,7 @@ void updateWorkspaceGeometry(); void updateCurrentWorkspace(); unsigned long * getX11IntProperty(Atom property, long length); + void setX11IntProperty(Atom property, unsigned char *data, long length); private: int m_count;