X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2Fscreen.cc;h=039d82050fa770004a9f2ff93ef877ba7353d33d;hb=7c32ac2b3f0bfd02a1efea1d67e5ad1c3c5be93f;hp=3461178d6c3d80ac616af0778c63e3b6ff870da9;hpb=1e46a39dc305fe92b0c0eca1e60e76fded3e5214;p=chaz%2Fopenbox diff --git a/src/screen.cc b/src/screen.cc index 3461178d..039d8205 100644 --- a/src/screen.cc +++ b/src/screen.cc @@ -2,6 +2,15 @@ #include "config.h" +#include "screen.hh" +#include "client.hh" +#include "openbox.hh" +#include "frame.hh" +#include "bindings.hh" +#include "python.hh" +#include "otk/display.hh" +#include "otk/property.hh" + extern "C" { #ifdef HAVE_UNISTD_H # include @@ -12,15 +21,6 @@ extern "C" { #define _(str) gettext(str) } -#include "screen.hh" -#include "client.hh" -#include "openbox.hh" -#include "frame.hh" -#include "bindings.hh" -#include "python.hh" -#include "otk/display.hh" -#include "otk/property.hh" - #include #include #include @@ -44,8 +44,6 @@ Screen::Screen(int screen) assert(screen >= 0); assert(screen < ScreenCount(**otk::display)); _info = otk::display->screenInfo(screen); - _showing_desktop = false; - ::running = false; XErrorHandler old = XSetErrorHandler(::anotherWMRunning); XSelectInput(**otk::display, _info->rootWindow(), @@ -113,6 +111,12 @@ Screen::Screen(int screen) changeDesktop(0); // set the hint + // don't start in showing-desktop mode + _showing_desktop = false; + otk::Property::set(_info->rootWindow(), + otk::Property::atoms.net_showing_desktop, + otk::Property::atoms.cardinal, 0); + // create the window which gets focus when no clients get it XSetWindowAttributes attr; attr.override_redirect = true; @@ -863,6 +867,11 @@ void Screen::setDesktopName(unsigned int i, const otk::ustring &name) otk::Property::utf8, newnames); } +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);