From 1e46a39dc305fe92b0c0eca1e60e76fded3e5214 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Mon, 10 Feb 2003 22:17:40 +0000 Subject: more user friendly net_showing_desktop support --- src/screen.cc | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'src/screen.cc') diff --git a/src/screen.cc b/src/screen.cc index d242e887..3461178d 100644 --- a/src/screen.cc +++ b/src/screen.cc @@ -889,15 +889,10 @@ void Screen::showDesktop(bool show) if (show) { Client *c = openbox->focusedClient(); if (c) saved_focus = c->window(); - } else { - Client *f = openbox->focusedClient(); - if (!f || f->type() == Client::Type_Desktop) { - Client *c = openbox->findClient(saved_focus); - if (c) c->focus(); - } } _showing_desktop = show; + ClientList::iterator it, end = clients.end(); for (it = clients.begin(); it != end; ++it) { if ((*it)->type() == Client::Type_Desktop) { @@ -906,6 +901,19 @@ void Screen::showDesktop(bool show) } else (*it)->showhide(); } + + if (!show) { + Client *f = openbox->focusedClient(); + if (!f || f->type() == Client::Type_Desktop) { + Client *c = openbox->findClient(saved_focus); + if (c) c->focus(); + } + } + + otk::Property::set(_info->rootWindow(), + otk::Property::atoms.net_showing_desktop, + otk::Property::atoms.cardinal, + show ? 1 : 0); } void Screen::propertyHandler(const XPropertyEvent &e) -- cgit v1.2.3