diff options
| author | Dana Jansens <danakj@orodu.net> | 2003-02-17 21:49:39 +0000 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2003-02-17 21:49:39 +0000 |
| commit | 232092fa2105fd001dbddfb6d5b536e215ca3346 (patch) | |
| tree | 64b74cc009acb28aab995865293d6a35d7957b1d /src/screen.cc | |
| parent | 60cd451a23daa8df35d5a51b61101fdb5a63fa78 (diff) | |
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)
Diffstat (limited to 'src/screen.cc')
| -rw-r--r-- | src/screen.cc | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/screen.cc b/src/screen.cc index be56156d..ff78e572 100644 --- a/src/screen.cc +++ b/src/screen.cc @@ -198,7 +198,7 @@ void Screen::updateDesktopLayout() otk::Property::atoms.net_desktop_layout, otk::Property::atoms.cardinal, &num, &data)) { - if (num >= 4) { + if (num == 4) { if (data[0] == _NET_WM_ORIENTATION_VERT) _layout.orientation = DesktopLayout::Vertical; if (data[3] == _NET_WM_TOPRIGHT) @@ -810,6 +810,9 @@ void Screen::changeNumDesktops(unsigned int num) // the number of rows/columns will differ 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! if (_desktop >= _num_desktops) changeDesktop(_num_desktops - 1); @@ -818,7 +821,7 @@ void Screen::changeNumDesktops(unsigned int num) void Screen::updateDesktopNames() { - unsigned long num = (unsigned) -1; + unsigned long num; if (!otk::Property::get(_info->rootWindow(), 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 { assert(desktop < _num_desktops || desktop == 0xffffffff); if (desktop < _num_desktops) |
