aboutsummaryrefslogtreecommitdiff
path: root/src/Window.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/Window.cc')
-rw-r--r--src/Window.cc92
1 files changed, 46 insertions, 46 deletions
diff --git a/src/Window.cc b/src/Window.cc
index 4b77b95..25a6baf 100644
--- a/src/Window.cc
+++ b/src/Window.cc
@@ -271,7 +271,7 @@ FluxboxWindow::FluxboxWindow(WinClient &client, FbTk::XLayer &layer):
271 m_creation_time(0), 271 m_creation_time(0),
272 moving(false), resizing(false), shaded(false), iconic(false), 272 moving(false), resizing(false), shaded(false), iconic(false),
273 stuck(false), m_initialized(false), fullscreen(false), 273 stuck(false), m_initialized(false), fullscreen(false),
274 maximized(FbWinFrame::MAX_NONE), 274 maximized(WindowState::MAX_NONE),
275 m_attaching_tab(0), 275 m_attaching_tab(0),
276 display(FbTk::App::instance()->display()), 276 display(FbTk::App::instance()->display()),
277 m_button_grab_x(0), m_button_grab_y(0), 277 m_button_grab_x(0), m_button_grab_y(0),
@@ -423,7 +423,7 @@ void FluxboxWindow::init() {
423 m_workspace_number = m_screen.currentWorkspaceID(); 423 m_workspace_number = m_screen.currentWorkspaceID();
424 424
425 // set default decorations but don't apply them 425 // set default decorations but don't apply them
426 setDecorationMask(FbWinFrame::getDecoMaskFromString(screen().defaultDeco()), 426 setDecorationMask(WindowState::getDecoMaskFromString(screen().defaultDeco()),
427 false); 427 false);
428 428
429 functions.resize = functions.move = functions.iconify = functions.maximize 429 functions.resize = functions.move = functions.iconify = functions.maximize
@@ -559,7 +559,7 @@ void FluxboxWindow::init() {
559 559
560 if (maximized) { 560 if (maximized) {
561 int tmp = maximized; 561 int tmp = maximized;
562 maximized = FbWinFrame::MAX_NONE; 562 maximized = WindowState::MAX_NONE;
563 setMaximizedState(tmp); 563 setMaximizedState(tmp);
564 } 564 }
565 565
@@ -1045,7 +1045,7 @@ void FluxboxWindow::updateSizeHints() {
1045 if ((*it) == m_client) 1045 if ((*it) == m_client)
1046 continue; 1046 continue;
1047 1047
1048 const FbWinFrame::SizeHints &hint = (*it)->sizeHints(); 1048 const SizeHints &hint = (*it)->sizeHints();
1049 if (m_size_hint.min_width < hint.min_width) 1049 if (m_size_hint.min_width < hint.min_width)
1050 m_size_hint.min_width = hint.min_width; 1050 m_size_hint.min_width = hint.min_width;
1051 if (m_size_hint.max_width > hint.max_width) 1051 if (m_size_hint.max_width > hint.max_width)
@@ -1144,7 +1144,7 @@ void FluxboxWindow::updateMWMHintsFromClient(WinClient &client) {
1144 } 1144 }
1145 1145
1146 unsigned int mask = decorationMask(); 1146 unsigned int mask = decorationMask();
1147 mask &= FbWinFrame::getDecoMaskFromString(screen().defaultDeco()); 1147 mask &= WindowState::getDecoMaskFromString(screen().defaultDeco());
1148 setDecorationMask(mask, false); 1148 setDecorationMask(mask, false);
1149 1149
1150 // functions.tabable is ours, not special one 1150 // functions.tabable is ours, not special one
@@ -1503,7 +1503,7 @@ void FluxboxWindow::setFullscreenLayer() {
1503void FluxboxWindow::maximize(int type) { 1503void FluxboxWindow::maximize(int type) {
1504 1504
1505 // nothing to do 1505 // nothing to do
1506 if (type == FbWinFrame::MAX_NONE) 1506 if (type == WindowState::MAX_NONE)
1507 return; 1507 return;
1508 1508
1509 int new_max = maximized; 1509 int new_max = maximized;
@@ -1512,14 +1512,14 @@ void FluxboxWindow::maximize(int type) {
1512 // when _don't_ we want to toggle? 1512 // when _don't_ we want to toggle?
1513 // - type is horizontal maximise, or 1513 // - type is horizontal maximise, or
1514 // - type is full and we are not maximised horz but already vertically 1514 // - type is full and we are not maximised horz but already vertically
1515 if (type != FbWinFrame::MAX_HORZ && 1515 if (type != WindowState::MAX_HORZ &&
1516 (type != FbWinFrame::MAX_FULL || maximized != FbWinFrame::MAX_VERT)) 1516 (type != WindowState::MAX_FULL || maximized != WindowState::MAX_VERT))
1517 new_max ^= FbWinFrame::MAX_VERT; 1517 new_max ^= WindowState::MAX_VERT;
1518 1518
1519 // maximize horizontally? 1519 // maximize horizontally?
1520 if (type != FbWinFrame::MAX_VERT && 1520 if (type != WindowState::MAX_VERT &&
1521 (type != FbWinFrame::MAX_FULL || maximized != FbWinFrame::MAX_HORZ)) 1521 (type != WindowState::MAX_FULL || maximized != WindowState::MAX_HORZ))
1522 new_max ^= FbWinFrame::MAX_HORZ; 1522 new_max ^= WindowState::MAX_HORZ;
1523 1523
1524 setMaximizedState(new_max); 1524 setMaximizedState(new_max);
1525} 1525}
@@ -1552,21 +1552,21 @@ void FluxboxWindow::setMaximizedState(int type) {
1552 * Maximize window horizontal 1552 * Maximize window horizontal
1553 */ 1553 */
1554void FluxboxWindow::maximizeHorizontal() { 1554void FluxboxWindow::maximizeHorizontal() {
1555 maximize(FbWinFrame::MAX_HORZ); 1555 maximize(WindowState::MAX_HORZ);
1556} 1556}
1557 1557
1558/** 1558/**
1559 * Maximize window vertical 1559 * Maximize window vertical
1560 */ 1560 */
1561void FluxboxWindow::maximizeVertical() { 1561void FluxboxWindow::maximizeVertical() {
1562 maximize(FbWinFrame::MAX_VERT); 1562 maximize(WindowState::MAX_VERT);
1563} 1563}
1564 1564
1565/** 1565/**
1566 * Maximize window fully 1566 * Maximize window fully
1567 */ 1567 */
1568void FluxboxWindow::maximizeFull() { 1568void FluxboxWindow::maximizeFull() {
1569 maximize(FbWinFrame::MAX_FULL); 1569 maximize(WindowState::MAX_FULL);
1570} 1570}
1571 1571
1572void FluxboxWindow::setWorkspace(int n) { 1572void FluxboxWindow::setWorkspace(int n) {
@@ -2807,9 +2807,9 @@ void FluxboxWindow::toggleDecoration() {
2807 if (m_toggled_decos) { 2807 if (m_toggled_decos) {
2808 m_old_decoration_mask = decorationMask(); 2808 m_old_decoration_mask = decorationMask();
2809 if (decorations.titlebar | decorations.tab) 2809 if (decorations.titlebar | decorations.tab)
2810 setDecorationMask(FbWinFrame::DECOR_NONE); 2810 setDecorationMask(WindowState::DECOR_NONE);
2811 else 2811 else
2812 setDecorationMask(FbWinFrame::DECOR_NORMAL); 2812 setDecorationMask(WindowState::DECOR_NORMAL);
2813 } else //revert back to old decoration 2813 } else //revert back to old decoration
2814 setDecorationMask(m_old_decoration_mask); 2814 setDecorationMask(m_old_decoration_mask);
2815 2815
@@ -2818,42 +2818,42 @@ void FluxboxWindow::toggleDecoration() {
2818unsigned int FluxboxWindow::decorationMask() const { 2818unsigned int FluxboxWindow::decorationMask() const {
2819 unsigned int ret = 0; 2819 unsigned int ret = 0;
2820 if (decorations.titlebar) 2820 if (decorations.titlebar)
2821 ret |= FbWinFrame::DECORM_TITLEBAR; 2821 ret |= WindowState::DECORM_TITLEBAR;
2822 if (decorations.handle) 2822 if (decorations.handle)
2823 ret |= FbWinFrame::DECORM_HANDLE; 2823 ret |= WindowState::DECORM_HANDLE;
2824 if (decorations.border) 2824 if (decorations.border)
2825 ret |= FbWinFrame::DECORM_BORDER; 2825 ret |= WindowState::DECORM_BORDER;
2826 if (decorations.iconify) 2826 if (decorations.iconify)
2827 ret |= FbWinFrame::DECORM_ICONIFY; 2827 ret |= WindowState::DECORM_ICONIFY;
2828 if (decorations.maximize) 2828 if (decorations.maximize)
2829 ret |= FbWinFrame::DECORM_MAXIMIZE; 2829 ret |= WindowState::DECORM_MAXIMIZE;
2830 if (decorations.close) 2830 if (decorations.close)
2831 ret |= FbWinFrame::DECORM_CLOSE; 2831 ret |= WindowState::DECORM_CLOSE;
2832 if (decorations.menu) 2832 if (decorations.menu)
2833 ret |= FbWinFrame::DECORM_MENU; 2833 ret |= WindowState::DECORM_MENU;
2834 if (decorations.sticky) 2834 if (decorations.sticky)
2835 ret |= FbWinFrame::DECORM_STICKY; 2835 ret |= WindowState::DECORM_STICKY;
2836 if (decorations.shade) 2836 if (decorations.shade)
2837 ret |= FbWinFrame::DECORM_SHADE; 2837 ret |= WindowState::DECORM_SHADE;
2838 if (decorations.tab) 2838 if (decorations.tab)
2839 ret |= FbWinFrame::DECORM_TAB; 2839 ret |= WindowState::DECORM_TAB;
2840 if (decorations.enabled) 2840 if (decorations.enabled)
2841 ret |= FbWinFrame::DECORM_ENABLED; 2841 ret |= WindowState::DECORM_ENABLED;
2842 return ret; 2842 return ret;
2843} 2843}
2844 2844
2845void FluxboxWindow::setDecorationMask(unsigned int mask, bool apply) { 2845void FluxboxWindow::setDecorationMask(unsigned int mask, bool apply) {
2846 decorations.titlebar = mask & FbWinFrame::DECORM_TITLEBAR; 2846 decorations.titlebar = mask & WindowState::DECORM_TITLEBAR;
2847 decorations.handle = mask & FbWinFrame::DECORM_HANDLE; 2847 decorations.handle = mask & WindowState::DECORM_HANDLE;
2848 decorations.border = mask & FbWinFrame::DECORM_BORDER; 2848 decorations.border = mask & WindowState::DECORM_BORDER;
2849 decorations.iconify = mask & FbWinFrame::DECORM_ICONIFY; 2849 decorations.iconify = mask & WindowState::DECORM_ICONIFY;
2850 decorations.maximize = mask & FbWinFrame::DECORM_MAXIMIZE; 2850 decorations.maximize = mask & WindowState::DECORM_MAXIMIZE;
2851 decorations.close = mask & FbWinFrame::DECORM_CLOSE; 2851 decorations.close = mask & WindowState::DECORM_CLOSE;
2852 decorations.menu = mask & FbWinFrame::DECORM_MENU; 2852 decorations.menu = mask & WindowState::DECORM_MENU;
2853 decorations.sticky = mask & FbWinFrame::DECORM_STICKY; 2853 decorations.sticky = mask & WindowState::DECORM_STICKY;
2854 decorations.shade = mask & FbWinFrame::DECORM_SHADE; 2854 decorations.shade = mask & WindowState::DECORM_SHADE;
2855 decorations.tab = mask & FbWinFrame::DECORM_TAB; 2855 decorations.tab = mask & WindowState::DECORM_TAB;
2856 decorations.enabled = mask & FbWinFrame::DECORM_ENABLED; 2856 decorations.enabled = mask & WindowState::DECORM_ENABLED;
2857 // we don't want to do this during initialization 2857 // we don't want to do this during initialization
2858 if (apply) 2858 if (apply)
2859 applyDecorations(); 2859 applyDecorations();
@@ -3024,7 +3024,7 @@ void FluxboxWindow::doSnapping(int &orig_left, int &orig_top) {
3024 // we only care about the left/top etc that includes borders 3024 // we only care about the left/top etc that includes borders
3025 int borderW = 0; 3025 int borderW = 0;
3026 3026
3027 if (decorationMask() & (FbWinFrame::DECORM_BORDER|FbWinFrame::DECORM_HANDLE)) 3027 if (decorationMask() & (WindowState::DECORM_BORDER|WindowState::DECORM_HANDLE))
3028 borderW = frame().window().borderWidth(); 3028 borderW = frame().window().borderWidth();
3029 3029
3030 int top = orig_top; // orig include the borders 3030 int top = orig_top; // orig include the borders
@@ -3096,7 +3096,7 @@ void FluxboxWindow::doSnapping(int &orig_left, int &orig_top) {
3096 if ((*it) == this) 3096 if ((*it) == this)
3097 continue; // skip myself 3097 continue; // skip myself
3098 3098
3099 bw = (*it)->decorationMask() & (FbWinFrame::DECORM_BORDER|FbWinFrame::DECORM_HANDLE) ? 3099 bw = (*it)->decorationMask() & (WindowState::DECORM_BORDER|WindowState::DECORM_HANDLE) ?
3100 (*it)->frame().window().borderWidth() : 0; 3100 (*it)->frame().window().borderWidth() : 0;
3101 3101
3102 snapToWindow(dx, dy, left, right, top, bottom, 3102 snapToWindow(dx, dy, left, right, top, bottom,
@@ -3175,7 +3175,7 @@ void FluxboxWindow::startResizing(int x, int y, ReferenceCorner dir) {
3175 m_resize_corner = dir; 3175 m_resize_corner = dir;
3176 3176
3177 resizing = true; 3177 resizing = true;
3178 maximized = FbWinFrame::MAX_NONE; 3178 maximized = WindowState::MAX_NONE;
3179 frame().setMaximized(maximized); 3179 frame().setMaximized(maximized);
3180 3180
3181 const Cursor& cursor = (m_resize_corner == LEFTTOP) ? frame().theme()->upperLeftAngleCursor() : 3181 const Cursor& cursor = (m_resize_corner == LEFTTOP) ? frame().theme()->upperLeftAngleCursor() :
@@ -3862,7 +3862,7 @@ void FluxboxWindow::setWindowType(Focusable::WindowType type) {
3862 setFocusNew(false); 3862 setFocusNew(false);
3863 setMouseFocus(false); 3863 setMouseFocus(false);
3864 setClickFocus(false); 3864 setClickFocus(false);
3865 setDecorationMask(FbWinFrame::DECOR_NONE); 3865 setDecorationMask(WindowState::DECOR_NONE);
3866 moveToLayer(::Layer::DOCK); 3866 moveToLayer(::Layer::DOCK);
3867 break; 3867 break;
3868 case Focusable::TYPE_DESKTOP: 3868 case Focusable::TYPE_DESKTOP:
@@ -3877,7 +3877,7 @@ void FluxboxWindow::setWindowType(Focusable::WindowType type) {
3877 setFocusNew(false); 3877 setFocusNew(false);
3878 setMouseFocus(false); 3878 setMouseFocus(false);
3879 moveToLayer(::Layer::DESKTOP); 3879 moveToLayer(::Layer::DESKTOP);
3880 setDecorationMask(FbWinFrame::DECOR_NONE); 3880 setDecorationMask(WindowState::DECOR_NONE);
3881 setTabable(false); 3881 setTabable(false);
3882 setMovable(false); 3882 setMovable(false);
3883 setResizable(false); 3883 setResizable(false);
@@ -3889,7 +3889,7 @@ void FluxboxWindow::setWindowType(Focusable::WindowType type) {
3889 * window is a splash screen displayed as an application 3889 * window is a splash screen displayed as an application
3890 * is starting up. 3890 * is starting up.
3891 */ 3891 */
3892 setDecorationMask(FbWinFrame::DECOR_NONE); 3892 setDecorationMask(WindowState::DECOR_NONE);
3893 setFocusHidden(true); 3893 setFocusHidden(true);
3894 setIconHidden(true); 3894 setIconHidden(true);
3895 setFocusNew(false); 3895 setFocusNew(false);
@@ -3909,7 +3909,7 @@ void FluxboxWindow::setWindowType(Focusable::WindowType type) {
3909 * application). Windows of this type may set the 3909 * application). Windows of this type may set the
3910 * WM_TRANSIENT_FOR hint indicating the main application window. 3910 * WM_TRANSIENT_FOR hint indicating the main application window.
3911 */ 3911 */
3912 setDecorationMask(FbWinFrame::DECOR_TOOL); 3912 setDecorationMask(WindowState::DECOR_TOOL);
3913 setIconHidden(true); 3913 setIconHidden(true);
3914 moveToLayer(::Layer::ABOVE_DOCK); 3914 moveToLayer(::Layer::ABOVE_DOCK);
3915 break; 3915 break;