summaryrefslogtreecommitdiff
path: root/src/core/place.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/place.c')
-rw-r--r--src/core/place.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/core/place.c b/src/core/place.c
index 6c0efc128..fea6beaed 100644
--- a/src/core/place.c
+++ b/src/core/place.c
@@ -318,6 +318,19 @@ window_overlaps_focus_window (MetaWindow *window)
&overlap);
}
+static gboolean
+window_place_centered (MetaWindow *window)
+{
+ MetaWindowType type;
+
+ type = window->type;
+
+ return (type == META_WINDOW_DIALOG ||
+ type == META_WINDOW_MODAL_DIALOG ||
+ type == META_WINDOW_SPLASHSCREEN ||
+ (type == META_WINDOW_NORMAL && meta_prefs_get_center_new_windows ()));
+}
+
static void
avoid_being_obscured_as_second_modal_dialog (MetaWindow *window,
int *x,
@@ -737,9 +750,7 @@ meta_window_place (MetaWindow *window,
* on the sides of the parent window or something.
*/
- if (window->type == META_WINDOW_DIALOG ||
- window->type == META_WINDOW_MODAL_DIALOG ||
- window->type == META_WINDOW_SPLASHSCREEN)
+ if (window_place_centered (window))
{
/* Center on current monitor */
int w, h;