don't let the user toggle decorations on widnows that don't have any decorations to toggle
This commit is contained in:
parent
3c590a5851
commit
c6dac85397
3 changed files with 15 additions and 4 deletions
|
@ -1585,7 +1585,8 @@ void client_setup_decor_and_functions(ObClient *self)
|
||||||
OB_CLIENT_FUNC_SHADE |
|
OB_CLIENT_FUNC_SHADE |
|
||||||
OB_CLIENT_FUNC_CLOSE |
|
OB_CLIENT_FUNC_CLOSE |
|
||||||
OB_CLIENT_FUNC_BELOW |
|
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 ||
|
if (!(self->min_size.width < self->max_size.width ||
|
||||||
self->min_size.height < self->max_size.height))
|
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)
|
if (self->max_vert && self->max_horz)
|
||||||
self->decorations &= ~(OB_FRAME_DECOR_HANDLE | OB_FRAME_DECOR_GRIPS);
|
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
|
/* finally, the user can have requested no decorations, which overrides
|
||||||
everything (but doesnt give it a border if it doesnt have one) */
|
everything (but doesnt give it a border if it doesnt have one) */
|
||||||
if (self->undecorated) {
|
if (self->undecorated) {
|
||||||
|
@ -3571,7 +3577,11 @@ void client_set_layer(ObClient *self, gint layer)
|
||||||
|
|
||||||
void client_set_undecorated(ObClient *self, gboolean undecorated)
|
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;
|
self->undecorated = undecorated;
|
||||||
client_setup_decor_and_functions(self);
|
client_setup_decor_and_functions(self);
|
||||||
client_change_state(self); /* reflect this in the state hints */
|
client_change_state(self); /* reflect this in the state hints */
|
||||||
|
|
|
@ -73,7 +73,8 @@ typedef enum
|
||||||
OB_CLIENT_FUNC_FULLSCREEN = 1 << 5, /*!< Allow to be made fullscreen */
|
OB_CLIENT_FUNC_FULLSCREEN = 1 << 5, /*!< Allow to be made fullscreen */
|
||||||
OB_CLIENT_FUNC_CLOSE = 1 << 6, /*!< Allow to be closed */
|
OB_CLIENT_FUNC_CLOSE = 1 << 6, /*!< Allow to be closed */
|
||||||
OB_CLIENT_FUNC_ABOVE = 1 << 7, /*!< Allow to be put in lower layer */
|
OB_CLIENT_FUNC_ABOVE = 1 << 7, /*!< Allow to be put in lower layer */
|
||||||
OB_CLIENT_FUNC_BELOW = 1 << 8 /*!< Allow to be put in higher layer */
|
OB_CLIENT_FUNC_BELOW = 1 << 8, /*!< Allow to be put in higher layer */
|
||||||
|
OB_CLIENT_FUNC_UNDECORATE = 1 << 9 /*!< Allow to be undecorated */
|
||||||
} ObFunctions;
|
} ObFunctions;
|
||||||
|
|
||||||
struct _ObClient
|
struct _ObClient
|
||||||
|
|
|
@ -91,7 +91,7 @@ static gboolean client_menu_update(ObMenuFrame *frame, gpointer data)
|
||||||
*en = c->functions & OB_CLIENT_FUNC_CLOSE;
|
*en = c->functions & OB_CLIENT_FUNC_CLOSE;
|
||||||
break;
|
break;
|
||||||
case CLIENT_DECORATE:
|
case CLIENT_DECORATE:
|
||||||
*en = client_normal(c);
|
*en = c->functions & OB_CLIENT_FUNC_UNDECORATE;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
*en = TRUE;
|
*en = TRUE;
|
||||||
|
|
Loading…
Reference in a new issue