fixed some window placement issues

This commit is contained in:
markt 2007-05-17 18:27:59 +00:00
parent 30834f9f6e
commit d927862a8f
3 changed files with 12 additions and 5 deletions

View file

@ -1,5 +1,9 @@
(Format: Year/Month/Day)
Changes for 1.0.0:
*07/05/17:
* Fixed some window placement issues (thanks Tomas Janousek)
ScreenPlacement.cc
*07/05/16:
* Fixed bug with fluxbox-generate_menu -is (thanks Jim Ramsay)
util/fluxbox-generate_menu.in
*07/05/12:

View file

@ -118,10 +118,11 @@ bool ScreenPlacement::placeWindow(const std::vector<FluxboxWindow *> &windowlist
win_h = win.height() + win.fbWindow().borderWidth()*2 + win.heightOffset();
// make sure the window is inside our screen(head) area
if (place_x + win_w > head_right)
place_x = (head_right - win_w) / 2 + win.xOffset();
if (place_y + win_h > head_bot)
place_y = (head_bot - win_h) / 2 + win.yOffset();
if (place_x + win_w - win.xOffset() > head_right)
place_x = head_left + (head_right - head_left - win_w) / 2 +
win.xOffset();
if (place_y + win_h - win.yOffset() > head_bot)
place_y = head_top + (head_bot - head_top - win_h) / 2 + win.yOffset();
return true;
}

View file

@ -84,6 +84,7 @@ template<>
string FbTk::Resource<BScreen::FollowModel>::getString() const {
switch (m_value) {
case BScreen::FOLLOW_ACTIVE_WINDOW:
default:
return string("Follow");
break;
case BScreen::FETCH_ACTIVE_WINDOW:
@ -93,7 +94,6 @@ string FbTk::Resource<BScreen::FollowModel>::getString() const {
return string("SemiFollow");
break;
case BScreen::IGNORE_OTHER_WORKSPACES:
default:
return string("Ignore");
break;
}
@ -111,6 +111,8 @@ setFromString(char const *strval) {
m_value = BScreen::FETCH_ACTIVE_WINDOW;
else if (strcasecmp(strval, "SemiFollow") == 0)
m_value = BScreen::SEMIFOLLOW_ACTIVE_WINDOW;
else if (strcasecmp(strval, "Ignore") == 0)
m_value = BScreen::IGNORE_OTHER_WORKSPACES;
else
setDefaultValue();
}