From 611371df45718f3bff58cf08423621ae9feaca63 Mon Sep 17 00:00:00 2001 From: Elijah Newren Date: Sun, 16 Oct 2005 14:45:27 +0000 Subject: The various keep-'em-onscreen constraints should only apply to normal 2005-10-16 Elijah Newren * src/constraints.c: (constrain_to_single_xinerama): (constrain_fully_onscreen): (constrain_partially_onscreen): The various keep-'em-onscreen constraints should only apply to normal windows (otherwise, docks get shoved out of their place by their own strut) --- ChangeLog | 10 ++++++++++ src/constraints.c | 27 ++++++++++++++++++++++----- 2 files changed, 32 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index f3ea631a..1ebaf5eb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2005-10-16 Elijah Newren + + * src/constraints.c: + (constrain_to_single_xinerama): + (constrain_fully_onscreen): + (constrain_partially_onscreen): + The various keep-'em-onscreen constraints should only apply to + normal windows (otherwise, docks get shoved out of their place by + their own strut) + 2005-10-16 Elijah Newren * src/window.c: diff --git a/src/constraints.c b/src/constraints.c index 535da64c..eed8f6cc 100644 --- a/src/constraints.c +++ b/src/constraints.c @@ -1247,8 +1247,14 @@ constrain_to_single_xinerama (MetaWindow *window, if (priority > PRIORITY_ENTIRELY_VISIBLE_ON_SINGLE_XINERAMA) return TRUE; - /* Exit early if we know the constraint won't apply */ - if (!window->require_on_single_xinerama || info->is_user_action) + /* Exit early if we know the constraint won't apply--note that this constraint + * is only meant for normal windows (e.g. we don't want docks to be shoved + * "onscreen" by their own strut). + */ + if (window->type == META_WINDOW_DESKTOP || + window->type == META_WINDOW_DOCK || + !window->require_on_single_xinerama || + info->is_user_action) return TRUE; /* Have a helper function handle the constraint for us */ @@ -1280,8 +1286,13 @@ constrain_fully_onscreen (MetaWindow *window, if (priority > PRIORITY_ENTIRELY_VISIBLE_ON_WORKAREA) return TRUE; - /* Exit early if we know the constraint won't apply */ - if (!window->require_fully_onscreen || + /* Exit early if we know the constraint won't apply--note that this constraint + * is only meant for normal windows (e.g. we don't want docks to be shoved + * "onscreen" by their own strut). + */ + if (window->type == META_WINDOW_DESKTOP || + window->type == META_WINDOW_DOCK || + !window->require_fully_onscreen || (info->is_user_action && info->action_type != ACTION_RESIZE)) return TRUE; @@ -1308,7 +1319,13 @@ constrain_partially_onscreen (MetaWindow *window, if (priority > PRIORITY_PARTIALLY_VISIBLE_ON_WORKAREA) return TRUE; - /* No special reasons, other than possibly priority, for this not applying */ + /* Exit early if we know the constraint won't apply--note that this constraint + * is only meant for normal windows (e.g. we don't want docks to be shoved + * "onscreen" by their own strut). + */ + if (window->type == META_WINDOW_DESKTOP || + window->type == META_WINDOW_DOCK) + return TRUE; /* Determine how much offscreen things are allowed. We first need to * figure out how much must remain on the screen. For that, we use 25% -- cgit v1.2.1