aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2003-02-20 23:17:36 (GMT)
committerfluxgen <fluxgen>2003-02-20 23:17:36 (GMT)
commit6e1f30c308dd2ad7f1794fa3f6ecfc4be7997152 (patch)
tree0dab0c6ecba6ce56fd8b168605f420a94c0065ee /src
parent3e2586bc1b480ed8199146a7aca07aab7cbad7f4 (diff)
downloadfluxbox-6e1f30c308dd2ad7f1794fa3f6ecfc4be7997152.zip
fluxbox-6e1f30c308dd2ad7f1794fa3f6ecfc4be7997152.tar.bz2
fixed menu position when we dont have a titlebar and minor cleaning
Diffstat (limited to 'src')
-rw-r--r--src/Window.cc41
1 files changed, 22 insertions, 19 deletions
diff --git a/src/Window.cc b/src/Window.cc
index 55fe23c..73afefc 100644
--- a/src/Window.cc
+++ b/src/Window.cc
@@ -22,7 +22,7 @@
22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23// DEALINGS IN THE SOFTWARE. 23// DEALINGS IN THE SOFTWARE.
24 24
25// $Id: Window.cc,v 1.121 2003/02/19 14:53:38 fluxgen Exp $ 25// $Id: Window.cc,v 1.122 2003/02/20 23:17:36 fluxgen Exp $
26 26
27#include "Window.hh" 27#include "Window.hh"
28 28
@@ -483,8 +483,9 @@ void FluxboxWindow::positionWindows() {
483 if (decorations.titlebar) { 483 if (decorations.titlebar) {
484 m_frame.titlebar().setBorderWidth(screen->getBorderWidth()); 484 m_frame.titlebar().setBorderWidth(screen->getBorderWidth());
485 m_frame.showTitlebar(); 485 m_frame.showTitlebar();
486 } else 486 } else {
487 m_frame.hideTitlebar(); 487 m_frame.hideTitlebar();
488 }
488 489
489 if (decorations.handle) { 490 if (decorations.handle) {
490 m_frame.handle().setBorderWidth(screen->getBorderWidth()); 491 m_frame.handle().setBorderWidth(screen->getBorderWidth());
@@ -831,7 +832,7 @@ void FluxboxWindow::moveResize(int new_x, int new_y,
831 if (tab) 832 if (tab)
832 tab->resize(); 833 tab->resize();
833 834
834 positionWindows(); 835 //positionWindows();
835 setFocusFlag(focused); 836 setFocusFlag(focused);
836 shaded = false; 837 shaded = false;
837 send_event = true; 838 send_event = true;
@@ -1636,10 +1637,12 @@ void FluxboxWindow::popupMenu() {
1636 m_windowmenu.hide(); 1637 m_windowmenu.hide();
1637 return; 1638 return;
1638 } 1639 }
1640 // move menu directly under titlebar
1641 int diff_y = m_frame.titlebar().height() + m_frame.titlebar().borderWidth();
1642 if (!decorations.titlebar) // if we don't have any titlebar
1643 diff_y = 0;
1639 1644
1640 m_windowmenu.move(m_last_button_x, 1645 m_windowmenu.move(m_last_button_x, m_frame.y() + diff_y);
1641 m_frame.y() + m_frame.titlebar().height() +
1642 m_frame.titlebar().borderWidth()*2);
1643 m_windowmenu.show(); 1646 m_windowmenu.show();
1644 m_windowmenu.raise(); 1647 m_windowmenu.raise();
1645} 1648}
@@ -1655,7 +1658,7 @@ void FluxboxWindow::restoreGravity() {
1655 client.x = m_frame.x(); 1658 client.x = m_frame.x();
1656 break; 1659 break;
1657 1660
1658 // handle Eastward gravity 1661 // handle Eastward gravity
1659 case NorthEastGravity: 1662 case NorthEastGravity:
1660 case EastGravity: 1663 case EastGravity:
1661 case SouthEastGravity: 1664 case SouthEastGravity:
@@ -1917,9 +1920,10 @@ void FluxboxWindow::propertyNotifyEvent(Atom atom) {
1917 upsize(); 1920 upsize();
1918 1921
1919 // reconfigure if the old values changed 1922 // reconfigure if the old values changed
1920 if ((x != m_frame.x()) || (y != m_frame.y()) || 1923 if (x != m_frame.x() || y != m_frame.y() ||
1921 (w != m_frame.width()) || (h != m_frame.height())) 1924 w != m_frame.width() || h != m_frame.height()) {
1922 reconfigure(); 1925 moveResize(x, y, w, h);
1926 }
1923 1927
1924 break; 1928 break;
1925 } 1929 }
@@ -1927,9 +1931,10 @@ void FluxboxWindow::propertyNotifyEvent(Atom atom) {
1927 default: 1931 default:
1928 if (atom == FbAtoms::instance()->getWMProtocolsAtom()) { 1932 if (atom == FbAtoms::instance()->getWMProtocolsAtom()) {
1929 getWMProtocols(); 1933 getWMProtocols();
1934 //!!TODO check this area
1930 // reset window actions 1935 // reset window actions
1931 screen->setupWindowActions(*this); 1936 screen->setupWindowActions(*this);
1932 //!!TODO check this area 1937
1933 } 1938 }
1934 break; 1939 break;
1935 } 1940 }
@@ -1946,9 +1951,6 @@ void FluxboxWindow::configureRequestEvent(XConfigureRequestEvent &cr) {
1946 if (cr.window != client.window) 1951 if (cr.window != client.window)
1947 return; 1952 return;
1948 1953
1949 if (! validateClient())
1950 return;
1951
1952 int cx = m_frame.x(), cy = m_frame.y(); 1954 int cx = m_frame.x(), cy = m_frame.y();
1953 unsigned int cw = m_frame.width(), ch = m_frame.height(); 1955 unsigned int cw = m_frame.width(), ch = m_frame.height();
1954 1956
@@ -1959,7 +1961,7 @@ void FluxboxWindow::configureRequestEvent(XConfigureRequestEvent &cr) {
1959 cx = cr.x; 1961 cx = cr.x;
1960 1962
1961 if (cr.value_mask & CWY) 1963 if (cr.value_mask & CWY)
1962 cy = cr.y - m_frame.titlebar().height(); 1964 cy = cr.y - (decorations.titlebar ? m_frame.titlebar().height() : 0);
1963 1965
1964 if (cr.value_mask & CWWidth) 1966 if (cr.value_mask & CWWidth)
1965 cw = cr.width; 1967 cw = cr.width;
@@ -1967,13 +1969,14 @@ void FluxboxWindow::configureRequestEvent(XConfigureRequestEvent &cr) {
1967 if (cr.value_mask & CWHeight) 1969 if (cr.value_mask & CWHeight)
1968 ch = cr.height; 1970 ch = cr.height;
1969 1971
1970 if (m_frame.x() != cx || m_frame.y() != cy || 1972
1971 m_frame.width() != cw || m_frame.height() != ch) { 1973 // the request is for client window so we resize the frame to it first
1972 // the request is for client window so we resize the frame to it first 1974 if (frame().width() != cw || frame().height() != ch)
1973 frame().resizeForClient(cw, ch); 1975 frame().resizeForClient(cw, ch);
1976 if (frame().x() != cx || frame().y() != cy)
1974 move(cx, cy); 1977 move(cx, cy);
1975 1978
1976 } 1979
1977 1980
1978 if (cr.value_mask & CWStackMode) { 1981 if (cr.value_mask & CWStackMode) {
1979 switch (cr.detail) { 1982 switch (cr.detail) {