aboutsummaryrefslogtreecommitdiff
path: root/src/Window.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/Window.cc')
-rw-r--r--src/Window.cc79
1 files changed, 40 insertions, 39 deletions
diff --git a/src/Window.cc b/src/Window.cc
index 6806afa..54f6915 100644
--- a/src/Window.cc
+++ b/src/Window.cc
@@ -1516,10 +1516,10 @@ void FluxboxWindow::setFullscreen(bool flag) {
1516 1516
1517 frame().setUseShape(true); 1517 frame().setUseShape(true);
1518 if (m_toggled_decos) { 1518 if (m_toggled_decos) {
1519 if (m_old_decoration_mask & (DECORM_TITLEBAR | DECORM_TAB)) 1519 if (m_old_decoration_mask & (FbWinFrame::DECORM_TITLEBAR | FbWinFrame::DECORM_TAB))
1520 setDecorationMask(DECOR_NONE); 1520 setDecorationMask(FbWinFrame::DECOR_NONE);
1521 else 1521 else
1522 setDecorationMask(DECOR_NORMAL); 1522 setDecorationMask(FbWinFrame::DECOR_NORMAL);
1523 } else 1523 } else
1524 setDecorationMask(m_old_decoration_mask); 1524 setDecorationMask(m_old_decoration_mask);
1525 1525
@@ -3032,6 +3032,7 @@ void FluxboxWindow::applyDecorations(bool initial) {
3032 client_move = true; 3032 client_move = true;
3033 } 3033 }
3034 3034
3035 frame().setDecorationMask(decorationMask());
3035 frame().reconfigure(); 3036 frame().reconfigure();
3036 if (client_move) 3037 if (client_move)
3037 Fluxbox::instance()->updateFrameExtents(*this); 3038 Fluxbox::instance()->updateFrameExtents(*this);
@@ -3051,9 +3052,9 @@ void FluxboxWindow::toggleDecoration() {
3051 if (m_toggled_decos) { 3052 if (m_toggled_decos) {
3052 m_old_decoration_mask = decorationMask(); 3053 m_old_decoration_mask = decorationMask();
3053 if (decorations.titlebar | decorations.tab) 3054 if (decorations.titlebar | decorations.tab)
3054 setDecorationMask(DECOR_NONE); 3055 setDecorationMask(FbWinFrame::DECOR_NONE);
3055 else 3056 else
3056 setDecorationMask(DECOR_NORMAL); 3057 setDecorationMask(FbWinFrame::DECOR_NORMAL);
3057 } else //revert back to old decoration 3058 } else //revert back to old decoration
3058 setDecorationMask(m_old_decoration_mask); 3059 setDecorationMask(m_old_decoration_mask);
3059 3060
@@ -3062,42 +3063,42 @@ void FluxboxWindow::toggleDecoration() {
3062unsigned int FluxboxWindow::decorationMask() const { 3063unsigned int FluxboxWindow::decorationMask() const {
3063 unsigned int ret = 0; 3064 unsigned int ret = 0;
3064 if (decorations.titlebar) 3065 if (decorations.titlebar)
3065 ret |= DECORM_TITLEBAR; 3066 ret |= FbWinFrame::DECORM_TITLEBAR;
3066 if (decorations.handle) 3067 if (decorations.handle)
3067 ret |= DECORM_HANDLE; 3068 ret |= FbWinFrame::DECORM_HANDLE;
3068 if (decorations.border) 3069 if (decorations.border)
3069 ret |= DECORM_BORDER; 3070 ret |= FbWinFrame::DECORM_BORDER;
3070 if (decorations.iconify) 3071 if (decorations.iconify)
3071 ret |= DECORM_ICONIFY; 3072 ret |= FbWinFrame::DECORM_ICONIFY;
3072 if (decorations.maximize) 3073 if (decorations.maximize)
3073 ret |= DECORM_MAXIMIZE; 3074 ret |= FbWinFrame::DECORM_MAXIMIZE;
3074 if (decorations.close) 3075 if (decorations.close)
3075 ret |= DECORM_CLOSE; 3076 ret |= FbWinFrame::DECORM_CLOSE;
3076 if (decorations.menu) 3077 if (decorations.menu)
3077 ret |= DECORM_MENU; 3078 ret |= FbWinFrame::DECORM_MENU;
3078 if (decorations.sticky) 3079 if (decorations.sticky)
3079 ret |= DECORM_STICKY; 3080 ret |= FbWinFrame::DECORM_STICKY;
3080 if (decorations.shade) 3081 if (decorations.shade)
3081 ret |= DECORM_SHADE; 3082 ret |= FbWinFrame::DECORM_SHADE;
3082 if (decorations.tab) 3083 if (decorations.tab)
3083 ret |= DECORM_TAB; 3084 ret |= FbWinFrame::DECORM_TAB;
3084 if (decorations.enabled) 3085 if (decorations.enabled)
3085 ret |= DECORM_ENABLED; 3086 ret |= FbWinFrame::DECORM_ENABLED;
3086 return ret; 3087 return ret;
3087} 3088}
3088 3089
3089void FluxboxWindow::setDecorationMask(unsigned int mask, bool apply) { 3090void FluxboxWindow::setDecorationMask(unsigned int mask, bool apply) {
3090 decorations.titlebar = mask & DECORM_TITLEBAR; 3091 decorations.titlebar = mask & FbWinFrame::DECORM_TITLEBAR;
3091 decorations.handle = mask & DECORM_HANDLE; 3092 decorations.handle = mask & FbWinFrame::DECORM_HANDLE;
3092 decorations.border = mask & DECORM_BORDER; 3093 decorations.border = mask & FbWinFrame::DECORM_BORDER;
3093 decorations.iconify = mask & DECORM_ICONIFY; 3094 decorations.iconify = mask & FbWinFrame::DECORM_ICONIFY;
3094 decorations.maximize = mask & DECORM_MAXIMIZE; 3095 decorations.maximize = mask & FbWinFrame::DECORM_MAXIMIZE;
3095 decorations.close = mask & DECORM_CLOSE; 3096 decorations.close = mask & FbWinFrame::DECORM_CLOSE;
3096 decorations.menu = mask & DECORM_MENU; 3097 decorations.menu = mask & FbWinFrame::DECORM_MENU;
3097 decorations.sticky = mask & DECORM_STICKY; 3098 decorations.sticky = mask & FbWinFrame::DECORM_STICKY;
3098 decorations.shade = mask & DECORM_SHADE; 3099 decorations.shade = mask & FbWinFrame::DECORM_SHADE;
3099 decorations.tab = mask & DECORM_TAB; 3100 decorations.tab = mask & FbWinFrame::DECORM_TAB;
3100 decorations.enabled = mask & DECORM_ENABLED; 3101 decorations.enabled = mask & FbWinFrame::DECORM_ENABLED;
3101 // we don't want to do this during initialization 3102 // we don't want to do this during initialization
3102 if (apply) 3103 if (apply)
3103 applyDecorations(); 3104 applyDecorations();
@@ -3268,7 +3269,7 @@ void FluxboxWindow::doSnapping(int &orig_left, int &orig_top) {
3268 // we only care about the left/top etc that includes borders 3269 // we only care about the left/top etc that includes borders
3269 int borderW = 0; 3270 int borderW = 0;
3270 3271
3271 if (decorationMask() & (DECORM_BORDER|DECORM_HANDLE)) 3272 if (decorationMask() & (FbWinFrame::DECORM_BORDER|FbWinFrame::DECORM_HANDLE))
3272 borderW = frame().window().borderWidth(); 3273 borderW = frame().window().borderWidth();
3273 3274
3274 int top = orig_top; // orig include the borders 3275 int top = orig_top; // orig include the borders
@@ -3340,7 +3341,7 @@ void FluxboxWindow::doSnapping(int &orig_left, int &orig_top) {
3340 if ((*it) == this) 3341 if ((*it) == this)
3341 continue; // skip myself 3342 continue; // skip myself
3342 3343
3343 bw = (*it)->decorationMask() & (DECORM_BORDER|DECORM_HANDLE) ? 3344 bw = (*it)->decorationMask() & (FbWinFrame::DECORM_BORDER|FbWinFrame::DECORM_HANDLE) ?
3344 (*it)->frame().window().borderWidth() : 0; 3345 (*it)->frame().window().borderWidth() : 0;
3345 3346
3346 snapToWindow(dx, dy, left, right, top, bottom, 3347 snapToWindow(dx, dy, left, right, top, bottom,
@@ -4106,17 +4107,17 @@ void FluxboxWindow::associateClient(WinClient &client) {
4106 4107
4107int FluxboxWindow::getDecoMaskFromString(const string &str_label) { 4108int FluxboxWindow::getDecoMaskFromString(const string &str_label) {
4108 if (strcasecmp(str_label.c_str(), "NONE") == 0) 4109 if (strcasecmp(str_label.c_str(), "NONE") == 0)
4109 return DECOR_NONE; 4110 return FbWinFrame::DECOR_NONE;
4110 if (strcasecmp(str_label.c_str(), "NORMAL") == 0) 4111 if (strcasecmp(str_label.c_str(), "NORMAL") == 0)
4111 return DECOR_NORMAL; 4112 return FbWinFrame::DECOR_NORMAL;
4112 if (strcasecmp(str_label.c_str(), "TINY") == 0) 4113 if (strcasecmp(str_label.c_str(), "TINY") == 0)
4113 return DECOR_TINY; 4114 return FbWinFrame::DECOR_TINY;
4114 if (strcasecmp(str_label.c_str(), "TOOL") == 0) 4115 if (strcasecmp(str_label.c_str(), "TOOL") == 0)
4115 return DECOR_TOOL; 4116 return FbWinFrame::DECOR_TOOL;
4116 if (strcasecmp(str_label.c_str(), "BORDER") == 0) 4117 if (strcasecmp(str_label.c_str(), "BORDER") == 0)
4117 return DECOR_BORDER; 4118 return FbWinFrame::DECOR_BORDER;
4118 if (strcasecmp(str_label.c_str(), "TAB") == 0) 4119 if (strcasecmp(str_label.c_str(), "TAB") == 0)
4119 return DECOR_TAB; 4120 return FbWinFrame::DECOR_TAB;
4120 int mask = -1; 4121 int mask = -1;
4121 if (str_label.size() > 1 && str_label[0] == '0' && str_label[1] == 'x' || 4122 if (str_label.size() > 1 && str_label[0] == '0' && str_label[1] == 'x' ||
4122 str_label.size() > 0 && isdigit(str_label[0])) 4123 str_label.size() > 0 && isdigit(str_label[0]))
@@ -4158,7 +4159,7 @@ void FluxboxWindow::setWindowType(Focusable::WindowType type) {
4158 */ 4159 */
4159 setFocusHidden(true); 4160 setFocusHidden(true);
4160 setIconHidden(true); 4161 setIconHidden(true);
4161 setDecorationMask(DECOR_NONE); 4162 setDecorationMask(FbWinFrame::DECOR_NONE);
4162 moveToLayer(::Layer::DOCK); 4163 moveToLayer(::Layer::DOCK);
4163 break; 4164 break;
4164 case Focusable::TYPE_DESKTOP: 4165 case Focusable::TYPE_DESKTOP:
@@ -4171,7 +4172,7 @@ void FluxboxWindow::setWindowType(Focusable::WindowType type) {
4171 setFocusHidden(true); 4172 setFocusHidden(true);
4172 setIconHidden(true); 4173 setIconHidden(true);
4173 moveToLayer(::Layer::DESKTOP); 4174 moveToLayer(::Layer::DESKTOP);
4174 setDecorationMask(DECOR_NONE); 4175 setDecorationMask(FbWinFrame::DECOR_NONE);
4175 setTabable(false); 4176 setTabable(false);
4176 setMovable(false); 4177 setMovable(false);
4177 setResizable(false); 4178 setResizable(false);
@@ -4183,7 +4184,7 @@ void FluxboxWindow::setWindowType(Focusable::WindowType type) {
4183 * window is a splash screen displayed as an application 4184 * window is a splash screen displayed as an application
4184 * is starting up. 4185 * is starting up.
4185 */ 4186 */
4186 setDecorationMask(DECOR_NONE); 4187 setDecorationMask(FbWinFrame::DECOR_NONE);
4187 setFocusHidden(true); 4188 setFocusHidden(true);
4188 setIconHidden(true); 4189 setIconHidden(true);
4189 setMovable(false); 4190 setMovable(false);
@@ -4200,7 +4201,7 @@ void FluxboxWindow::setWindowType(Focusable::WindowType type) {
4200 * application). Windows of this type may set the 4201 * application). Windows of this type may set the
4201 * WM_TRANSIENT_FOR hint indicating the main application window. 4202 * WM_TRANSIENT_FOR hint indicating the main application window.
4202 */ 4203 */
4203 setDecorationMask(DECOR_TOOL); 4204 setDecorationMask(FbWinFrame::DECOR_TOOL);
4204 setIconHidden(true); 4205 setIconHidden(true);
4205 moveToLayer(::Layer::ABOVE_DOCK); 4206 moveToLayer(::Layer::ABOVE_DOCK);
4206 break; 4207 break;