aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarkt <markt>2007-06-03 20:29:35 (GMT)
committermarkt <markt>2007-06-03 20:29:35 (GMT)
commita01f5143e2a2ba612628963b844ad6596854c4be (patch)
tree8a00bca31dfb240101a82b1a5d4695f69e2c0d92
parent64de0ae568c01adf839c4b73c6705caa40bb3c6a (diff)
downloadfluxbox-a01f5143e2a2ba612628963b844ad6596854c4be.zip
fluxbox-a01f5143e2a2ba612628963b844ad6596854c4be.tar.bz2
open slit menu properly wrt xinerama
-rw-r--r--ChangeLog2
-rw-r--r--src/Slit.cc33
2 files changed, 18 insertions, 17 deletions
diff --git a/ChangeLog b/ChangeLog
index a903f27..37cd23a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,8 @@
1 (Format: Year/Month/Day) 1 (Format: Year/Month/Day)
2Changes for 1.1: 2Changes for 1.1:
3*07/06/03: 3*07/06/03:
4 * Submenus of slit menu were misbehaving with xinerama (Mark)
5 Slit.cc
4 * Also send transient windows when sending a window to another workspace, bug 6 * Also send transient windows when sending a window to another workspace, bug
5 #1716900 (Mark) 7 #1716900 (Mark)
6 Screen.cc 8 Screen.cc
diff --git a/src/Slit.cc b/src/Slit.cc
index fbab1e6..f5f1158 100644
--- a/src/Slit.cc
+++ b/src/Slit.cc
@@ -1010,26 +1010,25 @@ void Slit::handleEvent(XEvent &event) {
1010 } 1010 }
1011} 1011}
1012 1012
1013void Slit::buttonPressEvent(XButtonEvent &e) { 1013void Slit::buttonPressEvent(XButtonEvent &be) {
1014 if (e.window != frame.window.window()) 1014 if (be.window != frame.window.window())
1015 return; 1015 return;
1016 1016
1017 if (e.button == Button3) { 1017 if (be.button == Button3) {
1018 if (! m_slitmenu.isVisible()) { 1018 if (! m_slitmenu.isVisible()) {
1019 int x = e.x_root - (m_slitmenu.width() / 2), 1019 int head = screen().getHead(be.x_root, be.y_root);
1020 y = e.y_root - (m_slitmenu.height() / 2); 1020 int borderw = m_slitmenu.fbwindow().borderWidth();
1021 1021 pair<int, int> m = screen().clampToHead(head,
1022 if (x < 0) 1022 be.x_root - (m_slitmenu.width() / 2),
1023 x = 0; 1023 be.y_root - (m_slitmenu.titleWindow().height() / 2),
1024 else if (x + m_slitmenu.width() > screen().width()) 1024 m_slitmenu.width() + 2*borderw,
1025 x = screen().width() - m_slitmenu.width(); 1025 m_slitmenu.height() + 2*borderw);
1026 1026
1027 if (y < 0) 1027 m_slitmenu.setScreen(screen().getHeadX(head),
1028 y = 0; 1028 screen().getHeadY(head),
1029 else if (y + m_slitmenu.height() > screen().height()) 1029 screen().getHeadWidth(head),
1030 y = screen().height() - m_slitmenu.height(); 1030 screen().getHeadHeight(head));
1031 1031 m_slitmenu.move(m.first, m.second);
1032 m_slitmenu.move(x, y);
1033 m_slitmenu.show(); 1032 m_slitmenu.show();
1034 m_slitmenu.grabInputFocus(); 1033 m_slitmenu.grabInputFocus();
1035 } else 1034 } else