From fdc9b5adb7eb49a9e2481b07e9298b634133f745 Mon Sep 17 00:00:00 2001 From: mathias Date: Mon, 3 Jan 2005 05:00:39 +0000 Subject: fixed #996298, maximized windows and snapped windows dont respect toolbar-borderwidth further more windows do snap at screen-edges, no matter if maxover is enabled or not --- src/Screen.hh | 4 +--- src/Toolbar.cc | 8 ++++---- src/Window.cc | 22 ++++++++++++++++++++-- 3 files changed, 25 insertions(+), 9 deletions(-) diff --git a/src/Screen.hh b/src/Screen.hh index ad18f63..e0fe5da 100644 --- a/src/Screen.hh +++ b/src/Screen.hh @@ -464,11 +464,9 @@ private: const std::string m_name, m_altname; FbTk::ResourceManager &m_resource_manager; + // Xinerama related private data bool m_xinerama_avail; int m_xinerama_num_heads; - - // Xinerama related private data - int m_xinerama_center_x, m_xinerama_center_y; HeadArea *m_head_areas; diff --git a/src/Toolbar.cc b/src/Toolbar.cc index b2566b3..db0c4b8 100644 --- a/src/Toolbar.cc +++ b/src/Toolbar.cc @@ -314,22 +314,22 @@ void Toolbar::updateStrut() { case TOPLEFT: case TOPCENTER: case TOPRIGHT: - top = height(); + top = height() + 2 * theme().border().width(); break; case BOTTOMLEFT: case BOTTOMCENTER: case BOTTOMRIGHT: - bottom = height(); + bottom = height() + 2 * theme().border().width(); break; case RIGHTTOP: case RIGHTCENTER: case RIGHTBOTTOM: - right = width(); + right = width() + 2 * theme().border().width(); break; case LEFTTOP: case LEFTCENTER: case LEFTBOTTOM: - left = width(); + left = width() + 2 * theme().border().width(); break; }; m_strut = screen().requestStrut(getOnHead(), left, right, top, bottom); diff --git a/src/Window.cc b/src/Window.cc index e7d8476..0e2e72e 100644 --- a/src/Window.cc +++ b/src/Window.cc @@ -3273,23 +3273,39 @@ void FluxboxWindow::doSnapping(int &orig_left, int &orig_top) { ///////////////////////////////////// // begin by checking the screen (or Xinerama head) edges + int h; if (screen().numHeads() > 0) { // head "0" == whole screen width + height, which we skip since the // sum of all the heads covers those edges - for (int h = 1; h <= screen().numHeads(); h++) { + for (h = 1; h <= screen().numHeads(); h++) { snapToWindow(dx, dy, left, right, top, bottom, screen().maxLeft(h), screen().maxRight(h), screen().maxTop(h), screen().maxBottom(h)); } + for (h = 1; h <= screen().numHeads(); h++) { + snapToWindow(dx, dy, left, right, top, bottom, + screen().getHeadX(h), + screen().getHeadX(h) + screen().getHeadWidth(h), + screen().getHeadY(h), + screen().getHeadY(h) + screen().getHeadHeight(h)); + } } else { snapToWindow(dx, dy, left, right, top, bottom, screen().maxLeft(0), screen().maxRight(0), screen().maxTop(0), screen().maxBottom(0)); + + snapToWindow(dx, dy, left, right, top, bottom, + screen().getHeadX(0), + screen().getHeadX(0) + screen().getHeadWidth(0), + screen().getHeadY(0), + screen().getHeadY(0) + screen().getHeadHeight(0)); } + + ///////////////////////////////////// // now check window edges @@ -3301,7 +3317,9 @@ void FluxboxWindow::doSnapping(int &orig_left, int &orig_top) { unsigned int bw; for (; it != it_end; it++) { - if ((*it) == this) continue; // skip myself + if ((*it) == this) + continue; // skip myself + bw = (*it)->decorationMask() & DECORM_ENABLED ? (*it)->frame().window().borderWidth() : 0; snapToWindow(dx, dy, left, right, top, bottom, -- cgit v0.11.2