diff options
| author | Dana Jansens <danakj@orodu.net> | 2007-05-17 02:29:13 +0000 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2007-05-17 02:29:13 +0000 |
| commit | c6dac8539715c12db1e18c13f389c59557270268 (patch) | |
| tree | 61a46f0349956711e29cf0353e06ec55d84eacea /openbox/client.c | |
| parent | 3c590a5851877c0b0205bb107da5d8e9318409c7 (diff) | |
don't let the user toggle decorations on widnows that don't have any decorations to toggle
Diffstat (limited to 'openbox/client.c')
| -rw-r--r-- | openbox/client.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/openbox/client.c b/openbox/client.c index bca2261c..addaed44 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -1585,7 +1585,8 @@ void client_setup_decor_and_functions(ObClient *self) OB_CLIENT_FUNC_SHADE | OB_CLIENT_FUNC_CLOSE | OB_CLIENT_FUNC_BELOW | - OB_CLIENT_FUNC_ABOVE); + OB_CLIENT_FUNC_ABOVE | + OB_CLIENT_FUNC_UNDECORATE); if (!(self->min_size.width < self->max_size.width || self->min_size.height < self->max_size.height)) @@ -1684,6 +1685,11 @@ void client_setup_decor_and_functions(ObClient *self) if (self->max_vert && self->max_horz) self->decorations &= ~(OB_FRAME_DECOR_HANDLE | OB_FRAME_DECOR_GRIPS); + /* If there are no decorations to remove, don't allow the user to try + toggle the state */ + if (self->decorations == 0) + self->functions &= ~OB_CLIENT_FUNC_UNDECORATE; + /* finally, the user can have requested no decorations, which overrides everything (but doesnt give it a border if it doesnt have one) */ if (self->undecorated) { @@ -3571,7 +3577,11 @@ void client_set_layer(ObClient *self, gint layer) void client_set_undecorated(ObClient *self, gboolean undecorated) { - if (self->undecorated != undecorated) { + if (self->undecorated != undecorated && + /* don't let it undecorate if the function is missing, but let + it redecorate */ + (self->functions & OB_CLIENT_FUNC_UNDECORATE || !undecorated)) + { self->undecorated = undecorated; client_setup_decor_and_functions(self); client_change_state(self); /* reflect this in the state hints */ |
