diff options
author | Alberts Muktupāvels <alberts.muktupavels@gmail.com> | 2018-06-16 19:39:26 +0300 |
---|---|---|
committer | Alberts Muktupāvels <alberts.muktupavels@gmail.com> | 2018-06-16 19:39:26 +0300 |
commit | c5dd4a734174ec0ebfe8919bd88580d7f1997c03 (patch) | |
tree | 30cf11e48e6b562f3b391359634d68f20cce6c5a | |
parent | aef654c8c623132f55c19994c2f59164e2781507 (diff) | |
download | metacity-c5dd4a734174ec0ebfe8919bd88580d7f1997c03.tar.gz |
refer to monitors as "monitors" rather than "xineramas"
Follow mutter and rename xineramas to monitors.
-rw-r--r-- | src/core/boxes.c | 22 | ||||
-rw-r--r-- | src/core/constraints.c | 234 | ||||
-rw-r--r-- | src/core/display-private.h | 4 | ||||
-rw-r--r-- | src/core/display.c | 4 | ||||
-rw-r--r-- | src/core/edge-resistance.c | 48 | ||||
-rw-r--r-- | src/core/keybindings.c | 8 | ||||
-rw-r--r-- | src/core/place.c | 45 | ||||
-rw-r--r-- | src/core/screen-private.h | 34 | ||||
-rw-r--r-- | src/core/screen.c | 270 | ||||
-rw-r--r-- | src/core/stack.c | 12 | ||||
-rw-r--r-- | src/core/testboxes.c | 75 | ||||
-rw-r--r-- | src/core/window-private.h | 18 | ||||
-rw-r--r-- | src/core/window.c | 111 | ||||
-rw-r--r-- | src/core/workspace.c | 124 | ||||
-rw-r--r-- | src/core/workspace.h | 26 | ||||
-rw-r--r-- | src/include/boxes.h | 10 |
16 files changed, 531 insertions, 514 deletions
diff --git a/src/core/boxes.c b/src/core/boxes.c index f306365b..89408374 100644 --- a/src/core/boxes.c +++ b/src/core/boxes.c @@ -532,7 +532,7 @@ meta_rectangle_get_minimal_spanning_set_for_region ( * enough to make this worth bothering. Further, it is only called from * workspace.c:ensure_work_areas_validated (at least as of the time of * writing this comment), which in turn should only be called if the - * strut list changes or the screen or xinerama size changes. If it ever + * strut list changes or the screen or monitor size changes. If it ever * does show up on profiles (most likely because people start using * ridiculously huge numbers of partial struts), possible optimizations * include: @@ -1799,15 +1799,15 @@ meta_rectangle_find_onscreen_edges (const MetaRectangle *basic_rect, } GList* -meta_rectangle_find_nonintersected_xinerama_edges ( +meta_rectangle_find_nonintersected_monitor_edges ( const MetaRectangle *screen_rect, - const GList *xinerama_rects, + const GList *monitor_rects, const GSList *all_struts) { /* This function cannot easily be merged with * meta_rectangle_find_onscreen_edges() because real screen edges * and strut edges both are of the type "there ain't anything - * immediately on the other side"; xinerama edges are different. + * immediately on the other side"; monitor edges are different. */ GList *ret; const GList *cur; @@ -1816,10 +1816,10 @@ meta_rectangle_find_nonintersected_xinerama_edges ( /* Initialize the return list to be empty */ ret = NULL; - /* start of ret with all the edges of xineramas that are adjacent to - * another xinerama. + /* start of ret with all the edges of monitors that are adjacent to + * another monitor. */ - cur = xinerama_rects; + cur = monitor_rects; while (cur) { MetaRectangle *cur_rect = cur->data; @@ -1830,7 +1830,7 @@ meta_rectangle_find_nonintersected_xinerama_edges ( new_edge = g_new (MetaEdge, 1); new_edge->rect = meta_rect (BOX_LEFT (*cur_rect), BOX_TOP (*cur_rect), 0, cur_rect->height); new_edge->side_type = META_SIDE_LEFT; - new_edge->edge_type = META_EDGE_XINERAMA; + new_edge->edge_type = META_EDGE_MONITOR; ret = g_list_prepend (ret, new_edge); } if (BOX_RIGHT(*cur_rect) != BOX_RIGHT(*screen_rect)) @@ -1838,7 +1838,7 @@ meta_rectangle_find_nonintersected_xinerama_edges ( new_edge = g_new (MetaEdge, 1); new_edge->rect = meta_rect (BOX_RIGHT (*cur_rect), BOX_TOP (*cur_rect), 0, cur_rect->height); new_edge->side_type = META_SIDE_RIGHT; - new_edge->edge_type = META_EDGE_XINERAMA; + new_edge->edge_type = META_EDGE_MONITOR; ret = g_list_prepend (ret, new_edge); } if (BOX_TOP(*cur_rect) != BOX_TOP(*screen_rect)) @@ -1846,7 +1846,7 @@ meta_rectangle_find_nonintersected_xinerama_edges ( new_edge = g_new (MetaEdge, 1); new_edge->rect = meta_rect (BOX_LEFT (*cur_rect), BOX_TOP (*cur_rect), cur_rect->width, 0); new_edge->side_type = META_SIDE_TOP; - new_edge->edge_type = META_EDGE_XINERAMA; + new_edge->edge_type = META_EDGE_MONITOR; ret = g_list_prepend (ret, new_edge); } if (BOX_BOTTOM(*cur_rect) != BOX_BOTTOM(*screen_rect)) @@ -1854,7 +1854,7 @@ meta_rectangle_find_nonintersected_xinerama_edges ( new_edge = g_new (MetaEdge, 1); new_edge->rect = meta_rect (BOX_LEFT (*cur_rect), BOX_BOTTOM (*cur_rect), cur_rect->width, 0); new_edge->side_type = META_SIDE_BOTTOM; - new_edge->edge_type = META_EDGE_XINERAMA; + new_edge->edge_type = META_EDGE_MONITOR; ret = g_list_prepend (ret, new_edge); } diff --git a/src/core/constraints.c b/src/core/constraints.c index 9b7a541a..07dea283 100644 --- a/src/core/constraints.c +++ b/src/core/constraints.c @@ -93,7 +93,7 @@ typedef enum { PRIORITY_MINIMUM = 0, /* Dummy value used for loop start = min(all priorities) */ PRIORITY_ASPECT_RATIO = 0, - PRIORITY_ENTIRELY_VISIBLE_ON_SINGLE_XINERAMA = 0, + PRIORITY_ENTIRELY_VISIBLE_ON_SINGLE_MONITOR = 0, PRIORITY_ENTIRELY_VISIBLE_ON_WORKAREA = 1, PRIORITY_SIZE_HINTS_INCREMENTS = 1, PRIORITY_MAXIMIZATION = 2, @@ -129,23 +129,24 @@ typedef struct int resize_gravity; FixedDirections fixed_directions; - /* work_area_xinerama - current xinerama region minus struts - * entire_xinerama - current xienrama, including strut regions + /* work_area_monitor - current monitor region minus struts + * entire_monitor - current xienrama, including strut regions */ - MetaRectangle work_area_xinerama; - MetaRectangle entire_xinerama; + MetaRectangle work_area_monitor; + MetaRectangle entire_monitor; /* Spanning rectangles for the non-covered (by struts) region of the - * screen and also for just the current xinerama + * screen and also for just the current monitor */ GList *usable_screen_region; - GList *usable_xinerama_region; + GList *usable_monitor_region; } ConstraintInfo; -static gboolean do_screen_and_xinerama_relative_constraints (MetaWindow *window, - GList *region_spanning_rectangles, - ConstraintInfo *info, - gboolean check_only); +static gboolean do_screen_and_monitor_relative_constraints + (MetaWindow *window, + GList *region_spanning_rectangles, + ConstraintInfo *info, + gboolean check_only); static gboolean constrain_modal_dialog (MetaWindow *window, ConstraintInfo *info, @@ -175,7 +176,7 @@ static gboolean constrain_aspect_ratio (MetaWindow *window, ConstraintInfo *info, ConstraintPriority priority, gboolean check_only); -static gboolean constrain_to_single_xinerama (MetaWindow *window, +static gboolean constrain_to_single_monitor (MetaWindow *window, ConstraintInfo *info, ConstraintPriority priority, gboolean check_only); @@ -233,7 +234,7 @@ static const Constraint all_constraints[] = { {constrain_size_increments, "constrain_size_increments"}, {constrain_size_limits, "constrain_size_limits"}, {constrain_aspect_ratio, "constrain_aspect_ratio"}, - {constrain_to_single_xinerama, "constrain_to_single_xinerama"}, + {constrain_to_single_monitor, "constrain_to_single_monitor"}, {constrain_fully_onscreen, "constrain_fully_onscreen"}, {constrain_titlebar_visible, "constrain_titlebar_visible"}, {constrain_partially_onscreen, "constrain_partially_onscreen"}, @@ -330,7 +331,7 @@ meta_window_constrain (MetaWindow *window, *new = info.current; /* We may need to update window->require_fully_onscreen, - * window->require_on_single_xinerama, and perhaps other quantities + * window->require_on_single_monitor, and perhaps other quantities * if this was a user move or user move-and-resize operation. */ update_onscreen_requirements (window, &info); @@ -357,7 +358,7 @@ validate_fullscreen_monitors (MetaWindow *window) monitor = window->fullscreen_monitors[i]; - if (monitor < 0 || monitor > window->screen->n_xinerama_infos) + if (monitor < 0 || monitor > window->screen->n_monitor_infos) return FALSE; } @@ -373,7 +374,7 @@ setup_constraint_info (ConstraintInfo *info, const MetaRectangle *orig, MetaRectangle *new) { - const MetaXineramaScreenInfo *xinerama_info; + const MetaMonitorInfo *monitor_info; MetaWorkspace *cur_workspace; info->orig = *orig; @@ -433,15 +434,15 @@ setup_constraint_info (ConstraintInfo *info, if (!info->is_user_action) info->fixed_directions = FIXED_DIRECTION_NONE; - xinerama_info = - meta_screen_get_xinerama_for_rect (window->screen, &info->current); - meta_window_get_work_area_for_xinerama (window, - xinerama_info->number, - &info->work_area_xinerama); + monitor_info = + meta_screen_get_monitor_for_rect (window->screen, &info->current); + meta_window_get_work_area_for_monitor (window, + monitor_info->number, + &info->work_area_monitor); if (!window->fullscreen || !validate_fullscreen_monitors (window)) { - info->entire_xinerama = xinerama_info->rect; + info->entire_monitor = monitor_info->rect; } else { @@ -449,23 +450,23 @@ setup_constraint_info (ConstraintInfo *info, long monitor; monitor = window->fullscreen_monitors[i]; - info->entire_xinerama = - window->screen->xinerama_infos[monitor].rect; + info->entire_monitor = window->screen->monitor_infos[monitor].rect; + for (i = 1; i <= 3; i++) { monitor = window->fullscreen_monitors[i]; - meta_rectangle_union (&info->entire_xinerama, - &window->screen->xinerama_infos[monitor].rect, - &info->entire_xinerama); + meta_rectangle_union (&info->entire_monitor, + &window->screen->monitor_infos[monitor].rect, + &info->entire_monitor); } } cur_workspace = window->screen->active_workspace; - info->usable_screen_region = + info->usable_screen_region = meta_workspace_get_onscreen_region (cur_workspace); - info->usable_xinerama_region = - meta_workspace_get_onxinerama_region (cur_workspace, - xinerama_info->number); + info->usable_monitor_region = + meta_workspace_get_onmonitor_region (cur_workspace, + monitor_info->number); /* Log all this information for debugging */ meta_topic (META_DEBUG_GEOMETRY, @@ -476,8 +477,8 @@ setup_constraint_info (ConstraintInfo *info, " is_user_action : %s\n" " resize_gravity : %s\n" " fixed_directions: %s\n" - " work_area_xinerama: %d,%d +%d,%d\n" - " entire_xinerama : %d,%d +%d,%d\n", + " work_area_monitor: %d,%d +%d,%d\n" + " entire_monitor : %d,%d +%d,%d\n", info->orig.x, info->orig.y, info->orig.width, info->orig.height, info->current.x, info->current.y, info->current.width, info->current.height, @@ -491,11 +492,11 @@ setup_constraint_info (ConstraintInfo *info, (info->fixed_directions == FIXED_DIRECTION_X) ? "X fixed" : (info->fixed_directions == FIXED_DIRECTION_Y) ? "Y fixed" : "Freakin' Invalid Stupid", - info->work_area_xinerama.x, info->work_area_xinerama.y, - info->work_area_xinerama.width, - info->work_area_xinerama.height, - info->entire_xinerama.x, info->entire_xinerama.y, - info->entire_xinerama.width, info->entire_xinerama.height); + info->work_area_monitor.x, info->work_area_monitor.y, + info->work_area_monitor.width, + info->work_area_monitor.height, + info->entire_monitor.x, info->entire_monitor.y, + info->entire_monitor.width, info->entire_monitor.height); } static void @@ -519,26 +520,27 @@ place_window_if_needed(MetaWindow *window, { MetaRectangle placed_rect = info->orig; MetaWorkspace *cur_workspace; - const MetaXineramaScreenInfo *xinerama_info; + const MetaMonitorInfo *monitor_info; meta_window_place (window, info->borders, info->orig.x, info->orig.y, &placed_rect.x, &placed_rect.y); did_placement = TRUE; - /* placing the window may have changed the xinerama. Find the - * new xinerama and update the ConstraintInfo + /* placing the window may have changed the monitor. Find the + * new monitor and update the ConstraintInfo */ - xinerama_info = - meta_screen_get_xinerama_for_rect (window->screen, &placed_rect); - info->entire_xinerama = xinerama_info->rect; - meta_window_get_work_area_for_xinerama (window, - xinerama_info->number, - &info->work_area_xinerama); - cur_workspace = window->screen->active_workspace; - info->usable_xinerama_region = - meta_workspace_get_onxinerama_region (cur_workspace, - xinerama_info->number); + monitor_info = + meta_screen_get_monitor_for_rect (window->screen, &placed_rect); + info->entire_monitor = monitor_info->rect; + meta_window_get_work_area_for_monitor (window, + monitor_info->number, + &info->work_area_monitor); + + cur_workspace = window->screen->active_workspace; + info->usable_monitor_region = + meta_workspace_get_onmonitor_region (cur_workspace, + monitor_info->number); info->current.x = placed_rect.x; info->current.y = placed_rect.y; @@ -558,17 +560,17 @@ place_window_if_needed(MetaWindow *window, /* define a sane saved_rect so that the user can unmaximize to * something reasonable. */ - if (info->current.width >= info->work_area_xinerama.width) + if (info->current.width >= info->work_area_monitor.width) { - info->current.width = .75 * info->work_area_xinerama.width; - info->current.x = info->work_area_xinerama.x + - .125 * info->work_area_xinerama.width; + info->current.width = .75 * info->work_area_monitor.width; + info->current.x = info->work_area_monitor.x + + .125 * info->work_area_monitor.width; } - if (info->current.height >= info->work_area_xinerama.height) + if (info->current.height >= info->work_area_monitor.height) { - info->current.height = .75 * info->work_area_xinerama.height; - info->current.y = info->work_area_xinerama.y + - .083 * info->work_area_xinerama.height; + info->current.height = .75 * info->work_area_monitor.height; + info->current.y = info->work_area_monitor.y + + .083 * info->work_area_monitor.height; } if (window->maximize_horizontally_after_placement || @@ -618,7 +620,7 @@ update_onscreen_requirements (MetaWindow *window, return; /* USABILITY NOTE: Naturally, I only want the require_fully_onscreen, - * require_on_single_xinerama, and require_titlebar_visible flags to + * require_on_single_monitor, and require_titlebar_visible flags to * *become false* due to user interactions (which is allowed since * certain constraints are ignored for user interactions regardless of * the setting of these flags). However, whether to make these flags @@ -632,7 +634,7 @@ update_onscreen_requirements (MetaWindow *window, * problematic case but this may need to be revisited. */ - /* The require onscreen/on-single-xinerama and titlebar_visible + /* The require onscreen/on-single-monitor and titlebar_visible * stuff is relative to the outer window, not the inner */ extend_by_frame (window, &info->current, info->borders); @@ -651,17 +653,18 @@ update_onscreen_requirements (MetaWindow *window, window->require_fully_onscreen ? "TRUE" : "FALSE"); /* Update whether we want future constraint runs to require the - * window to be on a single xinerama. + * window to be on a single monitor. */ - old = window->require_on_single_xinerama; - window->require_on_single_xinerama = - meta_rectangle_contained_in_region (info->usable_xinerama_region, + old = window->require_on_single_monitor; + window->require_on_single_monitor = + meta_rectangle_contained_in_region (info->usable_monitor_region, &info->current); - if (old ^ window->require_on_single_xinerama) + + if (old ^ window->require_on_single_monitor) meta_topic (META_DEBUG_GEOMETRY, - "require_on_single_xinerama for %s toggled to %s\n", + "require_on_single_monitor for %s toggled to %s\n", window->desc, - window->require_on_single_xinerama ? "TRUE" : "FALSE"); + window->require_on_single_monitor ? "TRUE" : "FALSE"); /* Update whether we want future constraint runs to require the * titlebar to be visible. @@ -825,10 +828,10 @@ constrain_modal_dialog (MetaWindow *window, /* The calculated position above may need adjustment to make sure the * dialog does not end up partially off-screen */ - return do_screen_and_xinerama_relative_constraints (window, - info->usable_screen_region, - info, - check_only); + return do_screen_and_monitor_relative_constraints (window, + info->usable_screen_region, + info, + check_only); } static gboolean @@ -854,7 +857,7 @@ constrain_maximization (MetaWindow *window, /* Calculate target_size = maximized size of (window + frame) */ if (META_WINDOW_MAXIMIZED (window)) { - target_size = info->work_area_xinerama; + target_size = info->work_area_monitor; } else { @@ -877,7 +880,7 @@ constrain_maximization (MetaWindow *window, target_size = info->current; extend_by_frame (window, &target_size, info->borders); meta_rectangle_expand_to_avoiding_struts (&target_size, - &info->entire_xinerama, + &info->entire_monitor, direction, active_workspace_struts); } @@ -977,7 +980,7 @@ constrain_fullscreen (MetaWindow *window, ConstraintPriority priority, gboolean check_only) { - MetaRectangle min_size, max_size, xinerama; + MetaRectangle min_size, max_size, monitor; gboolean too_big, too_small, constraint_already_satisfied; if (priority > PRIORITY_FULLSCREEN) @@ -987,22 +990,24 @@ constrain_fullscreen (MetaWindow *window, if (!window->fullscreen) return TRUE; - xinerama = info->entire_xinerama; + monitor = info->entire_monitor; get_size_limits (window, info->borders, FALSE, &min_size, &max_size); - too_big = !meta_rectangle_could_fit_rect (&xinerama, &min_size); - too_small = !meta_rectangle_could_fit_rect (&max_size, &xinerama); + + too_big = !meta_rectangle_could_fit_rect (&monitor, &min_size); + too_small = !meta_rectangle_could_fit_rect (&max_size, &monitor); + if (too_big || too_small) return TRUE; /* Determine whether constraint is already satisfied; exit if it is */ constraint_already_satisfied = - meta_rectangle_equal (&info->current, &xinerama); + meta_rectangle_equal (&info->current, &monitor); if (check_only || constraint_already_satisfied) return constraint_already_satisfied; /*** Enforce constraint ***/ - info->current = xinerama; + info->current = monitor; return TRUE; } @@ -1266,11 +1271,10 @@ constrain_aspect_ratio (MetaWindow *window, } static gboolean -do_screen_and_xinerama_relative_constraints ( - MetaWindow *window, - GList *region_spanning_rectangles, - ConstraintInfo *info, - gboolean check_only) +do_screen_and_monitor_relative_constraints (MetaWindow *window, + GList *region_spanning_rectangles, + ConstraintInfo *info, + gboolean check_only) { gboolean exit_early = FALSE, constraint_satisfied; MetaRectangle how_far_it_can_be_smushed, min_size, max_size; @@ -1281,7 +1285,7 @@ do_screen_and_xinerama_relative_constraints ( char spanning_region[1 + 28 * g_list_length (region_spanning_rectangles)]; meta_topic (META_DEBUG_GEOMETRY, - "screen/xinerama constraint; region_spanning_rectangles: %s\n", + "screen/monitor constraint; region_spanning_rectangles: %s\n", meta_rectangle_region_to_string (region_spanning_rectangles, ", ", spanning_region)); } @@ -1338,32 +1342,32 @@ do_screen_and_xinerama_relative_constraints ( } static gboolean -constrain_to_single_xinerama (MetaWindow *window, - ConstraintInfo *info, - ConstraintPriority priority, - gboolean check_only) +constrain_to_single_monitor (MetaWindow *window, + ConstraintInfo *info, + ConstraintPriority priority, + gboolean check_only) { - if (priority > PRIORITY_ENTIRELY_VISIBLE_ON_SINGLE_XINERAMA) + if (priority > PRIORITY_ENTIRELY_VISIBLE_ON_SINGLE_MONITOR) return TRUE; /* 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) and we can't apply it to frameless windows - * or else users will be unable to move windows such as XMMS across xineramas. + * or else users will be unable to move windows such as XMMS across monitors. */ - if (window->type == META_WINDOW_DESKTOP || - window->type == META_WINDOW_DOCK || - window->screen->n_xinerama_infos == 1 || - !window->require_on_single_xinerama || - !window->frame || + if (window->type == META_WINDOW_DESKTOP || + window->type == META_WINDOW_DOCK || + window->screen->n_monitor_infos == 1 || + !window->require_on_single_monitor || + !window->frame || info->is_user_action) return TRUE; /* Have a helper function handle the constraint for us */ - return do_screen_and_xinerama_relative_constraints (window, - info->usable_xinerama_region, - info, - check_only); + return do_screen_and_monitor_relative_constraints (window, + info->usable_monitor_region, + info, + check_only); } static gboolean @@ -1387,10 +1391,10 @@ constrain_fully_onscreen (MetaWindow *window, return TRUE; /* Have a helper function handle the constraint for us */ - return do_screen_and_xinerama_relative_constraints (window, - info->usable_screen_region, - info, - check_only); + return do_screen_and_monitor_relative_constraints (window, + info->usable_screen_region, + info, + check_only); } static gboolean @@ -1462,11 +1466,13 @@ constrain_titlebar_visible (MetaWindow *window, bottom_amount, horiz_amount_onscreen, vert_amount_onscreen); + retval = - do_screen_and_xinerama_relative_constraints (window, - info->usable_screen_region, - info, - check_only); + do_screen_and_monitor_relative_constraints (window, + info->usable_screen_region, + info, + check_only); + meta_rectangle_expand_region_conditionally (info->usable_screen_region, -horiz_amount_offscreen, -horiz_amount_offscreen, @@ -1537,11 +1543,13 @@ constrain_partially_onscreen (MetaWindow *window, bottom_amount, horiz_amount_onscreen, vert_amount_onscreen); + retval = - do_screen_and_xinerama_relative_constraints (window, - info->usable_screen_region, - info, - check_only); + do_screen_and_monitor_relative_constraints (window, + info->usable_screen_region, + info, + check_only); + meta_rectangle_expand_region_conditionally (info->usable_screen_region, -horiz_amount_offscreen, -horiz_amount_offscreen, diff --git a/src/core/display-private.h b/src/core/display-private.h index c9e919e4..7db9ca13 100644 --- a/src/core/display-private.h +++ b/src/core/display-private.h @@ -220,8 +220,8 @@ struct _MetaDisplay unsigned int super_mask; unsigned int meta_mask; - /* Xinerama cache */ - unsigned int xinerama_cache_invalidated : 1; + /* Monitor cache */ + unsigned int monitor_cache_invalidated : 1; /* Opening the display */ unsigned int display_opening : 1; diff --git a/src/core/display.c b/src/core/display.c index 739e1237..808e376a 100644 --- a/src/core/display.c +++ b/src/core/display.c @@ -375,7 +375,7 @@ meta_display_open (void) the_display->leader_window = None; the_display->timestamp_pinging_window = None; - the_display->xinerama_cache_invalidated = TRUE; + the_display->monitor_cache_invalidated = TRUE; the_display->groups_by_leader = NULL; @@ -1656,7 +1656,7 @@ event_callback (XEvent *event, filter_out_event = FALSE; display->current_time = event_get_time (display, event); - display->xinerama_cache_invalidated = TRUE; + display->monitor_cache_invalidated = TRUE; if (event->xany.serial > display->focus_serial && display->focus_window && diff --git a/src/core/edge-resistance.c b/src/core/edge-resistance.c index 8f0dbd4f..4bab4a1b 100644 --- a/src/core/edge-resistance.c +++ b/src/core/edge-resistance.c @@ -338,15 +338,15 @@ apply_edge_resistance (MetaWindow *window, gboolean increasing = new_pos > old_pos; int increment = increasing ? 1 : -1; - const int PIXEL_DISTANCE_THRESHOLD_TOWARDS_WINDOW = 16; - const int PIXEL_DISTANCE_THRESHOLD_AWAYFROM_WINDOW = 0; - const int PIXEL_DISTANCE_THRESHOLD_TOWARDS_XINERAMA = 32; - const int PIXEL_DISTANCE_THRESHOLD_AWAYFROM_XINERAMA = 0; - const int PIXEL_DISTANCE_THRESHOLD_TOWARDS_SCREEN = 32; - const int PIXEL_DISTANCE_THRESHOLD_AWAYFROM_SCREEN = 0; - const int TIMEOUT_RESISTANCE_LENGTH_MS_WINDOW = 0; - const int TIMEOUT_RESISTANCE_LENGTH_MS_XINERAMA = 0; - const int TIMEOUT_RESISTANCE_LENGTH_MS_SCREEN = 0; + const int PIXEL_DISTANCE_THRESHOLD_TOWARDS_WINDOW = 16; + const int PIXEL_DISTANCE_THRESHOLD_AWAYFROM_WINDOW = 0; + const int PIXEL_DISTANCE_THRESHOLD_TOWARDS_MONITOR = 32; + const int PIXEL_DISTANCE_THRESHOLD_AWAYFROM_MONITOR = 0; + const int PIXEL_DISTANCE_THRESHOLD_TOWARDS_SCREEN = 32; + const int PIXEL_DISTANCE_THRESHOLD_AWAYFROM_SCREEN = 0; + const int TIMEOUT_RESISTANCE_LENGTH_MS_WINDOW = 0; + const int TIMEOUT_RESISTANCE_LENGTH_MS_MONITOR = 0; + const int TIMEOUT_RESISTANCE_LENGTH_MS_SCREEN = 0; /* Quit if no movement was specified */ if (old_pos == new_pos) @@ -423,8 +423,8 @@ apply_edge_resistance (MetaWindow *window, case META_EDGE_WINDOW: timeout_length_ms = TIMEOUT_RESISTANCE_LENGTH_MS_WINDOW; break; - case META_EDGE_XINERAMA: - timeout_length_ms = TIMEOUT_RESISTANCE_LENGTH_MS_XINERAMA; + case META_EDGE_MONITOR: + timeout_length_ms = TIMEOUT_RESISTANCE_LENGTH_MS_MONITOR; break; case META_EDGE_SCREEN: timeout_length_ms = TIMEOUT_RESISTANCE_LENGTH_MS_SCREEN; @@ -470,11 +470,11 @@ apply_edge_resistance (MetaWindow *window, else threshold = PIXEL_DISTANCE_THRESHOLD_AWAYFROM_WINDOW; break; - case META_EDGE_XINERAMA: + case META_EDGE_MONITOR: if (movement_towards_edge (edge->side_type, increment)) - threshold = PIXEL_DISTANCE_THRESHOLD_TOWARDS_XINERAMA; + threshold = PIXEL_DISTANCE_THRESHOLD_TOWARDS_MONITOR; else - threshold = PIXEL_DISTANCE_THRESHOLD_AWAYFROM_XINERAMA; + threshold = PIXEL_DISTANCE_THRESHOLD_AWAYFROM_MONITOR; break; case META_EDGE_SCREEN: if (movement_towards_edge (edge->side_type, increment)) @@ -767,9 +767,9 @@ stupid_sort_requiring_extra_pointer_dereference (gconstpointer a, static void cache_edges (MetaDisplay *display, - GList *window_edges, - GList *xinerama_edges, - GList *screen_edges) + GList *window_edges, + GList *monitor_edges, + GList *screen_edges) { MetaEdgeResistanceData *edge_data; GList *tmp; @@ -782,7 +782,7 @@ cache_edges (MetaDisplay *display, if (meta_check_debug_flags (META_DEBUG_EDGE_RESISTANCE)) { int max_edges = MAX (MAX( g_list_length (window_edges), - g_list_length (xinerama_edges)), + g_list_length (monitor_edges)), g_list_length (screen_edges)); char big_buffer[(EDGE_LENGTH+2)*max_edges]; @@ -790,9 +790,9 @@ cache_edges (MetaDisplay *display, meta_topic (META_DEBUG_EDGE_RESISTANCE, "Window edges for resistance : %s\n", big_buffer); - meta_rectangle_edge_list_to_string (xinerama_edges, ", ", big_buffer); + meta_rectangle_edge_list_to_string (monitor_edges, ", ", big_buffer); meta_topic (META_DEBUG_EDGE_RESISTANCE, - "Xinerama edges for resistance: %s\n", big_buffer); + "Monitor edges for resistance: %s\n", big_buffer); meta_rectangle_edge_list_to_string (screen_edges, ", ", big_buffer); meta_topic (META_DEBUG_EDGE_RESISTANCE, @@ -812,7 +812,7 @@ cache_edges (MetaDisplay *display, tmp = window_edges; break; case 1: - tmp = xinerama_edges; + tmp = monitor_edges; break; case 2: tmp = screen_edges; @@ -880,7 +880,7 @@ cache_edges (MetaDisplay *display, tmp = window_edges; break; case 1: - tmp = xinerama_edges; + tmp = monitor_edges; break; case 2: tmp = screen_edges; @@ -1120,12 +1120,12 @@ compute_resistance_and_snapping_edges (MetaDisplay *display) /* * 5th: Cache the combination of these edges with the onscreen and - * xinerama edges in an array for quick access. Free the edges since + * monitor edges in an array for quick access. Free the edges since * they've been cached elsewhere. */ cache_edges (display, edges, - display->grab_screen->active_workspace->xinerama_edges, + display->grab_screen->active_workspace->monitor_edges, display->grab_screen->active_workspace->screen_edges); g_list_free (edges); diff --git a/src/core/keybindings.c b/src/core/keybindings.c index 042c58d1..48a2066e 100644 --- a/src/core/keybindings.c +++ b/src/core/keybindings.c @@ -2448,7 +2448,7 @@ handle_move_to_corner_backend (MetaDisplay *display, int new_x, new_y; int frame_width, frame_height; - meta_window_get_work_area_all_xineramas (window, &work_area); + meta_window_get_work_area_all_monitors (window, &work_area); meta_window_get_outer_rect (window, &outer); meta_window_get_position (window, &orig_x, &orig_y); @@ -2571,7 +2571,7 @@ handle_move_to_center (MetaDisplay *display, int orig_x, orig_y; int frame_width, frame_height; - meta_window_get_work_area_all_xineramas (window, &work_area); + meta_window_get_work_area_all_monitors (window, &work_area); meta_window_get_outer_rect (window, &outer); meta_window_get_position (window, &orig_x, &orig_y); @@ -3032,10 +3032,10 @@ handle_toggle_tiled (MetaDisplay *display, MetaKeyBinding *binding, gpointer dummy) { - const MetaXineramaScreenInfo *monitor; + const MetaMonitorInfo *monitor; MetaTileMode mode = binding->handler->data; - monitor = meta_screen_get_current_xinerama (window->screen); + monitor = meta_screen_get_current_monitor (window->screen); if ((META_WINDOW_TILED_LEFT (window) && mode == META_TILE_LEFT) || (META_WINDOW_TILED_RIGHT (window) && mode == META_TILE_RIGHT)) diff --git a/src/core/place.c b/src/core/place.c index 8308f88b..cd45f12f 100644 --- a/src/core/place.c +++ b/src/core/place.c @@ -102,7 +102,7 @@ find_next_cascade (MetaWindow *window, int window_width, window_height; int cascade_stage; MetaRectangle work_area; - const MetaXineramaScreenInfo* current; + const MetaMonitorInfo *current; sorted = g_list_copy (windows); sorted = g_list_sort (sorted, northwestcmp); @@ -133,8 +133,8 @@ find_next_cascade (MetaWindow *window, * of NW corner of window frame. */ - current = meta_screen_get_current_xinerama (window->screen); - meta_window_get_work_area_for_xinerama (window, current->number, &work_area); + current = meta_screen_get_current_monitor (window->screen); + meta_window_get_work_area_for_monitor (window, current->number, &work_area); cascade_x = MAX (0, work_area.x); cascade_y = MAX (0, work_area.y); @@ -255,7 +255,7 @@ find_most_freespace (MetaWindow *window, frame_size_left = borders ? borders->visible.left : 0; frame_size_top = borders ? borders->visible.top : 0; - meta_window_get_work_area_current_xinerama (focus_window, &work_area); + meta_window_get_work_area_current_monitor (focus_window, &work_area); meta_window_get_outer_rect (focus_window, &avoid); meta_window_get_outer_rect (window, &outer); @@ -510,7 +510,7 @@ find_first_fit (MetaWindow *window, MetaFrameBorders *borders, /* visible windows on relevant workspaces */ GList *windows, - int xinerama, + int monitor, int x, int y, int *new_x, @@ -552,15 +552,16 @@ find_first_fit (MetaWindow *window, } { - char xinerama_location_string[RECT_LENGTH]; - meta_rectangle_to_string (&window->screen->xinerama_infos[xinerama].rect, - xinerama_location_string); + char monitor_location_string[RECT_LENGTH]; + meta_rectangle_to_string (&window->screen->monitor_infos[monitor].rect, + monitor_location_string); + meta_topic (META_DEBUG_XINERAMA, - "Natural xinerama is %s\n", - xinerama_location_string); + "Natural monitor is %s\n", + monitor_location_string); } - meta_window_get_work_area_for_xinerama (window, xinerama, &work_area); + meta_window_get_work_area_for_monitor (window, monitor, &work_area); center_tile_rect_in_area (&rect, &work_area); @@ -654,7 +655,7 @@ find_preferred_position (MetaWindow *window, MetaFrameBorders *borders, /* visible windows on relevant workspaces */ GList *windows, - int xinerama, + int monitor, int x, int y, int *new_x, @@ -671,14 +672,14 @@ find_preferred_position (MetaWindow *window, if (placement_mode_pref == META_PLACEMENT_MODE_SMART) { return find_first_fit (window, borders, windows, - xinerama, + monitor, x, y, new_x, new_y); } else if (placement_mode_pref == META_PLACEMENT_MODE_CASCADE) { /* This is an abuse of find_next_cascade(), because it was not * intended for this use, and because it is not designed to - * deal with placement on multiple Xineramas. + * deal with placement on multiple monitors. */ find_next_cascade (window, borders, windows, x, y, new_x, new_y); return TRUE; @@ -693,7 +694,7 @@ find_preferred_position (MetaWindow *window, rect.height += borders->visible.top + borders->visible.bottom; } - meta_window_get_work_area_for_xinerama (window, xinerama, &work_area); + meta_window_get_work_area_for_monitor (window, monitor, &work_area); /* Cannot use rect_fits_in_work_area here because that function * also checks the x & y position of rect, but those are not set @@ -754,7 +755,7 @@ meta_window_place (MetaWindow *window, int *new_y) { GList *windows; - const MetaXineramaScreenInfo *xi; + const MetaMonitorInfo *xi; /* frame member variables should NEVER be used in here, only * MetaFrameBorders. But remember borders == NULL @@ -910,11 +911,11 @@ meta_window_place (MetaWindow *window, window->type == META_WINDOW_MODAL_DIALOG || window->type == META_WINDOW_SPLASHSCREEN) { - /* Center on current xinerama (i.e. on current monitor) */ + /* Center on current monitor (i.e. on current monitor) */ int w, h; /* Warning, this function is a round trip! */ - xi = meta_screen_get_current_xinerama (window->screen); + xi = meta_screen_get_current_monitor (window->screen); w = xi->rect.width; h = xi->rect.height; @@ -925,7 +926,7 @@ meta_window_place (MetaWindow *window, x += xi->rect.x; y += xi->rect.y; - meta_topic (META_DEBUG_PLACEMENT, "Centered window %s on screen %d xinerama %d\n", + meta_topic (META_DEBUG_PLACEMENT, "Centered window %s on screen %d monitor %d\n", window->desc, window->screen->number, xi->number); goto done_check_denied_focus; @@ -959,7 +960,7 @@ meta_window_place (MetaWindow *window, } /* Warning, this is a round trip! */ - xi = meta_screen_get_current_xinerama (window->screen); + xi = meta_screen_get_current_monitor (window->screen); /* "Origin" placement algorithm */ x = xi->rect.x; @@ -980,9 +981,7 @@ meta_window_place (MetaWindow *window, MetaRectangle workarea; MetaRectangle outer; - meta_window_get_work_area_for_xinerama (window, - xi->number, - &workarea); + meta_window_get_work_area_for_monitor (window, xi->number, &workarea); meta_window_get_outer_rect (window, &outer); /* If the window is bigger than the screen, then automaximize. Do NOT diff --git a/src/core/screen-private.h b/src/core/screen-private.h index 935cbd80..1f07c642 100644 --- a/src/core/screen-private.h +++ b/src/core/screen-private.h @@ -37,9 +37,9 @@ #include "stack-tracker.h" #include "ui.h" -typedef struct _MetaXineramaScreenInfo MetaXineramaScreenInfo; +typedef struct _MetaMonitorInfo MetaMonitorInfo; -struct _MetaXineramaScreenInfo +struct _MetaMonitorInfo { int number; MetaRectangle rect; @@ -102,11 +102,11 @@ struct _MetaScreen Atom wm_sn_atom; guint32 wm_sn_timestamp; - MetaXineramaScreenInfo *xinerama_infos; - int n_xinerama_infos; + MetaMonitorInfo *monitor_infos; + int n_monitor_infos; - /* Cache the current Xinerama */ - int last_xinerama_index; + /* Cache the current monitor */ + int last_monitor_index; #ifdef HAVE_STARTUP_NOTIFICATION SnMonitorContext *sn_context; @@ -163,19 +163,19 @@ void meta_screen_tile_preview_hide (MetaScreen *screen); MetaWindow* meta_screen_get_mouse_window (MetaScreen *screen, MetaWindow *not_this_one); -const MetaXineramaScreenInfo* meta_screen_get_current_xinerama (MetaScreen *screen); -const MetaXineramaScreenInfo* meta_screen_get_xinerama_for_rect (MetaScreen *screen, - MetaRectangle *rect); -const MetaXineramaScreenInfo* meta_screen_get_xinerama_for_window (MetaScreen *screen, - MetaWindow *window); +const MetaMonitorInfo* meta_screen_get_current_monitor (MetaScreen *screen); +const MetaMonitorInfo* meta_screen_get_monitor_for_rect (MetaScreen *screen, + MetaRectangle *rect); +const MetaMonitorInfo* meta_screen_get_monitor_for_window (MetaScreen *screen, + MetaWindow *window); +const MetaMonitorInfo* meta_screen_get_monitor_neighbor (MetaScreen *screen, + int which_monitor, + MetaScreenDirection dir); -const MetaXineramaScreenInfo* meta_screen_get_xinerama_neighbor (MetaScreen *screen, - int which_xinerama, - MetaScreenDirection dir); -void meta_screen_get_natural_xinerama_list (MetaScreen *screen, - int** xineramas_list, - int* n_xineramas); +void meta_screen_get_natural_monitor_list (MetaScreen *screen, + int** monitors_list, + int* n_monitors); void meta_screen_update_workspace_layout (MetaScreen *screen); void meta_screen_update_workspace_names (MetaScreen *screen); diff --git a/src/core/screen.c b/src/core/screen.c index c1a2bd50..7f9e0b81 100644 --- a/src/core/screen.c +++ b/src/core/screen.c @@ -142,7 +142,7 @@ set_wm_icon_size_hint (MetaScreen *screen) } static void -reload_xinerama_infos (MetaScreen *screen) +reload_monitor_infos (MetaScreen *screen) { { GList *tmp; @@ -158,14 +158,14 @@ reload_xinerama_infos (MetaScreen *screen) } } - if (screen->xinerama_infos) - g_free (screen->xinerama_infos); + if (screen->monitor_infos) + g_free (screen->monitor_infos); - screen->xinerama_infos = NULL; - screen->n_xinerama_infos = 0; - screen->last_xinerama_index = 0; + screen->monitor_infos = NULL; + screen->n_monitor_infos = 0; + screen->last_monitor_index = 0; - screen->display->xinerama_cache_invalidated = TRUE; + screen->display->monitor_cache_invalidated = TRUE; #ifdef HAVE_XINERAMA if (XineramaIsActive (screen->display->xdisplay)) @@ -178,30 +178,30 @@ reload_xinerama_infos (MetaScreen *screen) infos = XineramaQueryScreens (screen->display->xdisplay, &n_infos); meta_topic (META_DEBUG_XINERAMA, - "Found %d Xinerama screens on display %s\n", + "Found %d monitors on display %s\n", n_infos, screen->display->name); if (n_infos > 0) { - screen->xinerama_infos = g_new (MetaXineramaScreenInfo, n_infos); - screen->n_xinerama_infos = n_infos; + screen->monitor_infos = g_new (MetaMonitorInfo, n_infos); + screen->n_monitor_infos = n_infos; i = 0; while (i < n_infos) { - screen->xinerama_infos[i].number = infos[i].screen_number; - screen->xinerama_infos[i].rect.x = infos[i].x_org; - screen->xinerama_infos[i].rect.y = infos[i].y_org; - screen->xinerama_infos[i].rect.width = infos[i].width; - screen->xinerama_infos[i].rect.height = infos[i].height; + screen->monitor_infos[i].number = infos[i].screen_number; + screen->monitor_infos[i].rect.x = infos[i].x_org; + screen->monitor_infos[i].rect.y = infos[i].y_org; + screen->monitor_infos[i].rect.width = infos[i].width; + screen->monitor_infos[i].rect.height = infos[i].height; meta_topic (META_DEBUG_XINERAMA, - "Xinerama %d is %d,%d %d x %d\n", - screen->xinerama_infos[i].number, - screen->xinerama_infos[i].rect.x, - screen->xinerama_infos[i].rect.y, - screen->xinerama_infos[i].rect.width, - screen->xinerama_infos[i].rect.height); + "Monitor %d is %d,%d %d x %d\n", + screen->monitor_infos[i].number, + screen->monitor_infos[i].rect.x, + screen->monitor_infos[i].rect.y, + screen->monitor_infos[i].rect.width, + screen->monitor_infos[i].rect.height); ++i; } @@ -223,40 +223,40 @@ reload_xinerama_infos (MetaScreen *screen) /* If no Xinerama, fill in the single screen info so * we can use the field unconditionally */ - if (screen->n_xinerama_infos == 0) + if (screen->n_monitor_infos == 0) { if (g_getenv ("METACITY_DEBUG_XINERAMA")) { meta_topic (META_DEBUG_XINERAMA, - "Pretending a single monitor has two Xinerama screens\n"); + "Pretending a single screen has two monitors\n"); - screen->xinerama_infos = g_new (MetaXineramaScreenInfo, 2); - screen->n_xinerama_infos = 2; + screen->monitor_infos = g_new (MetaMonitorInfo, 2); + screen->n_monitor_infos = 2; - screen->xinerama_infos[0].number = 0; - screen->xinerama_infos[0].rect = screen->rect; - screen->xinerama_infos[0].rect.width = screen->rect.width / 2; + screen->monitor_infos[0].number = 0; + screen->monitor_infos[0].rect = screen->rect; + screen->monitor_infos[0].rect.width = screen->rect.width / 2; - screen->xinerama_infos[1].number = 1; - screen->xinerama_infos[1].rect = screen->rect; - screen->xinerama_infos[1].rect.x = screen->rect.width / 2; - screen->xinerama_infos[1].rect.width = screen->rect.width / 2; + screen->monitor_infos[1].number = 1; + screen->monitor_infos[1].rect = screen->rect; + screen->monitor_infos[1].rect.x = screen->rect.width / 2; + screen->monitor_infos[1].rect.width = screen->rect.width / 2; } else { meta_topic (META_DEBUG_XINERAMA, - "No Xinerama screens, using default screen info\n"); + "No monitors, using default screen info\n"); - screen->xinerama_infos = g_new (MetaXineramaScreenInfo, 1); - screen->n_xinerama_infos = 1; + screen->monitor_infos = g_new (MetaMonitorInfo, 1); + screen->n_monitor_infos = 1; - screen->xinerama_infos[0].number = 0; - screen->xinerama_infos[0].rect = screen->rect; + screen->monitor_infos[0].number = 0; + screen->monitor_infos[0].rect = screen->rect; } } - g_assert (screen->n_xinerama_infos > 0); - g_assert (screen->xinerama_infos != NULL); + g_assert (screen->n_monitor_infos > 0); + g_assert (screen->monitor_infos != NULL); } MetaScreen* @@ -463,11 +463,11 @@ meta_screen_new (MetaDisplay *display, &gc_values); } - screen->xinerama_infos = NULL; - screen->n_xinerama_infos = 0; - screen->last_xinerama_index = 0; + screen->monitor_infos = NULL; + screen->n_monitor_infos = 0; + screen->last_monitor_index = 0; - reload_xinerama_infos (screen); + reload_monitor_infos (screen); meta_screen_set_cursor (screen, META_CURSOR_DEFAULT); @@ -619,8 +619,8 @@ meta_screen_free (MetaScreen *screen, XFreeGC (screen->display->xdisplay, screen->root_xor_gc); - if (screen->xinerama_infos) - g_free (screen->xinerama_infos); + if (screen->monitor_infos) + g_free (screen->monitor_infos); if (screen->tile_preview_timeout_id) g_source_remove (screen->tile_preview_timeout_id); @@ -1414,61 +1414,61 @@ meta_screen_get_mouse_window (MetaScreen *screen, return window; } -const MetaXineramaScreenInfo* -meta_screen_get_xinerama_for_rect (MetaScreen *screen, - MetaRectangle *rect) +const MetaMonitorInfo * +meta_screen_get_monitor_for_rect (MetaScreen *screen, + MetaRectangle *rect) { int i; - int best_xinerama, xinerama_score; + int best_monitor, monitor_score; - if (screen->n_xinerama_infos == 1) - return &screen->xinerama_infos[0]; + if (screen->n_monitor_infos == 1) + return &screen->monitor_infos[0]; - best_xinerama = 0; - xinerama_score = 0; + best_monitor = 0; + monitor_score = 0; - for (i = 0; i < screen->n_xinerama_infos; i++) + for (i = 0; i < screen->n_monitor_infos; i++) { MetaRectangle dest; - if (meta_rectangle_intersect (&screen->xinerama_infos[i].rect, + if (meta_rectangle_intersect (&screen->monitor_infos[i].rect, rect, &dest)) { int cur = meta_rectangle_area (&dest); - if (cur > xinerama_score) + if (cur > monitor_score) { - xinerama_score = cur; - best_xinerama = i; + monitor_score = cur; + best_monitor = i; } } } - return &screen->xinerama_infos[best_xinerama]; + return &screen->monitor_infos[best_monitor]; } -const MetaXineramaScreenInfo* -meta_screen_get_xinerama_for_window (MetaScreen *screen, - MetaWindow *window) +const MetaMonitorInfo * +meta_screen_get_monitor_for_window (MetaScreen *screen, + MetaWindow *window) { MetaRectangle window_rect; meta_window_get_outer_rect (window, &window_rect); - return meta_screen_get_xinerama_for_rect (screen, &window_rect); + return meta_screen_get_monitor_for_rect (screen, &window_rect); } -const MetaXineramaScreenInfo* -meta_screen_get_xinerama_neighbor (MetaScreen *screen, - int which_xinerama, - MetaScreenDirection direction) +const MetaMonitorInfo * +meta_screen_get_monitor_neighbor (MetaScreen *screen, + int which_monitor, + MetaScreenDirection direction) { - MetaXineramaScreenInfo* input = screen->xinerama_infos + which_xinerama; - MetaXineramaScreenInfo* current; + MetaMonitorInfo *input = screen->monitor_infos + which_monitor; + MetaMonitorInfo *current; int i; - for (i = 0; i < screen->n_xinerama_infos; i++) + for (i = 0; i < screen->n_monitor_infos; i++) { - current = screen->xinerama_infos + i; + current = screen->monitor_infos + i; if ((direction == META_SCREEN_RIGHT && current->rect.x == input->rect.x + input->rect.width && @@ -1491,110 +1491,112 @@ meta_screen_get_xinerama_neighbor (MetaScreen *screen, } void -meta_screen_get_natural_xinerama_list (MetaScreen *screen, - int** xineramas_list, - int* n_xineramas) +meta_screen_get_natural_monitor_list (MetaScreen *screen, + int** monitors_list, + int* n_monitors) { - const MetaXineramaScreenInfo* current; - const MetaXineramaScreenInfo* tmp; - GQueue* xinerama_queue; + const MetaMonitorInfo *current; + const MetaMonitorInfo *tmp; + GQueue* monitor_queue; int* visited; int cur = 0; int i; - *n_xineramas = screen->n_xinerama_infos; - *xineramas_list = g_new (int, screen->n_xinerama_infos); + *n_monitors = screen->n_monitor_infos; + *monitors_list = g_new (int, screen->n_monitor_infos); - /* we calculate a natural ordering by which to choose xineramas for - * window placement. We start at the current xinerama, and perform - * a breadth-first search of the xineramas starting from that - * xinerama. We choose preferentially left, then right, then down, - * then up. The visitation order produced by this traversal is the - * natural xinerama ordering. + /* we calculate a natural ordering by which to choose monitors for + * window placement. We start at the current monitor, and perform + * a breadth-first search of the monitors starting from that monitor. + * We choose preferentially left, then right, then down, then up. + * The visitation order produced by this traversal is the natural + * monitor ordering. */ - visited = g_new (int, screen->n_xinerama_infos); - for (i = 0; i < screen->n_xinerama_infos; i++) + visited = g_new (int, screen->n_monitor_infos); + for (i = 0; i < screen->n_monitor_infos; i++) { visited[i] = FALSE; } - current = meta_screen_get_current_xinerama (screen); - xinerama_queue = g_queue_new (); - g_queue_push_tail (xinerama_queue, (gpointer) current); + current = meta_screen_get_current_monitor (screen); + monitor_queue = g_queue_new (); + g_queue_push_tail (monitor_queue, (gpointer) current); visited[current->number] = TRUE; - while (!g_queue_is_empty (xinerama_queue)) + while (!g_queue_is_empty (monitor_queue)) { - current = (const MetaXineramaScreenInfo*) - g_queue_pop_head (xinerama_queue); + current = (const MetaMonitorInfo *) g_queue_pop_head (monitor_queue); - (*xineramas_list)[cur++] = current->number; + (*monitors_list)[cur++] = current->number; /* enqueue each of the directions */ - tmp = meta_screen_get_xinerama_neighbor (screen, - current->number, - META_SCREEN_LEFT); + tmp = meta_screen_get_monitor_neighbor (screen, + current->number, + META_SCREEN_LEFT); + if (tmp && !visited[tmp->number]) { - g_queue_push_tail (xinerama_queue, - (MetaXineramaScreenInfo*) tmp); + g_queue_push_tail (monitor_queue, (MetaMonitorInfo *) tmp); visited[tmp->number] = TRUE; } - tmp = meta_screen_get_xinerama_neighbor (screen, - current->number, - META_SCREEN_RIGHT); + + tmp = meta_screen_get_monitor_neighbor (screen, + current->number, + META_SCREEN_RIGHT); + if (tmp && !visited[tmp->number]) { - g_queue_push_tail (xinerama_queue, - (MetaXineramaScreenInfo*) tmp); + g_queue_push_tail (monitor_queue, (MetaMonitorInfo *) tmp); visited[tmp->number] = TRUE; } - tmp = meta_screen_get_xinerama_neighbor (screen, - current->number, - META_SCREEN_UP); + + tmp = meta_screen_get_monitor_neighbor (screen, + current->number, + META_SCREEN_UP); + if (tmp && !visited[tmp->number]) { - g_queue_push_tail (xinerama_queue, - (MetaXineramaScreenInfo*) tmp); + g_queue_push_tail (monitor_queue, (MetaMonitorInfo *) tmp); visited[tmp->number] = TRUE; } - tmp = meta_screen_get_xinerama_neighbor (screen, - current->number, - META_SCREEN_DOWN); + + tmp = meta_screen_get_monitor_neighbor (screen, + current->number, + META_SCREEN_DOWN); + if (tmp && !visited[tmp->number]) { - g_queue_push_tail (xinerama_queue, - (MetaXineramaScreenInfo*) tmp); + g_queue_push_tail (monitor_queue, (MetaMonitorInfo *) tmp); visited[tmp->number] = TRUE; } } - /* in case we somehow missed some set of xineramas, go through the - * visited list and add in any xineramas that were missed + /* in case we somehow missed some set of monitors, go through the + * visited list and add in any monitors that were missed */ - for (i = 0; i < screen->n_xinerama_infos; i++) + for (i = 0; i < screen->n_monitor_infos; i++) { if (visited[i] == FALSE) { - (*xineramas_list)[cur++] = i; + (*monitors_list)[cur++] = i; } } g_free (visited); - g_queue_free (xinerama_queue); + g_queue_free (monitor_queue); } -const MetaXineramaScreenInfo* -meta_screen_get_current_xinerama (MetaScreen *screen) +const MetaMonitorInfo * +meta_screen_get_current_monitor (MetaScreen *screen) { - if (screen->n_xinerama_infos == 1) - return &screen->xinerama_infos[0]; + if (screen->n_monitor_infos == 1) + return &screen->monitor_infos[0]; /* Sadly, we have to do it this way. Yuck. */ - if (screen->display->xinerama_cache_invalidated) + if (screen->display->monitor_cache_invalidated) { Window root_return, child_return; int win_x_return, win_y_return; @@ -1602,7 +1604,7 @@ meta_screen_get_current_xinerama (MetaScreen *screen) int i; MetaRectangle pointer_position; - screen->display->xinerama_cache_invalidated = FALSE; + screen->display->monitor_cache_invalidated = FALSE; pointer_position.width = pointer_position.height = 1; XQueryPointer (screen->display->xdisplay, @@ -1615,23 +1617,23 @@ meta_screen_get_current_xinerama (MetaScreen *screen) &win_y_return, &mask_return); - screen->last_xinerama_index = 0; - for (i = 0; i < screen->n_xinerama_infos; i++) + screen->last_monitor_index = 0; + for (i = 0; i < screen->n_monitor_infos; i++) { - if (meta_rectangle_contains_rect (&screen->xinerama_infos[i].rect, + if (meta_rectangle_contains_rect (&screen->monitor_infos[i].rect, &pointer_position)) { - screen->last_xinerama_index = i; + screen->last_monitor_index = i; break; } } meta_topic (META_DEBUG_XINERAMA, - "Rechecked current Xinerama, now %d\n", - screen->last_xinerama_index); + "Rechecked current monitor, now %d\n", + screen->last_monitor_index); } - return &screen->xinerama_infos[screen->last_xinerama_index]; + return &screen->monitor_infos[screen->last_monitor_index]; } #define _NET_WM_ORIENTATION_HORZ 0 @@ -1857,7 +1859,7 @@ set_work_area_hint (MetaScreen *screen) if (workspace->screen == screen) { - meta_workspace_get_work_area_all_xineramas (workspace, &area); + meta_workspace_get_work_area_all_monitors (workspace, &area); tmp[0] = area.x; tmp[1] = area.y; tmp[2] = area.width; @@ -2224,7 +2226,7 @@ meta_screen_resize (MetaScreen *screen, screen->rect.width = width; screen->rect.height = height; - reload_xinerama_infos (screen); + reload_monitor_infos (screen); set_desktop_geometry_hint (screen); meta_compositor_sync_screen_size (screen->display->compositor); diff --git a/src/core/stack.c b/src/core/stack.c index 6e03952f..dc96d818 100644 --- a/src/core/stack.c +++ b/src/core/stack.c @@ -255,14 +255,14 @@ is_focused_foreach (MetaWindow *window, } static gboolean -windows_on_different_xinerama (MetaWindow *a, - MetaWindow *b) +windows_on_different_monitor (MetaWindow *a, + MetaWindow *b) { if (a->screen != b->screen) return TRUE; - return meta_screen_get_xinerama_for_window (a->screen, a) != - meta_screen_get_xinerama_for_window (b->screen, b); + return meta_screen_get_monitor_for_window (a->screen, a) != + meta_screen_get_monitor_for_window (b->screen, b); } /* Get layer ignoring any transient or group relationships */ @@ -307,8 +307,8 @@ get_standalone_layer (MetaWindow *window) window == window->display->focus_window || window->display->focus_window == NULL || (window->display->focus_window != NULL && - windows_on_different_xinerama (window, - window->display->focus_window)))) + windows_on_different_monitor (window, + window->display->focus_window)))) layer = META_LAYER_FULLSCREEN; else if (window->wm_state_above) layer = META_LAYER_TOP; diff --git a/src/core/testboxes.c b/src/core/testboxes.c index 3bd4df0a..4558c1d2 100644 --- a/src/core/testboxes.c +++ b/src/core/testboxes.c @@ -82,8 +82,12 @@ new_screen_edge (int x, int y, int width, int height, int side_type) return temporary; } -static MetaEdge* -new_xinerama_edge (int x, int y, int width, int height, int side_type) +static MetaEdge * +new_monitor_edge (int x, + int y, + int width, + int height, + int side_type) { MetaEdge* temporary; temporary = g_new (MetaEdge, 1); @@ -92,7 +96,7 @@ new_xinerama_edge (int x, int y, int width, int height, int side_type) temporary->rect.width = width; temporary->rect.height = height; temporary->side_type = side_type; - temporary->edge_type = META_EDGE_XINERAMA; + temporary->edge_type = META_EDGE_MONITOR; return temporary; } @@ -316,8 +320,9 @@ get_screen_edges (int which) return ret; } -static GList* -get_xinerama_edges (int which_xinerama_set, int which_strut_set) +static GList * +get_monitor_edges (int which_monitor_set, + int which_strut_set) { GList *ret; GSList *struts; @@ -325,8 +330,8 @@ get_xinerama_edges (int which_xinerama_set, int which_strut_set) MetaRectangle screenrect; xins = NULL; - g_assert (which_xinerama_set >=0 && which_xinerama_set <= 3); - switch (which_xinerama_set) + g_assert (which_monitor_set >=0 && which_monitor_set <= 3); + switch (which_monitor_set) { case 0: xins = g_list_prepend (xins, new_meta_rect ( 0, 0, 1600, 1200)); @@ -356,7 +361,7 @@ get_xinerama_edges (int which_xinerama_set, int which_strut_set) screenrect.height = 1200; struts = get_strut_list (which_strut_set); - ret = meta_rectangle_find_nonintersected_xinerama_edges (&screenrect, xins, struts); + ret = meta_rectangle_find_nonintersected_monitor_edges (&screenrect, xins, struts); free_strut_list (struts); meta_rectangle_free_list_and_elements (xins); @@ -1153,7 +1158,7 @@ test_find_onscreen_edges (void) } static void -test_find_nonintersected_xinerama_edges (void) +test_find_nonintersected_monitor_edges (void) { GList* edges; GList* tmp; @@ -1164,32 +1169,32 @@ test_find_nonintersected_xinerama_edges (void) int bottom = META_DIRECTION_BOTTOM; /*************************************************************************/ - /* Make sure test xinerama set 0 for with region 0 has the correct edges */ + /* Make sure test monitor set 0 for with region 0 has the correct edges */ /*************************************************************************/ - edges = get_xinerama_edges (0, 0); + edges = get_monitor_edges (0, 0); tmp = NULL; verify_edge_lists_are_equal (edges, tmp); meta_rectangle_free_list_and_elements (tmp); meta_rectangle_free_list_and_elements (edges); /*************************************************************************/ - /* Make sure test xinerama set 2 for with region 1 has the correct edges */ + /* Make sure test monitor set 2 for with region 1 has the correct edges */ /*************************************************************************/ - edges = get_xinerama_edges (2, 1); + edges = get_monitor_edges (2, 1); tmp = NULL; - tmp = g_list_prepend (tmp, new_xinerama_edge ( 0, 600, 1600, 0, bottom)); - tmp = g_list_prepend (tmp, new_xinerama_edge ( 0, 600, 1600, 0, top)); + tmp = g_list_prepend (tmp, new_monitor_edge ( 0, 600, 1600, 0, bottom)); + tmp = g_list_prepend (tmp, new_monitor_edge ( 0, 600, 1600, 0, top)); verify_edge_lists_are_equal (edges, tmp); meta_rectangle_free_list_and_elements (tmp); meta_rectangle_free_list_and_elements (edges); /*************************************************************************/ - /* Make sure test xinerama set 1 for with region 2 has the correct edges */ + /* Make sure test monitor set 1 for with region 2 has the correct edges */ /*************************************************************************/ - edges = get_xinerama_edges (1, 2); + edges = get_monitor_edges (1, 2); tmp = NULL; - tmp = g_list_prepend (tmp, new_xinerama_edge ( 800, 20, 0, 1080, right)); - tmp = g_list_prepend (tmp, new_xinerama_edge ( 800, 20, 0, 1180, left)); + tmp = g_list_prepend (tmp, new_monitor_edge ( 800, 20, 0, 1080, right)); + tmp = g_list_prepend (tmp, new_monitor_edge ( 800, 20, 0, 1180, left)); #if 0 #define FUDGE 50 char big_buffer1[(EDGE_LENGTH+2)*FUDGE], big_buffer2[(EDGE_LENGTH+2)*FUDGE]; @@ -1203,36 +1208,36 @@ test_find_nonintersected_xinerama_edges (void) meta_rectangle_free_list_and_elements (edges); /*************************************************************************/ - /* Make sure test xinerama set 3 for with region 3 has the correct edges */ + /* Make sure test monitor set 3 for with region 3 has the correct edges */ /*************************************************************************/ - edges = get_xinerama_edges (3, 3); + edges = get_monitor_edges (3, 3); tmp = NULL; - tmp = g_list_prepend (tmp, new_xinerama_edge ( 900, 600, 700, 0, bottom)); - tmp = g_list_prepend (tmp, new_xinerama_edge ( 0, 600, 700, 0, bottom)); - tmp = g_list_prepend (tmp, new_xinerama_edge ( 900, 600, 700, 0, top)); - tmp = g_list_prepend (tmp, new_xinerama_edge ( 0, 600, 700, 0, top)); - tmp = g_list_prepend (tmp, new_xinerama_edge ( 800, 675, 0, 425, right)); - tmp = g_list_prepend (tmp, new_xinerama_edge ( 800, 675, 0, 525, left)); + tmp = g_list_prepend (tmp, new_monitor_edge ( 900, 600, 700, 0, bottom)); + tmp = g_list_prepend (tmp, new_monitor_edge ( 0, 600, 700, 0, bottom)); + tmp = g_list_prepend (tmp, new_monitor_edge ( 900, 600, 700, 0, top)); + tmp = g_list_prepend (tmp, new_monitor_edge ( 0, 600, 700, 0, top)); + tmp = g_list_prepend (tmp, new_monitor_edge ( 800, 675, 0, 425, right)); + tmp = g_list_prepend (tmp, new_monitor_edge ( 800, 675, 0, 525, left)); verify_edge_lists_are_equal (edges, tmp); meta_rectangle_free_list_and_elements (tmp); meta_rectangle_free_list_and_elements (edges); /*************************************************************************/ - /* Make sure test xinerama set 3 for with region 4 has the correct edges */ + /* Make sure test monitor set 3 for with region 4 has the correct edges */ /*************************************************************************/ - edges = get_xinerama_edges (3, 4); + edges = get_monitor_edges (3, 4); tmp = NULL; - tmp = g_list_prepend (tmp, new_xinerama_edge ( 800, 600, 800, 0, bottom)); - tmp = g_list_prepend (tmp, new_xinerama_edge ( 800, 600, 800, 0, top)); - tmp = g_list_prepend (tmp, new_xinerama_edge ( 800, 600, 0, 600, right)); + tmp = g_list_prepend (tmp, new_monitor_edge ( 800, 600, 800, 0, bottom)); + tmp = g_list_prepend (tmp, new_monitor_edge ( 800, 600, 800, 0, top)); + tmp = g_list_prepend (tmp, new_monitor_edge ( 800, 600, 0, 600, right)); verify_edge_lists_are_equal (edges, tmp); meta_rectangle_free_list_and_elements (tmp); meta_rectangle_free_list_and_elements (edges); /*************************************************************************/ - /* Make sure test xinerama set 3 for with region 5has the correct edges */ + /* Make sure test monitor set 3 for with region 5has the correct edges */ /*************************************************************************/ - edges = get_xinerama_edges (3, 5); + edges = get_monitor_edges (3, 5); tmp = NULL; verify_edge_lists_are_equal (edges, tmp); meta_rectangle_free_list_and_elements (tmp); @@ -1413,7 +1418,7 @@ main (int argc, char **argv) /* And now the functions dealing with edges more than boxes */ test_find_onscreen_edges (); - test_find_nonintersected_xinerama_edges (); + test_find_nonintersected_monitor_edges (); /* And now the misfit functions that don't quite fit in anywhere else... */ test_gravity_resize (); diff --git a/src/core/window-private.h b/src/core/window-private.h index 6def73a0..4b34d5f4 100644 --- a/src/core/window-private.h +++ b/src/core/window-private.h @@ -175,8 +175,8 @@ struct _MetaWindow /* Whether we're trying to constrain the window to be fully onscreen */ guint require_fully_onscreen : 1; - /* Whether we're trying to constrain the window to be on a single xinerama */ - guint require_on_single_xinerama : 1; + /* Whether we're trying to constrain the window to be on a single monitor */ + guint require_on_single_monitor : 1; /* Whether we're trying to constrain the window's titlebar to be onscreen */ guint require_titlebar_visible : 1; @@ -619,13 +619,13 @@ GList* meta_window_get_workspaces (MetaWindow *window); gboolean meta_window_located_on_workspace (MetaWindow *window, MetaWorkspace *workspace); -void meta_window_get_work_area_current_xinerama (MetaWindow *window, - MetaRectangle *area); -void meta_window_get_work_area_for_xinerama (MetaWindow *window, - int which_xinerama, - MetaRectangle *area); -void meta_window_get_work_area_all_xineramas (MetaWindow *window, - MetaRectangle *area); +void meta_window_get_work_area_current_monitor (MetaWindow *window, + MetaRectangle *area); +void meta_window_get_work_area_for_monitor (MetaWindow *window, + int which_monitor, + MetaRectangle *area); +void meta_window_get_work_area_all_monitors (MetaWindow *window, + MetaRectangle *area); void meta_window_get_current_tile_area (MetaWindow *window, MetaRectangle *tile_area); diff --git a/src/core/window.c b/src/core/window.c index 1080a830..30b2f7a4 100644 --- a/src/core/window.c +++ b/src/core/window.c @@ -480,7 +480,7 @@ meta_window_new (MetaDisplay *display, window->minimize_after_placement = FALSE; window->fullscreen_monitors[0] = -1; window->require_fully_onscreen = TRUE; - window->require_on_single_xinerama = TRUE; + window->require_on_single_monitor = TRUE; window->require_titlebar_visible = TRUE; window->on_all_workspaces = FALSE; window->tile_mode = META_TILE_NONE; @@ -2803,15 +2803,15 @@ meta_window_can_tile_maximized (MetaWindow *window) gboolean meta_window_can_tile_side_by_side (MetaWindow *window) { - const MetaXineramaScreenInfo *monitor; + const MetaMonitorInfo *monitor; MetaRectangle tile_area; /*if (!META_WINDOW_ALLOWS_RESIZE (window))*/ if (!meta_window_can_tile_maximized (window)) return FALSE; - monitor = meta_screen_get_current_xinerama (window->screen); - meta_window_get_work_area_for_xinerama (window, monitor->number, &tile_area); + monitor = meta_screen_get_current_monitor (window->screen); + meta_window_get_work_area_for_monitor (window, monitor->number, &tile_area); /* Do not allow tiling in portrait orientation */ if (tile_area.height > tile_area.width) @@ -3054,10 +3054,10 @@ meta_window_update_fullscreen_monitors (MetaWindow *window, unsigned long left, unsigned long right) { - if ((int)top < window->screen->n_xinerama_infos && - (int)bottom < window->screen->n_xinerama_infos && - (int)left < window->screen->n_xinerama_infos && - (int)right < window->screen->n_xinerama_infos) + if ((int)top < window->screen->n_monitor_infos && + (int)bottom < window->screen->n_monitor_infos && + (int)left < window->screen->n_monitor_infos && + (int)right < window->screen->n_monitor_infos) { window->fullscreen_monitors[0] = top; window->fullscreen_monitors[1] = bottom; @@ -5127,7 +5127,7 @@ meta_window_move_resize_request (MetaWindow *window, if (flags & (META_IS_MOVE_ACTION | META_IS_RESIZE_ACTION)) { - const MetaXineramaScreenInfo *xinerama_info; + const MetaMonitorInfo *monitor_info; MetaRectangle rect; rect.x = x; @@ -5135,7 +5135,7 @@ meta_window_move_resize_request (MetaWindow *window, rect.width = width; rect.height = height; - xinerama_info = meta_screen_get_xinerama_for_rect (window->screen, &rect); + monitor_info = meta_screen_get_monitor_for_rect (window->screen, &rect); /* Workaround braindead legacy apps that don't know how to * fullscreen themselves properly - don't get fooled by @@ -5145,7 +5145,7 @@ meta_window_move_resize_request (MetaWindow *window, */ if (meta_prefs_get_force_fullscreen() && (window->decorated || !meta_window_is_client_decorated (window)) && - meta_rectangle_equal (&rect, &xinerama_info->rect) && + meta_rectangle_equal (&rect, &monitor_info->rect) && window->has_fullscreen_func && !window->fullscreen) { @@ -6864,7 +6864,7 @@ recalc_window_features (MetaWindow *window) /* don't allow fullscreen if we can't resize, unless the size * is entire screen size (kind of broken, because we - * actually fullscreen to xinerama head size not screen size) + * actually fullscreen to monitor head size not screen size) */ if (window->size_hints.min_width == window->screen->rect.width && window->size_hints.min_height == window->screen->rect.height) @@ -7505,7 +7505,7 @@ update_move (MetaWindow *window, !META_WINDOW_MAXIMIZED (window) && !META_WINDOW_TILED_SIDE_BY_SIDE (window)) { - const MetaXineramaScreenInfo *monitor; + const MetaMonitorInfo *monitor; MetaRectangle work_area; /* For side-by-side tiling we are interested in the inside vertical @@ -7521,10 +7521,10 @@ update_move (MetaWindow *window, * refers to the monitor which contains the largest part of the window, * the latter to the one where the pointer is located. */ - monitor = meta_screen_get_current_xinerama (window->screen); - meta_window_get_work_area_for_xinerama (window, - monitor->number, - &work_area); + monitor = meta_screen_get_current_monitor (window->screen); + meta_window_get_work_area_for_monitor (window, + monitor->number, + &work_area); /* Check if the cursor is in a position which triggers tiling * and set tile_mode accordingly. @@ -7587,22 +7587,22 @@ update_move (MetaWindow *window, return; } - /* remaximize window on an other xinerama monitor if window has - * been shaken loose or it is still maximized (then move straight) + /* remaximize window on an other monitor if window has been shaken + * loose or it is still maximized (then move straight) */ else if (window->shaken_loose || META_WINDOW_MAXIMIZED (window)) { - const MetaXineramaScreenInfo *wxinerama; + const MetaMonitorInfo *wmonitor; MetaRectangle work_area; int monitor; - wxinerama = meta_screen_get_xinerama_for_window (window->screen, window); + wmonitor = meta_screen_get_monitor_for_window (window->screen, window); - for (monitor = 0; monitor < window->screen->n_xinerama_infos; monitor++) + for (monitor = 0; monitor < window->screen->n_monitor_infos; monitor++) { - meta_window_get_work_area_for_xinerama (window, monitor, &work_area); + meta_window_get_work_area_for_monitor (window, monitor, &work_area); - /* check if cursor is near the top of a xinerama work area */ + /* check if cursor is near the top of a monitor work area */ if (x >= work_area.x && x < (work_area.x + work_area.width) && y >= work_area.y && @@ -7611,7 +7611,7 @@ update_move (MetaWindow *window, /* move the saved rect if window will become maximized on an * other monitor so user isn't surprised on a later unmaximize */ - if (wxinerama->number != monitor) + if (wmonitor->number != monitor) { window->saved_rect.x = work_area.x; window->saved_rect.y = work_area.y; @@ -8189,24 +8189,24 @@ meta_window_handle_mouse_grab_op_event (MetaWindow *window, } static void -get_work_area_xinerama (MetaWindow *window, - MetaRectangle *area, - int which_xinerama) +get_work_area_monitor (MetaWindow *window, + MetaRectangle *area, + int which_monitor) { GList *tmp; - g_assert (which_xinerama >= 0); + g_assert (which_monitor >= 0); - /* Initialize to the whole xinerama */ - *area = window->screen->xinerama_infos[which_xinerama].rect; + /* Initialize to the whole monitor */ + *area = window->screen->monitor_infos[which_monitor].rect; tmp = meta_window_get_workspaces (window); while (tmp != NULL) { MetaRectangle workspace_work_area; - meta_workspace_get_work_area_for_xinerama (tmp->data, - which_xinerama, - &workspace_work_area); + meta_workspace_get_work_area_for_monitor (tmp->data, + which_monitor, + &workspace_work_area); meta_rectangle_intersect (area, &workspace_work_area, area); @@ -8214,37 +8214,35 @@ get_work_area_xinerama (MetaWindow *window, } meta_topic (META_DEBUG_WORKAREA, - "Window %s xinerama %d has work area %d,%d %d x %d\n", - window->desc, which_xinerama, + "Window %s monitor %d has work area %d,%d %d x %d\n", + window->desc, which_monitor, area->x, area->y, area->width, area->height); } void -meta_window_get_work_area_current_xinerama (MetaWindow *window, - MetaRectangle *area) +meta_window_get_work_area_current_monitor (MetaWindow *window, + MetaRectangle *area) { - const MetaXineramaScreenInfo *xinerama; + const MetaMonitorInfo *monitor; - xinerama = meta_screen_get_xinerama_for_window (window->screen, window); + monitor = meta_screen_get_monitor_for_window (window->screen, window); - meta_window_get_work_area_for_xinerama (window, xinerama->number, area); + meta_window_get_work_area_for_monitor (window, monitor->number, area); } void -meta_window_get_work_area_for_xinerama (MetaWindow *window, - int which_xinerama, - MetaRectangle *area) +meta_window_get_work_area_for_monitor (MetaWindow *window, + int which_monitor, + MetaRectangle *area) { - g_return_if_fail (which_xinerama >= 0); + g_return_if_fail (which_monitor >= 0); - get_work_area_xinerama (window, - area, - which_xinerama); + get_work_area_monitor (window, area, which_monitor); } void -meta_window_get_work_area_all_xineramas (MetaWindow *window, - MetaRectangle *area) +meta_window_get_work_area_all_monitors (MetaWindow *window, + MetaRectangle *area) { GList *tmp; @@ -8255,8 +8253,8 @@ meta_window_get_work_area_all_xineramas (MetaWindow *window, while (tmp != NULL) { MetaRectangle workspace_work_area; - meta_workspace_get_work_area_all_xineramas (tmp->data, - &workspace_work_area); + meta_workspace_get_work_area_all_monitors (tmp->data, + &workspace_work_area); meta_rectangle_intersect (area, &workspace_work_area, area); @@ -8282,9 +8280,12 @@ meta_window_get_current_tile_area (MetaWindow *window, * cases is the real monitor number actually required (e.g. the window is being moved with the mouse but * is still mostly on the wrong monitor). */ - if (window->tile_monitor_number >= window->screen->n_xinerama_infos) + if (window->tile_monitor_number >= window->screen->n_monitor_infos) { - window->tile_monitor_number = meta_screen_get_xinerama_for_window (window->screen, window)->number; + const MetaMonitorInfo *monitor; + + monitor = meta_screen_get_monitor_for_window (window->screen, window); + window->tile_monitor_number = monitor->number; } tile_monitor_number = window->tile_monitor_number; @@ -8294,7 +8295,7 @@ meta_window_get_current_tile_area (MetaWindow *window, tile_monitor_number = 0; } - meta_window_get_work_area_for_xinerama (window, tile_monitor_number, tile_area); + meta_window_get_work_area_for_monitor (window, tile_monitor_number, tile_area); if (window->tile_mode == META_TILE_LEFT || window->tile_mode == META_TILE_RIGHT) diff --git a/src/core/workspace.c b/src/core/workspace.c index 9af548b8..166d717f 100644 --- a/src/core/workspace.c +++ b/src/core/workspace.c @@ -63,16 +63,16 @@ meta_workspace_new (MetaScreen *screen) meta_screen_foreach_window (screen, maybe_add_to_list, &workspace->mru_list); workspace->work_areas_invalid = TRUE; - workspace->work_area_xinerama = NULL; + workspace->work_area_monitor = NULL; workspace->work_area_screen.x = 0; workspace->work_area_screen.y = 0; workspace->work_area_screen.width = 0; workspace->work_area_screen.height = 0; workspace->screen_region = NULL; - workspace->xinerama_region = NULL; + workspace->monitor_region = NULL; workspace->screen_edges = NULL; - workspace->xinerama_edges = NULL; + workspace->monitor_edges = NULL; workspace->list_containing_self = g_list_prepend (NULL, workspace); workspace->all_struts = NULL; @@ -139,7 +139,7 @@ meta_workspace_free (MetaWorkspace *workspace) workspace->screen->workspaces = g_list_remove (workspace->screen->workspaces, workspace); - g_free (workspace->work_area_xinerama); + g_free (workspace->work_area_monitor); g_list_free (workspace->mru_list); g_list_free (workspace->list_containing_self); @@ -154,12 +154,12 @@ meta_workspace_free (MetaWorkspace *workspace) if (!workspace->work_areas_invalid) { workspace_free_struts (workspace); - for (i = 0; i < screen->n_xinerama_infos; i++) - meta_rectangle_free_list_and_elements (workspace->xinerama_region[i]); - g_free (workspace->xinerama_region); + for (i = 0; i < screen->n_monitor_infos; i++) + meta_rectangle_free_list_and_elements (workspace->monitor_region[i]); + g_free (workspace->monitor_region); meta_rectangle_free_list_and_elements (workspace->screen_region); meta_rectangle_free_list_and_elements (workspace->screen_edges); - meta_rectangle_free_list_and_elements (workspace->xinerama_edges); + meta_rectangle_free_list_and_elements (workspace->monitor_edges); } g_free (workspace); @@ -564,21 +564,21 @@ meta_workspace_invalidate_work_area (MetaWorkspace *workspace) if (workspace == workspace->screen->active_workspace) meta_display_cleanup_edges (workspace->screen->display); - g_free (workspace->work_area_xinerama); - workspace->work_area_xinerama = NULL; + g_free (workspace->work_area_monitor); + workspace->work_area_monitor = NULL; workspace_free_struts (workspace); - for (i = 0; i < workspace->screen->n_xinerama_infos; i++) - meta_rectangle_free_list_and_elements (workspace->xinerama_region[i]); - g_free (workspace->xinerama_region); + for (i = 0; i < workspace->screen->n_monitor_infos; i++) + meta_rectangle_free_list_and_elements (workspace->monitor_region[i]); + g_free (workspace->monitor_region); meta_rectangle_free_list_and_elements (workspace->screen_region); meta_rectangle_free_list_and_elements (workspace->screen_edges); - meta_rectangle_free_list_and_elements (workspace->xinerama_edges); - workspace->xinerama_region = NULL; + meta_rectangle_free_list_and_elements (workspace->monitor_edges); + workspace->monitor_region = NULL; workspace->screen_region = NULL; workspace->screen_edges = NULL; - workspace->xinerama_edges = NULL; + workspace->monitor_edges = NULL; workspace->work_areas_invalid = TRUE; @@ -611,10 +611,10 @@ ensure_work_areas_validated (MetaWorkspace *workspace) return; g_assert (workspace->all_struts == NULL); - g_assert (workspace->xinerama_region == NULL); + g_assert (workspace->monitor_region == NULL); g_assert (workspace->screen_region == NULL); g_assert (workspace->screen_edges == NULL); - g_assert (workspace->xinerama_edges == NULL); + g_assert (workspace->monitor_edges == NULL); /* STEP 1: Get the list of struts */ windows = meta_workspace_list_windows (workspace); @@ -633,18 +633,19 @@ ensure_work_areas_validated (MetaWorkspace *workspace) g_list_free (windows); /* STEP 2: Get the maximal/spanning rects for the onscreen and - * on-single-xinerama regions + * on-single-monitor regions */ - g_assert (workspace->xinerama_region == NULL); - g_assert (workspace->screen_region == NULL); + g_assert (workspace->monitor_region == NULL); + g_assert (workspace->screen_region == NULL); + + workspace->monitor_region = g_new (GList*, + workspace->screen->n_monitor_infos); - workspace->xinerama_region = g_new (GList*, - workspace->screen->n_xinerama_infos); - for (i = 0; i < workspace->screen->n_xinerama_infos; i++) + for (i = 0; i < workspace->screen->n_monitor_infos; i++) { - workspace->xinerama_region[i] = + workspace->monitor_region[i] = meta_rectangle_get_minimal_spanning_set_for_region ( - &workspace->screen->xinerama_infos[i].rect, + &workspace->screen->monitor_infos[i].rect, workspace->all_struts); } workspace->screen_region = @@ -653,7 +654,7 @@ ensure_work_areas_validated (MetaWorkspace *workspace) workspace->all_struts); /* STEP 3: Get the work areas (region-to-maximize-to) for the screen and - * xineramas. + * monitors. */ work_area = workspace->screen->rect; /* start with the screen */ if (workspace->screen_region == NULL) @@ -710,35 +711,35 @@ ensure_work_areas_validated (MetaWorkspace *workspace) workspace->work_area_screen.width, workspace->work_area_screen.height); - /* Now find the work areas for each xinerama */ - g_free (workspace->work_area_xinerama); - workspace->work_area_xinerama = g_new (MetaRectangle, - workspace->screen->n_xinerama_infos); + /* Now find the work areas for each monitor */ + g_free (workspace->work_area_monitor); + workspace->work_area_monitor = g_new (MetaRectangle, + workspace->screen->n_monitor_infos); - for (i = 0; i < workspace->screen->n_xinerama_infos; i++) + for (i = 0; i < workspace->screen->n_monitor_infos; i++) { - work_area = workspace->screen->xinerama_infos[i].rect; + work_area = workspace->screen->monitor_infos[i].rect; - if (workspace->xinerama_region[i] == NULL) + if (workspace->monitor_region[i] == NULL) /* FIXME: constraints.c untested with this, but it might be nice for * a screen reader or magnifier. */ work_area = meta_rect (work_area.x, work_area.y, -1, -1); else - meta_rectangle_clip_to_region (workspace->xinerama_region[i], + meta_rectangle_clip_to_region (workspace->monitor_region[i], FIXED_DIRECTION_NONE, &work_area); - workspace->work_area_xinerama[i] = work_area; + workspace->work_area_monitor[i] = work_area; meta_topic (META_DEBUG_WORKAREA, "Computed work area for workspace %d " - "xinerama %d: %d,%d %d x %d\n", + "monitor %d: %d,%d %d x %d\n", meta_workspace_index (workspace), i, - workspace->work_area_xinerama[i].x, - workspace->work_area_xinerama[i].y, - workspace->work_area_xinerama[i].width, - workspace->work_area_xinerama[i].height); + workspace->work_area_monitor[i].x, + workspace->work_area_monitor[i].y, + workspace->work_area_monitor[i].width, + workspace->work_area_monitor[i].height); } /* STEP 4: Make sure the screen_region is nonempty (separate from step 2 @@ -752,17 +753,22 @@ ensure_work_areas_validated (MetaWorkspace *workspace) workspace->screen_region = g_list_prepend (NULL, nonempty_region); } - /* STEP 5: Cache screen and xinerama edges for edge resistance and snapping */ - g_assert (workspace->screen_edges == NULL); - g_assert (workspace->xinerama_edges == NULL); + /* STEP 5: Cache screen and monitor edges for edge resistance and snapping */ + g_assert (workspace->screen_edges == NULL); + g_assert (workspace->monitor_edges == NULL); + workspace->screen_edges = meta_rectangle_find_onscreen_edges (&workspace->screen->rect, workspace->all_struts); tmp = NULL; - for (i = 0; i < workspace->screen->n_xinerama_infos; i++) - tmp = g_list_prepend (tmp, &workspace->screen->xinerama_infos[i].rect); - workspace->xinerama_edges = - meta_rectangle_find_nonintersected_xinerama_edges (&workspace->screen->rect, tmp, workspace->all_struts); + for (i = 0; i < workspace->screen->n_monitor_infos; i++) + tmp = g_list_prepend (tmp, &workspace->screen->monitor_infos[i].rect); + + workspace->monitor_edges = + meta_rectangle_find_nonintersected_monitor_edges (&workspace->screen->rect, + tmp, + workspace->all_struts); + g_list_free (tmp); /* We're all done, YAAY! Record that everything has been validated. */ @@ -770,21 +776,21 @@ ensure_work_areas_validated (MetaWorkspace *workspace) } void -meta_workspace_get_work_area_for_xinerama (MetaWorkspace *workspace, - int which_xinerama, - MetaRectangle *area) +meta_workspace_get_work_area_for_monitor (MetaWorkspace *workspace, + int which_monitor, + MetaRectangle *area) { - g_assert (which_xinerama >= 0); + g_assert (which_monitor >= 0); ensure_work_areas_validated (workspace); - g_assert (which_xinerama < workspace->screen->n_xinerama_infos); + g_assert (which_monitor < workspace->screen->n_monitor_infos); - *area = workspace->work_area_xinerama[which_xinerama]; + *area = workspace->work_area_monitor[which_monitor]; } void -meta_workspace_get_work_area_all_xineramas (MetaWorkspace *workspace, - MetaRectangle *area) +meta_workspace_get_work_area_all_monitors (MetaWorkspace *workspace, + MetaRectangle *area) { ensure_work_areas_validated (workspace); @@ -800,12 +806,12 @@ meta_workspace_get_onscreen_region (MetaWorkspace *workspace) } GList* -meta_workspace_get_onxinerama_region (MetaWorkspace *workspace, - int which_xinerama) +meta_workspace_get_onmonitor_region (MetaWorkspace *workspace, + int which_monitor) { ensure_work_areas_validated (workspace); - return workspace->xinerama_region[which_xinerama]; + return workspace->monitor_region[which_monitor]; } static const gchar * diff --git a/src/core/workspace.h b/src/core/workspace.h index 6bfdf11a..89969c77 100644 --- a/src/core/workspace.h +++ b/src/core/workspace.h @@ -64,11 +64,11 @@ struct _MetaWorkspace GList *list_containing_self; MetaRectangle work_area_screen; - MetaRectangle *work_area_xinerama; + MetaRectangle *work_area_monitor; GList *screen_region; - GList **xinerama_region; + GList **monitor_region; GList *screen_edges; - GList *xinerama_edges; + GList *monitor_edges; GSList *all_struts; guint work_areas_invalid : 1; @@ -94,14 +94,14 @@ GList* meta_workspace_list_windows (MetaWorkspace *workspace); void meta_workspace_invalidate_work_area (MetaWorkspace *workspace); -void meta_workspace_get_work_area_for_xinerama (MetaWorkspace *workspace, - int which_xinerama, - MetaRectangle *area); -void meta_workspace_get_work_area_all_xineramas (MetaWorkspace *workspace, - MetaRectangle *area); -GList* meta_workspace_get_onscreen_region (MetaWorkspace *workspace); -GList* meta_workspace_get_onxinerama_region (MetaWorkspace *workspace, - int which_xinerama); +void meta_workspace_get_work_area_for_monitor (MetaWorkspace *workspace, + int which_monitor, + MetaRectangle *area); +void meta_workspace_get_work_area_all_monitors (MetaWorkspace *workspace, + MetaRectangle *area); +GList* meta_workspace_get_onscreen_region (MetaWorkspace *workspace); +GList* meta_workspace_get_onmonitor_region (MetaWorkspace *workspace, + int which_monitor); void meta_workspace_focus_default_window (MetaWorkspace *workspace, MetaWindow *not_this_one, @@ -113,7 +113,3 @@ MetaWorkspace* meta_workspace_get_neighbor (MetaWorkspace *workspace, const char* meta_workspace_get_name (MetaWorkspace *workspace); #endif - - - - diff --git a/src/include/boxes.h b/src/include/boxes.h index 61b9b61c..ddbc545c 100644 --- a/src/include/boxes.h +++ b/src/include/boxes.h @@ -56,7 +56,7 @@ typedef enum typedef enum { META_EDGE_WINDOW, - META_EDGE_XINERAMA, + META_EDGE_MONITOR, META_EDGE_SCREEN } MetaEdgeType; @@ -191,7 +191,7 @@ void meta_rectangle_expand_to_avoiding_struts ( * or * meta_rectangle_find_onscreen_edges () * or - * meta_rectangle_find_nonintersected_xinerama_edges() + * meta_rectangle_find_nonintersected_monitor_edges() */ void meta_rectangle_free_list_and_elements (GList *filled_list); @@ -278,12 +278,12 @@ GList* meta_rectangle_remove_intersections_with_boxes_from_edges ( GList* meta_rectangle_find_onscreen_edges (const MetaRectangle *basic_rect, const GSList *all_struts); -/* Finds edges between adjacent xineramas which are not covered by the given +/* Finds edges between adjacent monitors which are not covered by the given * struts. */ -GList* meta_rectangle_find_nonintersected_xinerama_edges ( +GList* meta_rectangle_find_nonintersected_monitor_edges ( const MetaRectangle *screen_rect, - const GList *xinerama_rects, + const GList *monitor_rects, const GSList *all_struts); #endif /* META_BOXES_H */ |