mirror of
https://github.com/brl/mutter.git
synced 2024-11-22 08:00:42 -05:00
mtk: Move Rectangle.equal from Meta
Moves equal the equal function and removes the clutter equivalent. The tests were not moved until all the remaining helper functions are moved. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3128>
This commit is contained in:
parent
918ae0f4d4
commit
9b2cba4e86
@ -222,9 +222,6 @@ gboolean _clutter_util_rectangle_intersection (const MtkRectangle *src1,
|
|||||||
const MtkRectangle *src2,
|
const MtkRectangle *src2,
|
||||||
MtkRectangle *dest);
|
MtkRectangle *dest);
|
||||||
|
|
||||||
gboolean clutter_util_rectangle_equal (const MtkRectangle *src1,
|
|
||||||
const MtkRectangle *src2);
|
|
||||||
|
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
PangoDirection _clutter_pango_unichar_direction (gunichar ch);
|
PangoDirection _clutter_pango_unichar_direction (gunichar ch);
|
||||||
|
|
||||||
|
@ -943,7 +943,7 @@ maybe_mark_full_redraw (ClutterStageView *view,
|
|||||||
MtkRectangle region_extents;
|
MtkRectangle region_extents;
|
||||||
|
|
||||||
cairo_region_get_extents (*region, ®ion_extents);
|
cairo_region_get_extents (*region, ®ion_extents);
|
||||||
if (clutter_util_rectangle_equal (&priv->layout, ®ion_extents))
|
if (mtk_rectangle_equal (&priv->layout, ®ion_extents))
|
||||||
g_clear_pointer (region, cairo_region_destroy);
|
g_clear_pointer (region, cairo_region_destroy);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -970,7 +970,7 @@ clutter_stage_view_add_redraw_clip (ClutterStageView *view,
|
|||||||
|
|
||||||
if (!priv->redraw_clip)
|
if (!priv->redraw_clip)
|
||||||
{
|
{
|
||||||
if (!clutter_util_rectangle_equal (&priv->layout, clip))
|
if (!mtk_rectangle_equal (&priv->layout, clip))
|
||||||
priv->redraw_clip = cairo_region_create_rectangle (clip);
|
priv->redraw_clip = cairo_region_create_rectangle (clip);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -227,16 +227,6 @@ _clutter_util_rectangle_intersection (const MtkRectangle *src1,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
|
||||||
clutter_util_rectangle_equal (const MtkRectangle *src1,
|
|
||||||
const MtkRectangle *src2)
|
|
||||||
{
|
|
||||||
return ((src1->x == src2->x) &&
|
|
||||||
(src1->y == src2->y) &&
|
|
||||||
(src1->width == src2->width) &&
|
|
||||||
(src1->height == src2->height));
|
|
||||||
}
|
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
GType value_type;
|
GType value_type;
|
||||||
|
@ -36,3 +36,22 @@ mtk_rectangle_free (MtkRectangle *rect)
|
|||||||
|
|
||||||
G_DEFINE_BOXED_TYPE (MtkRectangle, mtk_rectangle,
|
G_DEFINE_BOXED_TYPE (MtkRectangle, mtk_rectangle,
|
||||||
mtk_rectangle_copy, mtk_rectangle_free);
|
mtk_rectangle_copy, mtk_rectangle_free);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* mtk_rectangle_equal:
|
||||||
|
* @src1: The first rectangle
|
||||||
|
* @src2: The second rectangle
|
||||||
|
*
|
||||||
|
* Compares the two rectangles
|
||||||
|
*
|
||||||
|
* Returns: Whether the two rectangles are equal
|
||||||
|
*/
|
||||||
|
gboolean
|
||||||
|
mtk_rectangle_equal (const MtkRectangle *src1,
|
||||||
|
const MtkRectangle *src2)
|
||||||
|
{
|
||||||
|
return ((src1->x == src2->x) &&
|
||||||
|
(src1->y == src2->y) &&
|
||||||
|
(src1->width == src2->width) &&
|
||||||
|
(src1->height == src2->height));
|
||||||
|
}
|
||||||
|
@ -64,3 +64,7 @@ MtkRectangle * mtk_rectangle_copy (const MtkRectangle *rect);
|
|||||||
MTK_EXPORT
|
MTK_EXPORT
|
||||||
void mtk_rectangle_free (MtkRectangle *rect);
|
void mtk_rectangle_free (MtkRectangle *rect);
|
||||||
|
|
||||||
|
MTK_EXPORT
|
||||||
|
gboolean mtk_rectangle_equal (const MtkRectangle *src1,
|
||||||
|
const MtkRectangle *src2);
|
||||||
|
|
||||||
|
@ -925,7 +925,7 @@ ensure_logical_monitor (GList **logical_monitor_configs,
|
|||||||
{
|
{
|
||||||
MetaLogicalMonitorConfig *logical_monitor_config = l->data;
|
MetaLogicalMonitorConfig *logical_monitor_config = l->data;
|
||||||
|
|
||||||
if (meta_rectangle_equal (&logical_monitor_config->layout, layout))
|
if (mtk_rectangle_equal (&logical_monitor_config->layout, layout))
|
||||||
return logical_monitor_config;
|
return logical_monitor_config;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -177,7 +177,7 @@ logical_monitor_from_layout (MetaMonitorManager *manager,
|
|||||||
{
|
{
|
||||||
MetaLogicalMonitor *logical_monitor = l->data;
|
MetaLogicalMonitor *logical_monitor = l->data;
|
||||||
|
|
||||||
if (meta_rectangle_equal (layout, &logical_monitor->rect))
|
if (mtk_rectangle_equal (layout, &logical_monitor->rect))
|
||||||
return logical_monitor;
|
return logical_monitor;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -326,7 +326,7 @@ derive_scale_from_config (MetaMonitorManager *manager,
|
|||||||
{
|
{
|
||||||
MetaLogicalMonitorConfig *logical_monitor_config = l->data;
|
MetaLogicalMonitorConfig *logical_monitor_config = l->data;
|
||||||
|
|
||||||
if (meta_rectangle_equal (layout, &logical_monitor_config->layout))
|
if (mtk_rectangle_equal (layout, &logical_monitor_config->layout))
|
||||||
return logical_monitor_config->scale;
|
return logical_monitor_config->scale;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,8 +56,8 @@ update_monitor (MetaScreenCastMonitorStream *monitor_stream,
|
|||||||
if (!new_logical_monitor)
|
if (!new_logical_monitor)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
if (!meta_rectangle_equal (&new_logical_monitor->rect,
|
if (!mtk_rectangle_equal (&new_logical_monitor->rect,
|
||||||
&monitor_stream->logical_monitor->rect))
|
&monitor_stream->logical_monitor->rect))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
g_set_object (&monitor_stream->monitor, new_monitor);
|
g_set_object (&monitor_stream->monitor, new_monitor);
|
||||||
|
@ -215,7 +215,7 @@ meta_kms_crtc_state_changes (MetaKmsCrtcState *state,
|
|||||||
if (state->is_active != other_state->is_active)
|
if (state->is_active != other_state->is_active)
|
||||||
return META_KMS_RESOURCE_CHANGE_FULL;
|
return META_KMS_RESOURCE_CHANGE_FULL;
|
||||||
|
|
||||||
if (!meta_rectangle_equal (&state->rect, &other_state->rect))
|
if (!mtk_rectangle_equal (&state->rect, &other_state->rect))
|
||||||
return META_KMS_RESOURCE_CHANGE_FULL;
|
return META_KMS_RESOURCE_CHANGE_FULL;
|
||||||
|
|
||||||
if (state->is_drm_mode_valid != other_state->is_drm_mode_valid)
|
if (state->is_drm_mode_valid != other_state->is_drm_mode_valid)
|
||||||
|
@ -465,8 +465,8 @@ apply_edge_resistance_to_each_side (MetaEdgeResistanceData *edge_data,
|
|||||||
MetaEdgeResistanceFlags flags,
|
MetaEdgeResistanceFlags flags,
|
||||||
gboolean is_resize)
|
gboolean is_resize)
|
||||||
{
|
{
|
||||||
MetaRectangle modified_rect;
|
MetaRectangle modified_rect;
|
||||||
gboolean modified;
|
gboolean modified;
|
||||||
int new_left, new_right, new_top, new_bottom;
|
int new_left, new_right, new_top, new_bottom;
|
||||||
gboolean auto_snap, keyboard_op;
|
gboolean auto_snap, keyboard_op;
|
||||||
|
|
||||||
@ -621,7 +621,7 @@ apply_edge_resistance_to_each_side (MetaEdgeResistanceData *edge_data,
|
|||||||
new_top,
|
new_top,
|
||||||
new_right - new_left,
|
new_right - new_left,
|
||||||
new_bottom - new_top);
|
new_bottom - new_top);
|
||||||
modified = !meta_rectangle_equal (new_outer, &modified_rect);
|
modified = !mtk_rectangle_equal (new_outer, &modified_rect);
|
||||||
*new_outer = modified_rect;
|
*new_outer = modified_rect;
|
||||||
return modified;
|
return modified;
|
||||||
}
|
}
|
||||||
|
@ -1255,11 +1255,11 @@ meta_shaped_texture_is_opaque (MetaShapedTexture *stex)
|
|||||||
|
|
||||||
meta_shaped_texture_ensure_size_valid (stex);
|
meta_shaped_texture_ensure_size_valid (stex);
|
||||||
|
|
||||||
return meta_rectangle_equal (&opaque_rect,
|
return mtk_rectangle_equal (&opaque_rect,
|
||||||
&(MetaRectangle) {
|
&(MetaRectangle) {
|
||||||
.width = stex->dst_width,
|
.width = stex->dst_width,
|
||||||
.height = stex->dst_height
|
.height = stex->dst_height
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
* Copyright (C) 2005, 2006 Elijah Newren
|
* Copyright (C) 2005, 2006 Elijah Newren
|
||||||
* [meta_rectangle_intersect() is copyright the GTK+ Team according to Havoc,
|
* [meta_rectangle_intersect() is copyright the GTK+ Team according to Havoc,
|
||||||
* see gdkrectangle.c. As far as Havoc knows, he probably wrote
|
* see gdkrectangle.c. As far as Havoc knows, he probably wrote
|
||||||
* meta_rectangle_equal(), and I'm guessing it's (C) Red Hat. So...]
|
* mtk_rectangle_equal(), and I'm guessing it's (C) Red Hat. So...]
|
||||||
* Copyright (C) 1995-2000 GTK+ Team
|
* Copyright (C) 1995-2000 GTK+ Team
|
||||||
* Copyright (C) 2002 Red Hat, Inc.
|
* Copyright (C) 2002 Red Hat, Inc.
|
||||||
*
|
*
|
||||||
@ -200,16 +200,6 @@ meta_rectangle_intersect (const MetaRectangle *src1,
|
|||||||
return return_val;
|
return return_val;
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
|
||||||
meta_rectangle_equal (const MetaRectangle *src1,
|
|
||||||
const MetaRectangle *src2)
|
|
||||||
{
|
|
||||||
return ((src1->x == src2->x) &&
|
|
||||||
(src1->y == src2->y) &&
|
|
||||||
(src1->width == src2->width) &&
|
|
||||||
(src1->height == src2->height));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* meta_rectangle_union:
|
* meta_rectangle_union:
|
||||||
* @rect1: a #MetaRectangle
|
* @rect1: a #MetaRectangle
|
||||||
@ -884,7 +874,7 @@ meta_rectangle_is_adjacent_to_any_in_region (const GList *spanning_rects,
|
|||||||
{
|
{
|
||||||
MetaRectangle *other = (MetaRectangle *) l->data;
|
MetaRectangle *other = (MetaRectangle *) l->data;
|
||||||
|
|
||||||
if (rect == other || meta_rectangle_equal (rect, other))
|
if (rect == other || mtk_rectangle_equal (rect, other))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (meta_rectangle_is_adjacent_to (rect, other))
|
if (meta_rectangle_is_adjacent_to (rect, other))
|
||||||
|
@ -969,8 +969,8 @@ constrain_custom_rule (MetaWindow *window,
|
|||||||
meta_rectangle_intersect (&adjusted_unconstrained, &info->work_area_monitor,
|
meta_rectangle_intersect (&adjusted_unconstrained, &info->work_area_monitor,
|
||||||
&intersection);
|
&intersection);
|
||||||
|
|
||||||
constraint_satisfied = (meta_rectangle_equal (&info->current,
|
constraint_satisfied = (mtk_rectangle_equal (&info->current,
|
||||||
&adjusted_unconstrained) &&
|
&adjusted_unconstrained) &&
|
||||||
is_custom_rule_satisfied (&adjusted_unconstrained,
|
is_custom_rule_satisfied (&adjusted_unconstrained,
|
||||||
placement_rule,
|
placement_rule,
|
||||||
&intersection));
|
&intersection));
|
||||||
@ -1352,7 +1352,7 @@ constrain_fullscreen (MetaWindow *window,
|
|||||||
|
|
||||||
/* Determine whether constraint is already satisfied; exit if it is */
|
/* Determine whether constraint is already satisfied; exit if it is */
|
||||||
constraint_already_satisfied =
|
constraint_already_satisfied =
|
||||||
meta_rectangle_equal (&info->current, &monitor);
|
mtk_rectangle_equal (&info->current, &monitor);
|
||||||
if (check_only || constraint_already_satisfied)
|
if (check_only || constraint_already_satisfied)
|
||||||
return constraint_already_satisfied;
|
return constraint_already_satisfied;
|
||||||
|
|
||||||
|
@ -2813,7 +2813,7 @@ meta_window_is_monitor_sized (MetaWindow *window)
|
|||||||
meta_window_get_frame_rect (window, &window_rect);
|
meta_window_get_frame_rect (window, &window_rect);
|
||||||
meta_display_get_monitor_geometry (window->display, window->monitor->number, &monitor_rect);
|
meta_display_get_monitor_geometry (window->display, window->monitor->number, &monitor_rect);
|
||||||
|
|
||||||
if (meta_rectangle_equal (&window_rect, &monitor_rect))
|
if (mtk_rectangle_equal (&window_rect, &monitor_rect))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1032,7 +1032,7 @@ strut_lists_equal (GSList *l,
|
|||||||
MetaStrut *b = m->data;
|
MetaStrut *b = m->data;
|
||||||
|
|
||||||
if (a->side != b->side ||
|
if (a->side != b->side ||
|
||||||
!meta_rectangle_equal (&a->rect, &b->rect))
|
!mtk_rectangle_equal (&a->rect, &b->rect))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -122,10 +122,6 @@ gboolean meta_rectangle_intersect (const MetaRectangle *src1,
|
|||||||
const MetaRectangle *src2,
|
const MetaRectangle *src2,
|
||||||
MetaRectangle *dest);
|
MetaRectangle *dest);
|
||||||
|
|
||||||
META_EXPORT
|
|
||||||
gboolean meta_rectangle_equal (const MetaRectangle *src1,
|
|
||||||
const MetaRectangle *src2);
|
|
||||||
|
|
||||||
/* Find the bounding box of the union of two rectangles */
|
/* Find the bounding box of the union of two rectangles */
|
||||||
META_EXPORT
|
META_EXPORT
|
||||||
void meta_rectangle_union (const MetaRectangle *rect1,
|
void meta_rectangle_union (const MetaRectangle *rect1,
|
||||||
|
@ -143,7 +143,7 @@ test_intersect (void)
|
|||||||
|
|
||||||
meta_rectangle_intersect (&a, &b, &temp);
|
meta_rectangle_intersect (&a, &b, &temp);
|
||||||
temp2 = meta_rect (100, 200, 10, 2);
|
temp2 = meta_rect (100, 200, 10, 2);
|
||||||
g_assert (meta_rectangle_equal (&temp, &temp2));
|
g_assert (mtk_rectangle_equal (&temp, &temp2));
|
||||||
g_assert (meta_rectangle_area (&temp) == 20);
|
g_assert (meta_rectangle_area (&temp) == 20);
|
||||||
|
|
||||||
meta_rectangle_intersect (&a, &c, &temp);
|
meta_rectangle_intersect (&a, &c, &temp);
|
||||||
@ -153,7 +153,7 @@ test_intersect (void)
|
|||||||
g_assert (meta_rectangle_area (&temp) == 0);
|
g_assert (meta_rectangle_area (&temp) == 0);
|
||||||
|
|
||||||
meta_rectangle_intersect (&b, &d, &b);
|
meta_rectangle_intersect (&b, &d, &b);
|
||||||
g_assert (meta_rectangle_equal (&b, &b_intersect_d));
|
g_assert (mtk_rectangle_equal (&b, &b_intersect_d));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -166,11 +166,11 @@ test_equal (void)
|
|||||||
MetaRectangle e = {10, 62, 4, 18};
|
MetaRectangle e = {10, 62, 4, 18};
|
||||||
MetaRectangle f = {27, 12, 4, 18};
|
MetaRectangle f = {27, 12, 4, 18};
|
||||||
|
|
||||||
g_assert ( meta_rectangle_equal (&a, &b));
|
g_assert ( mtk_rectangle_equal (&a, &b));
|
||||||
g_assert (!meta_rectangle_equal (&a, &c));
|
g_assert (!mtk_rectangle_equal (&a, &c));
|
||||||
g_assert (!meta_rectangle_equal (&a, &d));
|
g_assert (!mtk_rectangle_equal (&a, &d));
|
||||||
g_assert (!meta_rectangle_equal (&a, &e));
|
g_assert (!mtk_rectangle_equal (&a, &e));
|
||||||
g_assert (!meta_rectangle_equal (&a, &f));
|
g_assert (!mtk_rectangle_equal (&a, &f));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -855,35 +855,35 @@ test_clipping_to_region (void)
|
|||||||
meta_rectangle_clip_to_region (region,
|
meta_rectangle_clip_to_region (region,
|
||||||
fixed_directions,
|
fixed_directions,
|
||||||
&rect);
|
&rect);
|
||||||
g_assert (meta_rectangle_equal (region->data, &rect));
|
g_assert (mtk_rectangle_equal (region->data, &rect));
|
||||||
|
|
||||||
rect = meta_rect (300, 1000, 400, 200);
|
rect = meta_rect (300, 1000, 400, 200);
|
||||||
temp = meta_rect (300, 1000, 400, 150);
|
temp = meta_rect (300, 1000, 400, 150);
|
||||||
meta_rectangle_clip_to_region (region,
|
meta_rectangle_clip_to_region (region,
|
||||||
fixed_directions,
|
fixed_directions,
|
||||||
&rect);
|
&rect);
|
||||||
g_assert (meta_rectangle_equal (&rect, &temp));
|
g_assert (mtk_rectangle_equal (&rect, &temp));
|
||||||
|
|
||||||
rect = meta_rect (400, 1000, 300, 200);
|
rect = meta_rect (400, 1000, 300, 200);
|
||||||
temp = meta_rect (450, 1000, 250, 200);
|
temp = meta_rect (450, 1000, 250, 200);
|
||||||
meta_rectangle_clip_to_region (region,
|
meta_rectangle_clip_to_region (region,
|
||||||
fixed_directions,
|
fixed_directions,
|
||||||
&rect);
|
&rect);
|
||||||
g_assert (meta_rectangle_equal (&rect, &temp));
|
g_assert (mtk_rectangle_equal (&rect, &temp));
|
||||||
|
|
||||||
rect = meta_rect (400, 1000, 300, 200);
|
rect = meta_rect (400, 1000, 300, 200);
|
||||||
temp = meta_rect (400, 1000, 300, 150);
|
temp = meta_rect (400, 1000, 300, 150);
|
||||||
meta_rectangle_clip_to_region (region,
|
meta_rectangle_clip_to_region (region,
|
||||||
FIXED_DIRECTION_X,
|
FIXED_DIRECTION_X,
|
||||||
&rect);
|
&rect);
|
||||||
g_assert (meta_rectangle_equal (&rect, &temp));
|
g_assert (mtk_rectangle_equal (&rect, &temp));
|
||||||
|
|
||||||
rect = meta_rect (400, 1000, 300, 200);
|
rect = meta_rect (400, 1000, 300, 200);
|
||||||
temp = meta_rect (400, 1000, 300, 150);
|
temp = meta_rect (400, 1000, 300, 150);
|
||||||
meta_rectangle_clip_to_region (region,
|
meta_rectangle_clip_to_region (region,
|
||||||
FIXED_DIRECTION_X,
|
FIXED_DIRECTION_X,
|
||||||
&rect);
|
&rect);
|
||||||
g_assert (meta_rectangle_equal (&rect, &temp));
|
g_assert (mtk_rectangle_equal (&rect, &temp));
|
||||||
|
|
||||||
meta_rectangle_free_list_and_elements (region);
|
meta_rectangle_free_list_and_elements (region);
|
||||||
}
|
}
|
||||||
@ -916,42 +916,42 @@ test_shoving_into_region (void)
|
|||||||
meta_rectangle_shove_into_region (region,
|
meta_rectangle_shove_into_region (region,
|
||||||
fixed_directions,
|
fixed_directions,
|
||||||
&rect);
|
&rect);
|
||||||
g_assert (meta_rectangle_equal (&rect, &temp));
|
g_assert (mtk_rectangle_equal (&rect, &temp));
|
||||||
|
|
||||||
rect = meta_rect (425, 1000, 300, 200);
|
rect = meta_rect (425, 1000, 300, 200);
|
||||||
temp = meta_rect (450, 1000, 300, 200);
|
temp = meta_rect (450, 1000, 300, 200);
|
||||||
meta_rectangle_shove_into_region (region,
|
meta_rectangle_shove_into_region (region,
|
||||||
fixed_directions,
|
fixed_directions,
|
||||||
&rect);
|
&rect);
|
||||||
g_assert (meta_rectangle_equal (&rect, &temp));
|
g_assert (mtk_rectangle_equal (&rect, &temp));
|
||||||
|
|
||||||
rect = meta_rect (425, 1000, 300, 200);
|
rect = meta_rect (425, 1000, 300, 200);
|
||||||
temp = meta_rect (425, 950, 300, 200);
|
temp = meta_rect (425, 950, 300, 200);
|
||||||
meta_rectangle_shove_into_region (region,
|
meta_rectangle_shove_into_region (region,
|
||||||
FIXED_DIRECTION_X,
|
FIXED_DIRECTION_X,
|
||||||
&rect);
|
&rect);
|
||||||
g_assert (meta_rectangle_equal (&rect, &temp));
|
g_assert (mtk_rectangle_equal (&rect, &temp));
|
||||||
|
|
||||||
rect = meta_rect ( 300, 1000, 400, 200);
|
rect = meta_rect ( 300, 1000, 400, 200);
|
||||||
temp = meta_rect (1200, 1000, 400, 200);
|
temp = meta_rect (1200, 1000, 400, 200);
|
||||||
meta_rectangle_shove_into_region (region,
|
meta_rectangle_shove_into_region (region,
|
||||||
FIXED_DIRECTION_Y,
|
FIXED_DIRECTION_Y,
|
||||||
&rect);
|
&rect);
|
||||||
g_assert (meta_rectangle_equal (&rect, &temp));
|
g_assert (mtk_rectangle_equal (&rect, &temp));
|
||||||
|
|
||||||
rect = meta_rect ( 800, 1150, 400, 50); /* Completely "offscreen" :) */
|
rect = meta_rect ( 800, 1150, 400, 50); /* Completely "offscreen" :) */
|
||||||
temp = meta_rect ( 800, 1050, 400, 50);
|
temp = meta_rect ( 800, 1050, 400, 50);
|
||||||
meta_rectangle_shove_into_region (region,
|
meta_rectangle_shove_into_region (region,
|
||||||
0,
|
0,
|
||||||
&rect);
|
&rect);
|
||||||
g_assert (meta_rectangle_equal (&rect, &temp));
|
g_assert (mtk_rectangle_equal (&rect, &temp));
|
||||||
|
|
||||||
rect = meta_rect (-1000, 0, 400, 150); /* Offscreen in 2 directions */
|
rect = meta_rect (-1000, 0, 400, 150); /* Offscreen in 2 directions */
|
||||||
temp = meta_rect ( 0, 20, 400, 150);
|
temp = meta_rect ( 0, 20, 400, 150);
|
||||||
meta_rectangle_shove_into_region (region,
|
meta_rectangle_shove_into_region (region,
|
||||||
0,
|
0,
|
||||||
&rect);
|
&rect);
|
||||||
g_assert (meta_rectangle_equal (&rect, &temp));
|
g_assert (mtk_rectangle_equal (&rect, &temp));
|
||||||
|
|
||||||
meta_rectangle_free_list_and_elements (region);
|
meta_rectangle_free_list_and_elements (region);
|
||||||
}
|
}
|
||||||
@ -966,7 +966,7 @@ verify_edge_lists_are_equal (GList *code, GList *answer)
|
|||||||
MetaEdge *a = code->data;
|
MetaEdge *a = code->data;
|
||||||
MetaEdge *b = answer->data;
|
MetaEdge *b = answer->data;
|
||||||
|
|
||||||
if (!meta_rectangle_equal (&a->rect, &b->rect) ||
|
if (!mtk_rectangle_equal (&a->rect, &b->rect) ||
|
||||||
a->side_type != b->side_type ||
|
a->side_type != b->side_type ||
|
||||||
a->edge_type != b->edge_type)
|
a->edge_type != b->edge_type)
|
||||||
{
|
{
|
||||||
@ -1236,7 +1236,7 @@ test_gravity_resize (void)
|
|||||||
META_GRAVITY_NORTH_WEST,
|
META_GRAVITY_NORTH_WEST,
|
||||||
20,
|
20,
|
||||||
5);
|
5);
|
||||||
g_assert (meta_rectangle_equal (&rect, &temp));
|
g_assert (mtk_rectangle_equal (&rect, &temp));
|
||||||
|
|
||||||
rect = meta_rect ( 50, 300, 250, 400);
|
rect = meta_rect ( 50, 300, 250, 400);
|
||||||
temp = meta_rect (165, 300, 20, 5);
|
temp = meta_rect (165, 300, 20, 5);
|
||||||
@ -1245,7 +1245,7 @@ test_gravity_resize (void)
|
|||||||
META_GRAVITY_NORTH,
|
META_GRAVITY_NORTH,
|
||||||
20,
|
20,
|
||||||
5);
|
5);
|
||||||
g_assert (meta_rectangle_equal (&rect, &temp));
|
g_assert (mtk_rectangle_equal (&rect, &temp));
|
||||||
|
|
||||||
rect = meta_rect ( 50, 300, 250, 400);
|
rect = meta_rect ( 50, 300, 250, 400);
|
||||||
temp = meta_rect (280, 300, 20, 5);
|
temp = meta_rect (280, 300, 20, 5);
|
||||||
@ -1254,7 +1254,7 @@ test_gravity_resize (void)
|
|||||||
META_GRAVITY_NORTH_EAST,
|
META_GRAVITY_NORTH_EAST,
|
||||||
20,
|
20,
|
||||||
5);
|
5);
|
||||||
g_assert (meta_rectangle_equal (&rect, &temp));
|
g_assert (mtk_rectangle_equal (&rect, &temp));
|
||||||
|
|
||||||
rect = meta_rect ( 50, 300, 250, 400);
|
rect = meta_rect ( 50, 300, 250, 400);
|
||||||
temp = meta_rect ( 50, 695, 50, 5);
|
temp = meta_rect ( 50, 695, 50, 5);
|
||||||
@ -1263,7 +1263,7 @@ test_gravity_resize (void)
|
|||||||
META_GRAVITY_SOUTH_WEST,
|
META_GRAVITY_SOUTH_WEST,
|
||||||
50,
|
50,
|
||||||
5);
|
5);
|
||||||
g_assert (meta_rectangle_equal (&rect, &temp));
|
g_assert (mtk_rectangle_equal (&rect, &temp));
|
||||||
|
|
||||||
rect = meta_rect ( 50, 300, 250, 400);
|
rect = meta_rect ( 50, 300, 250, 400);
|
||||||
temp = meta_rect (150, 695, 50, 5);
|
temp = meta_rect (150, 695, 50, 5);
|
||||||
@ -1272,7 +1272,7 @@ test_gravity_resize (void)
|
|||||||
META_GRAVITY_SOUTH,
|
META_GRAVITY_SOUTH,
|
||||||
50,
|
50,
|
||||||
5);
|
5);
|
||||||
g_assert (meta_rectangle_equal (&rect, &temp));
|
g_assert (mtk_rectangle_equal (&rect, &temp));
|
||||||
|
|
||||||
rect = meta_rect ( 50, 300, 250, 400);
|
rect = meta_rect ( 50, 300, 250, 400);
|
||||||
temp = meta_rect (250, 695, 50, 5);
|
temp = meta_rect (250, 695, 50, 5);
|
||||||
@ -1281,7 +1281,7 @@ test_gravity_resize (void)
|
|||||||
META_GRAVITY_SOUTH_EAST,
|
META_GRAVITY_SOUTH_EAST,
|
||||||
50,
|
50,
|
||||||
5);
|
5);
|
||||||
g_assert (meta_rectangle_equal (&rect, &temp));
|
g_assert (mtk_rectangle_equal (&rect, &temp));
|
||||||
|
|
||||||
rect = meta_rect (167, 738, 237, 843);
|
rect = meta_rect (167, 738, 237, 843);
|
||||||
temp = meta_rect (167, 1113, 832, 93);
|
temp = meta_rect (167, 1113, 832, 93);
|
||||||
@ -1290,7 +1290,7 @@ test_gravity_resize (void)
|
|||||||
META_GRAVITY_WEST,
|
META_GRAVITY_WEST,
|
||||||
832,
|
832,
|
||||||
93);
|
93);
|
||||||
g_assert (meta_rectangle_equal (&rect, &temp));
|
g_assert (mtk_rectangle_equal (&rect, &temp));
|
||||||
|
|
||||||
rect = meta_rect ( 167, 738, 237, 843);
|
rect = meta_rect ( 167, 738, 237, 843);
|
||||||
temp = meta_rect (-131, 1113, 833, 93);
|
temp = meta_rect (-131, 1113, 833, 93);
|
||||||
@ -1299,7 +1299,7 @@ test_gravity_resize (void)
|
|||||||
META_GRAVITY_CENTER,
|
META_GRAVITY_CENTER,
|
||||||
832,
|
832,
|
||||||
93);
|
93);
|
||||||
g_assert (meta_rectangle_equal (&rect, &temp));
|
g_assert (mtk_rectangle_equal (&rect, &temp));
|
||||||
|
|
||||||
rect = meta_rect (300, 1000, 400, 200);
|
rect = meta_rect (300, 1000, 400, 200);
|
||||||
temp = meta_rect (270, 994, 430, 212);
|
temp = meta_rect (270, 994, 430, 212);
|
||||||
@ -1308,7 +1308,7 @@ test_gravity_resize (void)
|
|||||||
META_GRAVITY_EAST,
|
META_GRAVITY_EAST,
|
||||||
430,
|
430,
|
||||||
211);
|
211);
|
||||||
g_assert (meta_rectangle_equal (&rect, &temp));
|
g_assert (mtk_rectangle_equal (&rect, &temp));
|
||||||
|
|
||||||
rect = meta_rect (300, 1000, 400, 200);
|
rect = meta_rect (300, 1000, 400, 200);
|
||||||
temp = meta_rect (300, 1000, 430, 211);
|
temp = meta_rect (300, 1000, 430, 211);
|
||||||
@ -1317,7 +1317,7 @@ test_gravity_resize (void)
|
|||||||
META_GRAVITY_STATIC,
|
META_GRAVITY_STATIC,
|
||||||
430,
|
430,
|
||||||
211);
|
211);
|
||||||
g_assert (meta_rectangle_equal (&rect, &temp));
|
g_assert (mtk_rectangle_equal (&rect, &temp));
|
||||||
}
|
}
|
||||||
|
|
||||||
#define EPSILON 0.000000001
|
#define EPSILON 0.000000001
|
||||||
|
@ -216,7 +216,7 @@ logical_monitor_from_layout (MetaMonitorManager *monitor_manager,
|
|||||||
{
|
{
|
||||||
MetaLogicalMonitor *logical_monitor = l->data;
|
MetaLogicalMonitor *logical_monitor = l->data;
|
||||||
|
|
||||||
if (meta_rectangle_equal (layout, &logical_monitor->rect))
|
if (mtk_rectangle_equal (layout, &logical_monitor->rect))
|
||||||
return logical_monitor;
|
return logical_monitor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -142,8 +142,8 @@ check_monitor_store_configuration (MetaMonitorConfigStore *config_store,
|
|||||||
GList *k;
|
GList *k;
|
||||||
int j;
|
int j;
|
||||||
|
|
||||||
g_assert (meta_rectangle_equal (&logical_monitor_config->layout,
|
g_assert (mtk_rectangle_equal (&logical_monitor_config->layout,
|
||||||
&config_expect->logical_monitors[i].layout));
|
&config_expect->logical_monitors[i].layout));
|
||||||
g_assert_cmpfloat (logical_monitor_config->scale,
|
g_assert_cmpfloat (logical_monitor_config->scale,
|
||||||
==,
|
==,
|
||||||
config_expect->logical_monitors[i].scale);
|
config_expect->logical_monitors[i].scale);
|
||||||
|
@ -100,7 +100,7 @@ assert_crtc_state_equals (const MetaKmsCrtcState *crtc_state1,
|
|||||||
const MetaKmsCrtcState *crtc_state2)
|
const MetaKmsCrtcState *crtc_state2)
|
||||||
{
|
{
|
||||||
g_assert_cmpint (crtc_state1->is_active, ==, crtc_state2->is_active);
|
g_assert_cmpint (crtc_state1->is_active, ==, crtc_state2->is_active);
|
||||||
g_assert (meta_rectangle_equal (&crtc_state1->rect, &crtc_state2->rect));
|
g_assert (mtk_rectangle_equal (&crtc_state1->rect, &crtc_state2->rect));
|
||||||
g_assert_cmpint (crtc_state1->is_drm_mode_valid,
|
g_assert_cmpint (crtc_state1->is_drm_mode_valid,
|
||||||
==,
|
==,
|
||||||
crtc_state2->is_drm_mode_valid);
|
crtc_state2->is_drm_mode_valid);
|
||||||
@ -297,7 +297,7 @@ meta_test_kms_device_mode_set (void)
|
|||||||
g_assert_true (crtc_state.is_active);
|
g_assert_true (crtc_state.is_active);
|
||||||
g_assert_true (crtc_state.is_drm_mode_valid);
|
g_assert_true (crtc_state.is_drm_mode_valid);
|
||||||
mode_rect = meta_get_mode_rect (mode);
|
mode_rect = meta_get_mode_rect (mode);
|
||||||
g_assert (meta_rectangle_equal (&crtc_state.rect, &mode_rect));
|
g_assert (mtk_rectangle_equal (&crtc_state.rect, &mode_rect));
|
||||||
|
|
||||||
g_assert_nonnull (meta_kms_connector_get_current_state (connector));
|
g_assert_nonnull (meta_kms_connector_get_current_state (connector));
|
||||||
connector_state =
|
connector_state =
|
||||||
|
@ -907,7 +907,7 @@ meta_wayland_xdg_toplevel_post_apply_state (MetaWaylandSurfaceRole *surface_rol
|
|||||||
surface_role_class->post_apply_state (surface_role, pending);
|
surface_role_class->post_apply_state (surface_role, pending);
|
||||||
|
|
||||||
window_geometry = meta_wayland_xdg_surface_get_window_geometry (xdg_surface);
|
window_geometry = meta_wayland_xdg_surface_get_window_geometry (xdg_surface);
|
||||||
geometry_changed = !meta_rectangle_equal (&old_geometry, &window_geometry);
|
geometry_changed = !mtk_rectangle_equal (&old_geometry, &window_geometry);
|
||||||
|
|
||||||
if (geometry_changed ||
|
if (geometry_changed ||
|
||||||
pending->derived.surface_size_changed ||
|
pending->derived.surface_size_changed ||
|
||||||
@ -1350,7 +1350,7 @@ meta_wayland_xdg_popup_post_apply_state (MetaWaylandSurfaceRole *surface_role,
|
|||||||
|
|
||||||
window_geometry = meta_wayland_xdg_surface_get_window_geometry (xdg_surface);
|
window_geometry = meta_wayland_xdg_surface_get_window_geometry (xdg_surface);
|
||||||
old_geometry = xdg_surface_priv->geometry;
|
old_geometry = xdg_surface_priv->geometry;
|
||||||
if (!meta_rectangle_equal (&old_geometry, &window_geometry) ||
|
if (!mtk_rectangle_equal (&old_geometry, &window_geometry) ||
|
||||||
pending->derived.surface_size_changed ||
|
pending->derived.surface_size_changed ||
|
||||||
pending->has_acked_configure_serial)
|
pending->has_acked_configure_serial)
|
||||||
meta_window_wayland_finish_move_resize (window, window_geometry, pending);
|
meta_window_wayland_finish_move_resize (window, window_geometry, pending);
|
||||||
@ -1805,7 +1805,7 @@ meta_wayland_xdg_surface_post_apply_state (MetaWaylandSurfaceRole *surface_role
|
|||||||
|
|
||||||
meta_wayland_shell_surface_calculate_geometry (shell_surface,
|
meta_wayland_shell_surface_calculate_geometry (shell_surface,
|
||||||
&new_geometry);
|
&new_geometry);
|
||||||
if (!meta_rectangle_equal (&new_geometry, &priv->geometry))
|
if (!mtk_rectangle_equal (&new_geometry, &priv->geometry))
|
||||||
{
|
{
|
||||||
pending->has_new_geometry = TRUE;
|
pending->has_new_geometry = TRUE;
|
||||||
priv->geometry = new_geometry;
|
priv->geometry = new_geometry;
|
||||||
|
@ -1247,7 +1247,7 @@ meta_xwayland_set_primary_output (MetaX11Display *x11_display)
|
|||||||
|
|
||||||
XRRFreeCrtcInfo (crtc_info);
|
XRRFreeCrtcInfo (crtc_info);
|
||||||
|
|
||||||
if (meta_rectangle_equal (&crtc_geometry, &primary_monitor->rect))
|
if (mtk_rectangle_equal (&crtc_geometry, &primary_monitor->rect))
|
||||||
{
|
{
|
||||||
XRRSetOutputPrimary (xdisplay, DefaultRootWindow (xdisplay),
|
XRRSetOutputPrimary (xdisplay, DefaultRootWindow (xdisplay),
|
||||||
output_id);
|
output_id);
|
||||||
|
@ -1694,7 +1694,7 @@ meta_window_x11_update_struts (MetaWindow *window)
|
|||||||
MetaStrut *new_strut = (MetaStrut*) new_iter->data;
|
MetaStrut *new_strut = (MetaStrut*) new_iter->data;
|
||||||
|
|
||||||
if (old_strut->side != new_strut->side ||
|
if (old_strut->side != new_strut->side ||
|
||||||
!meta_rectangle_equal (&old_strut->rect, &new_strut->rect))
|
!mtk_rectangle_equal (&old_strut->rect, &new_strut->rect))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
old_iter = old_iter->next;
|
old_iter = old_iter->next;
|
||||||
@ -2797,7 +2797,7 @@ meta_window_move_resize_request (MetaWindow *window,
|
|||||||
*/
|
*/
|
||||||
if (meta_prefs_get_force_fullscreen() &&
|
if (meta_prefs_get_force_fullscreen() &&
|
||||||
(window->decorated || !meta_window_is_client_decorated (window)) &&
|
(window->decorated || !meta_window_is_client_decorated (window)) &&
|
||||||
meta_rectangle_equal (&rect, &monitor_rect) &&
|
mtk_rectangle_equal (&rect, &monitor_rect) &&
|
||||||
window->has_fullscreen_func &&
|
window->has_fullscreen_func &&
|
||||||
!window->fullscreen)
|
!window->fullscreen)
|
||||||
{
|
{
|
||||||
@ -4266,7 +4266,7 @@ meta_window_x11_can_unredirect (MetaWindowX11 *window_x11)
|
|||||||
logical_monitor_layout =
|
logical_monitor_layout =
|
||||||
meta_logical_monitor_get_layout (logical_monitor);
|
meta_logical_monitor_get_layout (logical_monitor);
|
||||||
|
|
||||||
if (meta_rectangle_equal (&window_rect, &logical_monitor_layout))
|
if (mtk_rectangle_equal (&window_rect, &logical_monitor_layout))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user