summaryrefslogtreecommitdiff
path: root/src/screen.cc
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2003-02-10 22:17:40 +0000
committerDana Jansens <danakj@orodu.net>2003-02-10 22:17:40 +0000
commit1e46a39dc305fe92b0c0eca1e60e76fded3e5214 (patch)
treea3e7cb2997550a55e821ab3c83e729a84a5a54d1 /src/screen.cc
parentba9b0617ed0c68b0487fd5246fbcdc2156f65c08 (diff)
more user friendly net_showing_desktop support
Diffstat (limited to 'src/screen.cc')
-rw-r--r--src/screen.cc20
1 files changed, 14 insertions, 6 deletions
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)