From ba9b0617ed0c68b0487fd5246fbcdc2156f65c08 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Mon, 10 Feb 2003 17:01:32 +0000 Subject: [PATCH] smarter focus restoring --- src/screen.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/screen.cc b/src/screen.cc index 75d8e87e..d242e887 100644 --- a/src/screen.cc +++ b/src/screen.cc @@ -890,8 +890,11 @@ void Screen::showDesktop(bool show) Client *c = openbox->focusedClient(); if (c) saved_focus = c->window(); } else { - Client *c = openbox->findClient(saved_focus); - if (c) c->focus(); + Client *f = openbox->focusedClient(); + if (!f || f->type() == Client::Type_Desktop) { + Client *c = openbox->findClient(saved_focus); + if (c) c->focus(); + } } _showing_desktop = show; -- 2.45.2