+ObAppSettings* config_create_app_settings()
+{
+ ObAppSettings *settings = g_new0(ObAppSettings, 1);
+ settings->decor = -1;
+ settings->shade = -1;
+ settings->monitor = -1;
+ settings->focus = -1;
+ settings->desktop = 0;
+ settings->layer = -2;
+ settings->iconic = -1;
+ settings->skip_pager = -1;
+ settings->skip_taskbar = -1;
+ settings->fullscreen = -1;
+ settings->max_horz = -1;
+ settings->max_vert = -1;
+ return settings;
+}
+
+#define copy_if(setting, default) \
+ if (src->setting != default) dst->setting = src->setting
+void config_app_settings_copy_non_defaults(const ObAppSettings *src,
+ ObAppSettings *dst)
+{
+ g_assert(src != NULL);
+ g_assert(dst != NULL);
+
+ copy_if(decor, -1);
+ copy_if(shade, -1);
+ copy_if(focus, -1);
+ copy_if(desktop, 0);
+ copy_if(layer, -2);
+ copy_if(iconic, -1);
+ copy_if(skip_pager, -1);
+ copy_if(skip_taskbar, -1);
+ copy_if(fullscreen, -1);
+ copy_if(max_horz, -1);
+ copy_if(max_vert, -1);
+
+ if (src->pos_given) {
+ dst->pos_given = TRUE;
+ dst->center_x = src->center_x;
+ dst->center_y = src->center_y;
+ dst->position.x = src->position.x;
+ dst->position.y = src->position.y;
+ dst->monitor = src->monitor;
+ }
+}
+