+/* Center the given TildaWindow in the horizontal axis */
+static void
+tilda_window_center_horizontally (TildaWindow *self)
+{
+ const gint screen_center = gdk_screen_width() / 2;
+ const gint tilda_center = self->width / 2;
+ const gint center_coord = screen_center - tilda_center;
+
+ g_object_set (G_OBJECT(self), "x-position", center_coord, NULL);
+}
+
+/* Center the given TildaWindow in the vertical axis */
+static void
+tilda_window_center_vertically (TildaWindow *self)
+{
+ const gint screen_center = gdk_screen_height() / 2;
+ const gint tilda_center = self->height / 2;
+ const gint center_coord = screen_center - tilda_center;
+
+ g_object_set (G_OBJECT(self), "y-position", center_coord, NULL);
+}
+