better more obvious code
This commit is contained in:
parent
2f579df4e7
commit
be3b78736f
3 changed files with 12 additions and 13 deletions
|
@ -321,7 +321,7 @@ void client_manage(Window window)
|
||||||
client_restore_session_state(self);
|
client_restore_session_state(self);
|
||||||
|
|
||||||
/* now we have all of the window's information so we can set this up */
|
/* now we have all of the window's information so we can set this up */
|
||||||
client_setup_decor_and_functions(self);
|
client_setup_decor_and_functions(self, FALSE);
|
||||||
|
|
||||||
{
|
{
|
||||||
Time t = sn_app_started(self->startup_id, self->class);
|
Time t = sn_app_started(self->startup_id, self->class);
|
||||||
|
@ -1595,9 +1595,7 @@ void client_update_normal_hints(ObClient *self)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*! This needs to be followed by a call to client_configure to make
|
void client_setup_decor_and_functions(ObClient *self, gboolean reconfig)
|
||||||
the changes show */
|
|
||||||
void client_setup_decor_and_functions(ObClient *self)
|
|
||||||
{
|
{
|
||||||
/* start with everything (cept fullscreen) */
|
/* start with everything (cept fullscreen) */
|
||||||
self->decorations =
|
self->decorations =
|
||||||
|
@ -1753,6 +1751,9 @@ void client_setup_decor_and_functions(ObClient *self)
|
||||||
}
|
}
|
||||||
|
|
||||||
client_change_allowed_actions(self);
|
client_change_allowed_actions(self);
|
||||||
|
|
||||||
|
if (reconfig)
|
||||||
|
client_reconfigure(self);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void client_change_allowed_actions(ObClient *self)
|
static void client_change_allowed_actions(ObClient *self)
|
||||||
|
@ -3716,8 +3717,7 @@ void client_set_undecorated(ObClient *self, gboolean undecorated)
|
||||||
(self->functions & OB_CLIENT_FUNC_UNDECORATE || !undecorated))
|
(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, TRUE);
|
||||||
client_reconfigure(self); /* show the lack of decorations */
|
|
||||||
client_change_state(self); /* reflect this in the state hints */
|
client_change_state(self); /* reflect this in the state hints */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -604,8 +604,10 @@ void client_update_icon_geometry(ObClient *self);
|
||||||
/*! Set up what decor should be shown on the window and what functions should
|
/*! Set up what decor should be shown on the window and what functions should
|
||||||
be allowed (ObClient::decorations and ObClient::functions).
|
be allowed (ObClient::decorations and ObClient::functions).
|
||||||
This also updates the NET_WM_ALLOWED_ACTIONS hint.
|
This also updates the NET_WM_ALLOWED_ACTIONS hint.
|
||||||
|
@param reconfig When TRUE, the window will be reconfigured to show the
|
||||||
|
changes
|
||||||
*/
|
*/
|
||||||
void client_setup_decor_and_functions(ObClient *self);
|
void client_setup_decor_and_functions(ObClient *self, gboolean reconfig);
|
||||||
|
|
||||||
/*! Sets the window's type and transient flag */
|
/*! Sets the window's type and transient flag */
|
||||||
void client_get_type_and_transientness(ObClient *self);
|
void client_get_type_and_transientness(ObClient *self);
|
||||||
|
|
|
@ -1430,8 +1430,7 @@ static void event_handle_client(ObClient *client, XEvent *e)
|
||||||
if (msgtype == XA_WM_NORMAL_HINTS) {
|
if (msgtype == XA_WM_NORMAL_HINTS) {
|
||||||
client_update_normal_hints(client);
|
client_update_normal_hints(client);
|
||||||
/* normal hints can make a window non-resizable */
|
/* normal hints can make a window non-resizable */
|
||||||
client_setup_decor_and_functions(client);
|
client_setup_decor_and_functions(client, TRUE);
|
||||||
client_reconfigure(client);
|
|
||||||
} else if (msgtype == XA_WM_HINTS) {
|
} else if (msgtype == XA_WM_HINTS) {
|
||||||
client_update_wmhints(client);
|
client_update_wmhints(client);
|
||||||
} else if (msgtype == XA_WM_TRANSIENT_FOR) {
|
} else if (msgtype == XA_WM_TRANSIENT_FOR) {
|
||||||
|
@ -1439,8 +1438,7 @@ static void event_handle_client(ObClient *client, XEvent *e)
|
||||||
client_get_type_and_transientness(client);
|
client_get_type_and_transientness(client);
|
||||||
/* type may have changed, so update the layer */
|
/* type may have changed, so update the layer */
|
||||||
client_calc_layer(client);
|
client_calc_layer(client);
|
||||||
client_setup_decor_and_functions(client);
|
client_setup_decor_and_functions(client, TRUE);
|
||||||
client_reconfigure(client);
|
|
||||||
} else if (msgtype == prop_atoms.net_wm_name ||
|
} else if (msgtype == prop_atoms.net_wm_name ||
|
||||||
msgtype == prop_atoms.wm_name ||
|
msgtype == prop_atoms.wm_name ||
|
||||||
msgtype == prop_atoms.net_wm_icon_name ||
|
msgtype == prop_atoms.net_wm_icon_name ||
|
||||||
|
@ -1448,8 +1446,7 @@ static void event_handle_client(ObClient *client, XEvent *e)
|
||||||
client_update_title(client);
|
client_update_title(client);
|
||||||
} else if (msgtype == prop_atoms.wm_protocols) {
|
} else if (msgtype == prop_atoms.wm_protocols) {
|
||||||
client_update_protocols(client);
|
client_update_protocols(client);
|
||||||
client_setup_decor_and_functions(client);
|
client_setup_decor_and_functions(client, TRUE);
|
||||||
client_reconfigure(client);
|
|
||||||
}
|
}
|
||||||
else if (msgtype == prop_atoms.net_wm_strut) {
|
else if (msgtype == prop_atoms.net_wm_strut) {
|
||||||
client_update_strut(client);
|
client_update_strut(client);
|
||||||
|
|
Loading…
Reference in a new issue