provide a function to return all the desktop names instead of one at a time.
adjust to the new format for otk::Proeprty::get() functions (no nelements)
This commit is contained in:
parent
60cd451a23
commit
232092fa21
2 changed files with 7 additions and 17 deletions
|
@ -198,7 +198,7 @@ void Screen::updateDesktopLayout()
|
||||||
otk::Property::atoms.net_desktop_layout,
|
otk::Property::atoms.net_desktop_layout,
|
||||||
otk::Property::atoms.cardinal,
|
otk::Property::atoms.cardinal,
|
||||||
&num, &data)) {
|
&num, &data)) {
|
||||||
if (num >= 4) {
|
if (num == 4) {
|
||||||
if (data[0] == _NET_WM_ORIENTATION_VERT)
|
if (data[0] == _NET_WM_ORIENTATION_VERT)
|
||||||
_layout.orientation = DesktopLayout::Vertical;
|
_layout.orientation = DesktopLayout::Vertical;
|
||||||
if (data[3] == _NET_WM_TOPRIGHT)
|
if (data[3] == _NET_WM_TOPRIGHT)
|
||||||
|
@ -810,6 +810,9 @@ void Screen::changeNumDesktops(unsigned int num)
|
||||||
// the number of rows/columns will differ
|
// the number of rows/columns will differ
|
||||||
updateDesktopLayout();
|
updateDesktopLayout();
|
||||||
|
|
||||||
|
// may be some unnamed desktops that we need to fill in with names
|
||||||
|
updateDesktopNames();
|
||||||
|
|
||||||
// change our desktop if we're on one that no longer exists!
|
// change our desktop if we're on one that no longer exists!
|
||||||
if (_desktop >= _num_desktops)
|
if (_desktop >= _num_desktops)
|
||||||
changeDesktop(_num_desktops - 1);
|
changeDesktop(_num_desktops - 1);
|
||||||
|
@ -818,7 +821,7 @@ void Screen::changeNumDesktops(unsigned int num)
|
||||||
|
|
||||||
void Screen::updateDesktopNames()
|
void Screen::updateDesktopNames()
|
||||||
{
|
{
|
||||||
unsigned long num = (unsigned) -1;
|
unsigned long num;
|
||||||
|
|
||||||
if (!otk::Property::get(_info->rootWindow(),
|
if (!otk::Property::get(_info->rootWindow(),
|
||||||
otk::Property::atoms.net_desktop_names,
|
otk::Property::atoms.net_desktop_names,
|
||||||
|
@ -829,12 +832,6 @@ void Screen::updateDesktopNames()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
otk::ustring Screen::desktopName(unsigned int i) const
|
|
||||||
{
|
|
||||||
if (i >= _num_desktops) return "";
|
|
||||||
return _desktop_names[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
const otk::Rect& Screen::area(unsigned int desktop) const {
|
const otk::Rect& Screen::area(unsigned int desktop) const {
|
||||||
assert(desktop < _num_desktops || desktop == 0xffffffff);
|
assert(desktop < _num_desktops || desktop == 0xffffffff);
|
||||||
if (desktop < _num_desktops)
|
if (desktop < _num_desktops)
|
||||||
|
|
|
@ -222,15 +222,8 @@ public:
|
||||||
//! Lowers a client window below all others in its stacking layer
|
//! Lowers a client window below all others in its stacking layer
|
||||||
void lowerWindow(Client *client);
|
void lowerWindow(Client *client);
|
||||||
|
|
||||||
//! Sets the name of a desktop by changing the root window property
|
const otk::Property::StringVect& desktopNames() const
|
||||||
/*!
|
{ return _desktop_names; }
|
||||||
@param i The index of the desktop to set the name for (starts at 0)
|
|
||||||
@param name The name to set for the desktop
|
|
||||||
If the index is too large, it is simply ignored.
|
|
||||||
*/
|
|
||||||
void setDesktopName(unsigned int i, const otk::ustring &name);
|
|
||||||
|
|
||||||
otk::ustring desktopName(unsigned int i) const;
|
|
||||||
|
|
||||||
void installColormap(bool install) const;
|
void installColormap(bool install) const;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue