From b504021145c9d79759c3809c4001ee2acdf4a5aa Mon Sep 17 00:00:00 2001 From: markt Date: Wed, 24 Oct 2007 03:44:39 +0000 Subject: really fix placement when head is remembered but not position --- src/CascadePlacement.cc | 2 +- src/ColSmartPlacement.cc | 2 +- src/MinOverlapPlacement.cc | 2 +- src/RowSmartPlacement.cc | 2 +- src/ScreenPlacement.cc | 2 +- src/UnderMousePlacement.cc | 2 +- src/Window.cc | 6 ++++++ src/Window.hh | 1 + 8 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/CascadePlacement.cc b/src/CascadePlacement.cc index 3d4eeef..bd20e66 100644 --- a/src/CascadePlacement.cc +++ b/src/CascadePlacement.cc @@ -46,7 +46,7 @@ bool CascadePlacement::placeWindow(const std::list &windowlist, const FluxboxWindow &win, int &place_x, int &place_y) { - int head = (signed) win.screen().getCurrHead(); + int head = (signed) win.getOnHead(); int head_left = (signed) win.screen().maxLeft(head); int head_right = (signed) win.screen().maxRight(head); int head_top = (signed) win.screen().maxTop(head); diff --git a/src/ColSmartPlacement.cc b/src/ColSmartPlacement.cc index 16c3b81..995a2f9 100644 --- a/src/ColSmartPlacement.cc +++ b/src/ColSmartPlacement.cc @@ -32,7 +32,7 @@ bool ColSmartPlacement::placeWindow(const std::list &windowlist int &place_x, int &place_y) { // xinerama head constraints - int head = (signed) win.screen().getCurrHead(); + int head = (signed) win.getOnHead(); int head_left = (signed) win.screen().maxLeft(head); int head_right = (signed) win.screen().maxRight(head); int head_top = (signed) win.screen().maxTop(head); diff --git a/src/MinOverlapPlacement.cc b/src/MinOverlapPlacement.cc index e7e80cb..68301c6 100644 --- a/src/MinOverlapPlacement.cc +++ b/src/MinOverlapPlacement.cc @@ -39,7 +39,7 @@ bool MinOverlapPlacement::placeWindow( const FluxboxWindow &win, int &place_x, int &place_y) { // view (screen + head) constraints - int head = (signed) win.screen().getCurrHead(); + int head = (signed) win.getOnHead(); int head_left = (signed) win.screen().maxLeft(head); int head_right = (signed) win.screen().maxRight(head); int head_top = (signed) win.screen().maxTop(head); diff --git a/src/RowSmartPlacement.cc b/src/RowSmartPlacement.cc index e2a0be4..ec6078f 100644 --- a/src/RowSmartPlacement.cc +++ b/src/RowSmartPlacement.cc @@ -35,7 +35,7 @@ bool RowSmartPlacement::placeWindow(const std::list &windowlist int next_x, next_y; // view (screen + head) constraints - int head = (signed) win.screen().getCurrHead(); + int head = (signed) win.getOnHead(); int head_left = (signed) win.screen().maxLeft(head); int head_right = (signed) win.screen().maxRight(head); int head_top = (signed) win.screen().maxTop(head); diff --git a/src/ScreenPlacement.cc b/src/ScreenPlacement.cc index d614488..e8d1592 100644 --- a/src/ScreenPlacement.cc +++ b/src/ScreenPlacement.cc @@ -88,7 +88,7 @@ bool ScreenPlacement::placeWindow(const std::list &windowlist, } // view (screen + head) constraints - int head = (signed) win.screen().getCurrHead(); + int head = (signed) win.getOnHead(); int head_left = (signed) win.screen().maxLeft(head); int head_right = (signed) win.screen().maxRight(head); int head_top = (signed) win.screen().maxTop(head); diff --git a/src/UnderMousePlacement.cc b/src/UnderMousePlacement.cc index e601e77..c20e988 100644 --- a/src/UnderMousePlacement.cc +++ b/src/UnderMousePlacement.cc @@ -51,7 +51,7 @@ bool UnderMousePlacement::placeWindow(const std::list &list, int test_y = root_y - (win_h / 2); // keep the window inside the screen - int head = (signed) win.screen().getCurrHead(); + int head = (signed) win.getOnHead(); int head_left = (signed) win.screen().maxLeft(head); int head_right = (signed) win.screen().maxRight(head); int head_top = (signed) win.screen().maxTop(head); diff --git a/src/Window.cc b/src/Window.cc index 51a7ee9..bd39855 100644 --- a/src/Window.cc +++ b/src/Window.cc @@ -480,6 +480,8 @@ void FluxboxWindow::init() { real_y <= (signed) screen().height()) m_placed = true; + } else if (!m_placed) { + setOnHead(screen().getCurrHead()); } /* if (wattrib.width <= 0) @@ -4096,6 +4098,10 @@ int FluxboxWindow::getDecoMaskFromString(const string &str_label) { return mask; } +int FluxboxWindow::getOnHead() const { + return screen().getHead(fbWindow()); +} + void FluxboxWindow::setOnHead(int head) { if (head > 0 && head <= screen().numHeads()) { int cur = screen().getHead(fbWindow()); diff --git a/src/Window.hh b/src/Window.hh index cf0077e..b5c5dd2 100644 --- a/src/Window.hh +++ b/src/Window.hh @@ -306,6 +306,7 @@ public: void lowerLayer(); /// moves the window to a new layer void moveToLayer(int layernum, bool force = false); + int getOnHead() const; void setOnHead(int head); /// sets the window focus hidden state void setFocusHidden(bool value); -- cgit v0.11.2