+ if (settings) {
+ /* Don't worry, we won't actually both shade and undecorate the
+ * window when push comes to shove. */
+ if (settings->shade != -1)
+ client_shade(self, settings->shade);
+ if (settings->decor != -1)
+ client_set_undecorated(self, !settings->decor);
+ if (settings->iconic != -1)
+ client_iconify(self, settings->iconic, FALSE);
+ if (settings->skip_pager != -1) {
+ self->skip_pager = !!settings->skip_pager;
+ client_change_state(self);
+ }
+ if (settings->skip_taskbar != -1) {
+ self->skip_taskbar = !!settings->skip_taskbar;
+ client_change_state(self);
+ }
+
+ /* 1 && -1 shouldn't be possible by the code in config.c */
+ if (settings->max_vert == 1 && settings->max_horz == 1)
+ client_maximize(self, TRUE, 0, TRUE);
+ else if (settings->max_vert == 0 && settings->max_horz == 0)
+ client_maximize(self, FALSE, 0, TRUE);
+ else if (settings->max_vert == 1 && settings->max_horz == 0) {
+ client_maximize(self, TRUE, 2, TRUE);
+ client_maximize(self, FALSE, 1, TRUE);
+ } else if (settings->max_vert == 0 && settings->max_horz == 1) {
+ client_maximize(self, TRUE, 1, TRUE);
+ client_maximize(self, FALSE, 2, TRUE);
+ }
+
+ if (settings->fullscreen != -1)
+ client_fullscreen(self, !!settings->fullscreen, TRUE);
+
+ if (settings->desktop < screen_num_desktops
+ || settings->desktop == DESKTOP_ALL)
+ client_set_desktop(self, settings->desktop, TRUE);
+
+ if (settings->layer > -2 && settings->layer < 2)
+ client_set_layer(self, settings->layer);
+
+ }
+