From dbe6af58d247131a7b1547520474ac87fee4db4c Mon Sep 17 00:00:00 2001 From: bradleyhughes Date: Fri, 21 Jan 2005 10:53:21 +0000 Subject: [PATCH] Many docks have auto-hide features similar to the toolbar and slit... we don't want these things to be moved to the center of the screen when switching to an empty workspace. --- src/Window.cc | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/src/Window.cc b/src/Window.cc index bc81c4b..a529208 100644 --- a/src/Window.cc +++ b/src/Window.cc @@ -2095,12 +2095,25 @@ bool BlackboxWindow::setInputFocus(void) { if (client.state.focused) return true; - const bt::Rect &scr = _screen->screenInfo().rect(); - if (!frame.rect.intersects(scr)) { - // client is outside the screen, move it to the center - configure(scr.x() + (scr.width() - frame.rect.width()) / 2, - scr.y() + (scr.height() - frame.rect.height()) / 2, - frame.rect.width(), frame.rect.height()); + switch (windowType()) { + case WindowTypeDock: + /* + Many docks have auto-hide features similar to the toolbar and + slit... we don't want these things to be moved to the center of + the screen when switching to an empty workspace. + */ + break; + + default: + { const bt::Rect &scr = _screen->screenInfo().rect(); + if (!frame.rect.intersects(scr)) { + // client is outside the screen, move it to the center + configure(scr.x() + (scr.width() - frame.rect.width()) / 2, + scr.y() + (scr.height() - frame.rect.height()) / 2, + frame.rect.width(), frame.rect.height()); + } + break; + } } /* -- 2.11.4.GIT