open slit menu properly wrt xinerama

This commit is contained in:
markt 2007-06-03 20:30:21 +00:00
parent 226ec5d371
commit 678703b08f
2 changed files with 17 additions and 16 deletions

View file

@ -1,6 +1,8 @@
(Format: Year/Month/Day)
Changes for 1.0.0:
*07/06/03:
* Submenus of slit menu were misbehaving with xinerama (Mark)
Slit.cc
* Also send transient windows when sending a window to another workspace, bug
#1716900 (Mark)
Screen.cc

View file

@ -1010,26 +1010,25 @@ void Slit::handleEvent(XEvent &event) {
}
}
void Slit::buttonPressEvent(XButtonEvent &e) {
if (e.window != frame.window.window())
void Slit::buttonPressEvent(XButtonEvent &be) {
if (be.window != frame.window.window())
return;
if (e.button == Button3) {
if (be.button == Button3) {
if (! m_slitmenu.isVisible()) {
int x = e.x_root - (m_slitmenu.width() / 2),
y = e.y_root - (m_slitmenu.height() / 2);
int head = screen().getHead(be.x_root, be.y_root);
int borderw = m_slitmenu.fbwindow().borderWidth();
pair<int, int> m = screen().clampToHead(head,
be.x_root - (m_slitmenu.width() / 2),
be.y_root - (m_slitmenu.titleWindow().height() / 2),
m_slitmenu.width() + 2*borderw,
m_slitmenu.height() + 2*borderw);
if (x < 0)
x = 0;
else if (x + m_slitmenu.width() > screen().width())
x = screen().width() - m_slitmenu.width();
if (y < 0)
y = 0;
else if (y + m_slitmenu.height() > screen().height())
y = screen().height() - m_slitmenu.height();
m_slitmenu.move(x, y);
m_slitmenu.setScreen(screen().getHeadX(head),
screen().getHeadY(head),
screen().getHeadWidth(head),
screen().getHeadHeight(head));
m_slitmenu.move(m.first, m.second);
m_slitmenu.show();
m_slitmenu.grabInputFocus();
} else