diff options
author | markt <markt> | 2007-06-03 20:30:21 (GMT) |
---|---|---|
committer | markt <markt> | 2007-06-03 20:30:21 (GMT) |
commit | 678703b08f12a0ce4d2c879c1f001d41b34932ec (patch) | |
tree | e87e22ac9438a1e90ca9e24e0cfca24eb53c7a23 | |
parent | 226ec5d3715e7433fa1933e0507ae20d20f0453f (diff) | |
download | fluxbox_paul-678703b08f12a0ce4d2c879c1f001d41b34932ec.zip fluxbox_paul-678703b08f12a0ce4d2c879c1f001d41b34932ec.tar.bz2 |
open slit menu properly wrt xinerama
-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | src/Slit.cc | 33 |
2 files changed, 18 insertions, 17 deletions
@@ -1,6 +1,8 @@ | |||
1 | (Format: Year/Month/Day) | 1 | (Format: Year/Month/Day) |
2 | Changes for 1.0.0: | 2 | Changes for 1.0.0: |
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 | ||
1013 | void Slit::buttonPressEvent(XButtonEvent &e) { | 1013 | void 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 |