aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2002-01-05 10:58:48 (GMT)
committerfluxgen <fluxgen>2002-01-05 10:58:48 (GMT)
commit6370fb8c572b51ca8f3f62aa3a04c9b10448487a (patch)
treec84917ff68e7a1ff923854aa5cd97916f0a24180 /src
parentffe908dc2afb643a197b30a98c282f7d9ad94599 (diff)
downloadfluxbox_pavel-6370fb8c572b51ca8f3f62aa3a04c9b10448487a.zip
fluxbox_pavel-6370fb8c572b51ca8f3f62aa3a04c9b10448487a.tar.bz2
Added maximize slit stop
Diffstat (limited to 'src')
-rw-r--r--src/Window.cc66
1 files changed, 58 insertions, 8 deletions
diff --git a/src/Window.cc b/src/Window.cc
index 5c67618..25f632b 100644
--- a/src/Window.cc
+++ b/src/Window.cc
@@ -40,7 +40,7 @@
40#include "Window.hh" 40#include "Window.hh"
41#include "Windowmenu.hh" 41#include "Windowmenu.hh"
42#include "Workspace.hh" 42#include "Workspace.hh"
43 43#include "misc.hh"
44 44
45#ifdef SLIT 45#ifdef SLIT
46# include "Slit.hh" 46# include "Slit.hh"
@@ -59,8 +59,8 @@
59# endif // HAVE_STDIO_H 59# endif // HAVE_STDIO_H
60#endif // DEBUG 60#endif // DEBUG
61 61
62#include "misc.hh"
63 62
63#include <iostream>
64using namespace std; 64using namespace std;
65 65
66FluxboxWindow::FluxboxWindow(Window w, BScreen *s) { 66FluxboxWindow::FluxboxWindow(Window w, BScreen *s) {
@@ -1818,19 +1818,69 @@ void FluxboxWindow::withdraw(void) {
1818void FluxboxWindow::maximize(unsigned int button) { 1818void FluxboxWindow::maximize(unsigned int button) {
1819 if (! maximized) { 1819 if (! maximized) {
1820 int dx, dy; 1820 int dx, dy;
1821 unsigned int dw, dh; 1821 unsigned int dw, dh, slitModL = 0, slitModR = 0, slitModT = 0, slitModB = 0;
1822 1822#ifdef SLIT
1823 Slit* mSlt = screen->getSlit();
1824
1825 if(screen->doMaxOverSlit() && !screen->doFullMax() && (mSlt->getWidth() > 1))
1826 {
1827 switch(screen->getSlitDirection())
1828 {
1829 case Slit::Vertical:
1830 switch(screen->getSlitPlacement())
1831 {
1832 case Slit::TopRight:
1833 case Slit::CenterRight:
1834 case Slit::BottomRight:
1835 slitModR = mSlt->getWidth() + screen->getBevelWidth();
1836 break;
1837 default:
1838 slitModL = mSlt->getWidth() + screen->getBevelWidth();
1839 break;
1840 }
1841 break;
1842 case Slit::Horizontal:
1843 switch(screen->getSlitPlacement())
1844 {
1845 case Slit::TopLeft:
1846 case Slit::TopCenter:
1847 case Slit::TopRight:
1848 slitModT = mSlt->getHeight() + screen->getBevelWidth();
1849 switch (screen->getToolbarPlacement()) {
1850 case Toolbar::TopLeft:
1851 case Toolbar::TopCenter:
1852 case Toolbar::TopRight:
1853 slitModT -= screen->getToolbar()->getExposedHeight() + screen->getBorderWidth();
1854 break;
1855 }
1856 break;
1857 default:
1858 slitModB = mSlt->getHeight() + screen->getBevelWidth();
1859 switch (screen->getToolbarPlacement()) {
1860 case Toolbar::BottomLeft:
1861 case Toolbar::BottomCenter:
1862 case Toolbar::BottomRight:
1863 slitModB -= screen->getToolbar()->getExposedHeight() + screen->getBorderWidth();
1864 break;
1865 }
1866 break;
1867 }
1868 break;
1869 }
1870 }
1871#endif // SLIT
1872
1823 blackbox_attrib.premax_x = frame.x; 1873 blackbox_attrib.premax_x = frame.x;
1824 blackbox_attrib.premax_y = frame.y; 1874 blackbox_attrib.premax_y = frame.y;
1825 blackbox_attrib.premax_w = frame.width; 1875 blackbox_attrib.premax_w = frame.width;
1826 blackbox_attrib.premax_h = frame.height; 1876 blackbox_attrib.premax_h = frame.height;
1827 1877
1828 dw = screen->getWidth(); 1878 dw = screen->getWidth() - slitModL - slitModR;
1829 dw -= screen->getBorderWidth2x(); 1879 dw -= screen->getBorderWidth2x();
1830 dw -= frame.mwm_border_w * 2; 1880 dw -= frame.mwm_border_w * 2;
1831 dw -= client.base_width; 1881 dw -= client.base_width;
1832 1882
1833 dh = screen->getHeight(); 1883 dh = screen->getHeight() - slitModT - slitModB;
1834 dh -= screen->getBorderWidth2x(); 1884 dh -= screen->getBorderWidth2x();
1835 dh -= frame.mwm_border_w * 2; 1885 dh -= frame.mwm_border_w * 2;
1836 dh -= ((frame.handle_h + screen->getBorderWidth()) * decorations.handle); 1886 dh -= ((frame.handle_h + screen->getBorderWidth()) * decorations.handle);
@@ -1857,12 +1907,12 @@ void FluxboxWindow::maximize(unsigned int button) {
1857 dh += (frame.handle_h + screen->getBorderWidth()); 1907 dh += (frame.handle_h + screen->getBorderWidth());
1858 dh += frame.mwm_border_w * 2; 1908 dh += frame.mwm_border_w * 2;
1859 1909
1860 dx = ((screen->getWidth() - dw) / 2) - screen->getBorderWidth(); 1910 dx = ((screen->getWidth()+ slitModL - slitModR - dw) / 2) - screen->getBorderWidth();
1861 1911
1862 if (screen->doFullMax()) { 1912 if (screen->doFullMax()) {
1863 dy = ((screen->getHeight() - dh) / 2) - screen->getBorderWidth(); 1913 dy = ((screen->getHeight() - dh) / 2) - screen->getBorderWidth();
1864 } else { 1914 } else {
1865 dy = (((screen->getHeight() - (screen->getToolbar()->getExposedHeight())) 1915 dy = (((screen->getHeight() + slitModT - slitModB - (screen->getToolbar()->getExposedHeight()))
1866 - dh) / 2) - screen->getBorderWidth2x(); 1916 - dh) / 2) - screen->getBorderWidth2x();
1867 1917
1868 switch (screen->getToolbarPlacement()) { 1918 switch (screen->getToolbarPlacement()) {