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
This commit is contained in:
parent
0438a7bfd7
commit
fdc9b5adb7
3 changed files with 25 additions and 9 deletions
|
@ -464,11 +464,9 @@ private:
|
||||||
const std::string m_name, m_altname;
|
const std::string m_name, m_altname;
|
||||||
FbTk::ResourceManager &m_resource_manager;
|
FbTk::ResourceManager &m_resource_manager;
|
||||||
|
|
||||||
|
// Xinerama related private data
|
||||||
bool m_xinerama_avail;
|
bool m_xinerama_avail;
|
||||||
int m_xinerama_num_heads;
|
int m_xinerama_num_heads;
|
||||||
|
|
||||||
// Xinerama related private data
|
|
||||||
|
|
||||||
int m_xinerama_center_x, m_xinerama_center_y;
|
int m_xinerama_center_x, m_xinerama_center_y;
|
||||||
|
|
||||||
HeadArea *m_head_areas;
|
HeadArea *m_head_areas;
|
||||||
|
|
|
@ -314,22 +314,22 @@ void Toolbar::updateStrut() {
|
||||||
case TOPLEFT:
|
case TOPLEFT:
|
||||||
case TOPCENTER:
|
case TOPCENTER:
|
||||||
case TOPRIGHT:
|
case TOPRIGHT:
|
||||||
top = height();
|
top = height() + 2 * theme().border().width();
|
||||||
break;
|
break;
|
||||||
case BOTTOMLEFT:
|
case BOTTOMLEFT:
|
||||||
case BOTTOMCENTER:
|
case BOTTOMCENTER:
|
||||||
case BOTTOMRIGHT:
|
case BOTTOMRIGHT:
|
||||||
bottom = height();
|
bottom = height() + 2 * theme().border().width();
|
||||||
break;
|
break;
|
||||||
case RIGHTTOP:
|
case RIGHTTOP:
|
||||||
case RIGHTCENTER:
|
case RIGHTCENTER:
|
||||||
case RIGHTBOTTOM:
|
case RIGHTBOTTOM:
|
||||||
right = width();
|
right = width() + 2 * theme().border().width();
|
||||||
break;
|
break;
|
||||||
case LEFTTOP:
|
case LEFTTOP:
|
||||||
case LEFTCENTER:
|
case LEFTCENTER:
|
||||||
case LEFTBOTTOM:
|
case LEFTBOTTOM:
|
||||||
left = width();
|
left = width() + 2 * theme().border().width();
|
||||||
break;
|
break;
|
||||||
};
|
};
|
||||||
m_strut = screen().requestStrut(getOnHead(), left, right, top, bottom);
|
m_strut = screen().requestStrut(getOnHead(), left, right, top, bottom);
|
||||||
|
|
|
@ -3273,23 +3273,39 @@ void FluxboxWindow::doSnapping(int &orig_left, int &orig_top) {
|
||||||
/////////////////////////////////////
|
/////////////////////////////////////
|
||||||
// begin by checking the screen (or Xinerama head) edges
|
// begin by checking the screen (or Xinerama head) edges
|
||||||
|
|
||||||
|
int h;
|
||||||
if (screen().numHeads() > 0) {
|
if (screen().numHeads() > 0) {
|
||||||
// head "0" == whole screen width + height, which we skip since the
|
// head "0" == whole screen width + height, which we skip since the
|
||||||
// sum of all the heads covers those edges
|
// 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,
|
snapToWindow(dx, dy, left, right, top, bottom,
|
||||||
screen().maxLeft(h),
|
screen().maxLeft(h),
|
||||||
screen().maxRight(h),
|
screen().maxRight(h),
|
||||||
screen().maxTop(h),
|
screen().maxTop(h),
|
||||||
screen().maxBottom(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 {
|
} else {
|
||||||
snapToWindow(dx, dy, left, right, top, bottom,
|
snapToWindow(dx, dy, left, right, top, bottom,
|
||||||
screen().maxLeft(0),
|
screen().maxLeft(0),
|
||||||
screen().maxRight(0),
|
screen().maxRight(0),
|
||||||
screen().maxTop(0),
|
screen().maxTop(0),
|
||||||
screen().maxBottom(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
|
// now check window edges
|
||||||
|
|
||||||
|
@ -3301,7 +3317,9 @@ void FluxboxWindow::doSnapping(int &orig_left, int &orig_top) {
|
||||||
|
|
||||||
unsigned int bw;
|
unsigned int bw;
|
||||||
for (; it != it_end; it++) {
|
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;
|
bw = (*it)->decorationMask() & DECORM_ENABLED ? (*it)->frame().window().borderWidth() : 0;
|
||||||
|
|
||||||
snapToWindow(dx, dy, left, right, top, bottom,
|
snapToWindow(dx, dy, left, right, top, bottom,
|
||||||
|
|
Loading…
Reference in a new issue