From f2e161c535dda551737f73ca9415a9af1d6b3ff1 Mon Sep 17 00:00:00 2001 From: Karsten Heimrich Date: Tue, 27 Jan 2009 21:04:10 +0000 Subject: [PATCH] * make use of the now available decorator infos git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29065 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/screenshot/ScreenshotWindow.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/apps/screenshot/ScreenshotWindow.cpp b/src/apps/screenshot/ScreenshotWindow.cpp index 17ecd8b6e9..93f9c6547f 100644 --- a/src/apps/screenshot/ScreenshotWindow.cpp +++ b/src/apps/screenshot/ScreenshotWindow.cpp @@ -641,7 +641,7 @@ ScreenshotWindow::_GetActiveWindowFrame(BRect* frame) int32* tokens; int32 tokenCount; - status_t status = BPrivate::get_window_order(B_CURRENT_WORKSPACE, &tokens, + status_t status = BPrivate::get_window_order(current_workspace(), &tokens, &tokenCount); if (status != B_OK || !tokens || tokenCount < 1) return B_ERROR; @@ -656,14 +656,12 @@ ScreenshotWindow::_GetActiveWindowFrame(BRect* frame) frame->bottom = windowInfo->window_bottom; status = B_OK; - free(windowInfo); - if (fIncludeBorder) { - // TODO: that's wrong for windows without titlebar, change once - // we can access the decorator or get it via window info - frame->InsetBy(-5.0, -5.0); - frame->top -= 22.0; + float border = (windowInfo->border_size); + frame->InsetBy(-(border), -(border)); + frame->top -= windowInfo->tab_height; } + free(windowInfo); BRect screenFrame(BScreen(this).Frame()); if (frame->left < screenFrame.left)