mutter: Completely replace MetaRectangle with MtkRectangle
There are still various helpers that might be worth to move to mtk as well Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3128>
This commit is contained in:
parent
aec8e50df8
commit
3d693e8309
@ -173,7 +173,7 @@ meta_cursor_renderer_after_paint (ClutterStage *stage,
|
|||||||
if (priv->displayed_cursor && priv->needs_overlay)
|
if (priv->displayed_cursor && priv->needs_overlay)
|
||||||
{
|
{
|
||||||
graphene_rect_t rect;
|
graphene_rect_t rect;
|
||||||
MetaRectangle view_layout;
|
MtkRectangle view_layout;
|
||||||
graphene_rect_t view_rect;
|
graphene_rect_t view_rect;
|
||||||
|
|
||||||
rect = meta_cursor_renderer_calculate_rect (renderer,
|
rect = meta_cursor_renderer_calculate_rect (renderer,
|
||||||
|
@ -617,7 +617,7 @@ typedef enum
|
|||||||
} LineAdjacency;
|
} LineAdjacency;
|
||||||
|
|
||||||
static LineAdjacency
|
static LineAdjacency
|
||||||
get_barrier_adjacency (MetaRectangle *rect,
|
get_barrier_adjacency (MtkRectangle *rect,
|
||||||
int x1,
|
int x1,
|
||||||
int y1,
|
int y1,
|
||||||
int x2,
|
int x2,
|
||||||
@ -719,7 +719,7 @@ check_barrier (MetaInputCaptureSession *session,
|
|||||||
for (l = logical_monitors; l; l = l->next)
|
for (l = logical_monitors; l; l = l->next)
|
||||||
{
|
{
|
||||||
MetaLogicalMonitor *logical_monitor = l->data;
|
MetaLogicalMonitor *logical_monitor = l->data;
|
||||||
MetaRectangle layout;
|
MtkRectangle layout;
|
||||||
|
|
||||||
layout = meta_logical_monitor_get_layout (logical_monitor);
|
layout = meta_logical_monitor_get_layout (logical_monitor);
|
||||||
switch (get_barrier_adjacency (&layout, x1, y1, x2, y2, error))
|
switch (get_barrier_adjacency (&layout, x1, y1, x2, y2, error))
|
||||||
@ -877,7 +877,7 @@ handle_get_zones (MetaDBusInputCaptureSession *object,
|
|||||||
for (l = logical_monitors; l; l = l->next)
|
for (l = logical_monitors; l; l = l->next)
|
||||||
{
|
{
|
||||||
MetaLogicalMonitor *logical_monitor = l->data;
|
MetaLogicalMonitor *logical_monitor = l->data;
|
||||||
MetaRectangle layout;
|
MtkRectangle layout;
|
||||||
|
|
||||||
layout = meta_logical_monitor_get_layout (logical_monitor);
|
layout = meta_logical_monitor_get_layout (logical_monitor);
|
||||||
g_variant_builder_add (&zones_builder, "(uuii)",
|
g_variant_builder_add (&zones_builder, "(uuii)",
|
||||||
|
@ -912,7 +912,7 @@ handle_get_device_mapping (MetaDBusInputMapping *skeleton,
|
|||||||
|
|
||||||
if (logical_monitor)
|
if (logical_monitor)
|
||||||
{
|
{
|
||||||
MetaRectangle rect;
|
MtkRectangle rect;
|
||||||
|
|
||||||
rect = meta_logical_monitor_get_layout (logical_monitor);
|
rect = meta_logical_monitor_get_layout (logical_monitor);
|
||||||
g_dbus_method_invocation_return_value (invocation,
|
g_dbus_method_invocation_return_value (invocation,
|
||||||
|
@ -132,7 +132,7 @@ derive_monitor_transform (MetaMonitor *monitor)
|
|||||||
MetaLogicalMonitor *
|
MetaLogicalMonitor *
|
||||||
meta_logical_monitor_new_derived (MetaMonitorManager *monitor_manager,
|
meta_logical_monitor_new_derived (MetaMonitorManager *monitor_manager,
|
||||||
MetaMonitor *monitor,
|
MetaMonitor *monitor,
|
||||||
MetaRectangle *layout,
|
MtkRectangle *layout,
|
||||||
float scale,
|
float scale,
|
||||||
int monitor_number)
|
int monitor_number)
|
||||||
{
|
{
|
||||||
@ -214,7 +214,7 @@ meta_logical_monitor_get_transform (MetaLogicalMonitor *logical_monitor)
|
|||||||
return logical_monitor->transform;
|
return logical_monitor->transform;
|
||||||
}
|
}
|
||||||
|
|
||||||
MetaRectangle
|
MtkRectangle
|
||||||
meta_logical_monitor_get_layout (MetaLogicalMonitor *logical_monitor)
|
meta_logical_monitor_get_layout (MetaLogicalMonitor *logical_monitor)
|
||||||
{
|
{
|
||||||
return logical_monitor->rect;
|
return logical_monitor->rect;
|
||||||
|
@ -34,7 +34,7 @@ struct _MetaLogicalMonitor
|
|||||||
GObject parent;
|
GObject parent;
|
||||||
|
|
||||||
int number;
|
int number;
|
||||||
MetaRectangle rect;
|
MtkRectangle rect;
|
||||||
gboolean is_primary;
|
gboolean is_primary;
|
||||||
gboolean is_presentation; /* XXX: not yet used */
|
gboolean is_presentation; /* XXX: not yet used */
|
||||||
gboolean in_fullscreen;
|
gboolean in_fullscreen;
|
||||||
@ -71,7 +71,7 @@ MetaLogicalMonitor * meta_logical_monitor_new (MetaMonitorManager *monitor
|
|||||||
|
|
||||||
MetaLogicalMonitor * meta_logical_monitor_new_derived (MetaMonitorManager *monitor_manager,
|
MetaLogicalMonitor * meta_logical_monitor_new_derived (MetaMonitorManager *monitor_manager,
|
||||||
MetaMonitor *monitor,
|
MetaMonitor *monitor,
|
||||||
MetaRectangle *layout,
|
MtkRectangle *layout,
|
||||||
float scale,
|
float scale,
|
||||||
int monitor_number);
|
int monitor_number);
|
||||||
|
|
||||||
@ -88,7 +88,7 @@ float meta_logical_monitor_get_scale (MetaLogicalMonitor *logical_monitor);
|
|||||||
MetaMonitorTransform meta_logical_monitor_get_transform (MetaLogicalMonitor *logical_monitor);
|
MetaMonitorTransform meta_logical_monitor_get_transform (MetaLogicalMonitor *logical_monitor);
|
||||||
|
|
||||||
META_EXPORT_TEST
|
META_EXPORT_TEST
|
||||||
MetaRectangle meta_logical_monitor_get_layout (MetaLogicalMonitor *logical_monitor);
|
MtkRectangle meta_logical_monitor_get_layout (MetaLogicalMonitor *logical_monitor);
|
||||||
|
|
||||||
META_EXPORT_TEST
|
META_EXPORT_TEST
|
||||||
GList * meta_logical_monitor_get_monitors (MetaLogicalMonitor *logical_monitor);
|
GList * meta_logical_monitor_get_monitors (MetaLogicalMonitor *logical_monitor);
|
||||||
|
@ -773,7 +773,7 @@ create_preferred_logical_monitor_config (MetaMonitorManager *monitor_ma
|
|||||||
|
|
||||||
logical_monitor_config = g_new0 (MetaLogicalMonitorConfig, 1);
|
logical_monitor_config = g_new0 (MetaLogicalMonitorConfig, 1);
|
||||||
*logical_monitor_config = (MetaLogicalMonitorConfig) {
|
*logical_monitor_config = (MetaLogicalMonitorConfig) {
|
||||||
.layout = (MetaRectangle) {
|
.layout = (MtkRectangle) {
|
||||||
.x = x,
|
.x = x,
|
||||||
.y = y,
|
.y = y,
|
||||||
.width = width,
|
.width = width,
|
||||||
@ -898,7 +898,7 @@ verify_suggested_monitors_config (GList *logical_monitor_configs)
|
|||||||
for (l = logical_monitor_configs; l; l = l->next)
|
for (l = logical_monitor_configs; l; l = l->next)
|
||||||
{
|
{
|
||||||
MetaLogicalMonitorConfig *logical_monitor_config = l->data;
|
MetaLogicalMonitorConfig *logical_monitor_config = l->data;
|
||||||
MetaRectangle *rect = &logical_monitor_config->layout;
|
MtkRectangle *rect = &logical_monitor_config->layout;
|
||||||
|
|
||||||
if (meta_rectangle_overlaps_with_region (region, rect))
|
if (meta_rectangle_overlaps_with_region (region, rect))
|
||||||
{
|
{
|
||||||
@ -912,7 +912,7 @@ verify_suggested_monitors_config (GList *logical_monitor_configs)
|
|||||||
|
|
||||||
for (l = region; region->next && l; l = l->next)
|
for (l = region; region->next && l; l = l->next)
|
||||||
{
|
{
|
||||||
MetaRectangle *rect = l->data;
|
MtkRectangle *rect = l->data;
|
||||||
|
|
||||||
if (!meta_rectangle_is_adjacent_to_any_in_region (region, rect))
|
if (!meta_rectangle_is_adjacent_to_any_in_region (region, rect))
|
||||||
{
|
{
|
||||||
@ -1351,12 +1351,7 @@ create_for_switch_config_all_mirror (MetaMonitorConfigManager *config_manager)
|
|||||||
|
|
||||||
logical_monitor_config = g_new0 (MetaLogicalMonitorConfig, 1);
|
logical_monitor_config = g_new0 (MetaLogicalMonitorConfig, 1);
|
||||||
*logical_monitor_config = (MetaLogicalMonitorConfig) {
|
*logical_monitor_config = (MetaLogicalMonitorConfig) {
|
||||||
.layout = (MetaRectangle) {
|
.layout = MTK_RECTANGLE_INIT (0, 0, width, height),
|
||||||
.x = 0,
|
|
||||||
.y = 0,
|
|
||||||
.width = width,
|
|
||||||
.height = height
|
|
||||||
},
|
|
||||||
.scale = best_scale,
|
.scale = best_scale,
|
||||||
.monitor_configs = monitor_configs,
|
.monitor_configs = monitor_configs,
|
||||||
.is_primary = TRUE,
|
.is_primary = TRUE,
|
||||||
|
@ -37,7 +37,7 @@ typedef struct _MetaMonitorConfig
|
|||||||
|
|
||||||
typedef struct _MetaLogicalMonitorConfig
|
typedef struct _MetaLogicalMonitorConfig
|
||||||
{
|
{
|
||||||
MetaRectangle layout;
|
MtkRectangle layout;
|
||||||
GList *monitor_configs;
|
GList *monitor_configs;
|
||||||
MetaMonitorTransform transform;
|
MetaMonitorTransform transform;
|
||||||
float scale;
|
float scale;
|
||||||
|
@ -67,7 +67,7 @@ typedef struct
|
|||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
gboolean enabled;
|
gboolean enabled;
|
||||||
MetaRectangle rect;
|
MtkRectangle rect;
|
||||||
float refresh_rate;
|
float refresh_rate;
|
||||||
MetaMonitorTransform transform;
|
MetaMonitorTransform transform;
|
||||||
|
|
||||||
@ -720,7 +720,7 @@ try_derive_tiled_monitor_config (MetaLegacyMonitorsConfig *config,
|
|||||||
MetaOutputKey *output_key,
|
MetaOutputKey *output_key,
|
||||||
MetaOutputConfig *output_config,
|
MetaOutputConfig *output_config,
|
||||||
MetaMonitorConfigStore *config_store,
|
MetaMonitorConfigStore *config_store,
|
||||||
MetaRectangle *out_layout,
|
MtkRectangle *out_layout,
|
||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
MonitorTile top_left_tile = { 0 };
|
MonitorTile top_left_tile = { 0 };
|
||||||
@ -752,7 +752,7 @@ try_derive_tiled_monitor_config (MetaLegacyMonitorsConfig *config,
|
|||||||
{
|
{
|
||||||
MetaOutputKey *other_output_key = &config->keys[i];
|
MetaOutputKey *other_output_key = &config->keys[i];
|
||||||
MetaOutputConfig *other_output_config = &config->outputs[i];
|
MetaOutputConfig *other_output_config = &config->outputs[i];
|
||||||
MetaRectangle *rect;
|
MtkRectangle *rect;
|
||||||
|
|
||||||
if (strcmp (output_key->vendor, other_output_key->vendor) != 0 ||
|
if (strcmp (output_key->vendor, other_output_key->vendor) != 0 ||
|
||||||
strcmp (output_key->product, other_output_key->product) != 0 ||
|
strcmp (output_key->product, other_output_key->product) != 0 ||
|
||||||
@ -871,7 +871,7 @@ try_derive_tiled_monitor_config (MetaLegacyMonitorsConfig *config,
|
|||||||
if (!monitor_config)
|
if (!monitor_config)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
*out_layout = (MetaRectangle) {
|
*out_layout = (MtkRectangle) {
|
||||||
.x = min_x,
|
.x = min_x,
|
||||||
.y = min_y,
|
.y = min_y,
|
||||||
.width = max_x - min_x,
|
.width = max_x - min_x,
|
||||||
@ -884,7 +884,7 @@ try_derive_tiled_monitor_config (MetaLegacyMonitorsConfig *config,
|
|||||||
static MetaMonitorConfig *
|
static MetaMonitorConfig *
|
||||||
derive_monitor_config (MetaOutputKey *output_key,
|
derive_monitor_config (MetaOutputKey *output_key,
|
||||||
MetaOutputConfig *output_config,
|
MetaOutputConfig *output_config,
|
||||||
MetaRectangle *out_layout,
|
MtkRectangle *out_layout,
|
||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
int mode_width;
|
int mode_width;
|
||||||
@ -916,7 +916,7 @@ derive_monitor_config (MetaOutputKey *output_key,
|
|||||||
static MetaLogicalMonitorConfig *
|
static MetaLogicalMonitorConfig *
|
||||||
ensure_logical_monitor (GList **logical_monitor_configs,
|
ensure_logical_monitor (GList **logical_monitor_configs,
|
||||||
MetaOutputConfig *output_config,
|
MetaOutputConfig *output_config,
|
||||||
MetaRectangle *layout)
|
MtkRectangle *layout)
|
||||||
{
|
{
|
||||||
MetaLogicalMonitorConfig *new_logical_monitor_config;
|
MetaLogicalMonitorConfig *new_logical_monitor_config;
|
||||||
GList *l;
|
GList *l;
|
||||||
@ -957,7 +957,7 @@ derive_logical_monitor_configs (MetaLegacyMonitorsConfig *config,
|
|||||||
MetaOutputKey *output_key = &config->keys[i];
|
MetaOutputKey *output_key = &config->keys[i];
|
||||||
MetaOutputConfig *output_config = &config->outputs[i];
|
MetaOutputConfig *output_config = &config->outputs[i];
|
||||||
MetaMonitorConfig *monitor_config = NULL;
|
MetaMonitorConfig *monitor_config = NULL;
|
||||||
MetaRectangle layout;
|
MtkRectangle layout;
|
||||||
MetaLogicalMonitorConfig *logical_monitor_config;
|
MetaLogicalMonitorConfig *logical_monitor_config;
|
||||||
|
|
||||||
if (!output_config->enabled)
|
if (!output_config->enabled)
|
||||||
|
@ -290,10 +290,10 @@ MetaLogicalMonitor *meta_monitor_manager_get_logical_monitor_at (MetaMonitorMana
|
|||||||
float y);
|
float y);
|
||||||
|
|
||||||
MetaLogicalMonitor *meta_monitor_manager_get_logical_monitor_from_rect (MetaMonitorManager *manager,
|
MetaLogicalMonitor *meta_monitor_manager_get_logical_monitor_from_rect (MetaMonitorManager *manager,
|
||||||
MetaRectangle *rect);
|
MtkRectangle *rect);
|
||||||
|
|
||||||
MetaLogicalMonitor *meta_monitor_manager_get_highest_scale_monitor_from_rect (MetaMonitorManager *manager,
|
MetaLogicalMonitor *meta_monitor_manager_get_highest_scale_monitor_from_rect (MetaMonitorManager *manager,
|
||||||
MetaRectangle *rect);
|
MtkRectangle *rect);
|
||||||
|
|
||||||
MetaLogicalMonitor *meta_monitor_manager_get_logical_monitor_neighbor (MetaMonitorManager *manager,
|
MetaLogicalMonitor *meta_monitor_manager_get_logical_monitor_neighbor (MetaMonitorManager *manager,
|
||||||
MetaLogicalMonitor *logical_monitor,
|
MetaLogicalMonitor *logical_monitor,
|
||||||
|
@ -169,7 +169,7 @@ is_main_tiled_monitor_output (MetaOutput *output)
|
|||||||
static MetaLogicalMonitor *
|
static MetaLogicalMonitor *
|
||||||
logical_monitor_from_layout (MetaMonitorManager *manager,
|
logical_monitor_from_layout (MetaMonitorManager *manager,
|
||||||
GList *logical_monitors,
|
GList *logical_monitors,
|
||||||
MetaRectangle *layout)
|
MtkRectangle *layout)
|
||||||
{
|
{
|
||||||
GList *l;
|
GList *l;
|
||||||
|
|
||||||
@ -318,7 +318,7 @@ derive_calculated_global_scale (MetaMonitorManager *manager)
|
|||||||
static float
|
static float
|
||||||
derive_scale_from_config (MetaMonitorManager *manager,
|
derive_scale_from_config (MetaMonitorManager *manager,
|
||||||
MetaMonitorsConfig *config,
|
MetaMonitorsConfig *config,
|
||||||
MetaRectangle *layout)
|
MtkRectangle *layout)
|
||||||
{
|
{
|
||||||
GList *l;
|
GList *l;
|
||||||
|
|
||||||
@ -364,7 +364,7 @@ meta_monitor_manager_rebuild_logical_monitors_derived (MetaMonitorManager *manag
|
|||||||
{
|
{
|
||||||
MetaMonitor *monitor = l->data;
|
MetaMonitor *monitor = l->data;
|
||||||
MetaLogicalMonitor *logical_monitor;
|
MetaLogicalMonitor *logical_monitor;
|
||||||
MetaRectangle layout;
|
MtkRectangle layout;
|
||||||
|
|
||||||
if (!meta_monitor_is_active (monitor))
|
if (!meta_monitor_is_active (monitor))
|
||||||
continue;
|
continue;
|
||||||
@ -3349,7 +3349,7 @@ meta_monitor_manager_get_logical_monitor_at (MetaMonitorManager *manager,
|
|||||||
*/
|
*/
|
||||||
MetaLogicalMonitor *
|
MetaLogicalMonitor *
|
||||||
meta_monitor_manager_get_logical_monitor_from_rect (MetaMonitorManager *manager,
|
meta_monitor_manager_get_logical_monitor_from_rect (MetaMonitorManager *manager,
|
||||||
MetaRectangle *rect)
|
MtkRectangle *rect)
|
||||||
{
|
{
|
||||||
MetaLogicalMonitor *best_logical_monitor;
|
MetaLogicalMonitor *best_logical_monitor;
|
||||||
int best_logical_monitor_area;
|
int best_logical_monitor_area;
|
||||||
@ -3363,7 +3363,7 @@ meta_monitor_manager_get_logical_monitor_from_rect (MetaMonitorManager *manager,
|
|||||||
for (l = manager->logical_monitors; l; l = l->next)
|
for (l = manager->logical_monitors; l; l = l->next)
|
||||||
{
|
{
|
||||||
MetaLogicalMonitor *logical_monitor = l->data;
|
MetaLogicalMonitor *logical_monitor = l->data;
|
||||||
MetaRectangle intersection;
|
MtkRectangle intersection;
|
||||||
int intersection_area;
|
int intersection_area;
|
||||||
|
|
||||||
if (META_POINT_IN_RECT (center_x, center_y, logical_monitor->rect))
|
if (META_POINT_IN_RECT (center_x, center_y, logical_monitor->rect))
|
||||||
@ -3401,7 +3401,7 @@ meta_monitor_manager_get_logical_monitor_from_rect (MetaMonitorManager *manager,
|
|||||||
*/
|
*/
|
||||||
MetaLogicalMonitor *
|
MetaLogicalMonitor *
|
||||||
meta_monitor_manager_get_highest_scale_monitor_from_rect (MetaMonitorManager *manager,
|
meta_monitor_manager_get_highest_scale_monitor_from_rect (MetaMonitorManager *manager,
|
||||||
MetaRectangle *rect)
|
MtkRectangle *rect)
|
||||||
{
|
{
|
||||||
MetaLogicalMonitor *best_logical_monitor = NULL;
|
MetaLogicalMonitor *best_logical_monitor = NULL;
|
||||||
GList *l;
|
GList *l;
|
||||||
@ -3410,7 +3410,7 @@ meta_monitor_manager_get_highest_scale_monitor_from_rect (MetaMonitorManager *ma
|
|||||||
for (l = manager->logical_monitors; l; l = l->next)
|
for (l = manager->logical_monitors; l; l = l->next)
|
||||||
{
|
{
|
||||||
MetaLogicalMonitor *logical_monitor = l->data;
|
MetaLogicalMonitor *logical_monitor = l->data;
|
||||||
MetaRectangle intersection;
|
MtkRectangle intersection;
|
||||||
float scale;
|
float scale;
|
||||||
|
|
||||||
if (!mtk_rectangle_intersect (&logical_monitor->rect,
|
if (!mtk_rectangle_intersect (&logical_monitor->rect,
|
||||||
|
@ -453,7 +453,7 @@ meta_monitor_get_current_resolution (MetaMonitor *monitor,
|
|||||||
|
|
||||||
void
|
void
|
||||||
meta_monitor_derive_layout (MetaMonitor *monitor,
|
meta_monitor_derive_layout (MetaMonitor *monitor,
|
||||||
MetaRectangle *layout)
|
MtkRectangle *layout)
|
||||||
{
|
{
|
||||||
META_MONITOR_GET_CLASS (monitor)->derive_layout (monitor, layout);
|
META_MONITOR_GET_CLASS (monitor)->derive_layout (monitor, layout);
|
||||||
}
|
}
|
||||||
@ -844,7 +844,7 @@ meta_monitor_normal_get_main_output (MetaMonitor *monitor)
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
meta_monitor_normal_derive_layout (MetaMonitor *monitor,
|
meta_monitor_normal_derive_layout (MetaMonitor *monitor,
|
||||||
MetaRectangle *layout)
|
MtkRectangle *layout)
|
||||||
{
|
{
|
||||||
MetaOutput *output;
|
MetaOutput *output;
|
||||||
MetaCrtc *crtc;
|
MetaCrtc *crtc;
|
||||||
@ -1541,7 +1541,7 @@ meta_monitor_tiled_get_main_output (MetaMonitor *monitor)
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
meta_monitor_tiled_derive_layout (MetaMonitor *monitor,
|
meta_monitor_tiled_derive_layout (MetaMonitor *monitor,
|
||||||
MetaRectangle *layout)
|
MtkRectangle *layout)
|
||||||
{
|
{
|
||||||
MetaMonitorPrivate *monitor_priv =
|
MetaMonitorPrivate *monitor_priv =
|
||||||
meta_monitor_get_instance_private (monitor);
|
meta_monitor_get_instance_private (monitor);
|
||||||
@ -1574,7 +1574,7 @@ meta_monitor_tiled_derive_layout (MetaMonitor *monitor,
|
|||||||
max_y = MAX (crtc_layout->origin.y + crtc_layout->size.height, max_y);
|
max_y = MAX (crtc_layout->origin.y + crtc_layout->size.height, max_y);
|
||||||
}
|
}
|
||||||
|
|
||||||
*layout = (MetaRectangle) {
|
*layout = (MtkRectangle) {
|
||||||
.x = roundf (min_x),
|
.x = roundf (min_x),
|
||||||
.y = roundf (min_y),
|
.y = roundf (min_y),
|
||||||
.width = roundf (max_x - min_x),
|
.width = roundf (max_x - min_x),
|
||||||
|
@ -71,7 +71,7 @@ struct _MetaMonitorClass
|
|||||||
|
|
||||||
MetaOutput * (* get_main_output) (MetaMonitor *monitor);
|
MetaOutput * (* get_main_output) (MetaMonitor *monitor);
|
||||||
void (* derive_layout) (MetaMonitor *monitor,
|
void (* derive_layout) (MetaMonitor *monitor,
|
||||||
MetaRectangle *layout);
|
MtkRectangle *layout);
|
||||||
void (* calculate_crtc_pos) (MetaMonitor *monitor,
|
void (* calculate_crtc_pos) (MetaMonitor *monitor,
|
||||||
MetaMonitorMode *monitor_mode,
|
MetaMonitorMode *monitor_mode,
|
||||||
MetaOutput *output,
|
MetaOutput *output,
|
||||||
@ -136,7 +136,7 @@ void meta_monitor_get_current_resolution (MetaMonitor *monitor,
|
|||||||
int *height);
|
int *height);
|
||||||
|
|
||||||
void meta_monitor_derive_layout (MetaMonitor *monitor,
|
void meta_monitor_derive_layout (MetaMonitor *monitor,
|
||||||
MetaRectangle *layout);
|
MtkRectangle *layout);
|
||||||
|
|
||||||
META_EXPORT_TEST
|
META_EXPORT_TEST
|
||||||
void meta_monitor_get_physical_dimensions (MetaMonitor *monitor,
|
void meta_monitor_get_physical_dimensions (MetaMonitor *monitor,
|
||||||
|
@ -91,7 +91,7 @@ meta_screen_cast_area_stream_src_get_specs (MetaScreenCastStreamSrc *src,
|
|||||||
{
|
{
|
||||||
MetaScreenCastStream *stream = meta_screen_cast_stream_src_get_stream (src);
|
MetaScreenCastStream *stream = meta_screen_cast_stream_src_get_stream (src);
|
||||||
MetaScreenCastAreaStream *area_stream = META_SCREEN_CAST_AREA_STREAM (stream);
|
MetaScreenCastAreaStream *area_stream = META_SCREEN_CAST_AREA_STREAM (stream);
|
||||||
MetaRectangle *area;
|
MtkRectangle *area;
|
||||||
float scale;
|
float scale;
|
||||||
|
|
||||||
area = meta_screen_cast_area_stream_get_area (area_stream);
|
area = meta_screen_cast_area_stream_get_area (area_stream);
|
||||||
@ -113,7 +113,7 @@ is_cursor_in_stream (MetaScreenCastAreaStreamSrc *area_src)
|
|||||||
MetaBackend *backend = get_backend (area_src);
|
MetaBackend *backend = get_backend (area_src);
|
||||||
MetaCursorRenderer *cursor_renderer =
|
MetaCursorRenderer *cursor_renderer =
|
||||||
meta_backend_get_cursor_renderer (backend);
|
meta_backend_get_cursor_renderer (backend);
|
||||||
MetaRectangle *area;
|
MtkRectangle *area;
|
||||||
graphene_rect_t area_rect;
|
graphene_rect_t area_rect;
|
||||||
MetaCursorSprite *cursor_sprite;
|
MetaCursorSprite *cursor_sprite;
|
||||||
|
|
||||||
@ -275,7 +275,7 @@ stage_painted (MetaStage *stage,
|
|||||||
MetaScreenCastStream *stream = meta_screen_cast_stream_src_get_stream (src);
|
MetaScreenCastStream *stream = meta_screen_cast_stream_src_get_stream (src);
|
||||||
MetaScreenCastAreaStream *area_stream = META_SCREEN_CAST_AREA_STREAM (stream);
|
MetaScreenCastAreaStream *area_stream = META_SCREEN_CAST_AREA_STREAM (stream);
|
||||||
const cairo_region_t *redraw_clip;
|
const cairo_region_t *redraw_clip;
|
||||||
MetaRectangle *area;
|
MtkRectangle *area;
|
||||||
|
|
||||||
if (area_src->maybe_record_idle_id)
|
if (area_src->maybe_record_idle_id)
|
||||||
return;
|
return;
|
||||||
@ -308,7 +308,7 @@ add_view_painted_watches (MetaScreenCastAreaStreamSrc *area_src)
|
|||||||
MetaRenderer *renderer = meta_backend_get_renderer (backend);
|
MetaRenderer *renderer = meta_backend_get_renderer (backend);
|
||||||
ClutterStage *stage;
|
ClutterStage *stage;
|
||||||
MetaStage *meta_stage;
|
MetaStage *meta_stage;
|
||||||
MetaRectangle *area;
|
MtkRectangle *area;
|
||||||
GList *l;
|
GList *l;
|
||||||
|
|
||||||
stage = get_stage (area_src);
|
stage = get_stage (area_src);
|
||||||
@ -318,7 +318,7 @@ add_view_painted_watches (MetaScreenCastAreaStreamSrc *area_src)
|
|||||||
for (l = meta_renderer_get_views (renderer); l; l = l->next)
|
for (l = meta_renderer_get_views (renderer); l; l = l->next)
|
||||||
{
|
{
|
||||||
MetaRendererView *view = l->data;
|
MetaRendererView *view = l->data;
|
||||||
MetaRectangle view_layout;
|
MtkRectangle view_layout;
|
||||||
|
|
||||||
clutter_stage_view_get_layout (CLUTTER_STAGE_VIEW (view), &view_layout);
|
clutter_stage_view_get_layout (CLUTTER_STAGE_VIEW (view), &view_layout);
|
||||||
if (mtk_rectangle_overlap (area, &view_layout))
|
if (mtk_rectangle_overlap (area, &view_layout))
|
||||||
@ -466,7 +466,7 @@ meta_screen_cast_area_stream_src_record_to_buffer (MetaScreenCastStreamSrc *src
|
|||||||
MetaScreenCastStream *stream = meta_screen_cast_stream_src_get_stream (src);
|
MetaScreenCastStream *stream = meta_screen_cast_stream_src_get_stream (src);
|
||||||
MetaScreenCastAreaStream *area_stream = META_SCREEN_CAST_AREA_STREAM (stream);
|
MetaScreenCastAreaStream *area_stream = META_SCREEN_CAST_AREA_STREAM (stream);
|
||||||
ClutterStage *stage;
|
ClutterStage *stage;
|
||||||
MetaRectangle *area;
|
MtkRectangle *area;
|
||||||
float scale;
|
float scale;
|
||||||
ClutterPaintFlag paint_flags = CLUTTER_PAINT_FLAG_CLEAR;
|
ClutterPaintFlag paint_flags = CLUTTER_PAINT_FLAG_CLEAR;
|
||||||
|
|
||||||
@ -507,7 +507,7 @@ meta_screen_cast_area_stream_src_record_to_framebuffer (MetaScreenCastStreamSrc
|
|||||||
MetaScreenCastAreaStream *area_stream = META_SCREEN_CAST_AREA_STREAM (stream);
|
MetaScreenCastAreaStream *area_stream = META_SCREEN_CAST_AREA_STREAM (stream);
|
||||||
MetaBackend *backend = get_backend (area_src);
|
MetaBackend *backend = get_backend (area_src);
|
||||||
ClutterStage *stage;
|
ClutterStage *stage;
|
||||||
MetaRectangle *area;
|
MtkRectangle *area;
|
||||||
float scale;
|
float scale;
|
||||||
ClutterPaintFlag paint_flags = CLUTTER_PAINT_FLAG_CLEAR;
|
ClutterPaintFlag paint_flags = CLUTTER_PAINT_FLAG_CLEAR;
|
||||||
|
|
||||||
@ -561,7 +561,7 @@ meta_screen_cast_area_stream_src_set_cursor_metadata (MetaScreenCastStreamSrc *s
|
|||||||
MetaCursorTracker *cursor_tracker =
|
MetaCursorTracker *cursor_tracker =
|
||||||
meta_backend_get_cursor_tracker (backend);
|
meta_backend_get_cursor_tracker (backend);
|
||||||
MetaCursorSprite *cursor_sprite;
|
MetaCursorSprite *cursor_sprite;
|
||||||
MetaRectangle *area;
|
MtkRectangle *area;
|
||||||
float scale;
|
float scale;
|
||||||
graphene_point_t cursor_position;
|
graphene_point_t cursor_position;
|
||||||
int x, y;
|
int x, y;
|
||||||
|
@ -28,7 +28,7 @@ struct _MetaScreenCastAreaStream
|
|||||||
|
|
||||||
ClutterStage *stage;
|
ClutterStage *stage;
|
||||||
|
|
||||||
MetaRectangle area;
|
MtkRectangle area;
|
||||||
float scale;
|
float scale;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -42,7 +42,7 @@ meta_screen_cast_area_stream_get_stage (MetaScreenCastAreaStream *area_stream)
|
|||||||
return area_stream->stage;
|
return area_stream->stage;
|
||||||
}
|
}
|
||||||
|
|
||||||
MetaRectangle *
|
MtkRectangle *
|
||||||
meta_screen_cast_area_stream_get_area (MetaScreenCastAreaStream *area_stream)
|
meta_screen_cast_area_stream_get_area (MetaScreenCastAreaStream *area_stream)
|
||||||
{
|
{
|
||||||
return &area_stream->area;
|
return &area_stream->area;
|
||||||
@ -56,7 +56,7 @@ meta_screen_cast_area_stream_get_scale (MetaScreenCastAreaStream *area_stream)
|
|||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
calculate_scale (ClutterStage *stage,
|
calculate_scale (ClutterStage *stage,
|
||||||
MetaRectangle *area,
|
MtkRectangle *area,
|
||||||
float *out_scale)
|
float *out_scale)
|
||||||
{
|
{
|
||||||
GList *l;
|
GList *l;
|
||||||
@ -65,7 +65,7 @@ calculate_scale (ClutterStage *stage,
|
|||||||
for (l = clutter_stage_peek_stage_views (stage); l; l = l->next)
|
for (l = clutter_stage_peek_stage_views (stage); l; l = l->next)
|
||||||
{
|
{
|
||||||
ClutterStageView *stage_view = l->data;
|
ClutterStageView *stage_view = l->data;
|
||||||
MetaRectangle view_layout;
|
MtkRectangle view_layout;
|
||||||
|
|
||||||
clutter_stage_view_get_layout (stage_view, &view_layout);
|
clutter_stage_view_get_layout (stage_view, &view_layout);
|
||||||
if (mtk_rectangle_overlap (area, &view_layout))
|
if (mtk_rectangle_overlap (area, &view_layout))
|
||||||
@ -82,7 +82,7 @@ calculate_scale (ClutterStage *stage,
|
|||||||
MetaScreenCastAreaStream *
|
MetaScreenCastAreaStream *
|
||||||
meta_screen_cast_area_stream_new (MetaScreenCastSession *session,
|
meta_screen_cast_area_stream_new (MetaScreenCastSession *session,
|
||||||
GDBusConnection *connection,
|
GDBusConnection *connection,
|
||||||
MetaRectangle *area,
|
MtkRectangle *area,
|
||||||
ClutterStage *stage,
|
ClutterStage *stage,
|
||||||
MetaScreenCastCursorMode cursor_mode,
|
MetaScreenCastCursorMode cursor_mode,
|
||||||
MetaScreenCastFlag flags,
|
MetaScreenCastFlag flags,
|
||||||
|
@ -31,7 +31,7 @@ G_DECLARE_FINAL_TYPE (MetaScreenCastAreaStream,
|
|||||||
|
|
||||||
MetaScreenCastAreaStream * meta_screen_cast_area_stream_new (MetaScreenCastSession *session,
|
MetaScreenCastAreaStream * meta_screen_cast_area_stream_new (MetaScreenCastSession *session,
|
||||||
GDBusConnection *connection,
|
GDBusConnection *connection,
|
||||||
MetaRectangle *area,
|
MtkRectangle *area,
|
||||||
ClutterStage *stage,
|
ClutterStage *stage,
|
||||||
MetaScreenCastCursorMode cursor_mode,
|
MetaScreenCastCursorMode cursor_mode,
|
||||||
MetaScreenCastFlag flags,
|
MetaScreenCastFlag flags,
|
||||||
@ -39,6 +39,6 @@ MetaScreenCastAreaStream * meta_screen_cast_area_stream_new (MetaScreenCastSessi
|
|||||||
|
|
||||||
ClutterStage * meta_screen_cast_area_stream_get_stage (MetaScreenCastAreaStream *area_stream);
|
ClutterStage * meta_screen_cast_area_stream_get_stage (MetaScreenCastAreaStream *area_stream);
|
||||||
|
|
||||||
MetaRectangle * meta_screen_cast_area_stream_get_area (MetaScreenCastAreaStream *area_stream);
|
MtkRectangle * meta_screen_cast_area_stream_get_area (MetaScreenCastAreaStream *area_stream);
|
||||||
|
|
||||||
float meta_screen_cast_area_stream_get_scale (MetaScreenCastAreaStream *area_stream);
|
float meta_screen_cast_area_stream_get_scale (MetaScreenCastAreaStream *area_stream);
|
||||||
|
@ -226,7 +226,7 @@ is_cursor_in_stream (MetaScreenCastMonitorStreamSrc *monitor_src)
|
|||||||
meta_backend_get_cursor_renderer (backend);
|
meta_backend_get_cursor_renderer (backend);
|
||||||
MetaMonitor *monitor;
|
MetaMonitor *monitor;
|
||||||
MetaLogicalMonitor *logical_monitor;
|
MetaLogicalMonitor *logical_monitor;
|
||||||
MetaRectangle logical_monitor_layout;
|
MtkRectangle logical_monitor_layout;
|
||||||
graphene_rect_t logical_monitor_rect;
|
graphene_rect_t logical_monitor_rect;
|
||||||
MetaCursorSprite *cursor_sprite;
|
MetaCursorSprite *cursor_sprite;
|
||||||
|
|
||||||
@ -364,7 +364,7 @@ add_view_watches (MetaScreenCastMonitorStreamSrc *monitor_src,
|
|||||||
MetaStage *meta_stage;
|
MetaStage *meta_stage;
|
||||||
MetaMonitor *monitor;
|
MetaMonitor *monitor;
|
||||||
MetaLogicalMonitor *logical_monitor;
|
MetaLogicalMonitor *logical_monitor;
|
||||||
MetaRectangle logical_monitor_layout;
|
MtkRectangle logical_monitor_layout;
|
||||||
GList *l;
|
GList *l;
|
||||||
|
|
||||||
stage = get_stage (monitor_src);
|
stage = get_stage (monitor_src);
|
||||||
@ -376,7 +376,7 @@ add_view_watches (MetaScreenCastMonitorStreamSrc *monitor_src,
|
|||||||
for (l = meta_renderer_get_views (renderer); l; l = l->next)
|
for (l = meta_renderer_get_views (renderer); l; l = l->next)
|
||||||
{
|
{
|
||||||
MetaRendererView *view = l->data;
|
MetaRendererView *view = l->data;
|
||||||
MetaRectangle view_layout;
|
MtkRectangle view_layout;
|
||||||
|
|
||||||
clutter_stage_view_get_layout (CLUTTER_STAGE_VIEW (view), &view_layout);
|
clutter_stage_view_get_layout (CLUTTER_STAGE_VIEW (view), &view_layout);
|
||||||
if (mtk_rectangle_overlap (&logical_monitor_layout, &view_layout))
|
if (mtk_rectangle_overlap (&logical_monitor_layout, &view_layout))
|
||||||
@ -590,7 +590,7 @@ meta_screen_cast_monitor_stream_src_record_to_framebuffer (MetaScreenCastStreamS
|
|||||||
ClutterStage *stage = get_stage (monitor_src);
|
ClutterStage *stage = get_stage (monitor_src);
|
||||||
MetaMonitor *monitor;
|
MetaMonitor *monitor;
|
||||||
MetaLogicalMonitor *logical_monitor;
|
MetaLogicalMonitor *logical_monitor;
|
||||||
MetaRectangle logical_monitor_layout;
|
MtkRectangle logical_monitor_layout;
|
||||||
float view_scale;
|
float view_scale;
|
||||||
ClutterPaintFlag paint_flags = CLUTTER_PAINT_FLAG_CLEAR;
|
ClutterPaintFlag paint_flags = CLUTTER_PAINT_FLAG_CLEAR;
|
||||||
|
|
||||||
@ -635,7 +635,7 @@ meta_screen_cast_monitor_stream_record_follow_up (MetaScreenCastStreamSrc *src)
|
|||||||
ClutterStage *stage = get_stage (monitor_src);
|
ClutterStage *stage = get_stage (monitor_src);
|
||||||
MetaMonitor *monitor;
|
MetaMonitor *monitor;
|
||||||
MetaLogicalMonitor *logical_monitor;
|
MetaLogicalMonitor *logical_monitor;
|
||||||
MetaRectangle logical_monitor_layout;
|
MtkRectangle logical_monitor_layout;
|
||||||
GList *l;
|
GList *l;
|
||||||
|
|
||||||
g_clear_handle_id (&monitor_src->maybe_record_idle_id, g_source_remove);
|
g_clear_handle_id (&monitor_src->maybe_record_idle_id, g_source_remove);
|
||||||
@ -647,8 +647,8 @@ meta_screen_cast_monitor_stream_record_follow_up (MetaScreenCastStreamSrc *src)
|
|||||||
for (l = meta_renderer_get_views (renderer); l; l = l->next)
|
for (l = meta_renderer_get_views (renderer); l; l = l->next)
|
||||||
{
|
{
|
||||||
MetaRendererView *view = l->data;
|
MetaRendererView *view = l->data;
|
||||||
MetaRectangle view_layout;
|
MtkRectangle view_layout;
|
||||||
MetaRectangle damage;
|
MtkRectangle damage;
|
||||||
|
|
||||||
clutter_stage_view_get_layout (CLUTTER_STAGE_VIEW (view), &view_layout);
|
clutter_stage_view_get_layout (CLUTTER_STAGE_VIEW (view), &view_layout);
|
||||||
|
|
||||||
@ -679,7 +679,7 @@ meta_screen_cast_monitor_stream_src_set_cursor_metadata (MetaScreenCastStreamSrc
|
|||||||
MetaCursorSprite *cursor_sprite;
|
MetaCursorSprite *cursor_sprite;
|
||||||
MetaMonitor *monitor;
|
MetaMonitor *monitor;
|
||||||
MetaLogicalMonitor *logical_monitor;
|
MetaLogicalMonitor *logical_monitor;
|
||||||
MetaRectangle logical_monitor_layout;
|
MtkRectangle logical_monitor_layout;
|
||||||
graphene_rect_t logical_monitor_rect;
|
graphene_rect_t logical_monitor_rect;
|
||||||
float view_scale;
|
float view_scale;
|
||||||
graphene_point_t cursor_position;
|
graphene_point_t cursor_position;
|
||||||
|
@ -165,7 +165,7 @@ meta_screen_cast_monitor_stream_set_parameters (MetaScreenCastStream *stream,
|
|||||||
{
|
{
|
||||||
MetaScreenCastMonitorStream *monitor_stream =
|
MetaScreenCastMonitorStream *monitor_stream =
|
||||||
META_SCREEN_CAST_MONITOR_STREAM (stream);
|
META_SCREEN_CAST_MONITOR_STREAM (stream);
|
||||||
MetaRectangle logical_monitor_layout;
|
MtkRectangle logical_monitor_layout;
|
||||||
const char *output_name;
|
const char *output_name;
|
||||||
|
|
||||||
logical_monitor_layout =
|
logical_monitor_layout =
|
||||||
@ -197,7 +197,7 @@ meta_screen_cast_monitor_stream_transform_position (MetaScreenCastStream *stream
|
|||||||
MetaScreenCastMonitorStream *monitor_stream =
|
MetaScreenCastMonitorStream *monitor_stream =
|
||||||
META_SCREEN_CAST_MONITOR_STREAM (stream);
|
META_SCREEN_CAST_MONITOR_STREAM (stream);
|
||||||
MetaBackend *backend = meta_monitor_get_backend (monitor_stream->monitor);
|
MetaBackend *backend = meta_monitor_get_backend (monitor_stream->monitor);
|
||||||
MetaRectangle logical_monitor_layout;
|
MtkRectangle logical_monitor_layout;
|
||||||
double scale;
|
double scale;
|
||||||
|
|
||||||
logical_monitor_layout =
|
logical_monitor_layout =
|
||||||
|
@ -606,7 +606,7 @@ handle_record_area (MetaDBusScreenCastSession *skeleton,
|
|||||||
gboolean is_recording;
|
gboolean is_recording;
|
||||||
MetaScreenCastFlag flags;
|
MetaScreenCastFlag flags;
|
||||||
g_autoptr (GError) error = NULL;
|
g_autoptr (GError) error = NULL;
|
||||||
MetaRectangle rect;
|
MtkRectangle rect;
|
||||||
MetaScreenCastAreaStream *area_stream;
|
MetaScreenCastAreaStream *area_stream;
|
||||||
MetaScreenCastStream *stream;
|
MetaScreenCastStream *stream;
|
||||||
char *stream_path;
|
char *stream_path;
|
||||||
@ -646,7 +646,7 @@ handle_record_area (MetaDBusScreenCastSession *skeleton,
|
|||||||
if (is_recording)
|
if (is_recording)
|
||||||
flags |= META_SCREEN_CAST_FLAG_IS_RECORDING;
|
flags |= META_SCREEN_CAST_FLAG_IS_RECORDING;
|
||||||
|
|
||||||
rect = (MetaRectangle) {
|
rect = (MtkRectangle) {
|
||||||
.x = x,
|
.x = x,
|
||||||
.y = y,
|
.y = y,
|
||||||
.width = width,
|
.width = width,
|
||||||
|
@ -241,7 +241,7 @@ meta_screen_cast_stream_src_get_specs (MetaScreenCastStreamSrc *src,
|
|||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
meta_screen_cast_stream_src_get_videocrop (MetaScreenCastStreamSrc *src,
|
meta_screen_cast_stream_src_get_videocrop (MetaScreenCastStreamSrc *src,
|
||||||
MetaRectangle *crop_rect)
|
MtkRectangle *crop_rect)
|
||||||
{
|
{
|
||||||
MetaScreenCastStreamSrcClass *klass =
|
MetaScreenCastStreamSrcClass *klass =
|
||||||
META_SCREEN_CAST_STREAM_SRC_GET_CLASS (src);
|
META_SCREEN_CAST_STREAM_SRC_GET_CLASS (src);
|
||||||
@ -746,7 +746,7 @@ meta_screen_cast_stream_src_maybe_record_frame_with_timestamp (MetaScreenCastStr
|
|||||||
meta_screen_cast_stream_src_get_instance_private (src);
|
meta_screen_cast_stream_src_get_instance_private (src);
|
||||||
MetaScreenCastRecordResult record_result =
|
MetaScreenCastRecordResult record_result =
|
||||||
META_SCREEN_CAST_RECORD_RESULT_RECORDED_NOTHING;
|
META_SCREEN_CAST_RECORD_RESULT_RECORDED_NOTHING;
|
||||||
MetaRectangle crop_rect;
|
MtkRectangle crop_rect;
|
||||||
struct pw_buffer *buffer;
|
struct pw_buffer *buffer;
|
||||||
struct spa_buffer *spa_buffer;
|
struct spa_buffer *spa_buffer;
|
||||||
struct spa_meta_header *header;
|
struct spa_meta_header *header;
|
||||||
|
@ -75,7 +75,7 @@ struct _MetaScreenCastStreamSrcClass
|
|||||||
void (* record_follow_up) (MetaScreenCastStreamSrc *src);
|
void (* record_follow_up) (MetaScreenCastStreamSrc *src);
|
||||||
|
|
||||||
gboolean (* get_videocrop) (MetaScreenCastStreamSrc *src,
|
gboolean (* get_videocrop) (MetaScreenCastStreamSrc *src,
|
||||||
MetaRectangle *crop_rect);
|
MtkRectangle *crop_rect);
|
||||||
void (* set_cursor_metadata) (MetaScreenCastStreamSrc *src,
|
void (* set_cursor_metadata) (MetaScreenCastStreamSrc *src,
|
||||||
struct spa_meta_cursor *spa_meta_cursor);
|
struct spa_meta_cursor *spa_meta_cursor);
|
||||||
|
|
||||||
|
@ -360,7 +360,7 @@ meta_screen_cast_virtual_stream_src_record_to_buffer (MetaScreenCastStreamSrc *
|
|||||||
MetaScreenCastStream *stream;
|
MetaScreenCastStream *stream;
|
||||||
ClutterPaintFlag paint_flags;
|
ClutterPaintFlag paint_flags;
|
||||||
ClutterStageView *view;
|
ClutterStageView *view;
|
||||||
MetaRectangle view_rect;
|
MtkRectangle view_rect;
|
||||||
float scale;
|
float scale;
|
||||||
|
|
||||||
stream = meta_screen_cast_stream_src_get_stream (src);
|
stream = meta_screen_cast_stream_src_get_stream (src);
|
||||||
@ -419,7 +419,7 @@ meta_screen_cast_virtual_stream_src_record_to_framebuffer (MetaScreenCastStreamS
|
|||||||
static void
|
static void
|
||||||
meta_screen_cast_virtual_stream_record_follow_up (MetaScreenCastStreamSrc *src)
|
meta_screen_cast_virtual_stream_record_follow_up (MetaScreenCastStreamSrc *src)
|
||||||
{
|
{
|
||||||
MetaRectangle damage;
|
MtkRectangle damage;
|
||||||
|
|
||||||
clutter_stage_view_get_layout (view_from_src (src), &damage);
|
clutter_stage_view_get_layout (view_from_src (src), &damage);
|
||||||
damage.width = 1;
|
damage.width = 1;
|
||||||
@ -437,7 +437,7 @@ is_cursor_in_stream (MetaScreenCastVirtualStreamSrc *virtual_src)
|
|||||||
MetaCursorRenderer *cursor_renderer =
|
MetaCursorRenderer *cursor_renderer =
|
||||||
meta_backend_get_cursor_renderer (backend);
|
meta_backend_get_cursor_renderer (backend);
|
||||||
ClutterStageView *stage_view = view_from_src (src);
|
ClutterStageView *stage_view = view_from_src (src);
|
||||||
MetaRectangle view_layout;
|
MtkRectangle view_layout;
|
||||||
graphene_rect_t view_rect;
|
graphene_rect_t view_rect;
|
||||||
MetaCursorSprite *cursor_sprite;
|
MetaCursorSprite *cursor_sprite;
|
||||||
|
|
||||||
@ -478,7 +478,7 @@ meta_screen_cast_virtual_stream_src_set_cursor_metadata (MetaScreenCastStreamSrc
|
|||||||
meta_backend_get_cursor_tracker (backend);
|
meta_backend_get_cursor_tracker (backend);
|
||||||
MetaCursorSprite *cursor_sprite;
|
MetaCursorSprite *cursor_sprite;
|
||||||
ClutterStageView *stage_view;
|
ClutterStageView *stage_view;
|
||||||
MetaRectangle view_layout;
|
MtkRectangle view_layout;
|
||||||
float view_scale;
|
float view_scale;
|
||||||
graphene_rect_t view_rect;
|
graphene_rect_t view_rect;
|
||||||
graphene_point_t cursor_position;
|
graphene_point_t cursor_position;
|
||||||
|
@ -89,7 +89,7 @@ meta_screen_cast_virtual_stream_transform_position (MetaScreenCastStream *stream
|
|||||||
MetaScreenCastVirtualStreamSrc *virtual_src =
|
MetaScreenCastVirtualStreamSrc *virtual_src =
|
||||||
META_SCREEN_CAST_VIRTUAL_STREAM_SRC (src);
|
META_SCREEN_CAST_VIRTUAL_STREAM_SRC (src);
|
||||||
ClutterStageView *view;
|
ClutterStageView *view;
|
||||||
MetaRectangle view_layout;
|
MtkRectangle view_layout;
|
||||||
|
|
||||||
if (!meta_screen_cast_stream_src_is_enabled (src))
|
if (!meta_screen_cast_stream_src_is_enabled (src))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -109,7 +109,7 @@ get_stream_height (MetaScreenCastWindowStreamSrc *window_src)
|
|||||||
static void
|
static void
|
||||||
maybe_draw_cursor_sprite (MetaScreenCastWindowStreamSrc *window_src,
|
maybe_draw_cursor_sprite (MetaScreenCastWindowStreamSrc *window_src,
|
||||||
uint8_t *data,
|
uint8_t *data,
|
||||||
MetaRectangle *stream_rect)
|
MtkRectangle *stream_rect)
|
||||||
{
|
{
|
||||||
MetaScreenCastStreamSrc *src = META_SCREEN_CAST_STREAM_SRC (window_src);
|
MetaScreenCastStreamSrc *src = META_SCREEN_CAST_STREAM_SRC (window_src);
|
||||||
MetaBackend *backend = get_backend (window_src);
|
MetaBackend *backend = get_backend (window_src);
|
||||||
@ -192,7 +192,7 @@ maybe_draw_cursor_sprite (MetaScreenCastWindowStreamSrc *window_src,
|
|||||||
static void
|
static void
|
||||||
maybe_blit_cursor_sprite (MetaScreenCastWindowStreamSrc *window_src,
|
maybe_blit_cursor_sprite (MetaScreenCastWindowStreamSrc *window_src,
|
||||||
CoglFramebuffer *framebuffer,
|
CoglFramebuffer *framebuffer,
|
||||||
MetaRectangle *stream_rect)
|
MtkRectangle *stream_rect)
|
||||||
{
|
{
|
||||||
MetaBackend *backend = get_backend (window_src);
|
MetaBackend *backend = get_backend (window_src);
|
||||||
CoglContext *cogl_context =
|
CoglContext *cogl_context =
|
||||||
@ -266,10 +266,10 @@ capture_into (MetaScreenCastWindowStreamSrc *window_src,
|
|||||||
uint8_t *data)
|
uint8_t *data)
|
||||||
{
|
{
|
||||||
MetaScreenCastStreamSrc *src = META_SCREEN_CAST_STREAM_SRC (window_src);
|
MetaScreenCastStreamSrc *src = META_SCREEN_CAST_STREAM_SRC (window_src);
|
||||||
MetaRectangle stream_rect;
|
MtkRectangle stream_rect;
|
||||||
MetaScreenCastStream *stream;
|
MetaScreenCastStream *stream;
|
||||||
|
|
||||||
stream_rect = (MetaRectangle) {
|
stream_rect = (MtkRectangle) {
|
||||||
.width = width,
|
.width = width,
|
||||||
.height = height,
|
.height = height,
|
||||||
};
|
};
|
||||||
@ -309,11 +309,11 @@ meta_screen_cast_window_stream_src_get_specs (MetaScreenCastStreamSrc *src,
|
|||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
meta_screen_cast_window_stream_src_get_videocrop (MetaScreenCastStreamSrc *src,
|
meta_screen_cast_window_stream_src_get_videocrop (MetaScreenCastStreamSrc *src,
|
||||||
MetaRectangle *crop_rect)
|
MtkRectangle *crop_rect)
|
||||||
{
|
{
|
||||||
MetaScreenCastWindowStreamSrc *window_src =
|
MetaScreenCastWindowStreamSrc *window_src =
|
||||||
META_SCREEN_CAST_WINDOW_STREAM_SRC (src);
|
META_SCREEN_CAST_WINDOW_STREAM_SRC (src);
|
||||||
MetaRectangle stream_rect;
|
MtkRectangle stream_rect;
|
||||||
|
|
||||||
meta_screen_cast_window_get_buffer_bounds (window_src->screen_cast_window,
|
meta_screen_cast_window_get_buffer_bounds (window_src->screen_cast_window,
|
||||||
crop_rect);
|
crop_rect);
|
||||||
@ -511,7 +511,7 @@ meta_screen_cast_window_stream_src_record_to_framebuffer (MetaScreenCastStreamSr
|
|||||||
MetaScreenCastWindowStreamSrc *window_src =
|
MetaScreenCastWindowStreamSrc *window_src =
|
||||||
META_SCREEN_CAST_WINDOW_STREAM_SRC (src);
|
META_SCREEN_CAST_WINDOW_STREAM_SRC (src);
|
||||||
MetaScreenCastStream *stream;
|
MetaScreenCastStream *stream;
|
||||||
MetaRectangle stream_rect;
|
MtkRectangle stream_rect;
|
||||||
|
|
||||||
stream_rect.x = 0;
|
stream_rect.x = 0;
|
||||||
stream_rect.y = 0;
|
stream_rect.y = 0;
|
||||||
|
@ -29,7 +29,7 @@ meta_screen_cast_window_default_init (MetaScreenCastWindowInterface *iface)
|
|||||||
|
|
||||||
void
|
void
|
||||||
meta_screen_cast_window_get_buffer_bounds (MetaScreenCastWindow *screen_cast_window,
|
meta_screen_cast_window_get_buffer_bounds (MetaScreenCastWindow *screen_cast_window,
|
||||||
MetaRectangle *bounds)
|
MtkRectangle *bounds)
|
||||||
{
|
{
|
||||||
META_SCREEN_CAST_WINDOW_GET_IFACE (screen_cast_window)->get_buffer_bounds (screen_cast_window,
|
META_SCREEN_CAST_WINDOW_GET_IFACE (screen_cast_window)->get_buffer_bounds (screen_cast_window,
|
||||||
bounds);
|
bounds);
|
||||||
@ -70,7 +70,7 @@ meta_screen_cast_window_transform_cursor_position (MetaScreenCastWindow *screen_
|
|||||||
|
|
||||||
void
|
void
|
||||||
meta_screen_cast_window_capture_into (MetaScreenCastWindow *screen_cast_window,
|
meta_screen_cast_window_capture_into (MetaScreenCastWindow *screen_cast_window,
|
||||||
MetaRectangle *bounds,
|
MtkRectangle *bounds,
|
||||||
uint8_t *data)
|
uint8_t *data)
|
||||||
{
|
{
|
||||||
META_SCREEN_CAST_WINDOW_GET_IFACE (screen_cast_window)->capture_into (screen_cast_window,
|
META_SCREEN_CAST_WINDOW_GET_IFACE (screen_cast_window)->capture_into (screen_cast_window,
|
||||||
@ -80,7 +80,7 @@ meta_screen_cast_window_capture_into (MetaScreenCastWindow *screen_cast_window,
|
|||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
meta_screen_cast_window_blit_to_framebuffer (MetaScreenCastWindow *screen_cast_window,
|
meta_screen_cast_window_blit_to_framebuffer (MetaScreenCastWindow *screen_cast_window,
|
||||||
MetaRectangle *bounds,
|
MtkRectangle *bounds,
|
||||||
CoglFramebuffer *framebuffer)
|
CoglFramebuffer *framebuffer)
|
||||||
{
|
{
|
||||||
MetaScreenCastWindowInterface *iface =
|
MetaScreenCastWindowInterface *iface =
|
||||||
|
@ -35,7 +35,7 @@ struct _MetaScreenCastWindowInterface
|
|||||||
GTypeInterface parent_iface;
|
GTypeInterface parent_iface;
|
||||||
|
|
||||||
void (*get_buffer_bounds) (MetaScreenCastWindow *screen_cast_window,
|
void (*get_buffer_bounds) (MetaScreenCastWindow *screen_cast_window,
|
||||||
MetaRectangle *bounds);
|
MtkRectangle *bounds);
|
||||||
|
|
||||||
void (*transform_relative_position) (MetaScreenCastWindow *screen_cast_window,
|
void (*transform_relative_position) (MetaScreenCastWindow *screen_cast_window,
|
||||||
double x,
|
double x,
|
||||||
@ -51,11 +51,11 @@ struct _MetaScreenCastWindowInterface
|
|||||||
graphene_point_t *out_relative_cursor_position);
|
graphene_point_t *out_relative_cursor_position);
|
||||||
|
|
||||||
void (*capture_into) (MetaScreenCastWindow *screen_cast_window,
|
void (*capture_into) (MetaScreenCastWindow *screen_cast_window,
|
||||||
MetaRectangle *bounds,
|
MtkRectangle *bounds,
|
||||||
uint8_t *data);
|
uint8_t *data);
|
||||||
|
|
||||||
gboolean (*blit_to_framebuffer) (MetaScreenCastWindow *screen_cast_window,
|
gboolean (*blit_to_framebuffer) (MetaScreenCastWindow *screen_cast_window,
|
||||||
MetaRectangle *bounds,
|
MtkRectangle *bounds,
|
||||||
CoglFramebuffer *framebuffer);
|
CoglFramebuffer *framebuffer);
|
||||||
|
|
||||||
gboolean (*has_damage) (MetaScreenCastWindow *screen_cast_window);
|
gboolean (*has_damage) (MetaScreenCastWindow *screen_cast_window);
|
||||||
@ -65,7 +65,7 @@ struct _MetaScreenCastWindowInterface
|
|||||||
};
|
};
|
||||||
|
|
||||||
void meta_screen_cast_window_get_buffer_bounds (MetaScreenCastWindow *screen_cast_window,
|
void meta_screen_cast_window_get_buffer_bounds (MetaScreenCastWindow *screen_cast_window,
|
||||||
MetaRectangle *bounds);
|
MtkRectangle *bounds);
|
||||||
|
|
||||||
void meta_screen_cast_window_transform_relative_position (MetaScreenCastWindow *screen_cast_window,
|
void meta_screen_cast_window_transform_relative_position (MetaScreenCastWindow *screen_cast_window,
|
||||||
double x,
|
double x,
|
||||||
@ -81,11 +81,11 @@ gboolean meta_screen_cast_window_transform_cursor_position (MetaScreenCastWindow
|
|||||||
graphene_point_t *out_relative_cursor_position);
|
graphene_point_t *out_relative_cursor_position);
|
||||||
|
|
||||||
void meta_screen_cast_window_capture_into (MetaScreenCastWindow *screen_cast_window,
|
void meta_screen_cast_window_capture_into (MetaScreenCastWindow *screen_cast_window,
|
||||||
MetaRectangle *bounds,
|
MtkRectangle *bounds,
|
||||||
uint8_t *data);
|
uint8_t *data);
|
||||||
|
|
||||||
gboolean meta_screen_cast_window_blit_to_framebuffer (MetaScreenCastWindow *screen_cast_window,
|
gboolean meta_screen_cast_window_blit_to_framebuffer (MetaScreenCastWindow *screen_cast_window,
|
||||||
MetaRectangle *bounds,
|
MtkRectangle *bounds,
|
||||||
CoglFramebuffer *framebuffer);
|
CoglFramebuffer *framebuffer);
|
||||||
|
|
||||||
gboolean meta_screen_cast_window_has_damage (MetaScreenCastWindow *screen_cast_window);
|
gboolean meta_screen_cast_window_has_damage (MetaScreenCastWindow *screen_cast_window);
|
||||||
|
@ -27,7 +27,7 @@ typedef struct _ViewInfo ViewInfo;
|
|||||||
|
|
||||||
struct _ViewInfo
|
struct _ViewInfo
|
||||||
{
|
{
|
||||||
MetaRectangle rect;
|
MtkRectangle rect;
|
||||||
float scale;
|
float scale;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -265,7 +265,7 @@ meta_crtc_kms_assign_primary_plane (MetaCrtcKms *crtc_kms,
|
|||||||
const MetaCrtcConfig *crtc_config;
|
const MetaCrtcConfig *crtc_config;
|
||||||
const MetaCrtcModeInfo *crtc_mode_info;
|
const MetaCrtcModeInfo *crtc_mode_info;
|
||||||
MetaFixed16Rectangle src_rect;
|
MetaFixed16Rectangle src_rect;
|
||||||
MetaRectangle dst_rect;
|
MtkRectangle dst_rect;
|
||||||
MetaKmsAssignPlaneFlag flags;
|
MetaKmsAssignPlaneFlag flags;
|
||||||
MetaKmsCrtc *kms_crtc;
|
MetaKmsCrtc *kms_crtc;
|
||||||
MetaKmsDevice *kms_device;
|
MetaKmsDevice *kms_device;
|
||||||
@ -281,7 +281,7 @@ meta_crtc_kms_assign_primary_plane (MetaCrtcKms *crtc_kms,
|
|||||||
.width = meta_fixed_16_from_int (crtc_mode_info->width),
|
.width = meta_fixed_16_from_int (crtc_mode_info->width),
|
||||||
.height = meta_fixed_16_from_int (crtc_mode_info->height),
|
.height = meta_fixed_16_from_int (crtc_mode_info->height),
|
||||||
};
|
};
|
||||||
dst_rect = (MetaRectangle) {
|
dst_rect = (MtkRectangle) {
|
||||||
.x = 0,
|
.x = 0,
|
||||||
.y = 0,
|
.y = 0,
|
||||||
.width = crtc_mode_info->width,
|
.width = crtc_mode_info->width,
|
||||||
|
@ -247,7 +247,7 @@ meta_kms_crtc_read_state (MetaKmsCrtc *crtc,
|
|||||||
crtc->prop_table.props,
|
crtc->prop_table.props,
|
||||||
META_KMS_CRTC_N_PROPS);
|
META_KMS_CRTC_N_PROPS);
|
||||||
|
|
||||||
crtc_state.rect = (MetaRectangle) {
|
crtc_state.rect = (MtkRectangle) {
|
||||||
.x = drm_crtc->x,
|
.x = drm_crtc->x,
|
||||||
.y = drm_crtc->y,
|
.y = drm_crtc->y,
|
||||||
.width = drm_crtc->width,
|
.width = drm_crtc->width,
|
||||||
@ -311,7 +311,7 @@ meta_kms_crtc_update_state_in_impl (MetaKmsCrtc *crtc)
|
|||||||
if (!drm_crtc || !drm_props)
|
if (!drm_crtc || !drm_props)
|
||||||
{
|
{
|
||||||
crtc->current_state.is_active = FALSE;
|
crtc->current_state.is_active = FALSE;
|
||||||
crtc->current_state.rect = (MetaRectangle) { };
|
crtc->current_state.rect = (MtkRectangle) { };
|
||||||
crtc->current_state.is_drm_mode_valid = FALSE;
|
crtc->current_state.is_drm_mode_valid = FALSE;
|
||||||
changes = META_KMS_RESOURCE_CHANGE_FULL;
|
changes = META_KMS_RESOURCE_CHANGE_FULL;
|
||||||
goto out;
|
goto out;
|
||||||
@ -330,7 +330,7 @@ void
|
|||||||
meta_kms_crtc_disable_in_impl (MetaKmsCrtc *crtc)
|
meta_kms_crtc_disable_in_impl (MetaKmsCrtc *crtc)
|
||||||
{
|
{
|
||||||
crtc->current_state.is_active = FALSE;
|
crtc->current_state.is_active = FALSE;
|
||||||
crtc->current_state.rect = (MetaRectangle) { 0 };
|
crtc->current_state.rect = (MtkRectangle) { 0 };
|
||||||
crtc->current_state.is_drm_mode_valid = FALSE;
|
crtc->current_state.is_drm_mode_valid = FALSE;
|
||||||
crtc->current_state.drm_mode = (drmModeModeInfo) { 0 };
|
crtc->current_state.drm_mode = (drmModeModeInfo) { 0 };
|
||||||
}
|
}
|
||||||
@ -369,7 +369,7 @@ meta_kms_crtc_predict_state_in_impl (MetaKmsCrtc *crtc,
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
crtc->current_state.is_active = FALSE;
|
crtc->current_state.is_active = FALSE;
|
||||||
crtc->current_state.rect = (MetaRectangle) { 0 };
|
crtc->current_state.rect = (MtkRectangle) { 0 };
|
||||||
crtc->current_state.is_drm_mode_valid = FALSE;
|
crtc->current_state.is_drm_mode_valid = FALSE;
|
||||||
crtc->current_state.drm_mode = (drmModeModeInfo) { 0 };
|
crtc->current_state.drm_mode = (drmModeModeInfo) { 0 };
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,7 @@ typedef struct _MetaKmsCrtcState
|
|||||||
{
|
{
|
||||||
gboolean is_active;
|
gboolean is_active;
|
||||||
|
|
||||||
MetaRectangle rect;
|
MtkRectangle rect;
|
||||||
gboolean is_drm_mode_valid;
|
gboolean is_drm_mode_valid;
|
||||||
drmModeModeInfo drm_mode;
|
drmModeModeInfo drm_mode;
|
||||||
|
|
||||||
|
@ -371,7 +371,7 @@ maybe_update_cursor_plane (MetaKmsCursorManagerImpl *cursor_manager_impl,
|
|||||||
{
|
{
|
||||||
int width, height;
|
int width, height;
|
||||||
MetaFixed16Rectangle src_rect;
|
MetaFixed16Rectangle src_rect;
|
||||||
MetaRectangle dst_rect;
|
MtkRectangle dst_rect;
|
||||||
MetaKmsAssignPlaneFlag assign_plane_flags =
|
MetaKmsAssignPlaneFlag assign_plane_flags =
|
||||||
META_KMS_ASSIGN_PLANE_FLAG_NONE;
|
META_KMS_ASSIGN_PLANE_FLAG_NONE;
|
||||||
MetaKmsPlaneAssignment *plane_assignment;
|
MetaKmsPlaneAssignment *plane_assignment;
|
||||||
@ -395,7 +395,7 @@ maybe_update_cursor_plane (MetaKmsCursorManagerImpl *cursor_manager_impl,
|
|||||||
.width = meta_fixed_16_from_int (width),
|
.width = meta_fixed_16_from_int (width),
|
||||||
.height = meta_fixed_16_from_int (height),
|
.height = meta_fixed_16_from_int (height),
|
||||||
};
|
};
|
||||||
dst_rect = (MetaRectangle) {
|
dst_rect = (MtkRectangle) {
|
||||||
.x = round (cursor_rect.origin.x),
|
.x = round (cursor_rect.origin.x),
|
||||||
.y = round (cursor_rect.origin.y),
|
.y = round (cursor_rect.origin.y),
|
||||||
.width = round (cursor_rect.size.width),
|
.width = round (cursor_rect.size.width),
|
||||||
|
@ -60,7 +60,7 @@ typedef struct _MetaKmsPlaneAssignment
|
|||||||
MetaKmsPlane *plane;
|
MetaKmsPlane *plane;
|
||||||
MetaDrmBuffer *buffer;
|
MetaDrmBuffer *buffer;
|
||||||
MetaFixed16Rectangle src_rect;
|
MetaFixed16Rectangle src_rect;
|
||||||
MetaRectangle dst_rect;
|
MtkRectangle dst_rect;
|
||||||
MetaKmsAssignPlaneFlag flags;
|
MetaKmsAssignPlaneFlag flags;
|
||||||
MetaKmsFbDamage *fb_damage;
|
MetaKmsFbDamage *fb_damage;
|
||||||
MetaKmsPlaneRotation rotation;
|
MetaKmsPlaneRotation rotation;
|
||||||
|
@ -269,7 +269,7 @@ meta_kms_update_assign_plane (MetaKmsUpdate *update,
|
|||||||
MetaKmsPlane *plane,
|
MetaKmsPlane *plane,
|
||||||
MetaDrmBuffer *buffer,
|
MetaDrmBuffer *buffer,
|
||||||
MetaFixed16Rectangle src_rect,
|
MetaFixed16Rectangle src_rect,
|
||||||
MetaRectangle dst_rect,
|
MtkRectangle dst_rect,
|
||||||
MetaKmsAssignPlaneFlag flags)
|
MetaKmsAssignPlaneFlag flags)
|
||||||
{
|
{
|
||||||
MetaKmsPlaneAssignment *plane_assignment;
|
MetaKmsPlaneAssignment *plane_assignment;
|
||||||
|
@ -162,7 +162,7 @@ MetaKmsPlaneAssignment * meta_kms_update_assign_plane (MetaKmsUpdate *u
|
|||||||
MetaKmsPlane *plane,
|
MetaKmsPlane *plane,
|
||||||
MetaDrmBuffer *buffer,
|
MetaDrmBuffer *buffer,
|
||||||
MetaFixed16Rectangle src_rect,
|
MetaFixed16Rectangle src_rect,
|
||||||
MetaRectangle dst_rect,
|
MtkRectangle dst_rect,
|
||||||
MetaKmsAssignPlaneFlag flags);
|
MetaKmsAssignPlaneFlag flags);
|
||||||
|
|
||||||
MetaKmsPlaneAssignment * meta_kms_update_unassign_plane (MetaKmsUpdate *update,
|
MetaKmsPlaneAssignment * meta_kms_update_unassign_plane (MetaKmsUpdate *update,
|
||||||
@ -216,10 +216,10 @@ meta_fixed_16_to_double (MetaFixed16 fixed)
|
|||||||
return fixed / 65536.0;
|
return fixed / 65536.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline MetaRectangle
|
static inline MtkRectangle
|
||||||
meta_fixed_16_rectangle_to_rectangle (MetaFixed16Rectangle fixed_rect)
|
meta_fixed_16_rectangle_to_rectangle (MetaFixed16Rectangle fixed_rect)
|
||||||
{
|
{
|
||||||
return (MetaRectangle) {
|
return (MtkRectangle) {
|
||||||
.x = meta_fixed_16_to_int (fixed_rect.x),
|
.x = meta_fixed_16_to_int (fixed_rect.x),
|
||||||
.y = meta_fixed_16_to_int (fixed_rect.y),
|
.y = meta_fixed_16_to_int (fixed_rect.y),
|
||||||
.width = meta_fixed_16_to_int (fixed_rect.width),
|
.width = meta_fixed_16_to_int (fixed_rect.width),
|
||||||
|
@ -1103,7 +1103,7 @@ meta_renderer_native_queue_modes_reset (MetaRendererNative *renderer_native)
|
|||||||
META_ONSCREEN_NATIVE (framebuffer);
|
META_ONSCREEN_NATIVE (framebuffer);
|
||||||
MetaCrtc *crtc;
|
MetaCrtc *crtc;
|
||||||
MetaKmsCrtc *kms_crtc;
|
MetaKmsCrtc *kms_crtc;
|
||||||
MetaRectangle view_layout;
|
MtkRectangle view_layout;
|
||||||
float view_scale;
|
float view_scale;
|
||||||
MetaKmsCrtcLayout crtc_layout;
|
MetaKmsCrtcLayout crtc_layout;
|
||||||
|
|
||||||
@ -1320,7 +1320,7 @@ meta_renderer_native_create_view (MetaRenderer *renderer,
|
|||||||
float scale;
|
float scale;
|
||||||
int onscreen_width;
|
int onscreen_width;
|
||||||
int onscreen_height;
|
int onscreen_height;
|
||||||
MetaRectangle view_layout;
|
MtkRectangle view_layout;
|
||||||
MetaRendererViewNative *view_native;
|
MetaRendererViewNative *view_native;
|
||||||
EGLSurface egl_surface;
|
EGLSurface egl_surface;
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
|
@ -48,7 +48,7 @@ struct _MetaCrtcXrandr
|
|||||||
{
|
{
|
||||||
MetaCrtc parent;
|
MetaCrtc parent;
|
||||||
|
|
||||||
MetaRectangle rect;
|
MtkRectangle rect;
|
||||||
MetaMonitorTransform transform;
|
MetaMonitorTransform transform;
|
||||||
MetaCrtcMode *current_mode;
|
MetaCrtcMode *current_mode;
|
||||||
};
|
};
|
||||||
@ -254,7 +254,7 @@ meta_crtc_xrandr_new (MetaGpuXrandr *gpu_xrandr,
|
|||||||
panning = XRRGetPanning (xdisplay, resources, crtc_id);
|
panning = XRRGetPanning (xdisplay, resources, crtc_id);
|
||||||
if (panning && panning->width > 0 && panning->height > 0)
|
if (panning && panning->width > 0 && panning->height > 0)
|
||||||
{
|
{
|
||||||
crtc_xrandr->rect = (MetaRectangle) {
|
crtc_xrandr->rect = (MtkRectangle) {
|
||||||
.x = panning->left,
|
.x = panning->left,
|
||||||
.y = panning->top,
|
.y = panning->top,
|
||||||
.width = panning->width,
|
.width = panning->width,
|
||||||
@ -263,7 +263,7 @@ meta_crtc_xrandr_new (MetaGpuXrandr *gpu_xrandr,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
crtc_xrandr->rect = (MetaRectangle) {
|
crtc_xrandr->rect = (MtkRectangle) {
|
||||||
.x = xrandr_crtc->x,
|
.x = xrandr_crtc->x,
|
||||||
.y = xrandr_crtc->y,
|
.y = xrandr_crtc->y,
|
||||||
.width = xrandr_crtc->width,
|
.width = xrandr_crtc->width,
|
||||||
|
@ -105,7 +105,7 @@ meta_renderer_x11_nested_create_view (MetaRenderer *renderer,
|
|||||||
int width, height;
|
int width, height;
|
||||||
CoglOffscreen *fake_onscreen;
|
CoglOffscreen *fake_onscreen;
|
||||||
CoglOffscreen *offscreen;
|
CoglOffscreen *offscreen;
|
||||||
MetaRectangle view_layout;
|
MtkRectangle view_layout;
|
||||||
const MetaCrtcModeInfo *mode_info;
|
const MetaCrtcModeInfo *mode_info;
|
||||||
MetaRendererView *view;
|
MetaRendererView *view;
|
||||||
|
|
||||||
|
@ -126,8 +126,8 @@ void meta_compositor_switch_workspace (MetaCompositor *compositor,
|
|||||||
void meta_compositor_size_change_window (MetaCompositor *compositor,
|
void meta_compositor_size_change_window (MetaCompositor *compositor,
|
||||||
MetaWindow *window,
|
MetaWindow *window,
|
||||||
MetaSizeChange which_change,
|
MetaSizeChange which_change,
|
||||||
MetaRectangle *old_frame_rect,
|
MtkRectangle *old_frame_rect,
|
||||||
MetaRectangle *old_buffer_rect);
|
MtkRectangle *old_buffer_rect);
|
||||||
|
|
||||||
void meta_compositor_sync_window_geometry (MetaCompositor *compositor,
|
void meta_compositor_sync_window_geometry (MetaCompositor *compositor,
|
||||||
MetaWindow *window,
|
MetaWindow *window,
|
||||||
@ -148,7 +148,7 @@ void meta_compositor_flash_display (MetaCompositor *compositor,
|
|||||||
|
|
||||||
void meta_compositor_show_tile_preview (MetaCompositor *compositor,
|
void meta_compositor_show_tile_preview (MetaCompositor *compositor,
|
||||||
MetaWindow *window,
|
MetaWindow *window,
|
||||||
MetaRectangle *tile_rect,
|
MtkRectangle *tile_rect,
|
||||||
int tile_monitor_number);
|
int tile_monitor_number);
|
||||||
|
|
||||||
void meta_compositor_hide_tile_preview (MetaCompositor *compositor);
|
void meta_compositor_hide_tile_preview (MetaCompositor *compositor);
|
||||||
|
@ -623,8 +623,8 @@ void
|
|||||||
meta_compositor_size_change_window (MetaCompositor *compositor,
|
meta_compositor_size_change_window (MetaCompositor *compositor,
|
||||||
MetaWindow *window,
|
MetaWindow *window,
|
||||||
MetaSizeChange which_change,
|
MetaSizeChange which_change,
|
||||||
MetaRectangle *old_frame_rect,
|
MtkRectangle *old_frame_rect,
|
||||||
MetaRectangle *old_buffer_rect)
|
MtkRectangle *old_buffer_rect)
|
||||||
{
|
{
|
||||||
MetaWindowActor *window_actor = meta_window_actor_from_window (window);
|
MetaWindowActor *window_actor = meta_window_actor_from_window (window);
|
||||||
|
|
||||||
@ -769,8 +769,8 @@ update_top_window_actor (MetaCompositor *compositor)
|
|||||||
{
|
{
|
||||||
MetaWindowActor *window_actor = l->data;
|
MetaWindowActor *window_actor = l->data;
|
||||||
MetaWindow *window = meta_window_actor_get_meta_window (window_actor);
|
MetaWindow *window = meta_window_actor_get_meta_window (window_actor);
|
||||||
MetaRectangle buffer_rect;
|
MtkRectangle buffer_rect;
|
||||||
MetaRectangle display_rect = { 0 };
|
MtkRectangle display_rect = { 0 };
|
||||||
|
|
||||||
if (!window->visible_to_compositor)
|
if (!window->visible_to_compositor)
|
||||||
continue;
|
continue;
|
||||||
@ -1515,7 +1515,7 @@ meta_compositor_monotonic_to_high_res_xserver_time (MetaCompositor *compositor,
|
|||||||
void
|
void
|
||||||
meta_compositor_show_tile_preview (MetaCompositor *compositor,
|
meta_compositor_show_tile_preview (MetaCompositor *compositor,
|
||||||
MetaWindow *window,
|
MetaWindow *window,
|
||||||
MetaRectangle *tile_rect,
|
MtkRectangle *tile_rect,
|
||||||
int tile_monitor_number)
|
int tile_monitor_number)
|
||||||
{
|
{
|
||||||
MetaCompositorPrivate *priv =
|
MetaCompositorPrivate *priv =
|
||||||
|
@ -168,7 +168,7 @@ static int
|
|||||||
find_nearest_position (const GArray *edges,
|
find_nearest_position (const GArray *edges,
|
||||||
int position,
|
int position,
|
||||||
int old_position,
|
int old_position,
|
||||||
const MetaRectangle *new_rect,
|
const MtkRectangle *new_rect,
|
||||||
gboolean horizontal,
|
gboolean horizontal,
|
||||||
gboolean only_forward)
|
gboolean only_forward)
|
||||||
{
|
{
|
||||||
@ -303,8 +303,8 @@ static int
|
|||||||
apply_edge_resistance (MetaWindow *window,
|
apply_edge_resistance (MetaWindow *window,
|
||||||
int old_pos,
|
int old_pos,
|
||||||
int new_pos,
|
int new_pos,
|
||||||
const MetaRectangle *old_rect,
|
const MtkRectangle *old_rect,
|
||||||
const MetaRectangle *new_rect,
|
const MtkRectangle *new_rect,
|
||||||
GArray *edges,
|
GArray *edges,
|
||||||
gboolean xdir,
|
gboolean xdir,
|
||||||
gboolean include_windows,
|
gboolean include_windows,
|
||||||
@ -418,7 +418,7 @@ apply_edge_resistance (MetaWindow *window,
|
|||||||
static int
|
static int
|
||||||
apply_edge_snapping (int old_pos,
|
apply_edge_snapping (int old_pos,
|
||||||
int new_pos,
|
int new_pos,
|
||||||
const MetaRectangle *new_rect,
|
const MtkRectangle *new_rect,
|
||||||
GArray *edges,
|
GArray *edges,
|
||||||
gboolean xdir,
|
gboolean xdir,
|
||||||
gboolean keyboard_op)
|
gboolean keyboard_op)
|
||||||
@ -460,12 +460,12 @@ apply_edge_snapping (int old_pos,
|
|||||||
static gboolean
|
static gboolean
|
||||||
apply_edge_resistance_to_each_side (MetaEdgeResistanceData *edge_data,
|
apply_edge_resistance_to_each_side (MetaEdgeResistanceData *edge_data,
|
||||||
MetaWindow *window,
|
MetaWindow *window,
|
||||||
const MetaRectangle *old_outer,
|
const MtkRectangle *old_outer,
|
||||||
MetaRectangle *new_outer,
|
MtkRectangle *new_outer,
|
||||||
MetaEdgeResistanceFlags flags,
|
MetaEdgeResistanceFlags flags,
|
||||||
gboolean is_resize)
|
gboolean is_resize)
|
||||||
{
|
{
|
||||||
MetaRectangle modified_rect;
|
MtkRectangle 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;
|
||||||
@ -510,7 +510,7 @@ apply_edge_resistance_to_each_side (MetaEdgeResistanceData *edge_data,
|
|||||||
}
|
}
|
||||||
else if (auto_snap && META_WINDOW_TILED_SIDE_BY_SIDE (window))
|
else if (auto_snap && META_WINDOW_TILED_SIDE_BY_SIDE (window))
|
||||||
{
|
{
|
||||||
MetaRectangle workarea;
|
MtkRectangle workarea;
|
||||||
guint i;
|
guint i;
|
||||||
|
|
||||||
const gfloat tile_edges[] =
|
const gfloat tile_edges[] =
|
||||||
@ -918,8 +918,8 @@ compute_resistance_and_snapping_edges (MetaWindowDrag *window_drag)
|
|||||||
MetaWindow *cur_window = cur_window_iter->data;
|
MetaWindow *cur_window = cur_window_iter->data;
|
||||||
if (WINDOW_EDGES_RELEVANT (cur_window, display))
|
if (WINDOW_EDGES_RELEVANT (cur_window, display))
|
||||||
{
|
{
|
||||||
MetaRectangle *new_rect;
|
MtkRectangle *new_rect;
|
||||||
new_rect = g_new (MetaRectangle, 1);
|
new_rect = g_new (MtkRectangle, 1);
|
||||||
meta_window_get_frame_rect (cur_window, new_rect);
|
meta_window_get_frame_rect (cur_window, new_rect);
|
||||||
obscuring_windows = g_slist_prepend (obscuring_windows, new_rect);
|
obscuring_windows = g_slist_prepend (obscuring_windows, new_rect);
|
||||||
window_stacking =
|
window_stacking =
|
||||||
@ -943,7 +943,7 @@ compute_resistance_and_snapping_edges (MetaWindowDrag *window_drag)
|
|||||||
cur_window_iter = stacked_windows;
|
cur_window_iter = stacked_windows;
|
||||||
while (cur_window_iter != NULL)
|
while (cur_window_iter != NULL)
|
||||||
{
|
{
|
||||||
MetaRectangle cur_rect;
|
MtkRectangle cur_rect;
|
||||||
MetaWindow *cur_window = cur_window_iter->data;
|
MetaWindow *cur_window = cur_window_iter->data;
|
||||||
meta_window_get_frame_rect (cur_window, &cur_rect);
|
meta_window_get_frame_rect (cur_window, &cur_rect);
|
||||||
|
|
||||||
@ -956,8 +956,8 @@ compute_resistance_and_snapping_edges (MetaWindowDrag *window_drag)
|
|||||||
{
|
{
|
||||||
GList *new_edges;
|
GList *new_edges;
|
||||||
MetaEdge *new_edge;
|
MetaEdge *new_edge;
|
||||||
MetaRectangle display_rect = { 0 };
|
MtkRectangle display_rect = { 0 };
|
||||||
MetaRectangle reduced;
|
MtkRectangle reduced;
|
||||||
|
|
||||||
meta_display_get_size (display,
|
meta_display_get_size (display,
|
||||||
&display_rect.width, &display_rect.height);
|
&display_rect.width, &display_rect.height);
|
||||||
@ -1098,7 +1098,7 @@ meta_window_drag_edge_resistance_for_move (MetaWindowDrag *window_drag,
|
|||||||
MetaEdgeResistanceFlags flags)
|
MetaEdgeResistanceFlags flags)
|
||||||
{
|
{
|
||||||
MetaEdgeResistanceData *edge_data;
|
MetaEdgeResistanceData *edge_data;
|
||||||
MetaRectangle old_outer, proposed_outer, new_outer;
|
MtkRectangle old_outer, proposed_outer, new_outer;
|
||||||
gboolean is_resize, is_keyboard_op, snap;
|
gboolean is_resize, is_keyboard_op, snap;
|
||||||
MetaWindow *window;
|
MetaWindow *window;
|
||||||
|
|
||||||
@ -1130,7 +1130,7 @@ meta_window_drag_edge_resistance_for_move (MetaWindowDrag *window_drag,
|
|||||||
* just have both edges move according to the stricter of the
|
* just have both edges move according to the stricter of the
|
||||||
* resistances. Same thing goes for top & bottom edges.
|
* resistances. Same thing goes for top & bottom edges.
|
||||||
*/
|
*/
|
||||||
MetaRectangle *reference;
|
MtkRectangle *reference;
|
||||||
int left_change, right_change, smaller_x_change;
|
int left_change, right_change, smaller_x_change;
|
||||||
int top_change, bottom_change, smaller_y_change;
|
int top_change, bottom_change, smaller_y_change;
|
||||||
|
|
||||||
@ -1181,7 +1181,7 @@ meta_window_drag_edge_resistance_for_resize (MetaWindowDrag *window_dra
|
|||||||
MetaEdgeResistanceFlags flags)
|
MetaEdgeResistanceFlags flags)
|
||||||
{
|
{
|
||||||
MetaEdgeResistanceData *edge_data;
|
MetaEdgeResistanceData *edge_data;
|
||||||
MetaRectangle old_outer, new_outer;
|
MtkRectangle old_outer, new_outer;
|
||||||
int proposed_outer_width, proposed_outer_height;
|
int proposed_outer_width, proposed_outer_height;
|
||||||
MetaWindow *window;
|
MetaWindow *window;
|
||||||
|
|
||||||
|
@ -456,7 +456,7 @@ setup_pipeline (MetaBackgroundContent *self,
|
|||||||
|
|
||||||
if (self->changed & CHANGED_GRADIENT_PARAMETERS)
|
if (self->changed & CHANGED_GRADIENT_PARAMETERS)
|
||||||
{
|
{
|
||||||
MetaRectangle monitor_geometry;
|
MtkRectangle monitor_geometry;
|
||||||
float gradient_height_perc;
|
float gradient_height_perc;
|
||||||
|
|
||||||
meta_display_get_monitor_geometry (self->display,
|
meta_display_get_monitor_geometry (self->display,
|
||||||
@ -780,7 +780,7 @@ meta_background_content_get_preferred_size (ClutterContent *content,
|
|||||||
|
|
||||||
{
|
{
|
||||||
MetaBackgroundContent *background_content = META_BACKGROUND_CONTENT (content);
|
MetaBackgroundContent *background_content = META_BACKGROUND_CONTENT (content);
|
||||||
MetaRectangle monitor_geometry;
|
MtkRectangle monitor_geometry;
|
||||||
|
|
||||||
meta_display_get_monitor_geometry (background_content->display,
|
meta_display_get_monitor_geometry (background_content->display,
|
||||||
background_content->monitor,
|
background_content->monitor,
|
||||||
@ -806,8 +806,8 @@ static void
|
|||||||
set_monitor (MetaBackgroundContent *self,
|
set_monitor (MetaBackgroundContent *self,
|
||||||
int monitor)
|
int monitor)
|
||||||
{
|
{
|
||||||
MetaRectangle old_monitor_geometry;
|
MtkRectangle old_monitor_geometry;
|
||||||
MetaRectangle new_monitor_geometry;
|
MtkRectangle new_monitor_geometry;
|
||||||
MetaDisplay *display = self->display;
|
MetaDisplay *display = self->display;
|
||||||
|
|
||||||
if(self->monitor == monitor)
|
if(self->monitor == monitor)
|
||||||
|
@ -756,7 +756,7 @@ meta_background_get_texture (MetaBackground *self,
|
|||||||
CoglPipelineWrapMode *wrap_mode)
|
CoglPipelineWrapMode *wrap_mode)
|
||||||
{
|
{
|
||||||
MetaBackgroundMonitor *monitor;
|
MetaBackgroundMonitor *monitor;
|
||||||
MetaRectangle geometry;
|
MtkRectangle geometry;
|
||||||
MtkRectangle monitor_area;
|
MtkRectangle monitor_area;
|
||||||
CoglTexture *texture1, *texture2;
|
CoglTexture *texture1, *texture2;
|
||||||
float monitor_scale;
|
float monitor_scale;
|
||||||
|
@ -81,7 +81,7 @@ find_scanout_candidate (MetaCompositorView *compositor_view,
|
|||||||
CoglFramebuffer *framebuffer;
|
CoglFramebuffer *framebuffer;
|
||||||
MetaWindowActor *window_actor;
|
MetaWindowActor *window_actor;
|
||||||
MetaWindow *window;
|
MetaWindow *window;
|
||||||
MetaRectangle view_rect;
|
MtkRectangle view_rect;
|
||||||
ClutterActorBox actor_box;
|
ClutterActorBox actor_box;
|
||||||
MetaSurfaceActor *surface_actor;
|
MetaSurfaceActor *surface_actor;
|
||||||
MetaSurfaceActorWayland *surface_actor_wayland;
|
MetaSurfaceActorWayland *surface_actor_wayland;
|
||||||
|
@ -70,8 +70,8 @@ find_top_window_actor_on_view (ClutterStageView *stage_view,
|
|||||||
MetaWindowActor *window_actor = l->data;
|
MetaWindowActor *window_actor = l->data;
|
||||||
MetaWindow *window =
|
MetaWindow *window =
|
||||||
meta_window_actor_get_meta_window (window_actor);
|
meta_window_actor_get_meta_window (window_actor);
|
||||||
MetaRectangle buffer_rect;
|
MtkRectangle buffer_rect;
|
||||||
MetaRectangle view_layout;
|
MtkRectangle view_layout;
|
||||||
|
|
||||||
if (!window->visible_to_compositor)
|
if (!window->visible_to_compositor)
|
||||||
continue;
|
continue;
|
||||||
|
@ -242,7 +242,7 @@ shape_cow_for_window (MetaCompositorX11 *compositor_x11,
|
|||||||
XserverRegion output_region;
|
XserverRegion output_region;
|
||||||
XRectangle screen_rect, window_bounds;
|
XRectangle screen_rect, window_bounds;
|
||||||
int width, height;
|
int width, height;
|
||||||
MetaRectangle rect;
|
MtkRectangle rect;
|
||||||
|
|
||||||
meta_window_get_frame_rect (window, &rect);
|
meta_window_get_frame_rect (window, &rect);
|
||||||
|
|
||||||
|
@ -272,8 +272,8 @@ gboolean
|
|||||||
meta_plugin_manager_event_size_change (MetaPluginManager *plugin_mgr,
|
meta_plugin_manager_event_size_change (MetaPluginManager *plugin_mgr,
|
||||||
MetaWindowActor *actor,
|
MetaWindowActor *actor,
|
||||||
MetaSizeChange which_change,
|
MetaSizeChange which_change,
|
||||||
MetaRectangle *old_frame_rect,
|
MtkRectangle *old_frame_rect,
|
||||||
MetaRectangle *old_buffer_rect)
|
MtkRectangle *old_buffer_rect)
|
||||||
{
|
{
|
||||||
MetaPlugin *plugin = plugin_mgr->plugin;
|
MetaPlugin *plugin = plugin_mgr->plugin;
|
||||||
MetaPluginClass *klass = META_PLUGIN_GET_CLASS (plugin);
|
MetaPluginClass *klass = META_PLUGIN_GET_CLASS (plugin);
|
||||||
@ -357,7 +357,7 @@ meta_plugin_manager_confirm_display_change (MetaPluginManager *plugin_mgr)
|
|||||||
gboolean
|
gboolean
|
||||||
meta_plugin_manager_show_tile_preview (MetaPluginManager *plugin_mgr,
|
meta_plugin_manager_show_tile_preview (MetaPluginManager *plugin_mgr,
|
||||||
MetaWindow *window,
|
MetaWindow *window,
|
||||||
MetaRectangle *tile_rect,
|
MtkRectangle *tile_rect,
|
||||||
int tile_monitor_number)
|
int tile_monitor_number)
|
||||||
{
|
{
|
||||||
MetaPlugin *plugin = plugin_mgr->plugin;
|
MetaPlugin *plugin = plugin_mgr->plugin;
|
||||||
|
@ -59,8 +59,8 @@ void meta_plugin_manager_event_size_changed (MetaPluginManager *mgr,
|
|||||||
gboolean meta_plugin_manager_event_size_change (MetaPluginManager *mgr,
|
gboolean meta_plugin_manager_event_size_change (MetaPluginManager *mgr,
|
||||||
MetaWindowActor *actor,
|
MetaWindowActor *actor,
|
||||||
MetaSizeChange which_change,
|
MetaSizeChange which_change,
|
||||||
MetaRectangle *old_frame_rect,
|
MtkRectangle *old_frame_rect,
|
||||||
MetaRectangle *old_buffer_rect);
|
MtkRectangle *old_buffer_rect);
|
||||||
|
|
||||||
gboolean meta_plugin_manager_switch_workspace (MetaPluginManager *mgr,
|
gboolean meta_plugin_manager_switch_workspace (MetaPluginManager *mgr,
|
||||||
gint from,
|
gint from,
|
||||||
@ -79,7 +79,7 @@ void meta_plugin_manager_confirm_display_change (MetaPluginManager *mgr);
|
|||||||
|
|
||||||
gboolean meta_plugin_manager_show_tile_preview (MetaPluginManager *mgr,
|
gboolean meta_plugin_manager_show_tile_preview (MetaPluginManager *mgr,
|
||||||
MetaWindow *window,
|
MetaWindow *window,
|
||||||
MetaRectangle *tile_rect,
|
MtkRectangle *tile_rect,
|
||||||
int tile_monitor_number);
|
int tile_monitor_number);
|
||||||
gboolean meta_plugin_manager_hide_tile_preview (MetaPluginManager *mgr);
|
gboolean meta_plugin_manager_hide_tile_preview (MetaPluginManager *mgr);
|
||||||
|
|
||||||
|
@ -1256,7 +1256,7 @@ meta_shaped_texture_is_opaque (MetaShapedTexture *stex)
|
|||||||
meta_shaped_texture_ensure_size_valid (stex);
|
meta_shaped_texture_ensure_size_valid (stex);
|
||||||
|
|
||||||
return mtk_rectangle_equal (&opaque_rect,
|
return mtk_rectangle_equal (&opaque_rect,
|
||||||
&(MetaRectangle) {
|
&(MtkRectangle) {
|
||||||
.width = stex->dst_width,
|
.width = stex->dst_width,
|
||||||
.height = stex->dst_height
|
.height = stex->dst_height
|
||||||
});
|
});
|
||||||
@ -1452,7 +1452,7 @@ meta_shaped_texture_get_image (MetaShapedTexture *stex,
|
|||||||
image_clip))
|
image_clip))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
*image_clip = (MetaRectangle) {
|
*image_clip = (MtkRectangle) {
|
||||||
.x = image_clip->x * stex->buffer_scale,
|
.x = image_clip->x * stex->buffer_scale,
|
||||||
.y = image_clip->y * stex->buffer_scale,
|
.y = image_clip->y * stex->buffer_scale,
|
||||||
.width = image_clip->width * stex->buffer_scale,
|
.width = image_clip->width * stex->buffer_scale,
|
||||||
|
@ -199,7 +199,7 @@ meta_surface_actor_x11_process_damage (MetaSurfaceActor *actor,
|
|||||||
|
|
||||||
if (meta_window_is_fullscreen (self->window) && !self->unredirected && !self->does_full_damage)
|
if (meta_window_is_fullscreen (self->window) && !self->unredirected && !self->does_full_damage)
|
||||||
{
|
{
|
||||||
MetaRectangle window_rect;
|
MtkRectangle window_rect;
|
||||||
meta_window_get_frame_rect (self->window, &window_rect);
|
meta_window_get_frame_rect (self->window, &window_rect);
|
||||||
|
|
||||||
if (x == 0 &&
|
if (x == 0 &&
|
||||||
|
@ -34,7 +34,7 @@ struct _MetaWindowActorClass
|
|||||||
gboolean (*can_freeze_commits) (MetaWindowActor *actor);
|
gboolean (*can_freeze_commits) (MetaWindowActor *actor);
|
||||||
|
|
||||||
void (*sync_geometry) (MetaWindowActor *actor,
|
void (*sync_geometry) (MetaWindowActor *actor,
|
||||||
const MetaRectangle *actor_rect);
|
const MtkRectangle *actor_rect);
|
||||||
gboolean (*is_single_surface_actor) (MetaWindowActor *actor);
|
gboolean (*is_single_surface_actor) (MetaWindowActor *actor);
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -53,8 +53,8 @@ void meta_window_actor_hide (MetaWindowActor *self,
|
|||||||
|
|
||||||
void meta_window_actor_size_change (MetaWindowActor *self,
|
void meta_window_actor_size_change (MetaWindowActor *self,
|
||||||
MetaSizeChange which_change,
|
MetaSizeChange which_change,
|
||||||
MetaRectangle *old_frame_rect,
|
MtkRectangle *old_frame_rect,
|
||||||
MetaRectangle *old_buffer_rect);
|
MtkRectangle *old_buffer_rect);
|
||||||
|
|
||||||
void meta_window_actor_before_paint (MetaWindowActor *self,
|
void meta_window_actor_before_paint (MetaWindowActor *self,
|
||||||
ClutterStageView *stage_view);
|
ClutterStageView *stage_view);
|
||||||
|
@ -107,7 +107,7 @@ surface_container_apply_transform (ClutterActor *actor,
|
|||||||
CLUTTER_ACTOR_CLASS (meta_surface_container_actor_wayland_parent_class);
|
CLUTTER_ACTOR_CLASS (meta_surface_container_actor_wayland_parent_class);
|
||||||
MetaWindow *window;
|
MetaWindow *window;
|
||||||
MetaLogicalMonitor *logical_monitor;
|
MetaLogicalMonitor *logical_monitor;
|
||||||
MetaRectangle monitor_rect;
|
MtkRectangle monitor_rect;
|
||||||
float scale;
|
float scale;
|
||||||
float rel_x, rel_y;
|
float rel_x, rel_y;
|
||||||
float abs_x, abs_y;
|
float abs_x, abs_y;
|
||||||
@ -478,7 +478,7 @@ maybe_configure_black_background (MetaWindowActorWayland *self,
|
|||||||
MetaWindow *window = meta_window_actor_get_meta_window (window_actor);
|
MetaWindow *window = meta_window_actor_get_meta_window (window_actor);
|
||||||
MetaLogicalMonitor *logical_monitor;
|
MetaLogicalMonitor *logical_monitor;
|
||||||
int geometry_scale;
|
int geometry_scale;
|
||||||
MetaRectangle fullscreen_layout;
|
MtkRectangle fullscreen_layout;
|
||||||
ClutterActor *child;
|
ClutterActor *child;
|
||||||
ClutterActorIter iter;
|
ClutterActorIter iter;
|
||||||
float max_width = 0;
|
float max_width = 0;
|
||||||
@ -527,7 +527,7 @@ maybe_configure_black_background (MetaWindowActorWayland *self,
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
meta_window_actor_wayland_sync_geometry (MetaWindowActor *actor,
|
meta_window_actor_wayland_sync_geometry (MetaWindowActor *actor,
|
||||||
const MetaRectangle *actor_rect)
|
const MtkRectangle *actor_rect)
|
||||||
{
|
{
|
||||||
MetaWindowActorWayland *self = META_WINDOW_ACTOR_WAYLAND (actor);
|
MetaWindowActorWayland *self = META_WINDOW_ACTOR_WAYLAND (actor);
|
||||||
ClutterActor *surface_container = CLUTTER_ACTOR (self->surface_container);
|
ClutterActor *surface_container = CLUTTER_ACTOR (self->surface_container);
|
||||||
|
@ -1407,7 +1407,7 @@ meta_window_actor_x11_is_single_surface_actor (MetaWindowActor *actor)
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
meta_window_actor_x11_sync_geometry (MetaWindowActor *actor,
|
meta_window_actor_x11_sync_geometry (MetaWindowActor *actor,
|
||||||
const MetaRectangle *actor_rect)
|
const MtkRectangle *actor_rect)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -939,7 +939,7 @@ meta_window_actor_sync_actor_geometry (MetaWindowActor *self,
|
|||||||
{
|
{
|
||||||
MetaWindowActorPrivate *priv =
|
MetaWindowActorPrivate *priv =
|
||||||
meta_window_actor_get_instance_private (self);
|
meta_window_actor_get_instance_private (self);
|
||||||
MetaRectangle actor_rect;
|
MtkRectangle actor_rect;
|
||||||
ClutterActor *actor = CLUTTER_ACTOR (self);
|
ClutterActor *actor = CLUTTER_ACTOR (self);
|
||||||
MetaWindowActorChanges changes = 0;
|
MetaWindowActorChanges changes = 0;
|
||||||
|
|
||||||
@ -1076,8 +1076,8 @@ meta_window_actor_hide (MetaWindowActor *self,
|
|||||||
void
|
void
|
||||||
meta_window_actor_size_change (MetaWindowActor *self,
|
meta_window_actor_size_change (MetaWindowActor *self,
|
||||||
MetaSizeChange which_change,
|
MetaSizeChange which_change,
|
||||||
MetaRectangle *old_frame_rect,
|
MtkRectangle *old_frame_rect,
|
||||||
MetaRectangle *old_buffer_rect)
|
MtkRectangle *old_buffer_rect)
|
||||||
{
|
{
|
||||||
MetaWindowActorPrivate *priv =
|
MetaWindowActorPrivate *priv =
|
||||||
meta_window_actor_get_instance_private (self);
|
meta_window_actor_get_instance_private (self);
|
||||||
@ -1224,7 +1224,7 @@ meta_window_actor_get_geometry_scale (MetaWindowActor *window_actor)
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
meta_window_actor_get_buffer_bounds (MetaScreenCastWindow *screen_cast_window,
|
meta_window_actor_get_buffer_bounds (MetaScreenCastWindow *screen_cast_window,
|
||||||
MetaRectangle *bounds)
|
MtkRectangle *bounds)
|
||||||
{
|
{
|
||||||
MetaWindowActor *window_actor = META_WINDOW_ACTOR (screen_cast_window);
|
MetaWindowActor *window_actor = META_WINDOW_ACTOR (screen_cast_window);
|
||||||
MetaWindowActorPrivate *priv =
|
MetaWindowActorPrivate *priv =
|
||||||
@ -1232,7 +1232,7 @@ meta_window_actor_get_buffer_bounds (MetaScreenCastWindow *screen_cast_window,
|
|||||||
MetaShapedTexture *stex;
|
MetaShapedTexture *stex;
|
||||||
|
|
||||||
stex = meta_surface_actor_get_texture (priv->surface);
|
stex = meta_surface_actor_get_texture (priv->surface);
|
||||||
*bounds = (MetaRectangle) {
|
*bounds = (MtkRectangle) {
|
||||||
.width = floorf (meta_shaped_texture_get_unscaled_width (stex)),
|
.width = floorf (meta_shaped_texture_get_unscaled_width (stex)),
|
||||||
.height = floorf (meta_shaped_texture_get_unscaled_height (stex)),
|
.height = floorf (meta_shaped_texture_get_unscaled_height (stex)),
|
||||||
};
|
};
|
||||||
@ -1249,7 +1249,7 @@ meta_window_actor_transform_relative_position (MetaScreenCastWindow *screen_cast
|
|||||||
MetaWindowActor *window_actor = META_WINDOW_ACTOR (screen_cast_window);
|
MetaWindowActor *window_actor = META_WINDOW_ACTOR (screen_cast_window);
|
||||||
MetaWindowActorPrivate *priv =
|
MetaWindowActorPrivate *priv =
|
||||||
meta_window_actor_get_instance_private (window_actor);
|
meta_window_actor_get_instance_private (window_actor);
|
||||||
MetaRectangle bounds;
|
MtkRectangle bounds;
|
||||||
graphene_point3d_t v1 = { 0.f, }, v2 = { 0.f, };
|
graphene_point3d_t v1 = { 0.f, }, v2 = { 0.f, };
|
||||||
|
|
||||||
meta_window_actor_get_buffer_bounds (screen_cast_window, &bounds);
|
meta_window_actor_get_buffer_bounds (screen_cast_window, &bounds);
|
||||||
@ -1344,7 +1344,7 @@ meta_window_actor_transform_cursor_position (MetaScreenCastWindow *screen_cast_w
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
meta_window_actor_capture_into (MetaScreenCastWindow *screen_cast_window,
|
meta_window_actor_capture_into (MetaScreenCastWindow *screen_cast_window,
|
||||||
MetaRectangle *bounds,
|
MtkRectangle *bounds,
|
||||||
uint8_t *data)
|
uint8_t *data)
|
||||||
{
|
{
|
||||||
MetaWindowActor *window_actor = META_WINDOW_ACTOR (screen_cast_window);
|
MetaWindowActor *window_actor = META_WINDOW_ACTOR (screen_cast_window);
|
||||||
@ -1400,7 +1400,7 @@ meta_window_actor_capture_into (MetaScreenCastWindow *screen_cast_window,
|
|||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
meta_window_actor_blit_to_framebuffer (MetaScreenCastWindow *screen_cast_window,
|
meta_window_actor_blit_to_framebuffer (MetaScreenCastWindow *screen_cast_window,
|
||||||
MetaRectangle *bounds,
|
MtkRectangle *bounds,
|
||||||
CoglFramebuffer *framebuffer)
|
CoglFramebuffer *framebuffer)
|
||||||
{
|
{
|
||||||
MetaWindowActor *window_actor = META_WINDOW_ACTOR (screen_cast_window);
|
MetaWindowActor *window_actor = META_WINDOW_ACTOR (screen_cast_window);
|
||||||
@ -1560,7 +1560,7 @@ meta_window_actor_notify_damaged (MetaWindowActor *window_actor)
|
|||||||
|
|
||||||
static CoglFramebuffer *
|
static CoglFramebuffer *
|
||||||
create_framebuffer_from_window_actor (MetaWindowActor *self,
|
create_framebuffer_from_window_actor (MetaWindowActor *self,
|
||||||
MetaRectangle *clip,
|
MtkRectangle *clip,
|
||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
MetaWindowActorPrivate *priv = meta_window_actor_get_instance_private (self);
|
MetaWindowActorPrivate *priv = meta_window_actor_get_instance_private (self);
|
||||||
@ -1636,14 +1636,14 @@ meta_window_actor_is_single_surface_actor (MetaWindowActor *self)
|
|||||||
*/
|
*/
|
||||||
cairo_surface_t *
|
cairo_surface_t *
|
||||||
meta_window_actor_get_image (MetaWindowActor *self,
|
meta_window_actor_get_image (MetaWindowActor *self,
|
||||||
MetaRectangle *clip)
|
MtkRectangle *clip)
|
||||||
{
|
{
|
||||||
MetaWindowActorPrivate *priv = meta_window_actor_get_instance_private (self);
|
MetaWindowActorPrivate *priv = meta_window_actor_get_instance_private (self);
|
||||||
ClutterActor *actor = CLUTTER_ACTOR (self);
|
ClutterActor *actor = CLUTTER_ACTOR (self);
|
||||||
MetaShapedTexture *stex;
|
MetaShapedTexture *stex;
|
||||||
cairo_surface_t *surface = NULL;
|
cairo_surface_t *surface = NULL;
|
||||||
CoglFramebuffer *framebuffer;
|
CoglFramebuffer *framebuffer;
|
||||||
MetaRectangle framebuffer_clip;
|
MtkRectangle framebuffer_clip;
|
||||||
float resource_scale;
|
float resource_scale;
|
||||||
float x, y, width, height;
|
float x, y, width, height;
|
||||||
|
|
||||||
@ -1656,7 +1656,7 @@ meta_window_actor_get_image (MetaWindowActor *self,
|
|||||||
if (!meta_shaped_texture_should_get_via_offscreen (stex) &&
|
if (!meta_shaped_texture_should_get_via_offscreen (stex) &&
|
||||||
meta_window_actor_is_single_surface_actor (self))
|
meta_window_actor_is_single_surface_actor (self))
|
||||||
{
|
{
|
||||||
MetaRectangle *surface_clip = NULL;
|
MtkRectangle *surface_clip = NULL;
|
||||||
|
|
||||||
if (clip)
|
if (clip)
|
||||||
{
|
{
|
||||||
@ -1665,7 +1665,7 @@ meta_window_actor_get_image (MetaWindowActor *self,
|
|||||||
geometry_scale =
|
geometry_scale =
|
||||||
meta_window_actor_get_geometry_scale (self);
|
meta_window_actor_get_geometry_scale (self);
|
||||||
|
|
||||||
surface_clip = g_alloca (sizeof (MetaRectangle));
|
surface_clip = g_alloca (sizeof (MtkRectangle));
|
||||||
surface_clip->x = clip->x / geometry_scale,
|
surface_clip->x = clip->x / geometry_scale,
|
||||||
surface_clip->y = clip->y / geometry_scale;
|
surface_clip->y = clip->y / geometry_scale;
|
||||||
surface_clip->width = clip->width / geometry_scale;
|
surface_clip->width = clip->width / geometry_scale;
|
||||||
@ -1682,7 +1682,7 @@ meta_window_actor_get_image (MetaWindowActor *self,
|
|||||||
if (width == 0 || height == 0)
|
if (width == 0 || height == 0)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
framebuffer_clip = (MetaRectangle) {
|
framebuffer_clip = (MtkRectangle) {
|
||||||
.x = floorf (x),
|
.x = floorf (x),
|
||||||
.y = floorf (y),
|
.y = floorf (y),
|
||||||
.width = ceilf (width),
|
.width = ceilf (width),
|
||||||
@ -1691,8 +1691,8 @@ meta_window_actor_get_image (MetaWindowActor *self,
|
|||||||
|
|
||||||
if (clip)
|
if (clip)
|
||||||
{
|
{
|
||||||
MetaRectangle tmp_clip;
|
MtkRectangle tmp_clip;
|
||||||
MetaRectangle intersected_clip;
|
MtkRectangle intersected_clip;
|
||||||
|
|
||||||
tmp_clip = *clip;
|
tmp_clip = *clip;
|
||||||
tmp_clip.x += floorf (x);
|
tmp_clip.x += floorf (x);
|
||||||
@ -1746,7 +1746,7 @@ out:
|
|||||||
*/
|
*/
|
||||||
ClutterContent *
|
ClutterContent *
|
||||||
meta_window_actor_paint_to_content (MetaWindowActor *self,
|
meta_window_actor_paint_to_content (MetaWindowActor *self,
|
||||||
MetaRectangle *clip,
|
MtkRectangle *clip,
|
||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
MetaWindowActorPrivate *priv = meta_window_actor_get_instance_private (self);
|
MetaWindowActorPrivate *priv = meta_window_actor_get_instance_private (self);
|
||||||
@ -1754,7 +1754,7 @@ meta_window_actor_paint_to_content (MetaWindowActor *self,
|
|||||||
ClutterContent *content = NULL;
|
ClutterContent *content = NULL;
|
||||||
CoglFramebuffer *framebuffer;
|
CoglFramebuffer *framebuffer;
|
||||||
CoglTexture *texture;
|
CoglTexture *texture;
|
||||||
MetaRectangle framebuffer_clip;
|
MtkRectangle framebuffer_clip;
|
||||||
float x, y, width, height;
|
float x, y, width, height;
|
||||||
|
|
||||||
if (!priv->surface)
|
if (!priv->surface)
|
||||||
@ -1768,7 +1768,7 @@ meta_window_actor_paint_to_content (MetaWindowActor *self,
|
|||||||
if (width == 0 || height == 0)
|
if (width == 0 || height == 0)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
framebuffer_clip = (MetaRectangle) {
|
framebuffer_clip = (MtkRectangle) {
|
||||||
.x = floorf (x),
|
.x = floorf (x),
|
||||||
.y = floorf (y),
|
.y = floorf (y),
|
||||||
.width = ceilf (width),
|
.width = ceilf (width),
|
||||||
@ -1777,7 +1777,7 @@ meta_window_actor_paint_to_content (MetaWindowActor *self,
|
|||||||
|
|
||||||
if (clip)
|
if (clip)
|
||||||
{
|
{
|
||||||
MetaRectangle tmp_clip;
|
MtkRectangle tmp_clip;
|
||||||
|
|
||||||
if (!mtk_rectangle_intersect (&framebuffer_clip, clip, &tmp_clip))
|
if (!mtk_rectangle_intersect (&framebuffer_clip, clip, &tmp_clip))
|
||||||
goto out;
|
goto out;
|
||||||
|
@ -63,7 +63,7 @@ struct _MetaWindowDrag {
|
|||||||
int tile_monitor_number;
|
int tile_monitor_number;
|
||||||
int latest_motion_x;
|
int latest_motion_x;
|
||||||
int latest_motion_y;
|
int latest_motion_y;
|
||||||
MetaRectangle initial_window_pos;
|
MtkRectangle initial_window_pos;
|
||||||
int initial_x, initial_y; /* These are only relevant for */
|
int initial_x, initial_y; /* These are only relevant for */
|
||||||
gboolean threshold_movement_reached; /* raise_on_click == FALSE. */
|
gboolean threshold_movement_reached; /* raise_on_click == FALSE. */
|
||||||
unsigned int last_edge_resistance_flags;
|
unsigned int last_edge_resistance_flags;
|
||||||
@ -112,7 +112,7 @@ update_tile_preview_timeout (MetaWindowDrag *window_drag)
|
|||||||
|
|
||||||
if (needs_preview)
|
if (needs_preview)
|
||||||
{
|
{
|
||||||
MetaRectangle tile_rect;
|
MtkRectangle tile_rect;
|
||||||
int monitor;
|
int monitor;
|
||||||
|
|
||||||
monitor = meta_window_get_current_tile_monitor_number (window);
|
monitor = meta_window_get_current_tile_monitor_number (window);
|
||||||
@ -428,8 +428,8 @@ warp_grab_pointer (MetaWindowDrag *window_drag,
|
|||||||
int *x,
|
int *x,
|
||||||
int *y)
|
int *y)
|
||||||
{
|
{
|
||||||
MetaRectangle rect;
|
MtkRectangle rect;
|
||||||
MetaRectangle display_rect = { 0 };
|
MtkRectangle display_rect = { 0 };
|
||||||
MetaDisplay *display;
|
MetaDisplay *display;
|
||||||
ClutterSeat *seat;
|
ClutterSeat *seat;
|
||||||
|
|
||||||
@ -589,7 +589,7 @@ process_keyboard_move_grab (MetaWindowDrag *window_drag,
|
|||||||
{
|
{
|
||||||
MetaEdgeResistanceFlags flags;
|
MetaEdgeResistanceFlags flags;
|
||||||
gboolean handled;
|
gboolean handled;
|
||||||
MetaRectangle frame_rect;
|
MtkRectangle frame_rect;
|
||||||
ClutterModifierType modifiers;
|
ClutterModifierType modifiers;
|
||||||
uint32_t keyval;
|
uint32_t keyval;
|
||||||
int x, y;
|
int x, y;
|
||||||
@ -841,7 +841,7 @@ process_keyboard_resize_grab (MetaWindowDrag *window_drag,
|
|||||||
MetaWindow *window,
|
MetaWindow *window,
|
||||||
ClutterKeyEvent *event)
|
ClutterKeyEvent *event)
|
||||||
{
|
{
|
||||||
MetaRectangle frame_rect;
|
MtkRectangle frame_rect;
|
||||||
gboolean handled;
|
gboolean handled;
|
||||||
int height_inc;
|
int height_inc;
|
||||||
int width_inc;
|
int width_inc;
|
||||||
@ -1133,7 +1133,7 @@ update_move_maybe_tile (MetaWindowDrag *window_drag,
|
|||||||
MetaMonitorManager *monitor_manager =
|
MetaMonitorManager *monitor_manager =
|
||||||
meta_backend_get_monitor_manager (backend);
|
meta_backend_get_monitor_manager (backend);
|
||||||
MetaLogicalMonitor *logical_monitor;
|
MetaLogicalMonitor *logical_monitor;
|
||||||
MetaRectangle work_area;
|
MtkRectangle work_area;
|
||||||
|
|
||||||
/* For side-by-side tiling we are interested in the inside vertical
|
/* For side-by-side tiling we are interested in the inside vertical
|
||||||
* edges of the work area of the monitor where the pointer is located,
|
* edges of the work area of the monitor where the pointer is located,
|
||||||
@ -1186,7 +1186,7 @@ update_move (MetaWindowDrag *window_drag,
|
|||||||
MetaWindow *window;
|
MetaWindow *window;
|
||||||
int dx, dy;
|
int dx, dy;
|
||||||
int new_x, new_y;
|
int new_x, new_y;
|
||||||
MetaRectangle old, frame_rect;
|
MtkRectangle old, frame_rect;
|
||||||
int shake_threshold;
|
int shake_threshold;
|
||||||
|
|
||||||
window = window_drag->effective_grab_window;
|
window = window_drag->effective_grab_window;
|
||||||
@ -1271,7 +1271,7 @@ update_move (MetaWindowDrag *window_drag,
|
|||||||
* instead, as the "correct" anchoring looks wrong. */
|
* instead, as the "correct" anchoring looks wrong. */
|
||||||
if (window_drag->anchor_root_y < window_drag->initial_window_pos.y)
|
if (window_drag->anchor_root_y < window_drag->initial_window_pos.y)
|
||||||
{
|
{
|
||||||
MetaRectangle titlebar_rect;
|
MtkRectangle titlebar_rect;
|
||||||
meta_window_get_titlebar_rect (window, &titlebar_rect);
|
meta_window_get_titlebar_rect (window, &titlebar_rect);
|
||||||
window_drag->anchor_root_y = window_drag->initial_window_pos.y + titlebar_rect.height / 2;
|
window_drag->anchor_root_y = window_drag->initial_window_pos.y + titlebar_rect.height / 2;
|
||||||
}
|
}
|
||||||
@ -1296,7 +1296,7 @@ update_move (MetaWindowDrag *window_drag,
|
|||||||
meta_backend_get_monitor_manager (backend);
|
meta_backend_get_monitor_manager (backend);
|
||||||
int n_logical_monitors;
|
int n_logical_monitors;
|
||||||
const MetaLogicalMonitor *wmonitor;
|
const MetaLogicalMonitor *wmonitor;
|
||||||
MetaRectangle work_area;
|
MtkRectangle work_area;
|
||||||
int monitor;
|
int monitor;
|
||||||
|
|
||||||
window->tile_mode = META_TILE_NONE;
|
window->tile_mode = META_TILE_NONE;
|
||||||
@ -1424,8 +1424,8 @@ update_resize (MetaWindowDrag *window_drag,
|
|||||||
{
|
{
|
||||||
int dx, dy;
|
int dx, dy;
|
||||||
MetaGravity gravity;
|
MetaGravity gravity;
|
||||||
MetaRectangle new_rect;
|
MtkRectangle new_rect;
|
||||||
MetaRectangle old_rect;
|
MtkRectangle old_rect;
|
||||||
MetaWindow *window;
|
MetaWindow *window;
|
||||||
|
|
||||||
window = window_drag->effective_grab_window;
|
window = window_drag->effective_grab_window;
|
||||||
@ -1581,7 +1581,7 @@ queue_update_resize (MetaWindowDrag *window_drag,
|
|||||||
static void
|
static void
|
||||||
maybe_maximize_tiled_window (MetaWindow *window)
|
maybe_maximize_tiled_window (MetaWindow *window)
|
||||||
{
|
{
|
||||||
MetaRectangle work_area;
|
MtkRectangle work_area;
|
||||||
gint shake_threshold;
|
gint shake_threshold;
|
||||||
|
|
||||||
if (!META_WINDOW_TILED_SIDE_BY_SIDE (window))
|
if (!META_WINDOW_TILED_SIDE_BY_SIDE (window))
|
||||||
|
@ -101,7 +101,7 @@ static void kill_switch_workspace (MetaPlugin *plugin);
|
|||||||
|
|
||||||
static void show_tile_preview (MetaPlugin *plugin,
|
static void show_tile_preview (MetaPlugin *plugin,
|
||||||
MetaWindow *window,
|
MetaWindow *window,
|
||||||
MetaRectangle *tile_rect,
|
MtkRectangle *tile_rect,
|
||||||
int tile_monitor_number);
|
int tile_monitor_number);
|
||||||
static void hide_tile_preview (MetaPlugin *plugin);
|
static void hide_tile_preview (MetaPlugin *plugin);
|
||||||
|
|
||||||
@ -150,7 +150,7 @@ typedef struct _DisplayTilePreview
|
|||||||
{
|
{
|
||||||
ClutterActor *actor;
|
ClutterActor *actor;
|
||||||
|
|
||||||
MetaRectangle tile_rect;
|
MtkRectangle tile_rect;
|
||||||
} DisplayTilePreview;
|
} DisplayTilePreview;
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -323,7 +323,7 @@ on_monitors_changed (MetaMonitorManager *monitor_manager,
|
|||||||
{
|
{
|
||||||
MetaBackgroundContent *background_content;
|
MetaBackgroundContent *background_content;
|
||||||
ClutterContent *content;
|
ClutterContent *content;
|
||||||
MetaRectangle rect;
|
MtkRectangle rect;
|
||||||
ClutterActor *background_actor;
|
ClutterActor *background_actor;
|
||||||
MetaBackground *background;
|
MetaBackground *background;
|
||||||
uint8_t red;
|
uint8_t red;
|
||||||
@ -611,7 +611,7 @@ static void
|
|||||||
minimize (MetaPlugin *plugin, MetaWindowActor *window_actor)
|
minimize (MetaPlugin *plugin, MetaWindowActor *window_actor)
|
||||||
{
|
{
|
||||||
MetaWindowType type;
|
MetaWindowType type;
|
||||||
MetaRectangle icon_geometry;
|
MtkRectangle icon_geometry;
|
||||||
MetaWindow *meta_window = meta_window_actor_get_meta_window (window_actor);
|
MetaWindow *meta_window = meta_window_actor_get_meta_window (window_actor);
|
||||||
ClutterTimeline *timeline = NULL;
|
ClutterTimeline *timeline = NULL;
|
||||||
ClutterActor *actor = CLUTTER_ACTOR (window_actor);
|
ClutterActor *actor = CLUTTER_ACTOR (window_actor);
|
||||||
@ -836,7 +836,7 @@ get_display_tile_preview (MetaDisplay *display)
|
|||||||
static void
|
static void
|
||||||
show_tile_preview (MetaPlugin *plugin,
|
show_tile_preview (MetaPlugin *plugin,
|
||||||
MetaWindow *window,
|
MetaWindow *window,
|
||||||
MetaRectangle *tile_rect,
|
MtkRectangle *tile_rect,
|
||||||
int tile_monitor_number)
|
int tile_monitor_number)
|
||||||
{
|
{
|
||||||
MetaDisplay *display = meta_plugin_get_display (plugin);
|
MetaDisplay *display = meta_plugin_get_display (plugin);
|
||||||
|
@ -57,7 +57,7 @@ typedef enum _MetaRoundingStrategy
|
|||||||
*/
|
*/
|
||||||
#define RECT_LENGTH 27
|
#define RECT_LENGTH 27
|
||||||
#define EDGE_LENGTH 37
|
#define EDGE_LENGTH 37
|
||||||
char* meta_rectangle_to_string (const MetaRectangle *rect,
|
char* meta_rectangle_to_string (const MtkRectangle *rect,
|
||||||
char *output);
|
char *output);
|
||||||
char* meta_rectangle_region_to_string (GList *region,
|
char* meta_rectangle_region_to_string (GList *region,
|
||||||
const char *separator_string,
|
const char *separator_string,
|
||||||
@ -75,8 +75,8 @@ char* meta_rectangle_edge_list_to_string (
|
|||||||
* it in a MoveResize operation if you muck with old_rect just right).
|
* it in a MoveResize operation if you muck with old_rect just right).
|
||||||
*/
|
*/
|
||||||
META_EXPORT_TEST
|
META_EXPORT_TEST
|
||||||
void meta_rectangle_resize_with_gravity (const MetaRectangle *old_rect,
|
void meta_rectangle_resize_with_gravity (const MtkRectangle *old_rect,
|
||||||
MetaRectangle *rect,
|
MtkRectangle *rect,
|
||||||
MetaGravity gravity,
|
MetaGravity gravity,
|
||||||
int new_width,
|
int new_width,
|
||||||
int new_height);
|
int new_height);
|
||||||
@ -94,7 +94,7 @@ void meta_rectangle_resize_with_gravity (const MetaRectangle *old_rect,
|
|||||||
*/
|
*/
|
||||||
META_EXPORT_TEST
|
META_EXPORT_TEST
|
||||||
GList* meta_rectangle_get_minimal_spanning_set_for_region (
|
GList* meta_rectangle_get_minimal_spanning_set_for_region (
|
||||||
const MetaRectangle *basic_rect,
|
const MtkRectangle *basic_rect,
|
||||||
const GSList *all_struts);
|
const GSList *all_struts);
|
||||||
|
|
||||||
/* Expand all rectangles in region by the given amount on each side */
|
/* Expand all rectangles in region by the given amount on each side */
|
||||||
@ -121,8 +121,8 @@ GList* meta_rectangle_expand_region_conditionally (
|
|||||||
*/
|
*/
|
||||||
META_EXPORT_TEST
|
META_EXPORT_TEST
|
||||||
void meta_rectangle_expand_to_avoiding_struts (
|
void meta_rectangle_expand_to_avoiding_struts (
|
||||||
MetaRectangle *rect,
|
MtkRectangle *rect,
|
||||||
const MetaRectangle *expand_to,
|
const MtkRectangle *expand_to,
|
||||||
const MetaDirection direction,
|
const MetaDirection direction,
|
||||||
const GSList *all_struts);
|
const GSList *all_struts);
|
||||||
|
|
||||||
@ -143,21 +143,21 @@ void meta_rectangle_free_list_and_elements (GList *filled_list);
|
|||||||
META_EXPORT_TEST
|
META_EXPORT_TEST
|
||||||
gboolean meta_rectangle_could_fit_in_region (
|
gboolean meta_rectangle_could_fit_in_region (
|
||||||
const GList *spanning_rects,
|
const GList *spanning_rects,
|
||||||
const MetaRectangle *rect);
|
const MtkRectangle *rect);
|
||||||
|
|
||||||
META_EXPORT_TEST
|
META_EXPORT_TEST
|
||||||
gboolean meta_rectangle_contained_in_region (
|
gboolean meta_rectangle_contained_in_region (
|
||||||
const GList *spanning_rects,
|
const GList *spanning_rects,
|
||||||
const MetaRectangle *rect);
|
const MtkRectangle *rect);
|
||||||
|
|
||||||
META_EXPORT_TEST
|
META_EXPORT_TEST
|
||||||
gboolean meta_rectangle_overlaps_with_region (
|
gboolean meta_rectangle_overlaps_with_region (
|
||||||
const GList *spanning_rects,
|
const GList *spanning_rects,
|
||||||
const MetaRectangle *rect);
|
const MtkRectangle *rect);
|
||||||
|
|
||||||
gboolean meta_rectangle_is_adjacent_to_any_in_region (
|
gboolean meta_rectangle_is_adjacent_to_any_in_region (
|
||||||
const GList *spanning_rects,
|
const GList *spanning_rects,
|
||||||
MetaRectangle *rect);
|
MtkRectangle *rect);
|
||||||
|
|
||||||
/* Make the rectangle small enough to fit into one of the spanning_rects,
|
/* Make the rectangle small enough to fit into one of the spanning_rects,
|
||||||
* but make it no smaller than min_size.
|
* but make it no smaller than min_size.
|
||||||
@ -166,8 +166,8 @@ META_EXPORT_TEST
|
|||||||
void meta_rectangle_clamp_to_fit_into_region (
|
void meta_rectangle_clamp_to_fit_into_region (
|
||||||
const GList *spanning_rects,
|
const GList *spanning_rects,
|
||||||
FixedDirections fixed_directions,
|
FixedDirections fixed_directions,
|
||||||
MetaRectangle *rect,
|
MtkRectangle *rect,
|
||||||
const MetaRectangle *min_size);
|
const MtkRectangle *min_size);
|
||||||
|
|
||||||
/* Clip the rectangle so that it fits into one of the spanning_rects, assuming
|
/* Clip the rectangle so that it fits into one of the spanning_rects, assuming
|
||||||
* it overlaps with at least one of them
|
* it overlaps with at least one of them
|
||||||
@ -175,7 +175,7 @@ void meta_rectangle_clamp_to_fit_into_region (
|
|||||||
META_EXPORT_TEST
|
META_EXPORT_TEST
|
||||||
void meta_rectangle_clip_to_region (const GList *spanning_rects,
|
void meta_rectangle_clip_to_region (const GList *spanning_rects,
|
||||||
FixedDirections fixed_directions,
|
FixedDirections fixed_directions,
|
||||||
MetaRectangle *rect);
|
MtkRectangle *rect);
|
||||||
|
|
||||||
/* Shove the rectangle into one of the spanning_rects, assuming it fits in
|
/* Shove the rectangle into one of the spanning_rects, assuming it fits in
|
||||||
* one of them.
|
* one of them.
|
||||||
@ -184,7 +184,7 @@ META_EXPORT_TEST
|
|||||||
void meta_rectangle_shove_into_region(
|
void meta_rectangle_shove_into_region(
|
||||||
const GList *spanning_rects,
|
const GList *spanning_rects,
|
||||||
FixedDirections fixed_directions,
|
FixedDirections fixed_directions,
|
||||||
MetaRectangle *rect);
|
MtkRectangle *rect);
|
||||||
|
|
||||||
/* Finds the point on the line connecting (x1,y1) to (x2,y2) which is closest
|
/* Finds the point on the line connecting (x1,y1) to (x2,y2) which is closest
|
||||||
* to (px, py). Useful for finding an optimal rectangle size when given a
|
* to (px, py). Useful for finding an optimal rectangle size when given a
|
||||||
@ -206,7 +206,7 @@ void meta_rectangle_find_linepoint_closest_to_point (double x1, double y1,
|
|||||||
* nonzero-width dimension of the edge.
|
* nonzero-width dimension of the edge.
|
||||||
*/
|
*/
|
||||||
META_EXPORT_TEST
|
META_EXPORT_TEST
|
||||||
gboolean meta_rectangle_edge_aligns (const MetaRectangle *rect,
|
gboolean meta_rectangle_edge_aligns (const MtkRectangle *rect,
|
||||||
const MetaEdge *edge);
|
const MetaEdge *edge);
|
||||||
|
|
||||||
/* Compare two edges, so that sorting functions can put a list of edges in
|
/* Compare two edges, so that sorting functions can put a list of edges in
|
||||||
@ -233,7 +233,7 @@ GList* meta_rectangle_remove_intersections_with_boxes_from_edges (
|
|||||||
* MetaEdgeRect's.
|
* MetaEdgeRect's.
|
||||||
*/
|
*/
|
||||||
META_EXPORT_TEST
|
META_EXPORT_TEST
|
||||||
GList* meta_rectangle_find_onscreen_edges (const MetaRectangle *basic_rect,
|
GList* meta_rectangle_find_onscreen_edges (const MtkRectangle *basic_rect,
|
||||||
const GSList *all_struts);
|
const GSList *all_struts);
|
||||||
|
|
||||||
/* Finds edges between adjacent monitors which are not covered by the given
|
/* Finds edges between adjacent monitors which are not covered by the given
|
||||||
@ -245,17 +245,17 @@ GList* meta_rectangle_find_nonintersected_monitor_edges (
|
|||||||
const GSList *all_struts);
|
const GSList *all_struts);
|
||||||
|
|
||||||
META_EXPORT_TEST
|
META_EXPORT_TEST
|
||||||
gboolean meta_rectangle_is_adjacent_to (MetaRectangle *rect,
|
gboolean meta_rectangle_is_adjacent_to (MtkRectangle *rect,
|
||||||
MetaRectangle *other);
|
MtkRectangle *other);
|
||||||
|
|
||||||
META_EXPORT_TEST
|
META_EXPORT_TEST
|
||||||
void meta_rectangle_scale_double (const MetaRectangle *rect,
|
void meta_rectangle_scale_double (const MtkRectangle *rect,
|
||||||
double scale,
|
double scale,
|
||||||
MetaRoundingStrategy rounding_strategy,
|
MetaRoundingStrategy rounding_strategy,
|
||||||
MetaRectangle *dest);
|
MtkRectangle *dest);
|
||||||
|
|
||||||
static inline graphene_rect_t
|
static inline graphene_rect_t
|
||||||
meta_rectangle_to_graphene_rect (MetaRectangle *rect)
|
meta_rectangle_to_graphene_rect (MtkRectangle *rect)
|
||||||
{
|
{
|
||||||
return (graphene_rect_t) {
|
return (graphene_rect_t) {
|
||||||
.origin = {
|
.origin = {
|
||||||
@ -270,18 +270,18 @@ meta_rectangle_to_graphene_rect (MetaRectangle *rect)
|
|||||||
}
|
}
|
||||||
|
|
||||||
META_EXPORT_TEST
|
META_EXPORT_TEST
|
||||||
void meta_rectangle_transform (const MetaRectangle *rect,
|
void meta_rectangle_transform (const MtkRectangle *rect,
|
||||||
MetaMonitorTransform transform,
|
MetaMonitorTransform transform,
|
||||||
int width,
|
int width,
|
||||||
int height,
|
int height,
|
||||||
MetaRectangle *dest);
|
MtkRectangle *dest);
|
||||||
|
|
||||||
void meta_rectangle_from_graphene_rect (const graphene_rect_t *rect,
|
void meta_rectangle_from_graphene_rect (const graphene_rect_t *rect,
|
||||||
MetaRoundingStrategy rounding_strategy,
|
MetaRoundingStrategy rounding_strategy,
|
||||||
MetaRectangle *dest);
|
MtkRectangle *dest);
|
||||||
|
|
||||||
void meta_rectangle_crop_and_scale (const MetaRectangle *rect,
|
void meta_rectangle_crop_and_scale (const MtkRectangle *rect,
|
||||||
graphene_rect_t *src_rect,
|
graphene_rect_t *src_rect,
|
||||||
int dst_width,
|
int dst_width,
|
||||||
int dst_height,
|
int dst_height,
|
||||||
MetaRectangle *dest);
|
MtkRectangle *dest);
|
||||||
|
194
src/core/boxes.c
194
src/core/boxes.c
@ -31,28 +31,8 @@
|
|||||||
|
|
||||||
#include "meta/util.h"
|
#include "meta/util.h"
|
||||||
|
|
||||||
/* It would make sense to use GSlice here, but until we clean up the
|
|
||||||
* rest of this file and the internal API to use these functions, we
|
|
||||||
* leave it using g_malloc()/g_free() for consistency.
|
|
||||||
*/
|
|
||||||
|
|
||||||
MetaRectangle *
|
|
||||||
meta_rectangle_copy (const MetaRectangle *rect)
|
|
||||||
{
|
|
||||||
return g_memdup2 (rect, sizeof (MetaRectangle));
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
meta_rectangle_free (MetaRectangle *rect)
|
|
||||||
{
|
|
||||||
g_free (rect);
|
|
||||||
}
|
|
||||||
|
|
||||||
G_DEFINE_BOXED_TYPE (MetaRectangle, meta_rectangle,
|
|
||||||
meta_rectangle_copy, meta_rectangle_free);
|
|
||||||
|
|
||||||
char*
|
char*
|
||||||
meta_rectangle_to_string (const MetaRectangle *rect,
|
meta_rectangle_to_string (const MtkRectangle *rect,
|
||||||
char *output)
|
char *output)
|
||||||
{
|
{
|
||||||
/* 25 chars: 2 commas, space, plus, trailing \0 + 5 for each digit.
|
/* 25 chars: 2 commas, space, plus, trailing \0 + 5 for each digit.
|
||||||
@ -85,7 +65,7 @@ meta_rectangle_region_to_string (GList *region,
|
|||||||
|
|
||||||
while (tmp)
|
while (tmp)
|
||||||
{
|
{
|
||||||
MetaRectangle *rect = tmp->data;
|
MtkRectangle *rect = tmp->data;
|
||||||
g_snprintf (rect_string, RECT_LENGTH, "[%d,%d +%d,%d]",
|
g_snprintf (rect_string, RECT_LENGTH, "[%d,%d +%d,%d]",
|
||||||
rect->x, rect->y, rect->width, rect->height);
|
rect->x, rect->y, rect->width, rect->height);
|
||||||
cur = g_stpcpy (cur, rect_string);
|
cur = g_stpcpy (cur, rect_string);
|
||||||
@ -121,7 +101,7 @@ meta_rectangle_edge_list_to_string (GList *edge_list,
|
|||||||
while (tmp)
|
while (tmp)
|
||||||
{
|
{
|
||||||
MetaEdge *edge = tmp->data;
|
MetaEdge *edge = tmp->data;
|
||||||
MetaRectangle *rect = &edge->rect;
|
MtkRectangle *rect = &edge->rect;
|
||||||
g_snprintf (rect_string, EDGE_LENGTH, "([%d,%d +%d,%d], %2d, %2d)",
|
g_snprintf (rect_string, EDGE_LENGTH, "([%d,%d +%d,%d], %2d, %2d)",
|
||||||
rect->x, rect->y, rect->width, rect->height,
|
rect->x, rect->y, rect->width, rect->height,
|
||||||
edge->side_type, edge->edge_type);
|
edge->side_type, edge->edge_type);
|
||||||
@ -135,8 +115,8 @@ return output;
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
meta_rectangle_resize_with_gravity (const MetaRectangle *old_rect,
|
meta_rectangle_resize_with_gravity (const MtkRectangle *old_rect,
|
||||||
MetaRectangle *rect,
|
MtkRectangle *rect,
|
||||||
MetaGravity gravity,
|
MetaGravity gravity,
|
||||||
int new_width,
|
int new_width,
|
||||||
int new_height)
|
int new_height)
|
||||||
@ -251,14 +231,14 @@ merge_spanning_rects_in_region (GList *region)
|
|||||||
|
|
||||||
while (compare && compare->next)
|
while (compare && compare->next)
|
||||||
{
|
{
|
||||||
MetaRectangle *a = compare->data;
|
MtkRectangle *a = compare->data;
|
||||||
GList *other = compare->next;
|
GList *other = compare->next;
|
||||||
|
|
||||||
g_assert (a->width > 0 && a->height > 0);
|
g_assert (a->width > 0 && a->height > 0);
|
||||||
|
|
||||||
while (other)
|
while (other)
|
||||||
{
|
{
|
||||||
MetaRectangle *b = other->data;
|
MtkRectangle *b = other->data;
|
||||||
GList *delete_me = NULL;
|
GList *delete_me = NULL;
|
||||||
|
|
||||||
g_assert (b->width > 0 && b->height > 0);
|
g_assert (b->width > 0 && b->height > 0);
|
||||||
@ -344,8 +324,8 @@ merge_spanning_rects_in_region (GList *region)
|
|||||||
static gint
|
static gint
|
||||||
compare_rect_areas (gconstpointer a, gconstpointer b)
|
compare_rect_areas (gconstpointer a, gconstpointer b)
|
||||||
{
|
{
|
||||||
const MetaRectangle *a_rect = (gconstpointer) a;
|
const MtkRectangle *a_rect = (gconstpointer) a;
|
||||||
const MetaRectangle *b_rect = (gconstpointer) b;
|
const MtkRectangle *b_rect = (gconstpointer) b;
|
||||||
|
|
||||||
int a_area = mtk_rectangle_area (a_rect);
|
int a_area = mtk_rectangle_area (a_rect);
|
||||||
int b_area = mtk_rectangle_area (b_rect);
|
int b_area = mtk_rectangle_area (b_rect);
|
||||||
@ -355,7 +335,8 @@ compare_rect_areas (gconstpointer a, gconstpointer b)
|
|||||||
|
|
||||||
/* ... and another helper for get_minimal_spanning_set_for_region()... */
|
/* ... and another helper for get_minimal_spanning_set_for_region()... */
|
||||||
static gboolean
|
static gboolean
|
||||||
check_strut_align (MetaStrut *strut, const MetaRectangle *rect)
|
check_strut_align (MetaStrut *strut,
|
||||||
|
const MtkRectangle *rect)
|
||||||
{
|
{
|
||||||
/* Check whether @strut actually aligns to the side of @rect it claims */
|
/* Check whether @strut actually aligns to the side of @rect it claims */
|
||||||
switch (strut->side)
|
switch (strut->side)
|
||||||
@ -395,7 +376,7 @@ check_strut_align (MetaStrut *strut, const MetaRectangle *rect)
|
|||||||
*/
|
*/
|
||||||
GList*
|
GList*
|
||||||
meta_rectangle_get_minimal_spanning_set_for_region (
|
meta_rectangle_get_minimal_spanning_set_for_region (
|
||||||
const MetaRectangle *basic_rect,
|
const MtkRectangle *basic_rect,
|
||||||
const GSList *all_struts)
|
const GSList *all_struts)
|
||||||
{
|
{
|
||||||
/* NOTE FOR OPTIMIZERS: This function *might* be somewhat slow,
|
/* NOTE FOR OPTIMIZERS: This function *might* be somewhat slow,
|
||||||
@ -437,7 +418,7 @@ meta_rectangle_get_minimal_spanning_set_for_region (
|
|||||||
GList *ret;
|
GList *ret;
|
||||||
GList *tmp_list;
|
GList *tmp_list;
|
||||||
const GSList *strut_iter;
|
const GSList *strut_iter;
|
||||||
MetaRectangle *temp_rect;
|
MtkRectangle *temp_rect;
|
||||||
|
|
||||||
/* The algorithm is basically as follows:
|
/* The algorithm is basically as follows:
|
||||||
* Initialize rectangle_set to basic_rect
|
* Initialize rectangle_set to basic_rect
|
||||||
@ -450,7 +431,7 @@ meta_rectangle_get_minimal_spanning_set_for_region (
|
|||||||
* splitting
|
* splitting
|
||||||
*/
|
*/
|
||||||
|
|
||||||
temp_rect = g_new (MetaRectangle, 1);
|
temp_rect = g_new (MtkRectangle, 1);
|
||||||
*temp_rect = *basic_rect;
|
*temp_rect = *basic_rect;
|
||||||
ret = g_list_prepend (NULL, temp_rect);
|
ret = g_list_prepend (NULL, temp_rect);
|
||||||
|
|
||||||
@ -458,14 +439,14 @@ meta_rectangle_get_minimal_spanning_set_for_region (
|
|||||||
{
|
{
|
||||||
GList *rect_iter;
|
GList *rect_iter;
|
||||||
MetaStrut *strut = (MetaStrut*)strut_iter->data;
|
MetaStrut *strut = (MetaStrut*)strut_iter->data;
|
||||||
MetaRectangle *strut_rect = &strut->rect;
|
MtkRectangle *strut_rect = &strut->rect;
|
||||||
|
|
||||||
tmp_list = ret;
|
tmp_list = ret;
|
||||||
ret = NULL;
|
ret = NULL;
|
||||||
rect_iter = tmp_list;
|
rect_iter = tmp_list;
|
||||||
while (rect_iter)
|
while (rect_iter)
|
||||||
{
|
{
|
||||||
MetaRectangle *rect = (MetaRectangle*) rect_iter->data;
|
MtkRectangle *rect = (MtkRectangle*) rect_iter->data;
|
||||||
|
|
||||||
if (!mtk_rectangle_overlap (strut_rect, rect) ||
|
if (!mtk_rectangle_overlap (strut_rect, rect) ||
|
||||||
!check_strut_align (strut, basic_rect))
|
!check_strut_align (strut, basic_rect))
|
||||||
@ -475,7 +456,7 @@ meta_rectangle_get_minimal_spanning_set_for_region (
|
|||||||
/* If there is area in rect left of strut */
|
/* If there is area in rect left of strut */
|
||||||
if (BOX_LEFT (*rect) < BOX_LEFT (*strut_rect))
|
if (BOX_LEFT (*rect) < BOX_LEFT (*strut_rect))
|
||||||
{
|
{
|
||||||
temp_rect = g_new (MetaRectangle, 1);
|
temp_rect = g_new (MtkRectangle, 1);
|
||||||
*temp_rect = *rect;
|
*temp_rect = *rect;
|
||||||
temp_rect->width = BOX_LEFT (*strut_rect) - BOX_LEFT (*rect);
|
temp_rect->width = BOX_LEFT (*strut_rect) - BOX_LEFT (*rect);
|
||||||
ret = g_list_prepend (ret, temp_rect);
|
ret = g_list_prepend (ret, temp_rect);
|
||||||
@ -484,7 +465,7 @@ meta_rectangle_get_minimal_spanning_set_for_region (
|
|||||||
if (BOX_RIGHT (*rect) > BOX_RIGHT (*strut_rect))
|
if (BOX_RIGHT (*rect) > BOX_RIGHT (*strut_rect))
|
||||||
{
|
{
|
||||||
int new_x;
|
int new_x;
|
||||||
temp_rect = g_new (MetaRectangle, 1);
|
temp_rect = g_new (MtkRectangle, 1);
|
||||||
*temp_rect = *rect;
|
*temp_rect = *rect;
|
||||||
new_x = BOX_RIGHT (*strut_rect);
|
new_x = BOX_RIGHT (*strut_rect);
|
||||||
temp_rect->width = BOX_RIGHT (*rect) - new_x;
|
temp_rect->width = BOX_RIGHT (*rect) - new_x;
|
||||||
@ -494,7 +475,7 @@ meta_rectangle_get_minimal_spanning_set_for_region (
|
|||||||
/* If there is area in rect above strut */
|
/* If there is area in rect above strut */
|
||||||
if (BOX_TOP (*rect) < BOX_TOP (*strut_rect))
|
if (BOX_TOP (*rect) < BOX_TOP (*strut_rect))
|
||||||
{
|
{
|
||||||
temp_rect = g_new (MetaRectangle, 1);
|
temp_rect = g_new (MtkRectangle, 1);
|
||||||
*temp_rect = *rect;
|
*temp_rect = *rect;
|
||||||
temp_rect->height = BOX_TOP (*strut_rect) - BOX_TOP (*rect);
|
temp_rect->height = BOX_TOP (*strut_rect) - BOX_TOP (*rect);
|
||||||
ret = g_list_prepend (ret, temp_rect);
|
ret = g_list_prepend (ret, temp_rect);
|
||||||
@ -503,7 +484,7 @@ meta_rectangle_get_minimal_spanning_set_for_region (
|
|||||||
if (BOX_BOTTOM (*rect) > BOX_BOTTOM (*strut_rect))
|
if (BOX_BOTTOM (*rect) > BOX_BOTTOM (*strut_rect))
|
||||||
{
|
{
|
||||||
int new_y;
|
int new_y;
|
||||||
temp_rect = g_new (MetaRectangle, 1);
|
temp_rect = g_new (MtkRectangle, 1);
|
||||||
*temp_rect = *rect;
|
*temp_rect = *rect;
|
||||||
new_y = BOX_BOTTOM (*strut_rect);
|
new_y = BOX_BOTTOM (*strut_rect);
|
||||||
temp_rect->height = BOX_BOTTOM (*rect) - new_y;
|
temp_rect->height = BOX_BOTTOM (*rect) - new_y;
|
||||||
@ -562,7 +543,7 @@ meta_rectangle_expand_region_conditionally (GList *region,
|
|||||||
GList *tmp_list = region;
|
GList *tmp_list = region;
|
||||||
while (tmp_list)
|
while (tmp_list)
|
||||||
{
|
{
|
||||||
MetaRectangle *rect = (MetaRectangle*) tmp_list->data;
|
MtkRectangle *rect = (MtkRectangle*) tmp_list->data;
|
||||||
if (rect->width >= min_x)
|
if (rect->width >= min_x)
|
||||||
{
|
{
|
||||||
rect->x -= left_expand;
|
rect->x -= left_expand;
|
||||||
@ -580,8 +561,8 @@ meta_rectangle_expand_region_conditionally (GList *region,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
meta_rectangle_expand_to_avoiding_struts (MetaRectangle *rect,
|
meta_rectangle_expand_to_avoiding_struts (MtkRectangle *rect,
|
||||||
const MetaRectangle *expand_to,
|
const MtkRectangle *expand_to,
|
||||||
const MetaDirection direction,
|
const MetaDirection direction,
|
||||||
const GSList *all_struts)
|
const GSList *all_struts)
|
||||||
{
|
{
|
||||||
@ -657,7 +638,7 @@ meta_rectangle_free_list_and_elements (GList *filled_list)
|
|||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
meta_rectangle_could_fit_in_region (const GList *spanning_rects,
|
meta_rectangle_could_fit_in_region (const GList *spanning_rects,
|
||||||
const MetaRectangle *rect)
|
const MtkRectangle *rect)
|
||||||
{
|
{
|
||||||
const GList *temp;
|
const GList *temp;
|
||||||
gboolean could_fit;
|
gboolean could_fit;
|
||||||
@ -675,7 +656,7 @@ meta_rectangle_could_fit_in_region (const GList *spanning_rects,
|
|||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
meta_rectangle_contained_in_region (const GList * spanning_rects,
|
meta_rectangle_contained_in_region (const GList * spanning_rects,
|
||||||
const MetaRectangle *rect)
|
const MtkRectangle * rect)
|
||||||
{
|
{
|
||||||
const GList *temp;
|
const GList *temp;
|
||||||
gboolean contained;
|
gboolean contained;
|
||||||
@ -693,7 +674,7 @@ meta_rectangle_contained_in_region (const GList *spanning_rects,
|
|||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
meta_rectangle_overlaps_with_region (const GList * spanning_rects,
|
meta_rectangle_overlaps_with_region (const GList * spanning_rects,
|
||||||
const MetaRectangle *rect)
|
const MtkRectangle * rect)
|
||||||
{
|
{
|
||||||
const GList *temp;
|
const GList *temp;
|
||||||
gboolean overlaps;
|
gboolean overlaps;
|
||||||
@ -711,13 +692,13 @@ meta_rectangle_overlaps_with_region (const GList *spanning_rects,
|
|||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
meta_rectangle_is_adjacent_to_any_in_region (const GList *spanning_rects,
|
meta_rectangle_is_adjacent_to_any_in_region (const GList *spanning_rects,
|
||||||
MetaRectangle *rect)
|
MtkRectangle *rect)
|
||||||
{
|
{
|
||||||
const GList *l;
|
const GList *l;
|
||||||
|
|
||||||
for (l = spanning_rects; l; l = l->next)
|
for (l = spanning_rects; l; l = l->next)
|
||||||
{
|
{
|
||||||
MetaRectangle *other = (MetaRectangle *) l->data;
|
MtkRectangle *other = (MtkRectangle *) l->data;
|
||||||
|
|
||||||
if (rect == other || mtk_rectangle_equal (rect, other))
|
if (rect == other || mtk_rectangle_equal (rect, other))
|
||||||
continue;
|
continue;
|
||||||
@ -732,11 +713,11 @@ meta_rectangle_is_adjacent_to_any_in_region (const GList *spanning_rects,
|
|||||||
void
|
void
|
||||||
meta_rectangle_clamp_to_fit_into_region (const GList *spanning_rects,
|
meta_rectangle_clamp_to_fit_into_region (const GList *spanning_rects,
|
||||||
FixedDirections fixed_directions,
|
FixedDirections fixed_directions,
|
||||||
MetaRectangle *rect,
|
MtkRectangle *rect,
|
||||||
const MetaRectangle *min_size)
|
const MtkRectangle *min_size)
|
||||||
{
|
{
|
||||||
const GList *temp;
|
const GList *temp;
|
||||||
const MetaRectangle *best_rect = NULL;
|
const MtkRectangle *best_rect = NULL;
|
||||||
int best_overlap = 0;
|
int best_overlap = 0;
|
||||||
|
|
||||||
/* First, find best rectangle from spanning_rects to which we can clamp
|
/* First, find best rectangle from spanning_rects to which we can clamp
|
||||||
@ -744,7 +725,7 @@ meta_rectangle_clamp_to_fit_into_region (const GList *spanning_rects,
|
|||||||
*/
|
*/
|
||||||
for (temp = spanning_rects; temp; temp = temp->next)
|
for (temp = spanning_rects; temp; temp = temp->next)
|
||||||
{
|
{
|
||||||
MetaRectangle *compare_rect = temp->data;
|
MtkRectangle *compare_rect = temp->data;
|
||||||
int maximal_overlap_amount_for_compare;
|
int maximal_overlap_amount_for_compare;
|
||||||
|
|
||||||
/* If x is fixed and the entire width of rect doesn't fit in compare,
|
/* If x is fixed and the entire width of rect doesn't fit in compare,
|
||||||
@ -802,10 +783,10 @@ meta_rectangle_clamp_to_fit_into_region (const GList *spanning_rects,
|
|||||||
void
|
void
|
||||||
meta_rectangle_clip_to_region (const GList *spanning_rects,
|
meta_rectangle_clip_to_region (const GList *spanning_rects,
|
||||||
FixedDirections fixed_directions,
|
FixedDirections fixed_directions,
|
||||||
MetaRectangle *rect)
|
MtkRectangle *rect)
|
||||||
{
|
{
|
||||||
const GList *temp;
|
const GList *temp;
|
||||||
const MetaRectangle *best_rect = NULL;
|
const MtkRectangle *best_rect = NULL;
|
||||||
int best_overlap = 0;
|
int best_overlap = 0;
|
||||||
|
|
||||||
/* First, find best rectangle from spanning_rects to which we will clip
|
/* First, find best rectangle from spanning_rects to which we will clip
|
||||||
@ -813,8 +794,8 @@ meta_rectangle_clip_to_region (const GList *spanning_rects,
|
|||||||
*/
|
*/
|
||||||
for (temp = spanning_rects; temp; temp = temp->next)
|
for (temp = spanning_rects; temp; temp = temp->next)
|
||||||
{
|
{
|
||||||
MetaRectangle *compare_rect = temp->data;
|
MtkRectangle *compare_rect = temp->data;
|
||||||
MetaRectangle overlap;
|
MtkRectangle overlap;
|
||||||
int maximal_overlap_amount_for_compare;
|
int maximal_overlap_amount_for_compare;
|
||||||
|
|
||||||
/* If x is fixed and the entire width of rect doesn't fit in compare,
|
/* If x is fixed and the entire width of rect doesn't fit in compare,
|
||||||
@ -881,10 +862,10 @@ meta_rectangle_clip_to_region (const GList *spanning_rects,
|
|||||||
void
|
void
|
||||||
meta_rectangle_shove_into_region (const GList *spanning_rects,
|
meta_rectangle_shove_into_region (const GList *spanning_rects,
|
||||||
FixedDirections fixed_directions,
|
FixedDirections fixed_directions,
|
||||||
MetaRectangle *rect)
|
MtkRectangle *rect)
|
||||||
{
|
{
|
||||||
const GList *temp;
|
const GList *temp;
|
||||||
const MetaRectangle *best_rect = NULL;
|
const MtkRectangle *best_rect = NULL;
|
||||||
int best_overlap = 0;
|
int best_overlap = 0;
|
||||||
int shortest_distance = G_MAXINT;
|
int shortest_distance = G_MAXINT;
|
||||||
|
|
||||||
@ -894,7 +875,7 @@ meta_rectangle_shove_into_region (const GList *spanning_rects,
|
|||||||
|
|
||||||
for (temp = spanning_rects; temp; temp = temp->next)
|
for (temp = spanning_rects; temp; temp = temp->next)
|
||||||
{
|
{
|
||||||
MetaRectangle *compare_rect = temp->data;
|
MtkRectangle *compare_rect = temp->data;
|
||||||
int maximal_overlap_amount_for_compare;
|
int maximal_overlap_amount_for_compare;
|
||||||
int dist_to_compare;
|
int dist_to_compare;
|
||||||
|
|
||||||
@ -1044,7 +1025,8 @@ meta_rectangle_find_linepoint_closest_to_point (double x1,
|
|||||||
/***************************************************************************/
|
/***************************************************************************/
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
meta_rectangle_edge_aligns (const MetaRectangle *rect, const MetaEdge *edge)
|
meta_rectangle_edge_aligns (const MtkRectangle *rect,
|
||||||
|
const MetaEdge *edge)
|
||||||
{
|
{
|
||||||
/* The reason for the usage of <= below instead of < is because we are
|
/* The reason for the usage of <= below instead of < is because we are
|
||||||
* interested in in-the-way-or-adject'ness. So, a left (i.e. vertical
|
* interested in in-the-way-or-adject'ness. So, a left (i.e. vertical
|
||||||
@ -1070,22 +1052,22 @@ meta_rectangle_edge_aligns (const MetaRectangle *rect, const MetaEdge *edge)
|
|||||||
|
|
||||||
static GList*
|
static GList*
|
||||||
get_rect_minus_overlap (const GList *rect_in_list,
|
get_rect_minus_overlap (const GList *rect_in_list,
|
||||||
MetaRectangle *overlap)
|
MtkRectangle *overlap)
|
||||||
{
|
{
|
||||||
MetaRectangle *temp;
|
MtkRectangle *temp;
|
||||||
MetaRectangle *rect = rect_in_list->data;
|
MtkRectangle *rect = rect_in_list->data;
|
||||||
GList *ret = NULL;
|
GList *ret = NULL;
|
||||||
|
|
||||||
if (BOX_LEFT (*rect) < BOX_LEFT (*overlap))
|
if (BOX_LEFT (*rect) < BOX_LEFT (*overlap))
|
||||||
{
|
{
|
||||||
temp = g_new (MetaRectangle, 1);
|
temp = g_new (MtkRectangle, 1);
|
||||||
*temp = *rect;
|
*temp = *rect;
|
||||||
temp->width = BOX_LEFT (*overlap) - BOX_LEFT (*rect);
|
temp->width = BOX_LEFT (*overlap) - BOX_LEFT (*rect);
|
||||||
ret = g_list_prepend (ret, temp);
|
ret = g_list_prepend (ret, temp);
|
||||||
}
|
}
|
||||||
if (BOX_RIGHT (*rect) > BOX_RIGHT (*overlap))
|
if (BOX_RIGHT (*rect) > BOX_RIGHT (*overlap))
|
||||||
{
|
{
|
||||||
temp = g_new (MetaRectangle, 1);
|
temp = g_new (MtkRectangle, 1);
|
||||||
*temp = *rect;
|
*temp = *rect;
|
||||||
temp->x = BOX_RIGHT (*overlap);
|
temp->x = BOX_RIGHT (*overlap);
|
||||||
temp->width = BOX_RIGHT (*rect) - BOX_RIGHT (*overlap);
|
temp->width = BOX_RIGHT (*rect) - BOX_RIGHT (*overlap);
|
||||||
@ -1093,7 +1075,7 @@ get_rect_minus_overlap (const GList *rect_in_list,
|
|||||||
}
|
}
|
||||||
if (BOX_TOP (*rect) < BOX_TOP (*overlap))
|
if (BOX_TOP (*rect) < BOX_TOP (*overlap))
|
||||||
{
|
{
|
||||||
temp = g_new (MetaRectangle, 1);
|
temp = g_new (MtkRectangle, 1);
|
||||||
temp->x = overlap->x;
|
temp->x = overlap->x;
|
||||||
temp->width = overlap->width;
|
temp->width = overlap->width;
|
||||||
temp->y = BOX_TOP (*rect);
|
temp->y = BOX_TOP (*rect);
|
||||||
@ -1102,7 +1084,7 @@ get_rect_minus_overlap (const GList *rect_in_list,
|
|||||||
}
|
}
|
||||||
if (BOX_BOTTOM (*rect) > BOX_BOTTOM (*overlap))
|
if (BOX_BOTTOM (*rect) > BOX_BOTTOM (*overlap))
|
||||||
{
|
{
|
||||||
temp = g_new (MetaRectangle, 1);
|
temp = g_new (MtkRectangle, 1);
|
||||||
temp->x = overlap->x;
|
temp->x = overlap->x;
|
||||||
temp->width = overlap->width;
|
temp->width = overlap->width;
|
||||||
temp->y = BOX_BOTTOM (*overlap);
|
temp->y = BOX_BOTTOM (*overlap);
|
||||||
@ -1156,7 +1138,7 @@ replace_rect_with_list (GList *old_element,
|
|||||||
*/
|
*/
|
||||||
static GList*
|
static GList*
|
||||||
get_disjoint_strut_rect_list_in_region (const GSList *old_struts,
|
get_disjoint_strut_rect_list_in_region (const GSList *old_struts,
|
||||||
const MetaRectangle *region)
|
const MtkRectangle *region)
|
||||||
{
|
{
|
||||||
GList *strut_rects;
|
GList *strut_rects;
|
||||||
GList *tmp;
|
GList *tmp;
|
||||||
@ -1165,8 +1147,8 @@ get_disjoint_strut_rect_list_in_region (const GSList *old_struts,
|
|||||||
strut_rects = NULL;
|
strut_rects = NULL;
|
||||||
while (old_struts)
|
while (old_struts)
|
||||||
{
|
{
|
||||||
MetaRectangle *cur = &((MetaStrut*)old_struts->data)->rect;
|
MtkRectangle *cur = &((MetaStrut*)old_struts->data)->rect;
|
||||||
MetaRectangle *copy = g_new (MetaRectangle, 1);
|
MtkRectangle *copy = g_new (MtkRectangle, 1);
|
||||||
*copy = *cur;
|
*copy = *cur;
|
||||||
if (mtk_rectangle_intersect (copy, region, copy))
|
if (mtk_rectangle_intersect (copy, region, copy))
|
||||||
strut_rects = g_list_prepend (strut_rects, copy);
|
strut_rects = g_list_prepend (strut_rects, copy);
|
||||||
@ -1184,13 +1166,13 @@ get_disjoint_strut_rect_list_in_region (const GSList *old_struts,
|
|||||||
{
|
{
|
||||||
GList *compare;
|
GList *compare;
|
||||||
|
|
||||||
MetaRectangle *cur = tmp->data;
|
MtkRectangle *cur = tmp->data;
|
||||||
|
|
||||||
compare = tmp->next;
|
compare = tmp->next;
|
||||||
while (compare)
|
while (compare)
|
||||||
{
|
{
|
||||||
MetaRectangle *comp = compare->data;
|
MtkRectangle *comp = compare->data;
|
||||||
MetaRectangle overlap;
|
MtkRectangle overlap;
|
||||||
|
|
||||||
if (mtk_rectangle_intersect (cur, comp, &overlap))
|
if (mtk_rectangle_intersect (cur, comp, &overlap))
|
||||||
{
|
{
|
||||||
@ -1201,7 +1183,7 @@ get_disjoint_strut_rect_list_in_region (const GSList *old_struts,
|
|||||||
GList *comp_leftover = get_rect_minus_overlap (compare, &overlap);
|
GList *comp_leftover = get_rect_minus_overlap (compare, &overlap);
|
||||||
|
|
||||||
/* Add the intersection region to cur_leftover */
|
/* Add the intersection region to cur_leftover */
|
||||||
MetaRectangle *overlap_allocated = g_new (MetaRectangle, 1);
|
MtkRectangle *overlap_allocated = g_new (MtkRectangle, 1);
|
||||||
*overlap_allocated = overlap;
|
*overlap_allocated = overlap;
|
||||||
cur_leftover = g_list_prepend (cur_leftover, overlap_allocated);
|
cur_leftover = g_list_prepend (cur_leftover, overlap_allocated);
|
||||||
|
|
||||||
@ -1313,13 +1295,13 @@ edges_overlap (const MetaEdge *edge1,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
rectangle_and_edge_intersection (const MetaRectangle *rect,
|
rectangle_and_edge_intersection (const MtkRectangle *rect,
|
||||||
const MetaEdge *edge,
|
const MetaEdge *edge,
|
||||||
MetaEdge *overlap,
|
MetaEdge *overlap,
|
||||||
int *handle_type)
|
int *handle_type)
|
||||||
{
|
{
|
||||||
const MetaRectangle *rect2 = &edge->rect;
|
const MtkRectangle *rect2 = &edge->rect;
|
||||||
MetaRectangle *result = &overlap->rect;
|
MtkRectangle *result = &overlap->rect;
|
||||||
gboolean intersect = TRUE;
|
gboolean intersect = TRUE;
|
||||||
|
|
||||||
/* We don't know how to set these, so set them to invalid values */
|
/* We don't know how to set these, so set them to invalid values */
|
||||||
@ -1398,7 +1380,7 @@ rectangle_and_edge_intersection (const MetaRectangle *rect,
|
|||||||
*/
|
*/
|
||||||
static GList*
|
static GList*
|
||||||
add_edges (GList *cur_edges,
|
add_edges (GList *cur_edges,
|
||||||
const MetaRectangle *rect,
|
const MtkRectangle *rect,
|
||||||
gboolean rect_is_internal)
|
gboolean rect_is_internal)
|
||||||
{
|
{
|
||||||
MetaEdge *temp_edge;
|
MetaEdge *temp_edge;
|
||||||
@ -1504,8 +1486,10 @@ split_edge (GList *cur_list,
|
|||||||
* if and how rect and edge intersect.
|
* if and how rect and edge intersect.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
fix_up_edges (MetaRectangle *rect, MetaEdge *edge,
|
fix_up_edges (MtkRectangle *rect,
|
||||||
GList **strut_edges, GList **edge_splits,
|
MetaEdge *edge,
|
||||||
|
GList **strut_edges,
|
||||||
|
GList **edge_splits,
|
||||||
gboolean *edge_needs_removal)
|
gboolean *edge_needs_removal)
|
||||||
{
|
{
|
||||||
MetaEdge overlap;
|
MetaEdge overlap;
|
||||||
@ -1566,7 +1550,7 @@ meta_rectangle_remove_intersections_with_boxes_from_edges (
|
|||||||
rect_iter = rectangles;
|
rect_iter = rectangles;
|
||||||
while (rect_iter)
|
while (rect_iter)
|
||||||
{
|
{
|
||||||
MetaRectangle *rect = rect_iter->data;
|
MtkRectangle *rect = rect_iter->data;
|
||||||
GList *edge_iter = edges;
|
GList *edge_iter = edges;
|
||||||
while (edge_iter)
|
while (edge_iter)
|
||||||
{
|
{
|
||||||
@ -1623,7 +1607,7 @@ meta_rectangle_remove_intersections_with_boxes_from_edges (
|
|||||||
* This function is trying to find all the edges of an onscreen region.
|
* This function is trying to find all the edges of an onscreen region.
|
||||||
*/
|
*/
|
||||||
GList*
|
GList*
|
||||||
meta_rectangle_find_onscreen_edges (const MetaRectangle *basic_rect,
|
meta_rectangle_find_onscreen_edges (const MtkRectangle *basic_rect,
|
||||||
const GSList *all_struts)
|
const GSList *all_struts)
|
||||||
{
|
{
|
||||||
GList *ret;
|
GList *ret;
|
||||||
@ -1656,7 +1640,7 @@ meta_rectangle_find_onscreen_edges (const MetaRectangle *basic_rect,
|
|||||||
strut_rect_iter = fixed_strut_rects;
|
strut_rect_iter = fixed_strut_rects;
|
||||||
while (strut_rect_iter)
|
while (strut_rect_iter)
|
||||||
{
|
{
|
||||||
MetaRectangle *strut_rect = (MetaRectangle*) strut_rect_iter->data;
|
MtkRectangle *strut_rect = (MtkRectangle*) strut_rect_iter->data;
|
||||||
|
|
||||||
/* Get the new possible edges we may need to add from the strut */
|
/* Get the new possible edges we may need to add from the strut */
|
||||||
GList *new_strut_edges = add_edges (NULL, strut_rect, FALSE);
|
GList *new_strut_edges = add_edges (NULL, strut_rect, FALSE);
|
||||||
@ -1731,11 +1715,11 @@ meta_rectangle_find_nonintersected_monitor_edges (
|
|||||||
cur = monitor_rects;
|
cur = monitor_rects;
|
||||||
while (cur)
|
while (cur)
|
||||||
{
|
{
|
||||||
MetaRectangle *cur_rect = cur->data;
|
MtkRectangle *cur_rect = cur->data;
|
||||||
const GList *compare = monitor_rects;
|
const GList *compare = monitor_rects;
|
||||||
while (compare)
|
while (compare)
|
||||||
{
|
{
|
||||||
MetaRectangle *compare_rect = compare->data;
|
MtkRectangle *compare_rect = compare->data;
|
||||||
|
|
||||||
/* Check if cur might be horizontally adjacent to compare */
|
/* Check if cur might be horizontally adjacent to compare */
|
||||||
if (mtk_rectangle_vert_overlap (cur_rect, compare_rect))
|
if (mtk_rectangle_vert_overlap (cur_rect, compare_rect))
|
||||||
@ -1843,8 +1827,8 @@ meta_rectangle_find_nonintersected_monitor_edges (
|
|||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
meta_rectangle_is_adjacent_to (MetaRectangle *rect,
|
meta_rectangle_is_adjacent_to (MtkRectangle *rect,
|
||||||
MetaRectangle *other)
|
MtkRectangle *other)
|
||||||
{
|
{
|
||||||
int rect_x1 = rect->x;
|
int rect_x1 = rect->x;
|
||||||
int rect_y1 = rect->y;
|
int rect_y1 = rect->y;
|
||||||
@ -1866,10 +1850,10 @@ meta_rectangle_is_adjacent_to (MetaRectangle *rect,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
meta_rectangle_scale_double (const MetaRectangle *rect,
|
meta_rectangle_scale_double (const MtkRectangle *rect,
|
||||||
double scale,
|
double scale,
|
||||||
MetaRoundingStrategy rounding_strategy,
|
MetaRoundingStrategy rounding_strategy,
|
||||||
MetaRectangle *dest)
|
MtkRectangle *dest)
|
||||||
{
|
{
|
||||||
graphene_rect_t tmp = GRAPHENE_RECT_INIT (rect->x, rect->y,
|
graphene_rect_t tmp = GRAPHENE_RECT_INIT (rect->x, rect->y,
|
||||||
rect->width, rect->height);
|
rect->width, rect->height);
|
||||||
@ -1880,11 +1864,11 @@ meta_rectangle_scale_double (const MetaRectangle *rect,
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* meta_rectangle_transform:
|
* meta_rectangle_transform:
|
||||||
* @rect: the #MetaRectangle to be transformed
|
* @rect: the #MtkRectangle to be transformed
|
||||||
* @transform: the #MetaMonitorTransform
|
* @transform: the #MetaMonitorTransform
|
||||||
* @width: the width of the target space
|
* @width: the width of the target space
|
||||||
* @height: the height of the target space
|
* @height: the height of the target space
|
||||||
* @dest: the transformed #MetaRectangle
|
* @dest: the transformed #MtkRectangle
|
||||||
*
|
*
|
||||||
* This function transforms the values in @rect in order to compensate for
|
* This function transforms the values in @rect in order to compensate for
|
||||||
* @transform applied to a #MetaMonitor, making them match the viewport. Note
|
* @transform applied to a #MetaMonitor, making them match the viewport. Note
|
||||||
@ -1892,11 +1876,11 @@ meta_rectangle_scale_double (const MetaRectangle *rect,
|
|||||||
* an anti-clockwise rotation has to be applied to @rect.
|
* an anti-clockwise rotation has to be applied to @rect.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
meta_rectangle_transform (const MetaRectangle *rect,
|
meta_rectangle_transform (const MtkRectangle *rect,
|
||||||
MetaMonitorTransform transform,
|
MetaMonitorTransform transform,
|
||||||
int width,
|
int width,
|
||||||
int height,
|
int height,
|
||||||
MetaRectangle *dest)
|
MtkRectangle *dest)
|
||||||
{
|
{
|
||||||
switch (transform)
|
switch (transform)
|
||||||
{
|
{
|
||||||
@ -1904,7 +1888,7 @@ meta_rectangle_transform (const MetaRectangle *rect,
|
|||||||
*dest = *rect;
|
*dest = *rect;
|
||||||
break;
|
break;
|
||||||
case META_MONITOR_TRANSFORM_90:
|
case META_MONITOR_TRANSFORM_90:
|
||||||
*dest = (MetaRectangle) {
|
*dest = (MtkRectangle) {
|
||||||
.x = rect->y,
|
.x = rect->y,
|
||||||
.y = height - (rect->x + rect->width),
|
.y = height - (rect->x + rect->width),
|
||||||
.width = rect->height,
|
.width = rect->height,
|
||||||
@ -1912,7 +1896,7 @@ meta_rectangle_transform (const MetaRectangle *rect,
|
|||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
case META_MONITOR_TRANSFORM_180:
|
case META_MONITOR_TRANSFORM_180:
|
||||||
*dest = (MetaRectangle) {
|
*dest = (MtkRectangle) {
|
||||||
.x = width - (rect->x + rect->width),
|
.x = width - (rect->x + rect->width),
|
||||||
.y = height - (rect->y + rect->height),
|
.y = height - (rect->y + rect->height),
|
||||||
.width = rect->width,
|
.width = rect->width,
|
||||||
@ -1920,7 +1904,7 @@ meta_rectangle_transform (const MetaRectangle *rect,
|
|||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
case META_MONITOR_TRANSFORM_270:
|
case META_MONITOR_TRANSFORM_270:
|
||||||
*dest = (MetaRectangle) {
|
*dest = (MtkRectangle) {
|
||||||
.x = width - (rect->y + rect->height),
|
.x = width - (rect->y + rect->height),
|
||||||
.y = rect->x,
|
.y = rect->x,
|
||||||
.width = rect->height,
|
.width = rect->height,
|
||||||
@ -1928,7 +1912,7 @@ meta_rectangle_transform (const MetaRectangle *rect,
|
|||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
case META_MONITOR_TRANSFORM_FLIPPED:
|
case META_MONITOR_TRANSFORM_FLIPPED:
|
||||||
*dest = (MetaRectangle) {
|
*dest = (MtkRectangle) {
|
||||||
.x = width - (rect->x + rect->width),
|
.x = width - (rect->x + rect->width),
|
||||||
.y = rect->y,
|
.y = rect->y,
|
||||||
.width = rect->width,
|
.width = rect->width,
|
||||||
@ -1936,7 +1920,7 @@ meta_rectangle_transform (const MetaRectangle *rect,
|
|||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
case META_MONITOR_TRANSFORM_FLIPPED_90:
|
case META_MONITOR_TRANSFORM_FLIPPED_90:
|
||||||
*dest = (MetaRectangle) {
|
*dest = (MtkRectangle) {
|
||||||
.x = rect->y,
|
.x = rect->y,
|
||||||
.y = rect->x,
|
.y = rect->x,
|
||||||
.width = rect->height,
|
.width = rect->height,
|
||||||
@ -1944,7 +1928,7 @@ meta_rectangle_transform (const MetaRectangle *rect,
|
|||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
case META_MONITOR_TRANSFORM_FLIPPED_180:
|
case META_MONITOR_TRANSFORM_FLIPPED_180:
|
||||||
*dest = (MetaRectangle) {
|
*dest = (MtkRectangle) {
|
||||||
.x = rect->x,
|
.x = rect->x,
|
||||||
.y = height - (rect->y + rect->height),
|
.y = height - (rect->y + rect->height),
|
||||||
.width = rect->width,
|
.width = rect->width,
|
||||||
@ -1952,7 +1936,7 @@ meta_rectangle_transform (const MetaRectangle *rect,
|
|||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
case META_MONITOR_TRANSFORM_FLIPPED_270:
|
case META_MONITOR_TRANSFORM_FLIPPED_270:
|
||||||
*dest = (MetaRectangle) {
|
*dest = (MtkRectangle) {
|
||||||
.x = width - (rect->y + rect->height),
|
.x = width - (rect->y + rect->height),
|
||||||
.y = height - (rect->x + rect->width),
|
.y = height - (rect->x + rect->width),
|
||||||
.width = rect->height,
|
.width = rect->height,
|
||||||
@ -1965,13 +1949,13 @@ meta_rectangle_transform (const MetaRectangle *rect,
|
|||||||
void
|
void
|
||||||
meta_rectangle_from_graphene_rect (const graphene_rect_t *rect,
|
meta_rectangle_from_graphene_rect (const graphene_rect_t *rect,
|
||||||
MetaRoundingStrategy rounding_strategy,
|
MetaRoundingStrategy rounding_strategy,
|
||||||
MetaRectangle *dest)
|
MtkRectangle *dest)
|
||||||
{
|
{
|
||||||
switch (rounding_strategy)
|
switch (rounding_strategy)
|
||||||
{
|
{
|
||||||
case META_ROUNDING_STRATEGY_SHRINK:
|
case META_ROUNDING_STRATEGY_SHRINK:
|
||||||
{
|
{
|
||||||
*dest = (MetaRectangle) {
|
*dest = (MtkRectangle) {
|
||||||
.x = ceilf (rect->origin.x),
|
.x = ceilf (rect->origin.x),
|
||||||
.y = ceilf (rect->origin.y),
|
.y = ceilf (rect->origin.y),
|
||||||
.width = floorf (rect->size.width),
|
.width = floorf (rect->size.width),
|
||||||
@ -1985,7 +1969,7 @@ meta_rectangle_from_graphene_rect (const graphene_rect_t *rect,
|
|||||||
|
|
||||||
graphene_rect_round_extents (&clamped, &clamped);
|
graphene_rect_round_extents (&clamped, &clamped);
|
||||||
|
|
||||||
*dest = (MetaRectangle) {
|
*dest = (MtkRectangle) {
|
||||||
.x = clamped.origin.x,
|
.x = clamped.origin.x,
|
||||||
.y = clamped.origin.y,
|
.y = clamped.origin.y,
|
||||||
.width = clamped.size.width,
|
.width = clamped.size.width,
|
||||||
@ -1995,7 +1979,7 @@ meta_rectangle_from_graphene_rect (const graphene_rect_t *rect,
|
|||||||
break;
|
break;
|
||||||
case META_ROUNDING_STRATEGY_ROUND:
|
case META_ROUNDING_STRATEGY_ROUND:
|
||||||
{
|
{
|
||||||
*dest = (MetaRectangle) {
|
*dest = (MtkRectangle) {
|
||||||
.x = roundf (rect->origin.x),
|
.x = roundf (rect->origin.x),
|
||||||
.y = roundf (rect->origin.y),
|
.y = roundf (rect->origin.y),
|
||||||
.width = roundf (rect->size.width),
|
.width = roundf (rect->size.width),
|
||||||
@ -2006,11 +1990,11 @@ meta_rectangle_from_graphene_rect (const graphene_rect_t *rect,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
meta_rectangle_crop_and_scale (const MetaRectangle *rect,
|
meta_rectangle_crop_and_scale (const MtkRectangle *rect,
|
||||||
graphene_rect_t *src_rect,
|
graphene_rect_t *src_rect,
|
||||||
int dst_width,
|
int dst_width,
|
||||||
int dst_height,
|
int dst_height,
|
||||||
MetaRectangle *dest)
|
MtkRectangle *dest)
|
||||||
{
|
{
|
||||||
graphene_rect_t tmp = GRAPHENE_RECT_INIT (rect->x, rect->y,
|
graphene_rect_t tmp = GRAPHENE_RECT_INIT (rect->x, rect->y,
|
||||||
rect->width, rect->height);
|
rect->width, rect->height);
|
||||||
|
@ -124,9 +124,9 @@ typedef struct
|
|||||||
{
|
{
|
||||||
MetaBackend *backend;
|
MetaBackend *backend;
|
||||||
|
|
||||||
MetaRectangle orig;
|
MtkRectangle orig;
|
||||||
MetaRectangle current;
|
MtkRectangle current;
|
||||||
MetaRectangle temporary;
|
MtkRectangle temporary;
|
||||||
int rel_x;
|
int rel_x;
|
||||||
int rel_y;
|
int rel_y;
|
||||||
ActionType action_type;
|
ActionType action_type;
|
||||||
@ -143,8 +143,8 @@ typedef struct
|
|||||||
/* work_area_monitor - current monitor region minus struts
|
/* work_area_monitor - current monitor region minus struts
|
||||||
* entire_monitor - current monitor, including strut regions
|
* entire_monitor - current monitor, including strut regions
|
||||||
*/
|
*/
|
||||||
MetaRectangle work_area_monitor;
|
MtkRectangle work_area_monitor;
|
||||||
MetaRectangle entire_monitor;
|
MtkRectangle entire_monitor;
|
||||||
|
|
||||||
/* Spanning rectangles for the non-covered (by struts) region of the
|
/* Spanning rectangles for the non-covered (by struts) region of the
|
||||||
* screen and also for just the current monitor
|
* screen and also for just the current monitor
|
||||||
@ -213,8 +213,8 @@ static void setup_constraint_info (MetaBackend *backend,
|
|||||||
MetaWindow *window,
|
MetaWindow *window,
|
||||||
MetaMoveResizeFlags flags,
|
MetaMoveResizeFlags flags,
|
||||||
MetaGravity resize_gravity,
|
MetaGravity resize_gravity,
|
||||||
const MetaRectangle *orig,
|
const MtkRectangle *orig,
|
||||||
MetaRectangle *new);
|
MtkRectangle *new);
|
||||||
static void place_window_if_needed (MetaWindow *window,
|
static void place_window_if_needed (MetaWindow *window,
|
||||||
ConstraintInfo *info);
|
ConstraintInfo *info);
|
||||||
static void update_onscreen_requirements (MetaWindow *window,
|
static void update_onscreen_requirements (MetaWindow *window,
|
||||||
@ -289,9 +289,9 @@ void
|
|||||||
meta_window_constrain (MetaWindow *window,
|
meta_window_constrain (MetaWindow *window,
|
||||||
MetaMoveResizeFlags flags,
|
MetaMoveResizeFlags flags,
|
||||||
MetaGravity resize_gravity,
|
MetaGravity resize_gravity,
|
||||||
const MetaRectangle *orig,
|
const MtkRectangle *orig,
|
||||||
MetaRectangle *new,
|
MtkRectangle *new,
|
||||||
MetaRectangle *temporary,
|
MtkRectangle *temporary,
|
||||||
int *rel_x,
|
int *rel_x,
|
||||||
int *rel_y)
|
int *rel_y)
|
||||||
{
|
{
|
||||||
@ -351,8 +351,8 @@ setup_constraint_info (MetaBackend *backend,
|
|||||||
MetaWindow *window,
|
MetaWindow *window,
|
||||||
MetaMoveResizeFlags flags,
|
MetaMoveResizeFlags flags,
|
||||||
MetaGravity resize_gravity,
|
MetaGravity resize_gravity,
|
||||||
const MetaRectangle *orig,
|
const MtkRectangle *orig,
|
||||||
MetaRectangle *new)
|
MtkRectangle *new)
|
||||||
{
|
{
|
||||||
MetaMonitorManager *monitor_manager =
|
MetaMonitorManager *monitor_manager =
|
||||||
meta_backend_get_monitor_manager (backend);
|
meta_backend_get_monitor_manager (backend);
|
||||||
@ -419,8 +419,8 @@ setup_constraint_info (MetaBackend *backend,
|
|||||||
placement_rule = meta_window_get_placement_rule (window);
|
placement_rule = meta_window_get_placement_rule (window);
|
||||||
if (placement_rule)
|
if (placement_rule)
|
||||||
{
|
{
|
||||||
MetaRectangle rect;
|
MtkRectangle rect;
|
||||||
MetaRectangle parent_rect;
|
MtkRectangle parent_rect;
|
||||||
|
|
||||||
rect = placement_rule->anchor_rect;
|
rect = placement_rule->anchor_rect;
|
||||||
|
|
||||||
@ -517,7 +517,7 @@ setup_constraint_info (MetaBackend *backend,
|
|||||||
info->entire_monitor.width, info->entire_monitor.height);
|
info->entire_monitor.width, info->entire_monitor.height);
|
||||||
}
|
}
|
||||||
|
|
||||||
static MetaRectangle *
|
static MtkRectangle *
|
||||||
get_start_rect_for_resize (MetaWindow *window,
|
get_start_rect_for_resize (MetaWindow *window,
|
||||||
ConstraintInfo *info)
|
ConstraintInfo *info)
|
||||||
{
|
{
|
||||||
@ -548,12 +548,12 @@ place_window_if_needed(MetaWindow *window,
|
|||||||
{
|
{
|
||||||
MetaMonitorManager *monitor_manager =
|
MetaMonitorManager *monitor_manager =
|
||||||
meta_backend_get_monitor_manager (info->backend);
|
meta_backend_get_monitor_manager (info->backend);
|
||||||
MetaRectangle orig_rect;
|
MtkRectangle orig_rect;
|
||||||
MetaRectangle placed_rect;
|
MtkRectangle placed_rect;
|
||||||
MetaWorkspace *cur_workspace;
|
MetaWorkspace *cur_workspace;
|
||||||
MetaLogicalMonitor *logical_monitor;
|
MetaLogicalMonitor *logical_monitor;
|
||||||
|
|
||||||
placed_rect = (MetaRectangle) {
|
placed_rect = (MtkRectangle) {
|
||||||
.x = window->rect.x,
|
.x = window->rect.x,
|
||||||
.y = window->rect.y,
|
.y = window->rect.y,
|
||||||
.width = info->current.width,
|
.width = info->current.width,
|
||||||
@ -711,7 +711,7 @@ update_onscreen_requirements (MetaWindow *window,
|
|||||||
*/
|
*/
|
||||||
if (window->frame && window->decorated)
|
if (window->frame && window->decorated)
|
||||||
{
|
{
|
||||||
MetaRectangle titlebar_rect, frame_rect;
|
MtkRectangle titlebar_rect, frame_rect;
|
||||||
|
|
||||||
meta_window_get_titlebar_rect (window, &titlebar_rect);
|
meta_window_get_titlebar_rect (window, &titlebar_rect);
|
||||||
meta_window_get_frame_rect (window, &frame_rect);
|
meta_window_get_frame_rect (window, &frame_rect);
|
||||||
@ -734,10 +734,10 @@ update_onscreen_requirements (MetaWindow *window,
|
|||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
get_size_limits (MetaWindow *window,
|
get_size_limits (MetaWindow *window,
|
||||||
MetaRectangle *min_size,
|
MtkRectangle *min_size,
|
||||||
MetaRectangle *max_size)
|
MtkRectangle *max_size)
|
||||||
{
|
{
|
||||||
/* We pack the results into MetaRectangle structs just for convenience; we
|
/* We pack the results into MtkRectangle structs just for convenience; we
|
||||||
* don't actually use the position of those rects.
|
* don't actually use the position of those rects.
|
||||||
*/
|
*/
|
||||||
min_size->x = min_size->y = max_size->x = max_size->y = 0;
|
min_size->x = min_size->y = max_size->x = max_size->y = 0;
|
||||||
@ -809,14 +809,14 @@ try_flip_window_position (MetaWindow *window,
|
|||||||
MetaPlacementConstraintAdjustment constraint_adjustment,
|
MetaPlacementConstraintAdjustment constraint_adjustment,
|
||||||
int parent_x,
|
int parent_x,
|
||||||
int parent_y,
|
int parent_y,
|
||||||
MetaRectangle *rect,
|
MtkRectangle *rect,
|
||||||
int *rel_x,
|
int *rel_x,
|
||||||
int *rel_y,
|
int *rel_y,
|
||||||
MetaRectangle *intersection)
|
MtkRectangle *intersection)
|
||||||
{
|
{
|
||||||
MetaPlacementRule flipped_rule = *placement_rule;
|
MetaPlacementRule flipped_rule = *placement_rule;
|
||||||
MetaRectangle flipped_rect;
|
MtkRectangle flipped_rect;
|
||||||
MetaRectangle flipped_intersection;
|
MtkRectangle flipped_intersection;
|
||||||
int flipped_rel_x;
|
int flipped_rel_x;
|
||||||
int flipped_rel_y;
|
int flipped_rel_y;
|
||||||
|
|
||||||
@ -855,9 +855,9 @@ try_flip_window_position (MetaWindow *window,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
is_custom_rule_satisfied (MetaRectangle *rect,
|
is_custom_rule_satisfied (MtkRectangle *rect,
|
||||||
MetaPlacementRule *placement_rule,
|
MetaPlacementRule *placement_rule,
|
||||||
MetaRectangle *intersection)
|
MtkRectangle *intersection)
|
||||||
{
|
{
|
||||||
uint32_t x_constrain_actions, y_constrain_actions;
|
uint32_t x_constrain_actions, y_constrain_actions;
|
||||||
|
|
||||||
@ -881,10 +881,10 @@ constrain_custom_rule (MetaWindow *window,
|
|||||||
gboolean check_only)
|
gboolean check_only)
|
||||||
{
|
{
|
||||||
MetaPlacementRule *placement_rule;
|
MetaPlacementRule *placement_rule;
|
||||||
MetaRectangle intersection;
|
MtkRectangle intersection;
|
||||||
gboolean constraint_satisfied;
|
gboolean constraint_satisfied;
|
||||||
MetaRectangle temporary_rect;
|
MtkRectangle temporary_rect;
|
||||||
MetaRectangle adjusted_unconstrained;
|
MtkRectangle adjusted_unconstrained;
|
||||||
int adjusted_rel_x;
|
int adjusted_rel_x;
|
||||||
int adjusted_rel_y;
|
int adjusted_rel_y;
|
||||||
MetaPlacementRule current_rule;
|
MetaPlacementRule current_rule;
|
||||||
@ -925,7 +925,7 @@ constrain_custom_rule (MetaWindow *window,
|
|||||||
case META_PLACEMENT_STATE_CONSTRAINED_PENDING:
|
case META_PLACEMENT_STATE_CONSTRAINED_PENDING:
|
||||||
case META_PLACEMENT_STATE_CONSTRAINED_FINISHED:
|
case META_PLACEMENT_STATE_CONSTRAINED_FINISHED:
|
||||||
case META_PLACEMENT_STATE_INVALIDATED:
|
case META_PLACEMENT_STATE_INVALIDATED:
|
||||||
temporary_rect = (MetaRectangle) {
|
temporary_rect = (MtkRectangle) {
|
||||||
.x = parent->rect.x + window->placement.current.rel_x,
|
.x = parent->rect.x + window->placement.current.rel_x,
|
||||||
.y = parent->rect.y + window->placement.current.rel_y,
|
.y = parent->rect.y + window->placement.current.rel_y,
|
||||||
.width = info->current.width,
|
.width = info->current.width,
|
||||||
@ -1147,7 +1147,7 @@ constrain_modal_dialog (MetaWindow *window,
|
|||||||
{
|
{
|
||||||
int x, y;
|
int x, y;
|
||||||
MetaWindow *parent = meta_window_get_transient_for (window);
|
MetaWindow *parent = meta_window_get_transient_for (window);
|
||||||
MetaRectangle child_rect, parent_rect;
|
MtkRectangle child_rect, parent_rect;
|
||||||
gboolean constraint_already_satisfied;
|
gboolean constraint_already_satisfied;
|
||||||
|
|
||||||
if (!parent ||
|
if (!parent ||
|
||||||
@ -1192,8 +1192,8 @@ constrain_maximization (MetaWindow *window,
|
|||||||
gboolean check_only)
|
gboolean check_only)
|
||||||
{
|
{
|
||||||
MetaWorkspaceManager *workspace_manager = window->display->workspace_manager;
|
MetaWorkspaceManager *workspace_manager = window->display->workspace_manager;
|
||||||
MetaRectangle target_size;
|
MtkRectangle target_size;
|
||||||
MetaRectangle min_size, max_size;
|
MtkRectangle min_size, max_size;
|
||||||
gboolean hminbad, vminbad;
|
gboolean hminbad, vminbad;
|
||||||
gboolean horiz_equal, vert_equal;
|
gboolean horiz_equal, vert_equal;
|
||||||
gboolean constraint_already_satisfied;
|
gboolean constraint_already_satisfied;
|
||||||
@ -1280,8 +1280,8 @@ constrain_tiling (MetaWindow *window,
|
|||||||
ConstraintPriority priority,
|
ConstraintPriority priority,
|
||||||
gboolean check_only)
|
gboolean check_only)
|
||||||
{
|
{
|
||||||
MetaRectangle target_size;
|
MtkRectangle target_size;
|
||||||
MetaRectangle min_size, max_size;
|
MtkRectangle min_size, max_size;
|
||||||
gboolean hminbad, vminbad;
|
gboolean hminbad, vminbad;
|
||||||
gboolean horiz_equal, vert_equal;
|
gboolean horiz_equal, vert_equal;
|
||||||
gboolean constraint_already_satisfied;
|
gboolean constraint_already_satisfied;
|
||||||
@ -1332,7 +1332,7 @@ constrain_fullscreen (MetaWindow *window,
|
|||||||
ConstraintPriority priority,
|
ConstraintPriority priority,
|
||||||
gboolean check_only)
|
gboolean check_only)
|
||||||
{
|
{
|
||||||
MetaRectangle min_size, max_size, monitor;
|
MtkRectangle min_size, max_size, monitor;
|
||||||
gboolean too_big, too_small, constraint_already_satisfied;
|
gboolean too_big, too_small, constraint_already_satisfied;
|
||||||
|
|
||||||
if (priority > PRIORITY_FULLSCREEN)
|
if (priority > PRIORITY_FULLSCREEN)
|
||||||
@ -1370,8 +1370,8 @@ constrain_size_increments (MetaWindow *window,
|
|||||||
int bh, hi, bw, wi, extra_height, extra_width;
|
int bh, hi, bw, wi, extra_height, extra_width;
|
||||||
int new_width, new_height;
|
int new_width, new_height;
|
||||||
gboolean constraint_already_satisfied;
|
gboolean constraint_already_satisfied;
|
||||||
MetaRectangle *start_rect;
|
MtkRectangle *start_rect;
|
||||||
MetaRectangle client_rect;
|
MtkRectangle client_rect;
|
||||||
|
|
||||||
if (priority > PRIORITY_SIZE_HINTS_INCREMENTS)
|
if (priority > PRIORITY_SIZE_HINTS_INCREMENTS)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@ -1441,10 +1441,10 @@ constrain_size_limits (MetaWindow *window,
|
|||||||
ConstraintPriority priority,
|
ConstraintPriority priority,
|
||||||
gboolean check_only)
|
gboolean check_only)
|
||||||
{
|
{
|
||||||
MetaRectangle min_size, max_size;
|
MtkRectangle min_size, max_size;
|
||||||
gboolean too_big, too_small, constraint_already_satisfied;
|
gboolean too_big, too_small, constraint_already_satisfied;
|
||||||
int new_width, new_height;
|
int new_width, new_height;
|
||||||
MetaRectangle *start_rect;
|
MtkRectangle *start_rect;
|
||||||
|
|
||||||
if (priority > PRIORITY_SIZE_HINTS_LIMITS)
|
if (priority > PRIORITY_SIZE_HINTS_LIMITS)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@ -1495,8 +1495,8 @@ constrain_aspect_ratio (MetaWindow *window,
|
|||||||
int fudge, new_width, new_height;
|
int fudge, new_width, new_height;
|
||||||
double best_width, best_height;
|
double best_width, best_height;
|
||||||
double alt_width, alt_height;
|
double alt_width, alt_height;
|
||||||
MetaRectangle *start_rect;
|
MtkRectangle *start_rect;
|
||||||
MetaRectangle client_rect;
|
MtkRectangle client_rect;
|
||||||
|
|
||||||
if (priority > PRIORITY_ASPECT_RATIO)
|
if (priority > PRIORITY_ASPECT_RATIO)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@ -1633,7 +1633,7 @@ do_screen_and_monitor_relative_constraints (
|
|||||||
gboolean check_only)
|
gboolean check_only)
|
||||||
{
|
{
|
||||||
gboolean exit_early = FALSE, constraint_satisfied;
|
gboolean exit_early = FALSE, constraint_satisfied;
|
||||||
MetaRectangle how_far_it_can_be_smushed, min_size, max_size;
|
MtkRectangle how_far_it_can_be_smushed, min_size, max_size;
|
||||||
|
|
||||||
#ifdef WITH_VERBOSE_MODE
|
#ifdef WITH_VERBOSE_MODE
|
||||||
if (meta_is_verbose ())
|
if (meta_is_verbose ())
|
||||||
|
@ -29,8 +29,8 @@
|
|||||||
void meta_window_constrain (MetaWindow *window,
|
void meta_window_constrain (MetaWindow *window,
|
||||||
MetaMoveResizeFlags flags,
|
MetaMoveResizeFlags flags,
|
||||||
MetaGravity resize_gravity,
|
MetaGravity resize_gravity,
|
||||||
const MetaRectangle *orig,
|
const MtkRectangle *orig,
|
||||||
MetaRectangle *new,
|
MtkRectangle *new,
|
||||||
MetaRectangle *intermediate,
|
MtkRectangle *intermediate,
|
||||||
int *rel_x,
|
int *rel_x,
|
||||||
int *rel_y);
|
int *rel_y);
|
||||||
|
@ -286,7 +286,7 @@ gboolean meta_display_request_restart (MetaDisplay *display);
|
|||||||
|
|
||||||
gboolean meta_display_show_resize_popup (MetaDisplay *display,
|
gboolean meta_display_show_resize_popup (MetaDisplay *display,
|
||||||
gboolean show,
|
gboolean show,
|
||||||
MetaRectangle *rect,
|
MtkRectangle *rect,
|
||||||
int display_w,
|
int display_w,
|
||||||
int display_h);
|
int display_h);
|
||||||
|
|
||||||
|
@ -456,7 +456,7 @@ meta_display_class_init (MetaDisplayClass *klass)
|
|||||||
g_signal_accumulator_true_handled,
|
g_signal_accumulator_true_handled,
|
||||||
NULL, NULL,
|
NULL, NULL,
|
||||||
G_TYPE_BOOLEAN, 4,
|
G_TYPE_BOOLEAN, 4,
|
||||||
G_TYPE_BOOLEAN, META_TYPE_RECTANGLE, G_TYPE_INT, G_TYPE_INT);
|
G_TYPE_BOOLEAN, MTK_TYPE_RECTANGLE, G_TYPE_INT, G_TYPE_INT);
|
||||||
|
|
||||||
display_signals[GL_VIDEO_MEMORY_PURGED] =
|
display_signals[GL_VIDEO_MEMORY_PURGED] =
|
||||||
g_signal_new ("gl-video-memory-purged",
|
g_signal_new ("gl-video-memory-purged",
|
||||||
@ -2705,7 +2705,7 @@ meta_display_request_restart (MetaDisplay *display)
|
|||||||
gboolean
|
gboolean
|
||||||
meta_display_show_resize_popup (MetaDisplay *display,
|
meta_display_show_resize_popup (MetaDisplay *display,
|
||||||
gboolean show,
|
gboolean show,
|
||||||
MetaRectangle *rect,
|
MtkRectangle *rect,
|
||||||
int display_w,
|
int display_w,
|
||||||
int display_h)
|
int display_h)
|
||||||
{
|
{
|
||||||
@ -3234,7 +3234,7 @@ check_fullscreen_func (gpointer data)
|
|||||||
|
|
||||||
if (covers_monitors)
|
if (covers_monitors)
|
||||||
{
|
{
|
||||||
MetaRectangle window_rect;
|
MtkRectangle window_rect;
|
||||||
|
|
||||||
meta_window_get_frame_rect (window, &window_rect);
|
meta_window_get_frame_rect (window, &window_rect);
|
||||||
|
|
||||||
@ -3301,7 +3301,7 @@ meta_display_queue_check_fullscreen (MetaDisplay *display)
|
|||||||
|
|
||||||
int
|
int
|
||||||
meta_display_get_monitor_index_for_rect (MetaDisplay *display,
|
meta_display_get_monitor_index_for_rect (MetaDisplay *display,
|
||||||
MetaRectangle *rect)
|
MtkRectangle *rect)
|
||||||
{
|
{
|
||||||
MetaBackend *backend = backend_from_display (display);
|
MetaBackend *backend = backend_from_display (display);
|
||||||
MetaMonitorManager *monitor_manager =
|
MetaMonitorManager *monitor_manager =
|
||||||
@ -3416,7 +3416,7 @@ meta_display_get_primary_monitor (MetaDisplay *display)
|
|||||||
void
|
void
|
||||||
meta_display_get_monitor_geometry (MetaDisplay *display,
|
meta_display_get_monitor_geometry (MetaDisplay *display,
|
||||||
int monitor,
|
int monitor,
|
||||||
MetaRectangle *geometry)
|
MtkRectangle *geometry)
|
||||||
{
|
{
|
||||||
MetaBackend *backend = backend_from_display (display);
|
MetaBackend *backend = backend_from_display (display);
|
||||||
MetaMonitorManager *monitor_manager =
|
MetaMonitorManager *monitor_manager =
|
||||||
|
@ -36,7 +36,7 @@ struct _MetaFrame
|
|||||||
/* This rect is trusted info from where we put the
|
/* This rect is trusted info from where we put the
|
||||||
* frame, not the result of ConfigureNotify
|
* frame, not the result of ConfigureNotify
|
||||||
*/
|
*/
|
||||||
MetaRectangle rect;
|
MtkRectangle rect;
|
||||||
|
|
||||||
MetaFrameBorders cached_borders; /* valid if borders_cached is set */
|
MetaFrameBorders cached_borders; /* valid if borders_cached is set */
|
||||||
|
|
||||||
|
@ -2376,8 +2376,8 @@ handle_move_to_corner_backend (MetaDisplay *display,
|
|||||||
MetaWindow *window,
|
MetaWindow *window,
|
||||||
MetaGravity gravity)
|
MetaGravity gravity)
|
||||||
{
|
{
|
||||||
MetaRectangle work_area;
|
MtkRectangle work_area;
|
||||||
MetaRectangle frame_rect;
|
MtkRectangle frame_rect;
|
||||||
int new_x, new_y;
|
int new_x, new_y;
|
||||||
|
|
||||||
if (!window->monitor)
|
if (!window->monitor)
|
||||||
@ -2519,8 +2519,8 @@ handle_move_to_center (MetaDisplay *display,
|
|||||||
MetaKeyBinding *binding,
|
MetaKeyBinding *binding,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
MetaRectangle work_area;
|
MtkRectangle work_area;
|
||||||
MetaRectangle frame_rect;
|
MtkRectangle frame_rect;
|
||||||
|
|
||||||
meta_window_get_work_area_current_monitor (window, &work_area);
|
meta_window_get_work_area_current_monitor (window, &work_area);
|
||||||
meta_window_get_frame_rect (window, &frame_rect);
|
meta_window_get_frame_rect (window, &frame_rect);
|
||||||
@ -2564,7 +2564,7 @@ handle_activate_window_menu (MetaDisplay *display,
|
|||||||
if (display->focus_window)
|
if (display->focus_window)
|
||||||
{
|
{
|
||||||
int x, y;
|
int x, y;
|
||||||
MetaRectangle frame_rect;
|
MtkRectangle frame_rect;
|
||||||
MtkRectangle child_rect;
|
MtkRectangle child_rect;
|
||||||
|
|
||||||
meta_window_get_frame_rect (display->focus_window, &frame_rect);
|
meta_window_get_frame_rect (display->focus_window, &frame_rect);
|
||||||
@ -2926,7 +2926,7 @@ handle_raise_or_lower (MetaDisplay *display,
|
|||||||
|
|
||||||
while (above)
|
while (above)
|
||||||
{
|
{
|
||||||
MetaRectangle tmp, win_rect, above_rect;
|
MtkRectangle tmp, win_rect, above_rect;
|
||||||
|
|
||||||
if (above->mapped && meta_window_should_be_showing (above))
|
if (above->mapped && meta_window_should_be_showing (above))
|
||||||
{
|
{
|
||||||
|
@ -50,8 +50,8 @@ northwest_cmp (gconstpointer a,
|
|||||||
{
|
{
|
||||||
MetaWindow *aw = (gpointer) a;
|
MetaWindow *aw = (gpointer) a;
|
||||||
MetaWindow *bw = (gpointer) b;
|
MetaWindow *bw = (gpointer) b;
|
||||||
MetaRectangle a_frame;
|
MtkRectangle a_frame;
|
||||||
MetaRectangle b_frame;
|
MtkRectangle b_frame;
|
||||||
int from_origin_a;
|
int from_origin_a;
|
||||||
int from_origin_b;
|
int from_origin_b;
|
||||||
int ax, ay, bx, by;
|
int ax, ay, bx, by;
|
||||||
@ -82,9 +82,9 @@ northeast_cmp (gconstpointer a,
|
|||||||
{
|
{
|
||||||
MetaWindow *aw = (gpointer) a;
|
MetaWindow *aw = (gpointer) a;
|
||||||
MetaWindow *bw = (gpointer) b;
|
MetaWindow *bw = (gpointer) b;
|
||||||
MetaRectangle *area = user_data;
|
MtkRectangle *area = user_data;
|
||||||
MetaRectangle a_frame;
|
MtkRectangle a_frame;
|
||||||
MetaRectangle b_frame;
|
MtkRectangle b_frame;
|
||||||
int from_origin_a;
|
int from_origin_a;
|
||||||
int from_origin_b;
|
int from_origin_b;
|
||||||
int ax, ay, bx, by;
|
int ax, ay, bx, by;
|
||||||
@ -123,12 +123,12 @@ find_next_cascade (MetaWindow *window,
|
|||||||
GList *tmp;
|
GList *tmp;
|
||||||
GList *sorted;
|
GList *sorted;
|
||||||
int cascade_origin_x, cascade_x, cascade_y;
|
int cascade_origin_x, cascade_x, cascade_y;
|
||||||
MetaRectangle titlebar_rect;
|
MtkRectangle titlebar_rect;
|
||||||
int x_threshold, y_threshold;
|
int x_threshold, y_threshold;
|
||||||
MetaRectangle frame_rect;
|
MtkRectangle frame_rect;
|
||||||
int window_width, window_height;
|
int window_width, window_height;
|
||||||
int cascade_stage;
|
int cascade_stage;
|
||||||
MetaRectangle work_area;
|
MtkRectangle work_area;
|
||||||
MetaLogicalMonitor *current;
|
MetaLogicalMonitor *current;
|
||||||
gboolean ltr = meta_get_locale_direction () == META_LOCALE_DIRECTION_LTR;
|
gboolean ltr = meta_get_locale_direction () == META_LOCALE_DIRECTION_LTR;
|
||||||
|
|
||||||
@ -177,7 +177,7 @@ find_next_cascade (MetaWindow *window,
|
|||||||
while (tmp != NULL)
|
while (tmp != NULL)
|
||||||
{
|
{
|
||||||
MetaWindow *w;
|
MetaWindow *w;
|
||||||
MetaRectangle w_frame_rect;
|
MtkRectangle w_frame_rect;
|
||||||
int wx, ww, wy;
|
int wx, ww, wy;
|
||||||
gboolean nearby;
|
gboolean nearby;
|
||||||
|
|
||||||
@ -272,9 +272,9 @@ find_most_freespace (MetaWindow *window,
|
|||||||
int max_area;
|
int max_area;
|
||||||
int max_width, max_height, left, right, top, bottom;
|
int max_width, max_height, left, right, top, bottom;
|
||||||
int left_space, right_space, top_space, bottom_space;
|
int left_space, right_space, top_space, bottom_space;
|
||||||
MetaRectangle work_area;
|
MtkRectangle work_area;
|
||||||
MetaRectangle avoid;
|
MtkRectangle avoid;
|
||||||
MetaRectangle frame_rect;
|
MtkRectangle frame_rect;
|
||||||
|
|
||||||
meta_window_get_work_area_current_monitor (focus_window, &work_area);
|
meta_window_get_work_area_current_monitor (focus_window, &work_area);
|
||||||
meta_window_get_frame_rect (focus_window, &avoid);
|
meta_window_get_frame_rect (focus_window, &avoid);
|
||||||
@ -356,7 +356,7 @@ static gboolean
|
|||||||
window_overlaps_focus_window (MetaWindow *window)
|
window_overlaps_focus_window (MetaWindow *window)
|
||||||
{
|
{
|
||||||
MetaWindow *focus_window;
|
MetaWindow *focus_window;
|
||||||
MetaRectangle window_frame, focus_frame, overlap;
|
MtkRectangle window_frame, focus_frame, overlap;
|
||||||
|
|
||||||
focus_window = window->display->focus_window;
|
focus_window = window->display->focus_window;
|
||||||
if (focus_window == NULL)
|
if (focus_window == NULL)
|
||||||
@ -423,17 +423,17 @@ avoid_being_obscured_as_second_modal_dialog (MetaWindow *window,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
rectangle_overlaps_some_window (MetaRectangle *rect,
|
rectangle_overlaps_some_window (MtkRectangle *rect,
|
||||||
GList *windows)
|
GList *windows)
|
||||||
{
|
{
|
||||||
GList *tmp;
|
GList *tmp;
|
||||||
MetaRectangle dest;
|
MtkRectangle dest;
|
||||||
|
|
||||||
tmp = windows;
|
tmp = windows;
|
||||||
while (tmp != NULL)
|
while (tmp != NULL)
|
||||||
{
|
{
|
||||||
MetaWindow *other = tmp->data;
|
MetaWindow *other = tmp->data;
|
||||||
MetaRectangle other_rect;
|
MtkRectangle other_rect;
|
||||||
|
|
||||||
switch (other->type)
|
switch (other->type)
|
||||||
{
|
{
|
||||||
@ -474,8 +474,8 @@ leftmost_cmp (gconstpointer a, gconstpointer b)
|
|||||||
{
|
{
|
||||||
MetaWindow *aw = (gpointer) a;
|
MetaWindow *aw = (gpointer) a;
|
||||||
MetaWindow *bw = (gpointer) b;
|
MetaWindow *bw = (gpointer) b;
|
||||||
MetaRectangle a_frame;
|
MtkRectangle a_frame;
|
||||||
MetaRectangle b_frame;
|
MtkRectangle b_frame;
|
||||||
int ax, bx;
|
int ax, bx;
|
||||||
|
|
||||||
meta_window_get_frame_rect (aw, &a_frame);
|
meta_window_get_frame_rect (aw, &a_frame);
|
||||||
@ -503,8 +503,8 @@ topmost_cmp (gconstpointer a, gconstpointer b)
|
|||||||
{
|
{
|
||||||
MetaWindow *aw = (gpointer) a;
|
MetaWindow *aw = (gpointer) a;
|
||||||
MetaWindow *bw = (gpointer) b;
|
MetaWindow *bw = (gpointer) b;
|
||||||
MetaRectangle a_frame;
|
MtkRectangle a_frame;
|
||||||
MetaRectangle b_frame;
|
MtkRectangle b_frame;
|
||||||
int ay, by;
|
int ay, by;
|
||||||
|
|
||||||
meta_window_get_frame_rect (aw, &a_frame);
|
meta_window_get_frame_rect (aw, &a_frame);
|
||||||
@ -521,8 +521,8 @@ topmost_cmp (gconstpointer a, gconstpointer b)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
center_tile_rect_in_area (MetaRectangle *rect,
|
center_tile_rect_in_area (MtkRectangle *rect,
|
||||||
MetaRectangle *work_area)
|
MtkRectangle *work_area)
|
||||||
{
|
{
|
||||||
int fluff;
|
int fluff;
|
||||||
|
|
||||||
@ -570,8 +570,8 @@ find_first_fit (MetaWindow *window,
|
|||||||
GList *below_sorted;
|
GList *below_sorted;
|
||||||
GList *end_sorted;
|
GList *end_sorted;
|
||||||
GList *tmp;
|
GList *tmp;
|
||||||
MetaRectangle rect;
|
MtkRectangle rect;
|
||||||
MetaRectangle work_area;
|
MtkRectangle work_area;
|
||||||
gboolean ltr = meta_get_locale_direction () == META_LOCALE_DIRECTION_LTR;
|
gboolean ltr = meta_get_locale_direction () == META_LOCALE_DIRECTION_LTR;
|
||||||
|
|
||||||
retval = FALSE;
|
retval = FALSE;
|
||||||
@ -622,7 +622,7 @@ find_first_fit (MetaWindow *window,
|
|||||||
while (tmp != NULL)
|
while (tmp != NULL)
|
||||||
{
|
{
|
||||||
MetaWindow *w = tmp->data;
|
MetaWindow *w = tmp->data;
|
||||||
MetaRectangle frame_rect;
|
MtkRectangle frame_rect;
|
||||||
|
|
||||||
meta_window_get_frame_rect (w, &frame_rect);
|
meta_window_get_frame_rect (w, &frame_rect);
|
||||||
|
|
||||||
@ -648,7 +648,7 @@ find_first_fit (MetaWindow *window,
|
|||||||
while (tmp != NULL)
|
while (tmp != NULL)
|
||||||
{
|
{
|
||||||
MetaWindow *w = tmp->data;
|
MetaWindow *w = tmp->data;
|
||||||
MetaRectangle frame_rect;
|
MtkRectangle frame_rect;
|
||||||
|
|
||||||
meta_window_get_frame_rect (w, &frame_rect);
|
meta_window_get_frame_rect (w, &frame_rect);
|
||||||
|
|
||||||
@ -684,7 +684,7 @@ meta_window_process_placement (MetaWindow *window,
|
|||||||
int *rel_x,
|
int *rel_x,
|
||||||
int *rel_y)
|
int *rel_y)
|
||||||
{
|
{
|
||||||
MetaRectangle anchor_rect;
|
MtkRectangle anchor_rect;
|
||||||
int window_width, window_height;
|
int window_width, window_height;
|
||||||
int x, y;
|
int x, y;
|
||||||
|
|
||||||
@ -843,7 +843,7 @@ meta_window_place (MetaWindow *window,
|
|||||||
|
|
||||||
if (parent)
|
if (parent)
|
||||||
{
|
{
|
||||||
MetaRectangle frame_rect, parent_frame_rect;
|
MtkRectangle frame_rect, parent_frame_rect;
|
||||||
|
|
||||||
meta_window_get_frame_rect (window, &frame_rect);
|
meta_window_get_frame_rect (window, &frame_rect);
|
||||||
meta_window_get_frame_rect (parent, &parent_frame_rect);
|
meta_window_get_frame_rect (parent, &parent_frame_rect);
|
||||||
@ -877,8 +877,8 @@ meta_window_place (MetaWindow *window,
|
|||||||
if (window_place_centered (window))
|
if (window_place_centered (window))
|
||||||
{
|
{
|
||||||
/* Center on current monitor */
|
/* Center on current monitor */
|
||||||
MetaRectangle work_area;
|
MtkRectangle work_area;
|
||||||
MetaRectangle frame_rect;
|
MtkRectangle frame_rect;
|
||||||
|
|
||||||
/* Warning, this function is a round trip! */
|
/* Warning, this function is a round trip! */
|
||||||
logical_monitor = meta_backend_get_current_logical_monitor (backend);
|
logical_monitor = meta_backend_get_current_logical_monitor (backend);
|
||||||
@ -933,8 +933,8 @@ meta_window_place (MetaWindow *window,
|
|||||||
if (window->has_maximize_func && window->decorated &&
|
if (window->has_maximize_func && window->decorated &&
|
||||||
!window->fullscreen)
|
!window->fullscreen)
|
||||||
{
|
{
|
||||||
MetaRectangle workarea;
|
MtkRectangle workarea;
|
||||||
MetaRectangle frame_rect;
|
MtkRectangle frame_rect;
|
||||||
|
|
||||||
meta_window_get_work_area_for_logical_monitor (window,
|
meta_window_get_work_area_for_logical_monitor (window,
|
||||||
logical_monitor,
|
logical_monitor,
|
||||||
|
@ -128,7 +128,7 @@ typedef enum _MetaWindowSuspendState
|
|||||||
|
|
||||||
typedef struct _MetaPlacementRule
|
typedef struct _MetaPlacementRule
|
||||||
{
|
{
|
||||||
MetaRectangle anchor_rect;
|
MtkRectangle anchor_rect;
|
||||||
MetaPlacementGravity gravity;
|
MetaPlacementGravity gravity;
|
||||||
MetaPlacementAnchor anchor;
|
MetaPlacementAnchor anchor;
|
||||||
MetaPlacementConstraintAdjustment constraint_adjustment;
|
MetaPlacementConstraintAdjustment constraint_adjustment;
|
||||||
@ -139,7 +139,7 @@ typedef struct _MetaPlacementRule
|
|||||||
|
|
||||||
gboolean is_reactive;
|
gboolean is_reactive;
|
||||||
|
|
||||||
MetaRectangle parent_rect;
|
MtkRectangle parent_rect;
|
||||||
} MetaPlacementRule;
|
} MetaPlacementRule;
|
||||||
|
|
||||||
typedef enum _MetaPlacementState
|
typedef enum _MetaPlacementState
|
||||||
@ -292,20 +292,20 @@ struct _MetaWindow
|
|||||||
* information. */
|
* information. */
|
||||||
|
|
||||||
/* The current window geometry of the window. */
|
/* The current window geometry of the window. */
|
||||||
MetaRectangle rect;
|
MtkRectangle rect;
|
||||||
|
|
||||||
/* The geometry to restore when we unmaximize. */
|
/* The geometry to restore when we unmaximize. */
|
||||||
MetaRectangle saved_rect;
|
MtkRectangle saved_rect;
|
||||||
|
|
||||||
/* The geometry to restore when we unfullscreen. */
|
/* The geometry to restore when we unfullscreen. */
|
||||||
MetaRectangle saved_rect_fullscreen;
|
MtkRectangle saved_rect_fullscreen;
|
||||||
|
|
||||||
/* This is the geometry the window will have if no constraints have
|
/* This is the geometry the window will have if no constraints have
|
||||||
* applied. We use this whenever we are moving implicitly (for example,
|
* applied. We use this whenever we are moving implicitly (for example,
|
||||||
* if we move to avoid a panel, we can snap back to this position if
|
* if we move to avoid a panel, we can snap back to this position if
|
||||||
* the panel moves again).
|
* the panel moves again).
|
||||||
*/
|
*/
|
||||||
MetaRectangle unconstrained_rect;
|
MtkRectangle unconstrained_rect;
|
||||||
|
|
||||||
/* The rectangle of the "server-side" geometry of the buffer,
|
/* The rectangle of the "server-side" geometry of the buffer,
|
||||||
* in root coordinates.
|
* in root coordinates.
|
||||||
@ -316,10 +316,10 @@ struct _MetaWindow
|
|||||||
* surface associated with shell surface (xdg_surface, etc.)
|
* surface associated with shell surface (xdg_surface, etc.)
|
||||||
* The size matches the size surface size as displayed in the stage.
|
* The size matches the size surface size as displayed in the stage.
|
||||||
*/
|
*/
|
||||||
MetaRectangle buffer_rect;
|
MtkRectangle buffer_rect;
|
||||||
|
|
||||||
/* Cached net_wm_icon_geometry */
|
/* Cached net_wm_icon_geometry */
|
||||||
MetaRectangle icon_geometry;
|
MtkRectangle icon_geometry;
|
||||||
|
|
||||||
/* x/y/w/h here get filled with ConfigureRequest values */
|
/* x/y/w/h here get filled with ConfigureRequest values */
|
||||||
XSizeHints size_hints;
|
XSizeHints size_hints;
|
||||||
@ -571,9 +571,9 @@ struct _MetaWindowClass
|
|||||||
void (*current_workspace_changed) (MetaWindow *window);
|
void (*current_workspace_changed) (MetaWindow *window);
|
||||||
void (*move_resize_internal) (MetaWindow *window,
|
void (*move_resize_internal) (MetaWindow *window,
|
||||||
MetaGravity gravity,
|
MetaGravity gravity,
|
||||||
MetaRectangle unconstrained_rect,
|
MtkRectangle unconstrained_rect,
|
||||||
MetaRectangle constrained_rect,
|
MtkRectangle constrained_rect,
|
||||||
MetaRectangle temporary_rect,
|
MtkRectangle temporary_rect,
|
||||||
int rel_x,
|
int rel_x,
|
||||||
int rel_y,
|
int rel_y,
|
||||||
MetaMoveResizeFlags flags,
|
MetaMoveResizeFlags flags,
|
||||||
@ -592,7 +592,7 @@ struct _MetaWindowClass
|
|||||||
void (*main_monitor_changed) (MetaWindow *window,
|
void (*main_monitor_changed) (MetaWindow *window,
|
||||||
const MetaLogicalMonitor *old);
|
const MetaLogicalMonitor *old);
|
||||||
void (*adjust_fullscreen_monitor_rect) (MetaWindow *window,
|
void (*adjust_fullscreen_monitor_rect) (MetaWindow *window,
|
||||||
MetaRectangle *monitor_rect);
|
MtkRectangle *monitor_rect);
|
||||||
void (*force_restore_shortcuts) (MetaWindow *window,
|
void (*force_restore_shortcuts) (MetaWindow *window,
|
||||||
ClutterInputDevice *source);
|
ClutterInputDevice *source);
|
||||||
gboolean (*shortcuts_inhibited) (MetaWindow *window,
|
gboolean (*shortcuts_inhibited) (MetaWindow *window,
|
||||||
@ -656,7 +656,7 @@ void meta_window_restore_tile (MetaWindow *window,
|
|||||||
int height);
|
int height);
|
||||||
void meta_window_maximize_internal (MetaWindow *window,
|
void meta_window_maximize_internal (MetaWindow *window,
|
||||||
MetaMaximizeFlags directions,
|
MetaMaximizeFlags directions,
|
||||||
MetaRectangle *saved_rect);
|
MtkRectangle *saved_rect);
|
||||||
|
|
||||||
void meta_window_make_fullscreen_internal (MetaWindow *window);
|
void meta_window_make_fullscreen_internal (MetaWindow *window);
|
||||||
void meta_window_update_fullscreen_monitors (MetaWindow *window,
|
void meta_window_update_fullscreen_monitors (MetaWindow *window,
|
||||||
@ -668,7 +668,7 @@ void meta_window_update_fullscreen_monitors (MetaWindow *window,
|
|||||||
gboolean meta_window_has_fullscreen_monitors (MetaWindow *window);
|
gboolean meta_window_has_fullscreen_monitors (MetaWindow *window);
|
||||||
|
|
||||||
void meta_window_adjust_fullscreen_monitor_rect (MetaWindow *window,
|
void meta_window_adjust_fullscreen_monitor_rect (MetaWindow *window,
|
||||||
MetaRectangle *monitor_rect);
|
MtkRectangle *monitor_rect);
|
||||||
|
|
||||||
void meta_window_resize_frame_with_gravity (MetaWindow *window,
|
void meta_window_resize_frame_with_gravity (MetaWindow *window,
|
||||||
gboolean user_op,
|
gboolean user_op,
|
||||||
@ -731,12 +731,12 @@ GList* meta_window_get_workspaces (MetaWindow *window);
|
|||||||
|
|
||||||
void meta_window_get_work_area_for_logical_monitor (MetaWindow *window,
|
void meta_window_get_work_area_for_logical_monitor (MetaWindow *window,
|
||||||
MetaLogicalMonitor *logical_monitor,
|
MetaLogicalMonitor *logical_monitor,
|
||||||
MetaRectangle *area);
|
MtkRectangle *area);
|
||||||
|
|
||||||
int meta_window_get_current_tile_monitor_number (MetaWindow *window);
|
int meta_window_get_current_tile_monitor_number (MetaWindow *window);
|
||||||
void meta_window_get_tile_area (MetaWindow *window,
|
void meta_window_get_tile_area (MetaWindow *window,
|
||||||
MetaTileMode mode,
|
MetaTileMode mode,
|
||||||
MetaRectangle *tile_area);
|
MtkRectangle *tile_area);
|
||||||
|
|
||||||
|
|
||||||
gboolean meta_window_same_application (MetaWindow *window,
|
gboolean meta_window_same_application (MetaWindow *window,
|
||||||
@ -818,7 +818,7 @@ void meta_window_handle_ungrabbed_event (MetaWindow *window,
|
|||||||
void meta_window_get_client_area_rect (const MetaWindow *window,
|
void meta_window_get_client_area_rect (const MetaWindow *window,
|
||||||
MtkRectangle *rect);
|
MtkRectangle *rect);
|
||||||
void meta_window_get_titlebar_rect (MetaWindow *window,
|
void meta_window_get_titlebar_rect (MetaWindow *window,
|
||||||
MetaRectangle *titlebar_rect);
|
MtkRectangle *titlebar_rect);
|
||||||
|
|
||||||
void meta_window_activate_full (MetaWindow *window,
|
void meta_window_activate_full (MetaWindow *window,
|
||||||
guint32 timestamp,
|
guint32 timestamp,
|
||||||
@ -845,7 +845,7 @@ void meta_window_set_urgent (MetaWindow *window,
|
|||||||
void meta_window_move_resize_internal (MetaWindow *window,
|
void meta_window_move_resize_internal (MetaWindow *window,
|
||||||
MetaMoveResizeFlags flags,
|
MetaMoveResizeFlags flags,
|
||||||
MetaGravity gravity,
|
MetaGravity gravity,
|
||||||
MetaRectangle frame_rect);
|
MtkRectangle frame_rect);
|
||||||
|
|
||||||
void meta_window_grab_op_began (MetaWindow *window, MetaGrabOp op);
|
void meta_window_grab_op_began (MetaWindow *window, MetaGrabOp op);
|
||||||
void meta_window_grab_op_ended (MetaWindow *window, MetaGrabOp op);
|
void meta_window_grab_op_ended (MetaWindow *window, MetaGrabOp op);
|
||||||
@ -893,7 +893,7 @@ void meta_window_set_frame_xwindow (MetaWindow *window,
|
|||||||
Window xframe);
|
Window xframe);
|
||||||
|
|
||||||
void meta_window_maybe_apply_size_hints (MetaWindow *window,
|
void meta_window_maybe_apply_size_hints (MetaWindow *window,
|
||||||
MetaRectangle *target_rect);
|
MtkRectangle *target_rect);
|
||||||
|
|
||||||
void meta_window_inhibit_suspend_state (MetaWindow *window);
|
void meta_window_inhibit_suspend_state (MetaWindow *window);
|
||||||
|
|
||||||
|
@ -149,8 +149,8 @@ static gboolean queue_calc_showing_func (MetaWindow *window,
|
|||||||
|
|
||||||
static void meta_window_move_between_rects (MetaWindow *window,
|
static void meta_window_move_between_rects (MetaWindow *window,
|
||||||
MetaMoveResizeFlags move_resize_flags,
|
MetaMoveResizeFlags move_resize_flags,
|
||||||
const MetaRectangle *old_area,
|
const MtkRectangle *old_area,
|
||||||
const MetaRectangle *new_area);
|
const MtkRectangle *new_area);
|
||||||
|
|
||||||
static void unmaximize_window_before_freeing (MetaWindow *window);
|
static void unmaximize_window_before_freeing (MetaWindow *window);
|
||||||
static void unminimize_window_and_all_transient_parents (MetaWindow *window);
|
static void unminimize_window_and_all_transient_parents (MetaWindow *window);
|
||||||
@ -987,7 +987,7 @@ meta_window_find_monitor_from_frame_rect (MetaWindow *window)
|
|||||||
MetaBackend *backend = backend_from_window (window);
|
MetaBackend *backend = backend_from_window (window);
|
||||||
MetaMonitorManager *monitor_manager =
|
MetaMonitorManager *monitor_manager =
|
||||||
meta_backend_get_monitor_manager (backend);
|
meta_backend_get_monitor_manager (backend);
|
||||||
MetaRectangle window_rect;
|
MtkRectangle window_rect;
|
||||||
|
|
||||||
meta_window_get_frame_rect (window, &window_rect);
|
meta_window_get_frame_rect (window, &window_rect);
|
||||||
return meta_monitor_manager_get_logical_monitor_from_rect (monitor_manager,
|
return meta_monitor_manager_get_logical_monitor_from_rect (monitor_manager,
|
||||||
@ -1000,7 +1000,7 @@ meta_window_find_highest_scale_monitor_from_frame_rect (MetaWindow *window)
|
|||||||
MetaBackend *backend = backend_from_window (window);
|
MetaBackend *backend = backend_from_window (window);
|
||||||
MetaMonitorManager *monitor_manager =
|
MetaMonitorManager *monitor_manager =
|
||||||
meta_backend_get_monitor_manager (backend);
|
meta_backend_get_monitor_manager (backend);
|
||||||
MetaRectangle window_rect;
|
MtkRectangle window_rect;
|
||||||
|
|
||||||
meta_window_get_frame_rect (window, &window_rect);
|
meta_window_get_frame_rect (window, &window_rect);
|
||||||
return meta_monitor_manager_get_highest_scale_monitor_from_rect (monitor_manager,
|
return meta_monitor_manager_get_highest_scale_monitor_from_rect (monitor_manager,
|
||||||
@ -2018,7 +2018,7 @@ window_state_on_map (MetaWindow *window,
|
|||||||
static gboolean
|
static gboolean
|
||||||
windows_overlap (const MetaWindow *w1, const MetaWindow *w2)
|
windows_overlap (const MetaWindow *w1, const MetaWindow *w2)
|
||||||
{
|
{
|
||||||
MetaRectangle w1rect, w2rect;
|
MtkRectangle w1rect, w2rect;
|
||||||
meta_window_get_frame_rect (w1, &w1rect);
|
meta_window_get_frame_rect (w1, &w1rect);
|
||||||
meta_window_get_frame_rect (w2, &w2rect);
|
meta_window_get_frame_rect (w2, &w2rect);
|
||||||
return mtk_rectangle_overlap (&w1rect, &w2rect);
|
return mtk_rectangle_overlap (&w1rect, &w2rect);
|
||||||
@ -2247,7 +2247,7 @@ meta_window_show (MetaWindow *window)
|
|||||||
window->showing_for_first_time &&
|
window->showing_for_first_time &&
|
||||||
window->has_maximize_func)
|
window->has_maximize_func)
|
||||||
{
|
{
|
||||||
MetaRectangle work_area;
|
MtkRectangle work_area;
|
||||||
meta_window_get_work_area_for_monitor (window, window->monitor->number, &work_area);
|
meta_window_get_work_area_for_monitor (window, window->monitor->number, &work_area);
|
||||||
/* Automaximize windows that map with a size > MAX_UNMAXIMIZED_WINDOW_AREA of the work area */
|
/* Automaximize windows that map with a size > MAX_UNMAXIMIZED_WINDOW_AREA of the work area */
|
||||||
if (window->rect.width * window->rect.height > work_area.width * work_area.height * MAX_UNMAXIMIZED_WINDOW_AREA)
|
if (window->rect.width * window->rect.height > work_area.width * work_area.height * MAX_UNMAXIMIZED_WINDOW_AREA)
|
||||||
@ -2574,7 +2574,7 @@ meta_window_unminimize (MetaWindow *window)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
ensure_size_hints_satisfied (MetaRectangle *rect,
|
ensure_size_hints_satisfied (MtkRectangle *rect,
|
||||||
const XSizeHints *size_hints)
|
const XSizeHints *size_hints)
|
||||||
{
|
{
|
||||||
int minw, minh, maxw, maxh; /* min/max width/height */
|
int minw, minh, maxw, maxh; /* min/max width/height */
|
||||||
@ -2628,7 +2628,7 @@ meta_window_save_rect (MetaWindow *window)
|
|||||||
void
|
void
|
||||||
meta_window_maximize_internal (MetaWindow *window,
|
meta_window_maximize_internal (MetaWindow *window,
|
||||||
MetaMaximizeFlags directions,
|
MetaMaximizeFlags directions,
|
||||||
MetaRectangle *saved_rect)
|
MtkRectangle *saved_rect)
|
||||||
{
|
{
|
||||||
/* At least one of the two directions ought to be set */
|
/* At least one of the two directions ought to be set */
|
||||||
gboolean maximize_horizontally, maximize_vertically;
|
gboolean maximize_horizontally, maximize_vertically;
|
||||||
@ -2675,7 +2675,7 @@ void
|
|||||||
meta_window_maximize (MetaWindow *window,
|
meta_window_maximize (MetaWindow *window,
|
||||||
MetaMaximizeFlags directions)
|
MetaMaximizeFlags directions)
|
||||||
{
|
{
|
||||||
MetaRectangle *saved_rect = NULL;
|
MtkRectangle *saved_rect = NULL;
|
||||||
gboolean maximize_horizontally, maximize_vertically;
|
gboolean maximize_horizontally, maximize_vertically;
|
||||||
|
|
||||||
g_return_if_fail (META_IS_WINDOW (window));
|
g_return_if_fail (META_IS_WINDOW (window));
|
||||||
@ -2717,7 +2717,7 @@ meta_window_maximize (MetaWindow *window,
|
|||||||
directions,
|
directions,
|
||||||
saved_rect);
|
saved_rect);
|
||||||
|
|
||||||
MetaRectangle old_frame_rect, old_buffer_rect;
|
MtkRectangle old_frame_rect, old_buffer_rect;
|
||||||
|
|
||||||
meta_window_get_frame_rect (window, &old_frame_rect);
|
meta_window_get_frame_rect (window, &old_frame_rect);
|
||||||
meta_window_get_buffer_rect (window, &old_buffer_rect);
|
meta_window_get_buffer_rect (window, &old_buffer_rect);
|
||||||
@ -2774,7 +2774,7 @@ meta_window_is_fullscreen (MetaWindow *window)
|
|||||||
gboolean
|
gboolean
|
||||||
meta_window_is_screen_sized (MetaWindow *window)
|
meta_window_is_screen_sized (MetaWindow *window)
|
||||||
{
|
{
|
||||||
MetaRectangle window_rect;
|
MtkRectangle window_rect;
|
||||||
int screen_width, screen_height;
|
int screen_width, screen_height;
|
||||||
|
|
||||||
meta_display_get_size (window->display, &screen_width, &screen_height);
|
meta_display_get_size (window->display, &screen_width, &screen_height);
|
||||||
@ -2808,7 +2808,7 @@ meta_window_is_monitor_sized (MetaWindow *window)
|
|||||||
|
|
||||||
if (window->override_redirect)
|
if (window->override_redirect)
|
||||||
{
|
{
|
||||||
MetaRectangle window_rect, monitor_rect;
|
MtkRectangle window_rect, monitor_rect;
|
||||||
|
|
||||||
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);
|
||||||
@ -2869,7 +2869,7 @@ meta_window_update_tile_fraction (MetaWindow *window,
|
|||||||
int new_h)
|
int new_h)
|
||||||
{
|
{
|
||||||
MetaWindow *tile_match = window->tile_match;
|
MetaWindow *tile_match = window->tile_match;
|
||||||
MetaRectangle work_area;
|
MtkRectangle work_area;
|
||||||
MetaWindowDrag *window_drag;
|
MetaWindowDrag *window_drag;
|
||||||
|
|
||||||
if (!META_WINDOW_TILED_SIDE_BY_SIDE (window))
|
if (!META_WINDOW_TILED_SIDE_BY_SIDE (window))
|
||||||
@ -3001,7 +3001,7 @@ meta_window_tile (MetaWindow *window,
|
|||||||
!window_drag ||
|
!window_drag ||
|
||||||
window->tile_match != meta_window_drag_get_window (window_drag))
|
window->tile_match != meta_window_drag_get_window (window_drag))
|
||||||
{
|
{
|
||||||
MetaRectangle old_frame_rect, old_buffer_rect;
|
MtkRectangle old_frame_rect, old_buffer_rect;
|
||||||
|
|
||||||
meta_window_get_frame_rect (window, &old_frame_rect);
|
meta_window_get_frame_rect (window, &old_frame_rect);
|
||||||
meta_window_get_buffer_rect (window, &old_buffer_rect);
|
meta_window_get_buffer_rect (window, &old_buffer_rect);
|
||||||
@ -3046,8 +3046,8 @@ gboolean
|
|||||||
meta_window_can_tile_side_by_side (MetaWindow *window)
|
meta_window_can_tile_side_by_side (MetaWindow *window)
|
||||||
{
|
{
|
||||||
int monitor;
|
int monitor;
|
||||||
MetaRectangle tile_area;
|
MtkRectangle tile_area;
|
||||||
MetaRectangle client_rect;
|
MtkRectangle client_rect;
|
||||||
|
|
||||||
if (!meta_window_can_tile_maximized (window))
|
if (!meta_window_can_tile_maximized (window))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@ -3103,7 +3103,7 @@ unmaximize_window_before_freeing (MetaWindow *window)
|
|||||||
|
|
||||||
void
|
void
|
||||||
meta_window_maybe_apply_size_hints (MetaWindow *window,
|
meta_window_maybe_apply_size_hints (MetaWindow *window,
|
||||||
MetaRectangle *target_rect)
|
MtkRectangle *target_rect)
|
||||||
{
|
{
|
||||||
meta_window_frame_rect_to_client_rect (window, target_rect, target_rect);
|
meta_window_frame_rect_to_client_rect (window, target_rect, target_rect);
|
||||||
ensure_size_hints_satisfied (target_rect, &window->size_hints);
|
ensure_size_hints_satisfied (target_rect, &window->size_hints);
|
||||||
@ -3133,10 +3133,10 @@ meta_window_unmaximize (MetaWindow *window,
|
|||||||
if ((unmaximize_horizontally && window->maximized_horizontally) ||
|
if ((unmaximize_horizontally && window->maximized_horizontally) ||
|
||||||
(unmaximize_vertically && window->maximized_vertically))
|
(unmaximize_vertically && window->maximized_vertically))
|
||||||
{
|
{
|
||||||
MetaRectangle *desired_rect;
|
MtkRectangle *desired_rect;
|
||||||
MetaRectangle target_rect;
|
MtkRectangle target_rect;
|
||||||
MetaRectangle work_area;
|
MtkRectangle work_area;
|
||||||
MetaRectangle old_frame_rect, old_buffer_rect;
|
MtkRectangle old_frame_rect, old_buffer_rect;
|
||||||
gboolean has_target_size;
|
gboolean has_target_size;
|
||||||
|
|
||||||
meta_window_get_work_area_for_monitor (window, window->monitor->number, &work_area);
|
meta_window_get_work_area_for_monitor (window, window->monitor->number, &work_area);
|
||||||
@ -3306,7 +3306,7 @@ meta_window_make_fullscreen (MetaWindow *window)
|
|||||||
|
|
||||||
if (!window->fullscreen)
|
if (!window->fullscreen)
|
||||||
{
|
{
|
||||||
MetaRectangle old_frame_rect, old_buffer_rect;
|
MtkRectangle old_frame_rect, old_buffer_rect;
|
||||||
|
|
||||||
meta_window_get_frame_rect (window, &old_frame_rect);
|
meta_window_get_frame_rect (window, &old_frame_rect);
|
||||||
meta_window_get_buffer_rect (window, &old_buffer_rect);
|
meta_window_get_buffer_rect (window, &old_buffer_rect);
|
||||||
@ -3334,7 +3334,7 @@ meta_window_unmake_fullscreen (MetaWindow *window)
|
|||||||
|
|
||||||
if (window->fullscreen)
|
if (window->fullscreen)
|
||||||
{
|
{
|
||||||
MetaRectangle old_frame_rect, old_buffer_rect, target_rect;
|
MtkRectangle old_frame_rect, old_buffer_rect, target_rect;
|
||||||
gboolean has_target_size;
|
gboolean has_target_size;
|
||||||
|
|
||||||
meta_topic (META_DEBUG_WINDOW_OPS,
|
meta_topic (META_DEBUG_WINDOW_OPS,
|
||||||
@ -3420,7 +3420,7 @@ meta_window_has_fullscreen_monitors (MetaWindow *window)
|
|||||||
|
|
||||||
void
|
void
|
||||||
meta_window_adjust_fullscreen_monitor_rect (MetaWindow *window,
|
meta_window_adjust_fullscreen_monitor_rect (MetaWindow *window,
|
||||||
MetaRectangle *monitor_rect)
|
MtkRectangle *monitor_rect)
|
||||||
{
|
{
|
||||||
MetaWindowClass *window_class = META_WINDOW_GET_CLASS (window);
|
MetaWindowClass *window_class = META_WINDOW_GET_CLASS (window);
|
||||||
|
|
||||||
@ -3777,7 +3777,7 @@ void
|
|||||||
meta_window_move_resize_internal (MetaWindow *window,
|
meta_window_move_resize_internal (MetaWindow *window,
|
||||||
MetaMoveResizeFlags flags,
|
MetaMoveResizeFlags flags,
|
||||||
MetaGravity gravity,
|
MetaGravity gravity,
|
||||||
MetaRectangle frame_rect)
|
MtkRectangle frame_rect)
|
||||||
{
|
{
|
||||||
/* The rectangle here that's passed in *always* in "frame rect"
|
/* The rectangle here that's passed in *always* in "frame rect"
|
||||||
* coordinates. That means the position of the frame's visible bounds,
|
* coordinates. That means the position of the frame's visible bounds,
|
||||||
@ -3800,9 +3800,9 @@ meta_window_move_resize_internal (MetaWindow *window,
|
|||||||
|
|
||||||
MetaWorkspaceManager *workspace_manager = window->display->workspace_manager;
|
MetaWorkspaceManager *workspace_manager = window->display->workspace_manager;
|
||||||
gboolean did_placement;
|
gboolean did_placement;
|
||||||
MetaRectangle unconstrained_rect;
|
MtkRectangle unconstrained_rect;
|
||||||
MetaRectangle constrained_rect;
|
MtkRectangle constrained_rect;
|
||||||
MetaRectangle temporary_rect;
|
MtkRectangle temporary_rect;
|
||||||
int rel_x = 0;
|
int rel_x = 0;
|
||||||
int rel_y = 0;
|
int rel_y = 0;
|
||||||
MetaMoveResizeResultFlags result = 0;
|
MetaMoveResizeResultFlags result = 0;
|
||||||
@ -3862,7 +3862,7 @@ meta_window_move_resize_internal (MetaWindow *window,
|
|||||||
temporary_rect = window->rect;
|
temporary_rect = window->rect;
|
||||||
if (flags & META_MOVE_RESIZE_CONSTRAIN && window->monitor)
|
if (flags & META_MOVE_RESIZE_CONSTRAIN && window->monitor)
|
||||||
{
|
{
|
||||||
MetaRectangle old_rect;
|
MtkRectangle old_rect;
|
||||||
meta_window_get_frame_rect (window, &old_rect);
|
meta_window_get_frame_rect (window, &old_rect);
|
||||||
|
|
||||||
meta_window_constrain (window,
|
meta_window_constrain (window,
|
||||||
@ -3988,7 +3988,7 @@ meta_window_move_frame (MetaWindow *window,
|
|||||||
int root_y_nw)
|
int root_y_nw)
|
||||||
{
|
{
|
||||||
MetaMoveResizeFlags flags;
|
MetaMoveResizeFlags flags;
|
||||||
MetaRectangle rect = { root_x_nw, root_y_nw, 0, 0 };
|
MtkRectangle rect = { root_x_nw, root_y_nw, 0, 0 };
|
||||||
|
|
||||||
g_return_if_fail (!window->override_redirect);
|
g_return_if_fail (!window->override_redirect);
|
||||||
|
|
||||||
@ -4001,8 +4001,8 @@ meta_window_move_frame (MetaWindow *window,
|
|||||||
static void
|
static void
|
||||||
meta_window_move_between_rects (MetaWindow *window,
|
meta_window_move_between_rects (MetaWindow *window,
|
||||||
MetaMoveResizeFlags move_resize_flags,
|
MetaMoveResizeFlags move_resize_flags,
|
||||||
const MetaRectangle *old_area,
|
const MtkRectangle *old_area,
|
||||||
const MetaRectangle *new_area)
|
const MtkRectangle *new_area)
|
||||||
{
|
{
|
||||||
double rel_x, rel_y;
|
double rel_x, rel_y;
|
||||||
int new_x, new_y;
|
int new_x, new_y;
|
||||||
@ -4080,7 +4080,7 @@ meta_window_move_resize_frame (MetaWindow *window,
|
|||||||
int h)
|
int h)
|
||||||
{
|
{
|
||||||
MetaMoveResizeFlags flags;
|
MetaMoveResizeFlags flags;
|
||||||
MetaRectangle rect = { root_x_nw, root_y_nw, w, h };
|
MtkRectangle rect = { root_x_nw, root_y_nw, w, h };
|
||||||
|
|
||||||
g_return_if_fail (!window->override_redirect);
|
g_return_if_fail (!window->override_redirect);
|
||||||
|
|
||||||
@ -4104,7 +4104,7 @@ void
|
|||||||
meta_window_move_to_monitor (MetaWindow *window,
|
meta_window_move_to_monitor (MetaWindow *window,
|
||||||
int monitor)
|
int monitor)
|
||||||
{
|
{
|
||||||
MetaRectangle old_area, new_area;
|
MtkRectangle old_area, new_area;
|
||||||
|
|
||||||
if (window->tile_mode != META_TILE_NONE)
|
if (window->tile_mode != META_TILE_NONE)
|
||||||
window->tile_monitor_number = monitor;
|
window->tile_monitor_number = monitor;
|
||||||
@ -4124,7 +4124,7 @@ meta_window_move_to_monitor (MetaWindow *window,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
MetaRectangle old_frame_rect, old_buffer_rect;
|
MtkRectangle old_frame_rect, old_buffer_rect;
|
||||||
|
|
||||||
if (monitor == window->monitor->number)
|
if (monitor == window->monitor->number)
|
||||||
return;
|
return;
|
||||||
@ -4150,7 +4150,7 @@ adjust_size_for_tile_match (MetaWindow *window,
|
|||||||
int *new_w,
|
int *new_w,
|
||||||
int *new_h)
|
int *new_h)
|
||||||
{
|
{
|
||||||
MetaRectangle work_area, rect;
|
MtkRectangle work_area, rect;
|
||||||
MetaWindow *tile_match = window->tile_match;
|
MetaWindow *tile_match = window->tile_match;
|
||||||
|
|
||||||
if (!META_WINDOW_TILED_SIDE_BY_SIDE (window) || !tile_match)
|
if (!META_WINDOW_TILED_SIDE_BY_SIDE (window) || !tile_match)
|
||||||
@ -4181,7 +4181,7 @@ meta_window_resize_frame_with_gravity (MetaWindow *window,
|
|||||||
MetaGravity gravity)
|
MetaGravity gravity)
|
||||||
{
|
{
|
||||||
MetaMoveResizeFlags flags;
|
MetaMoveResizeFlags flags;
|
||||||
MetaRectangle rect;
|
MtkRectangle rect;
|
||||||
|
|
||||||
rect.width = w;
|
rect.width = w;
|
||||||
rect.height = h;
|
rect.height = h;
|
||||||
@ -4224,7 +4224,7 @@ meta_window_get_gravity_position (MetaWindow *window,
|
|||||||
int *root_x,
|
int *root_x,
|
||||||
int *root_y)
|
int *root_y)
|
||||||
{
|
{
|
||||||
MetaRectangle frame_extents;
|
MtkRectangle frame_extents;
|
||||||
int w, h;
|
int w, h;
|
||||||
int x, y;
|
int x, y;
|
||||||
|
|
||||||
@ -4322,7 +4322,7 @@ meta_window_get_session_geometry (MetaWindow *window,
|
|||||||
/**
|
/**
|
||||||
* meta_window_get_buffer_rect:
|
* meta_window_get_buffer_rect:
|
||||||
* @window: a #MetaWindow
|
* @window: a #MetaWindow
|
||||||
* @rect: (out): pointer to an allocated #MetaRectangle
|
* @rect: (out): pointer to an allocated #MtkRectangle
|
||||||
*
|
*
|
||||||
* Gets the rectangle that the pixmap or buffer of @window occupies.
|
* Gets the rectangle that the pixmap or buffer of @window occupies.
|
||||||
*
|
*
|
||||||
@ -4334,7 +4334,7 @@ meta_window_get_session_geometry (MetaWindow *window,
|
|||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
meta_window_get_buffer_rect (const MetaWindow *window,
|
meta_window_get_buffer_rect (const MetaWindow *window,
|
||||||
MetaRectangle *rect)
|
MtkRectangle *rect)
|
||||||
{
|
{
|
||||||
*rect = window->buffer_rect;
|
*rect = window->buffer_rect;
|
||||||
}
|
}
|
||||||
@ -4350,8 +4350,8 @@ meta_window_get_buffer_rect (const MetaWindow *window,
|
|||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
meta_window_client_rect_to_frame_rect (MetaWindow *window,
|
meta_window_client_rect_to_frame_rect (MetaWindow *window,
|
||||||
MetaRectangle *client_rect,
|
MtkRectangle *client_rect,
|
||||||
MetaRectangle *frame_rect)
|
MtkRectangle *frame_rect)
|
||||||
{
|
{
|
||||||
if (!frame_rect)
|
if (!frame_rect)
|
||||||
return;
|
return;
|
||||||
@ -4397,8 +4397,8 @@ meta_window_client_rect_to_frame_rect (MetaWindow *window,
|
|||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
meta_window_frame_rect_to_client_rect (MetaWindow *window,
|
meta_window_frame_rect_to_client_rect (MetaWindow *window,
|
||||||
MetaRectangle *frame_rect,
|
MtkRectangle *frame_rect,
|
||||||
MetaRectangle *client_rect)
|
MtkRectangle *client_rect)
|
||||||
{
|
{
|
||||||
if (!client_rect)
|
if (!client_rect)
|
||||||
return;
|
return;
|
||||||
@ -4428,7 +4428,7 @@ meta_window_frame_rect_to_client_rect (MetaWindow *window,
|
|||||||
/**
|
/**
|
||||||
* meta_window_get_frame_rect:
|
* meta_window_get_frame_rect:
|
||||||
* @window: a #MetaWindow
|
* @window: a #MetaWindow
|
||||||
* @rect: (out): pointer to an allocated #MetaRectangle
|
* @rect: (out): pointer to an allocated #MtkRectangle
|
||||||
*
|
*
|
||||||
* Gets the rectangle that bounds @window that is what the user thinks of
|
* Gets the rectangle that bounds @window that is what the user thinks of
|
||||||
* as the edge of the window.
|
* as the edge of the window.
|
||||||
@ -4438,7 +4438,7 @@ meta_window_frame_rect_to_client_rect (MetaWindow *window,
|
|||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
meta_window_get_frame_rect (const MetaWindow *window,
|
meta_window_get_frame_rect (const MetaWindow *window,
|
||||||
MetaRectangle *rect)
|
MtkRectangle *rect)
|
||||||
{
|
{
|
||||||
*rect = window->rect;
|
*rect = window->rect;
|
||||||
}
|
}
|
||||||
@ -4468,7 +4468,7 @@ meta_window_get_client_area_rect (const MetaWindow *window,
|
|||||||
|
|
||||||
void
|
void
|
||||||
meta_window_get_titlebar_rect (MetaWindow *window,
|
meta_window_get_titlebar_rect (MetaWindow *window,
|
||||||
MetaRectangle *rect)
|
MtkRectangle *rect)
|
||||||
{
|
{
|
||||||
meta_window_get_frame_rect (window, rect);
|
meta_window_get_frame_rect (window, rect);
|
||||||
|
|
||||||
@ -5326,7 +5326,7 @@ meta_window_set_focused_internal (MetaWindow *window,
|
|||||||
*/
|
*/
|
||||||
gboolean
|
gboolean
|
||||||
meta_window_get_icon_geometry (MetaWindow *window,
|
meta_window_get_icon_geometry (MetaWindow *window,
|
||||||
MetaRectangle *rect)
|
MtkRectangle *rect)
|
||||||
{
|
{
|
||||||
g_return_val_if_fail (!window->override_redirect, FALSE);
|
g_return_val_if_fail (!window->override_redirect, FALSE);
|
||||||
|
|
||||||
@ -5353,7 +5353,7 @@ meta_window_get_icon_geometry (MetaWindow *window,
|
|||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
meta_window_set_icon_geometry (MetaWindow *window,
|
meta_window_set_icon_geometry (MetaWindow *window,
|
||||||
MetaRectangle *rect)
|
MtkRectangle *rect)
|
||||||
{
|
{
|
||||||
if (rect)
|
if (rect)
|
||||||
{
|
{
|
||||||
@ -5621,7 +5621,7 @@ meta_window_recalc_features (MetaWindow *window)
|
|||||||
if (!window->has_resize_func)
|
if (!window->has_resize_func)
|
||||||
{
|
{
|
||||||
window->has_maximize_func = FALSE;
|
window->has_maximize_func = FALSE;
|
||||||
MetaRectangle display_rect = { 0 };
|
MtkRectangle display_rect = { 0 };
|
||||||
|
|
||||||
meta_display_get_size (window->display, &display_rect.width,
|
meta_display_get_size (window->display, &display_rect.width,
|
||||||
&display_rect.height);
|
&display_rect.height);
|
||||||
@ -5654,7 +5654,7 @@ meta_window_recalc_features (MetaWindow *window)
|
|||||||
|
|
||||||
if (window->has_maximize_func && window->monitor)
|
if (window->has_maximize_func && window->monitor)
|
||||||
{
|
{
|
||||||
MetaRectangle work_area, client_rect;
|
MtkRectangle work_area, client_rect;
|
||||||
|
|
||||||
meta_window_get_work_area_current_monitor (window, &work_area);
|
meta_window_get_work_area_current_monitor (window, &work_area);
|
||||||
meta_window_frame_rect_to_client_rect (window, &work_area, &client_rect);
|
meta_window_frame_rect_to_client_rect (window, &work_area, &client_rect);
|
||||||
@ -5729,7 +5729,7 @@ void
|
|||||||
meta_window_shove_titlebar_onscreen (MetaWindow *window)
|
meta_window_shove_titlebar_onscreen (MetaWindow *window)
|
||||||
{
|
{
|
||||||
MetaWorkspaceManager *workspace_manager = window->display->workspace_manager;
|
MetaWorkspaceManager *workspace_manager = window->display->workspace_manager;
|
||||||
MetaRectangle frame_rect;
|
MtkRectangle frame_rect;
|
||||||
GList *onscreen_region;
|
GList *onscreen_region;
|
||||||
int horiz_amount, vert_amount;
|
int horiz_amount, vert_amount;
|
||||||
|
|
||||||
@ -5770,7 +5770,7 @@ gboolean
|
|||||||
meta_window_titlebar_is_onscreen (MetaWindow *window)
|
meta_window_titlebar_is_onscreen (MetaWindow *window)
|
||||||
{
|
{
|
||||||
MetaWorkspaceManager *workspace_manager = window->display->workspace_manager;
|
MetaWorkspaceManager *workspace_manager = window->display->workspace_manager;
|
||||||
MetaRectangle titlebar_rect, frame_rect;
|
MtkRectangle titlebar_rect, frame_rect;
|
||||||
GList *onscreen_region;
|
GList *onscreen_region;
|
||||||
gboolean is_onscreen;
|
gboolean is_onscreen;
|
||||||
|
|
||||||
@ -5797,8 +5797,8 @@ meta_window_titlebar_is_onscreen (MetaWindow *window)
|
|||||||
onscreen_region = workspace_manager->active_workspace->screen_region;
|
onscreen_region = workspace_manager->active_workspace->screen_region;
|
||||||
while (onscreen_region)
|
while (onscreen_region)
|
||||||
{
|
{
|
||||||
MetaRectangle *spanning_rect = onscreen_region->data;
|
MtkRectangle *spanning_rect = onscreen_region->data;
|
||||||
MetaRectangle overlap;
|
MtkRectangle overlap;
|
||||||
|
|
||||||
mtk_rectangle_intersect (&titlebar_rect, spanning_rect, &overlap);
|
mtk_rectangle_intersect (&titlebar_rect, spanning_rect, &overlap);
|
||||||
if (overlap.height > MIN (titlebar_rect.height, min_height_needed) &&
|
if (overlap.height > MIN (titlebar_rect.height, min_height_needed) &&
|
||||||
@ -5818,7 +5818,7 @@ meta_window_titlebar_is_onscreen (MetaWindow *window)
|
|||||||
void
|
void
|
||||||
meta_window_get_work_area_for_logical_monitor (MetaWindow *window,
|
meta_window_get_work_area_for_logical_monitor (MetaWindow *window,
|
||||||
MetaLogicalMonitor *logical_monitor,
|
MetaLogicalMonitor *logical_monitor,
|
||||||
MetaRectangle *area)
|
MtkRectangle *area)
|
||||||
{
|
{
|
||||||
GList *tmp;
|
GList *tmp;
|
||||||
|
|
||||||
@ -5830,7 +5830,7 @@ meta_window_get_work_area_for_logical_monitor (MetaWindow *window,
|
|||||||
tmp = meta_window_get_workspaces (window);
|
tmp = meta_window_get_workspaces (window);
|
||||||
while (tmp != NULL)
|
while (tmp != NULL)
|
||||||
{
|
{
|
||||||
MetaRectangle workspace_work_area;
|
MtkRectangle workspace_work_area;
|
||||||
meta_workspace_get_work_area_for_logical_monitor (tmp->data,
|
meta_workspace_get_work_area_for_logical_monitor (tmp->data,
|
||||||
logical_monitor,
|
logical_monitor,
|
||||||
&workspace_work_area);
|
&workspace_work_area);
|
||||||
@ -5855,7 +5855,7 @@ meta_window_get_work_area_for_logical_monitor (MetaWindow *window,
|
|||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
meta_window_get_work_area_current_monitor (MetaWindow *window,
|
meta_window_get_work_area_current_monitor (MetaWindow *window,
|
||||||
MetaRectangle *area)
|
MtkRectangle *area)
|
||||||
{
|
{
|
||||||
meta_window_get_work_area_for_monitor (window,
|
meta_window_get_work_area_for_monitor (window,
|
||||||
window->monitor->number,
|
window->monitor->number,
|
||||||
@ -5874,7 +5874,7 @@ meta_window_get_work_area_current_monitor (MetaWindow *window,
|
|||||||
void
|
void
|
||||||
meta_window_get_work_area_for_monitor (MetaWindow *window,
|
meta_window_get_work_area_for_monitor (MetaWindow *window,
|
||||||
int which_monitor,
|
int which_monitor,
|
||||||
MetaRectangle *area)
|
MtkRectangle *area)
|
||||||
{
|
{
|
||||||
MetaBackend *backend = backend_from_window (window);
|
MetaBackend *backend = backend_from_window (window);
|
||||||
MetaMonitorManager *monitor_manager = meta_backend_get_monitor_manager (backend);
|
MetaMonitorManager *monitor_manager = meta_backend_get_monitor_manager (backend);
|
||||||
@ -5898,10 +5898,10 @@ meta_window_get_work_area_for_monitor (MetaWindow *window,
|
|||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
meta_window_get_work_area_all_monitors (MetaWindow *window,
|
meta_window_get_work_area_all_monitors (MetaWindow *window,
|
||||||
MetaRectangle *area)
|
MtkRectangle *area)
|
||||||
{
|
{
|
||||||
GList *tmp;
|
GList *tmp;
|
||||||
MetaRectangle display_rect = { 0 };
|
MtkRectangle display_rect = { 0 };
|
||||||
|
|
||||||
meta_display_get_size (window->display,
|
meta_display_get_size (window->display,
|
||||||
&display_rect.width,
|
&display_rect.width,
|
||||||
@ -5913,7 +5913,7 @@ meta_window_get_work_area_all_monitors (MetaWindow *window,
|
|||||||
tmp = meta_window_get_workspaces (window);
|
tmp = meta_window_get_workspaces (window);
|
||||||
while (tmp != NULL)
|
while (tmp != NULL)
|
||||||
{
|
{
|
||||||
MetaRectangle workspace_work_area;
|
MtkRectangle workspace_work_area;
|
||||||
meta_workspace_get_work_area_all_monitors (tmp->data,
|
meta_workspace_get_work_area_all_monitors (tmp->data,
|
||||||
&workspace_work_area);
|
&workspace_work_area);
|
||||||
mtk_rectangle_intersect (area,
|
mtk_rectangle_intersect (area,
|
||||||
@ -5944,9 +5944,9 @@ meta_window_get_current_tile_monitor_number (MetaWindow *window)
|
|||||||
void
|
void
|
||||||
meta_window_get_tile_area (MetaWindow *window,
|
meta_window_get_tile_area (MetaWindow *window,
|
||||||
MetaTileMode tile_mode,
|
MetaTileMode tile_mode,
|
||||||
MetaRectangle *tile_area)
|
MtkRectangle *tile_area)
|
||||||
{
|
{
|
||||||
MetaRectangle work_area;
|
MtkRectangle work_area;
|
||||||
int tile_monitor_number;
|
int tile_monitor_number;
|
||||||
double fraction;
|
double fraction;
|
||||||
|
|
||||||
@ -6345,7 +6345,7 @@ void
|
|||||||
meta_window_set_demands_attention (MetaWindow *window)
|
meta_window_set_demands_attention (MetaWindow *window)
|
||||||
{
|
{
|
||||||
MetaWorkspaceManager *workspace_manager = window->display->workspace_manager;
|
MetaWorkspaceManager *workspace_manager = window->display->workspace_manager;
|
||||||
MetaRectangle candidate_rect, other_rect;
|
MtkRectangle candidate_rect, other_rect;
|
||||||
GList *stack = window->display->stack->sorted;
|
GList *stack = window->display->stack->sorted;
|
||||||
MetaWindow *other_window;
|
MetaWindow *other_window;
|
||||||
gboolean obscured = FALSE;
|
gboolean obscured = FALSE;
|
||||||
@ -7166,7 +7166,7 @@ meta_window_find_tile_match (MetaWindow *window,
|
|||||||
if (match)
|
if (match)
|
||||||
{
|
{
|
||||||
MetaWindow *above, *bottommost, *topmost;
|
MetaWindow *above, *bottommost, *topmost;
|
||||||
MetaRectangle above_rect, bottommost_rect, topmost_rect;
|
MtkRectangle above_rect, bottommost_rect, topmost_rect;
|
||||||
MetaWindowDrag *window_drag;
|
MetaWindowDrag *window_drag;
|
||||||
|
|
||||||
if (meta_stack_windows_cmp (window->display->stack, match, window) > 0)
|
if (meta_stack_windows_cmp (window->display->stack, match, window) > 0)
|
||||||
@ -7704,7 +7704,7 @@ meta_window_handle_ungrabbed_event (MetaWindow *window,
|
|||||||
{
|
{
|
||||||
gboolean north, south;
|
gboolean north, south;
|
||||||
gboolean west, east;
|
gboolean west, east;
|
||||||
MetaRectangle frame_rect;
|
MtkRectangle frame_rect;
|
||||||
MetaGrabOp op = META_GRAB_OP_WINDOW_BASE;
|
MetaGrabOp op = META_GRAB_OP_WINDOW_BASE;
|
||||||
|
|
||||||
meta_window_get_frame_rect (window, &frame_rect);
|
meta_window_get_frame_rect (window, &frame_rect);
|
||||||
@ -7987,7 +7987,7 @@ meta_window_calculate_bounds (MetaWindow *window,
|
|||||||
main_monitor = meta_window_get_main_logical_monitor (window);
|
main_monitor = meta_window_get_main_logical_monitor (window);
|
||||||
if (main_monitor)
|
if (main_monitor)
|
||||||
{
|
{
|
||||||
MetaRectangle work_area;
|
MtkRectangle work_area;
|
||||||
|
|
||||||
meta_window_get_work_area_for_logical_monitor (window,
|
meta_window_get_work_area_for_logical_monitor (window,
|
||||||
main_monitor,
|
main_monitor,
|
||||||
|
@ -56,7 +56,7 @@ struct _MetaWorkspace
|
|||||||
|
|
||||||
GHashTable *logical_monitor_data;
|
GHashTable *logical_monitor_data;
|
||||||
|
|
||||||
MetaRectangle work_area_screen;
|
MtkRectangle work_area_screen;
|
||||||
GList *screen_region;
|
GList *screen_region;
|
||||||
GList *screen_edges;
|
GList *screen_edges;
|
||||||
GList *monitor_edges;
|
GList *monitor_edges;
|
||||||
@ -83,7 +83,7 @@ void meta_workspace_relocate_windows (MetaWorkspace *workspace,
|
|||||||
|
|
||||||
void meta_workspace_get_work_area_for_logical_monitor (MetaWorkspace *workspace,
|
void meta_workspace_get_work_area_for_logical_monitor (MetaWorkspace *workspace,
|
||||||
MetaLogicalMonitor *logical_monitor,
|
MetaLogicalMonitor *logical_monitor,
|
||||||
MetaRectangle *area);
|
MtkRectangle *area);
|
||||||
|
|
||||||
void meta_workspace_invalidate_work_area (MetaWorkspace *workspace);
|
void meta_workspace_invalidate_work_area (MetaWorkspace *workspace);
|
||||||
|
|
||||||
|
@ -84,7 +84,7 @@ static guint signals[LAST_SIGNAL] = { 0 };
|
|||||||
typedef struct _MetaWorkspaceLogicalMonitorData
|
typedef struct _MetaWorkspaceLogicalMonitorData
|
||||||
{
|
{
|
||||||
GList *logical_monitor_region;
|
GList *logical_monitor_region;
|
||||||
MetaRectangle logical_monitor_work_area;
|
MtkRectangle logical_monitor_work_area;
|
||||||
} MetaWorkspaceLogicalMonitorData;
|
} MetaWorkspaceLogicalMonitorData;
|
||||||
|
|
||||||
typedef struct _MetaWorkspaceFocusableAncestorData
|
typedef struct _MetaWorkspaceFocusableAncestorData
|
||||||
@ -838,8 +838,8 @@ ensure_work_areas_validated (MetaWorkspace *workspace)
|
|||||||
GList *windows;
|
GList *windows;
|
||||||
GList *tmp;
|
GList *tmp;
|
||||||
GList *logical_monitors, *l;
|
GList *logical_monitors, *l;
|
||||||
MetaRectangle display_rect = { 0 };
|
MtkRectangle display_rect = { 0 };
|
||||||
MetaRectangle work_area;
|
MtkRectangle work_area;
|
||||||
|
|
||||||
if (!workspace->work_areas_invalid)
|
if (!workspace->work_areas_invalid)
|
||||||
return;
|
return;
|
||||||
@ -994,8 +994,8 @@ ensure_work_areas_validated (MetaWorkspace *workspace)
|
|||||||
*/
|
*/
|
||||||
if (workspace->screen_region == NULL)
|
if (workspace->screen_region == NULL)
|
||||||
{
|
{
|
||||||
MetaRectangle *nonempty_region;
|
MtkRectangle *nonempty_region;
|
||||||
nonempty_region = g_new (MetaRectangle, 1);
|
nonempty_region = g_new (MtkRectangle, 1);
|
||||||
*nonempty_region = workspace->work_area_screen;
|
*nonempty_region = workspace->work_area_screen;
|
||||||
workspace->screen_region = g_list_prepend (NULL, nonempty_region);
|
workspace->screen_region = g_list_prepend (NULL, nonempty_region);
|
||||||
}
|
}
|
||||||
@ -1057,7 +1057,7 @@ meta_workspace_set_builtin_struts (MetaWorkspace *workspace,
|
|||||||
MetaMonitorManager *monitor_manager =
|
MetaMonitorManager *monitor_manager =
|
||||||
meta_backend_get_monitor_manager (backend);
|
meta_backend_get_monitor_manager (backend);
|
||||||
MetaDisplay *display = workspace->display;
|
MetaDisplay *display = workspace->display;
|
||||||
MetaRectangle display_rect = { 0 };
|
MtkRectangle display_rect = { 0 };
|
||||||
GSList *l;
|
GSList *l;
|
||||||
|
|
||||||
meta_display_get_size (display, &display_rect.width, &display_rect.height);
|
meta_display_get_size (display, &display_rect.width, &display_rect.height);
|
||||||
@ -1125,7 +1125,7 @@ meta_workspace_set_builtin_struts (MetaWorkspace *workspace,
|
|||||||
void
|
void
|
||||||
meta_workspace_get_work_area_for_logical_monitor (MetaWorkspace *workspace,
|
meta_workspace_get_work_area_for_logical_monitor (MetaWorkspace *workspace,
|
||||||
MetaLogicalMonitor *logical_monitor,
|
MetaLogicalMonitor *logical_monitor,
|
||||||
MetaRectangle *area)
|
MtkRectangle *area)
|
||||||
{
|
{
|
||||||
meta_workspace_get_work_area_for_monitor (workspace,
|
meta_workspace_get_work_area_for_monitor (workspace,
|
||||||
logical_monitor->number,
|
logical_monitor->number,
|
||||||
@ -1144,7 +1144,7 @@ meta_workspace_get_work_area_for_logical_monitor (MetaWorkspace *workspace,
|
|||||||
void
|
void
|
||||||
meta_workspace_get_work_area_for_monitor (MetaWorkspace *workspace,
|
meta_workspace_get_work_area_for_monitor (MetaWorkspace *workspace,
|
||||||
int which_monitor,
|
int which_monitor,
|
||||||
MetaRectangle *area)
|
MtkRectangle *area)
|
||||||
{
|
{
|
||||||
MetaContext *context = meta_display_get_context (workspace->display);
|
MetaContext *context = meta_display_get_context (workspace->display);
|
||||||
MetaBackend *backend = meta_context_get_backend (context);
|
MetaBackend *backend = meta_context_get_backend (context);
|
||||||
@ -1175,7 +1175,7 @@ meta_workspace_get_work_area_for_monitor (MetaWorkspace *workspace,
|
|||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
meta_workspace_get_work_area_all_monitors (MetaWorkspace *workspace,
|
meta_workspace_get_work_area_all_monitors (MetaWorkspace *workspace,
|
||||||
MetaRectangle *area)
|
MtkRectangle *area)
|
||||||
{
|
{
|
||||||
ensure_work_areas_validated (workspace);
|
ensure_work_areas_validated (workspace);
|
||||||
|
|
||||||
@ -1426,7 +1426,7 @@ window_contains_point (MetaWindow *window,
|
|||||||
int root_x,
|
int root_x,
|
||||||
int root_y)
|
int root_y)
|
||||||
{
|
{
|
||||||
MetaRectangle rect;
|
MtkRectangle rect;
|
||||||
|
|
||||||
meta_window_get_frame_rect (window, &rect);
|
meta_window_get_frame_rect (window, &rect);
|
||||||
|
|
||||||
|
@ -24,44 +24,15 @@
|
|||||||
#include <glib-object.h>
|
#include <glib-object.h>
|
||||||
#include <meta/common.h>
|
#include <meta/common.h>
|
||||||
|
|
||||||
#define META_TYPE_RECTANGLE (meta_rectangle_get_type ())
|
|
||||||
|
|
||||||
/**
|
|
||||||
* MetaRectangle:
|
|
||||||
* @x: X coordinate of the top-left corner
|
|
||||||
* @y: Y coordinate of the top-left corner
|
|
||||||
* @width: Width of the rectangle
|
|
||||||
* @height: Height of the rectangle
|
|
||||||
*/
|
|
||||||
#ifdef __GI_SCANNER__
|
|
||||||
/* The introspection scanner is currently unable to lookup how
|
|
||||||
* cairo_rectangle_int_t is actually defined. This prevents
|
|
||||||
* introspection data for the GdkRectangle type to include fields
|
|
||||||
* descriptions. To workaround this issue, we define it with the same
|
|
||||||
* content as cairo_rectangle_int_t, but only under the introspection
|
|
||||||
* define.
|
|
||||||
*/
|
|
||||||
struct _MetaRectangle
|
|
||||||
{
|
|
||||||
int x;
|
|
||||||
int y;
|
|
||||||
int width;
|
|
||||||
int height;
|
|
||||||
};
|
|
||||||
typedef struct _MetaRectangle MetaRectangle;
|
|
||||||
#else
|
|
||||||
typedef cairo_rectangle_int_t MetaRectangle;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* MetaStrut:
|
* MetaStrut:
|
||||||
* @rect: #MetaRectangle the #MetaStrut is on
|
* @rect: #MtkRectangle the #MetaStrut is on
|
||||||
* @side: #MetaSide the #MetaStrut is on
|
* @side: #MetaSide the #MetaStrut is on
|
||||||
*/
|
*/
|
||||||
typedef struct _MetaStrut MetaStrut;
|
typedef struct _MetaStrut MetaStrut;
|
||||||
struct _MetaStrut
|
struct _MetaStrut
|
||||||
{
|
{
|
||||||
MetaRectangle rect;
|
MtkRectangle rect;
|
||||||
MetaSide side;
|
MetaSide side;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -80,23 +51,14 @@ typedef enum
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* MetaEdge:
|
* MetaEdge:
|
||||||
* @rect: #MetaRectangle with the bounds of the edge
|
* @rect: #MtkRectangle with the bounds of the edge
|
||||||
* @side_type: Side
|
* @side_type: Side
|
||||||
* @edge_type: To what belongs the edge
|
* @edge_type: To what belongs the edge
|
||||||
*/
|
*/
|
||||||
typedef struct _MetaEdge MetaEdge;
|
typedef struct _MetaEdge MetaEdge;
|
||||||
struct _MetaEdge
|
struct _MetaEdge
|
||||||
{
|
{
|
||||||
MetaRectangle rect; /* width or height should be 1 */
|
MtkRectangle rect; /* width or height should be 1 */
|
||||||
MetaSide side_type;
|
MetaSide side_type;
|
||||||
MetaEdgeType edge_type;
|
MetaEdgeType edge_type;
|
||||||
};
|
};
|
||||||
|
|
||||||
META_EXPORT
|
|
||||||
GType meta_rectangle_get_type (void);
|
|
||||||
|
|
||||||
META_EXPORT
|
|
||||||
MetaRectangle *meta_rectangle_copy (const MetaRectangle *rect);
|
|
||||||
|
|
||||||
META_EXPORT
|
|
||||||
void meta_rectangle_free (MetaRectangle *rect);
|
|
||||||
|
@ -246,7 +246,7 @@ int meta_display_get_current_monitor (MetaDisplay *display);
|
|||||||
META_EXPORT
|
META_EXPORT
|
||||||
void meta_display_get_monitor_geometry (MetaDisplay *display,
|
void meta_display_get_monitor_geometry (MetaDisplay *display,
|
||||||
int monitor,
|
int monitor,
|
||||||
MetaRectangle *geometry);
|
MtkRectangle *geometry);
|
||||||
|
|
||||||
META_EXPORT
|
META_EXPORT
|
||||||
float meta_display_get_monitor_scale (MetaDisplay *display,
|
float meta_display_get_monitor_scale (MetaDisplay *display,
|
||||||
@ -258,7 +258,7 @@ gboolean meta_display_get_monitor_in_fullscreen (MetaDisplay *display,
|
|||||||
|
|
||||||
META_EXPORT
|
META_EXPORT
|
||||||
int meta_display_get_monitor_index_for_rect (MetaDisplay *display,
|
int meta_display_get_monitor_index_for_rect (MetaDisplay *display,
|
||||||
MetaRectangle *rect);
|
MtkRectangle *rect);
|
||||||
|
|
||||||
META_EXPORT
|
META_EXPORT
|
||||||
int meta_display_get_monitor_neighbor_index (MetaDisplay *display,
|
int meta_display_get_monitor_neighbor_index (MetaDisplay *display,
|
||||||
|
@ -95,8 +95,8 @@ struct _MetaPluginClass
|
|||||||
void (*size_change) (MetaPlugin *plugin,
|
void (*size_change) (MetaPlugin *plugin,
|
||||||
MetaWindowActor *actor,
|
MetaWindowActor *actor,
|
||||||
MetaSizeChange which_change,
|
MetaSizeChange which_change,
|
||||||
MetaRectangle *old_frame_rect,
|
MtkRectangle *old_frame_rect,
|
||||||
MetaRectangle *old_buffer_rect);
|
MtkRectangle *old_buffer_rect);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* MetaPluginClass::map:
|
* MetaPluginClass::map:
|
||||||
@ -131,7 +131,7 @@ struct _MetaPluginClass
|
|||||||
|
|
||||||
void (*show_tile_preview) (MetaPlugin *plugin,
|
void (*show_tile_preview) (MetaPlugin *plugin,
|
||||||
MetaWindow *window,
|
MetaWindow *window,
|
||||||
MetaRectangle *tile_rect,
|
MtkRectangle *tile_rect,
|
||||||
int tile_monitor_number);
|
int tile_monitor_number);
|
||||||
void (*hide_tile_preview) (MetaPlugin *plugin);
|
void (*hide_tile_preview) (MetaPlugin *plugin);
|
||||||
|
|
||||||
@ -144,7 +144,7 @@ struct _MetaPluginClass
|
|||||||
void (*show_window_menu_for_rect) (MetaPlugin *plugin,
|
void (*show_window_menu_for_rect) (MetaPlugin *plugin,
|
||||||
MetaWindow *window,
|
MetaWindow *window,
|
||||||
MetaWindowMenuType menu,
|
MetaWindowMenuType menu,
|
||||||
MetaRectangle *rect);
|
MtkRectangle *rect);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* MetaPluginClass::kill_window_effects:
|
* MetaPluginClass::kill_window_effects:
|
||||||
|
@ -52,7 +52,7 @@ cairo_surface_t * meta_window_actor_get_image (MetaWindowActor *self,
|
|||||||
|
|
||||||
META_EXPORT
|
META_EXPORT
|
||||||
ClutterContent * meta_window_actor_paint_to_content (MetaWindowActor *self,
|
ClutterContent * meta_window_actor_paint_to_content (MetaWindowActor *self,
|
||||||
MetaRectangle *clip,
|
MtkRectangle *clip,
|
||||||
GError **error);
|
GError **error);
|
||||||
|
|
||||||
META_EXPORT
|
META_EXPORT
|
||||||
|
@ -121,20 +121,22 @@ META_EXPORT
|
|||||||
gboolean meta_window_is_skip_taskbar (MetaWindow *window);
|
gboolean meta_window_is_skip_taskbar (MetaWindow *window);
|
||||||
|
|
||||||
META_EXPORT
|
META_EXPORT
|
||||||
void meta_window_get_buffer_rect (const MetaWindow *window, MetaRectangle *rect);
|
void meta_window_get_buffer_rect (const MetaWindow *window,
|
||||||
|
MtkRectangle *rect);
|
||||||
|
|
||||||
META_EXPORT
|
META_EXPORT
|
||||||
void meta_window_get_frame_rect (const MetaWindow *window, MetaRectangle *rect);
|
void meta_window_get_frame_rect (const MetaWindow *window,
|
||||||
|
MtkRectangle *rect);
|
||||||
|
|
||||||
META_EXPORT
|
META_EXPORT
|
||||||
void meta_window_client_rect_to_frame_rect (MetaWindow *window,
|
void meta_window_client_rect_to_frame_rect (MetaWindow *window,
|
||||||
MetaRectangle *client_rect,
|
MtkRectangle *client_rect,
|
||||||
MetaRectangle *frame_rect);
|
MtkRectangle *frame_rect);
|
||||||
|
|
||||||
META_EXPORT
|
META_EXPORT
|
||||||
void meta_window_frame_rect_to_client_rect (MetaWindow *window,
|
void meta_window_frame_rect_to_client_rect (MetaWindow *window,
|
||||||
MetaRectangle *frame_rect,
|
MtkRectangle *frame_rect,
|
||||||
MetaRectangle *client_rect);
|
MtkRectangle *client_rect);
|
||||||
|
|
||||||
META_EXPORT
|
META_EXPORT
|
||||||
MetaDisplay *meta_window_get_display (MetaWindow *window);
|
MetaDisplay *meta_window_get_display (MetaWindow *window);
|
||||||
@ -281,11 +283,11 @@ gboolean meta_window_is_on_primary_monitor (MetaWindow *window);
|
|||||||
|
|
||||||
META_EXPORT
|
META_EXPORT
|
||||||
gboolean meta_window_get_icon_geometry (MetaWindow *window,
|
gboolean meta_window_get_icon_geometry (MetaWindow *window,
|
||||||
MetaRectangle *rect);
|
MtkRectangle *rect);
|
||||||
|
|
||||||
META_EXPORT
|
META_EXPORT
|
||||||
void meta_window_set_icon_geometry (MetaWindow *window,
|
void meta_window_set_icon_geometry (MetaWindow *window,
|
||||||
MetaRectangle *rect);
|
MtkRectangle *rect);
|
||||||
|
|
||||||
META_EXPORT
|
META_EXPORT
|
||||||
void meta_window_maximize (MetaWindow *window,
|
void meta_window_maximize (MetaWindow *window,
|
||||||
@ -388,16 +390,16 @@ void meta_window_check_alive (MetaWindow *window,
|
|||||||
|
|
||||||
META_EXPORT
|
META_EXPORT
|
||||||
void meta_window_get_work_area_current_monitor (MetaWindow *window,
|
void meta_window_get_work_area_current_monitor (MetaWindow *window,
|
||||||
MetaRectangle *area);
|
MtkRectangle *area);
|
||||||
|
|
||||||
META_EXPORT
|
META_EXPORT
|
||||||
void meta_window_get_work_area_for_monitor (MetaWindow *window,
|
void meta_window_get_work_area_for_monitor (MetaWindow *window,
|
||||||
int which_monitor,
|
int which_monitor,
|
||||||
MetaRectangle *area);
|
MtkRectangle *area);
|
||||||
|
|
||||||
META_EXPORT
|
META_EXPORT
|
||||||
void meta_window_get_work_area_all_monitors (MetaWindow *window,
|
void meta_window_get_work_area_all_monitors (MetaWindow *window,
|
||||||
MetaRectangle *area);
|
MtkRectangle *area);
|
||||||
|
|
||||||
META_EXPORT
|
META_EXPORT
|
||||||
gboolean meta_window_begin_grab_op (MetaWindow *window,
|
gboolean meta_window_begin_grab_op (MetaWindow *window,
|
||||||
|
@ -47,11 +47,11 @@ GList* meta_workspace_list_windows (MetaWorkspace *workspace);
|
|||||||
META_EXPORT
|
META_EXPORT
|
||||||
void meta_workspace_get_work_area_for_monitor (MetaWorkspace *workspace,
|
void meta_workspace_get_work_area_for_monitor (MetaWorkspace *workspace,
|
||||||
int which_monitor,
|
int which_monitor,
|
||||||
MetaRectangle *area);
|
MtkRectangle *area);
|
||||||
|
|
||||||
META_EXPORT
|
META_EXPORT
|
||||||
void meta_workspace_get_work_area_all_monitors (MetaWorkspace *workspace,
|
void meta_workspace_get_work_area_all_monitors (MetaWorkspace *workspace,
|
||||||
MetaRectangle *area);
|
MtkRectangle *area);
|
||||||
|
|
||||||
META_EXPORT
|
META_EXPORT
|
||||||
void meta_workspace_activate (MetaWorkspace *workspace, guint32 timestamp);
|
void meta_workspace_activate (MetaWorkspace *workspace, guint32 timestamp);
|
||||||
|
@ -41,7 +41,7 @@ init_random_ness (void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
get_random_rect (MetaRectangle *rect)
|
get_random_rect (MtkRectangle *rect)
|
||||||
{
|
{
|
||||||
rect->x = rand () % 1600;
|
rect->x = rand () % 1600;
|
||||||
rect->y = rand () % 1200;
|
rect->y = rand () % 1200;
|
||||||
@ -93,7 +93,7 @@ new_monitor_edge (int x, int y, int width, int height, int side_type)
|
|||||||
static void
|
static void
|
||||||
test_init_rect (void)
|
test_init_rect (void)
|
||||||
{
|
{
|
||||||
MetaRectangle rect;
|
MtkRectangle rect;
|
||||||
|
|
||||||
rect = MTK_RECTANGLE_INIT (1, 2, 3, 4);
|
rect = MTK_RECTANGLE_INIT (1, 2, 3, 4);
|
||||||
g_assert_cmpint (rect.x, ==, 1);
|
g_assert_cmpint (rect.x, ==, 1);
|
||||||
@ -105,7 +105,7 @@ test_init_rect (void)
|
|||||||
static void
|
static void
|
||||||
test_area (void)
|
test_area (void)
|
||||||
{
|
{
|
||||||
MetaRectangle temp;
|
MtkRectangle temp;
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; i < NUM_RANDOM_RUNS; i++)
|
for (i = 0; i < NUM_RANDOM_RUNS; i++)
|
||||||
{
|
{
|
||||||
@ -120,13 +120,13 @@ test_area (void)
|
|||||||
static void
|
static void
|
||||||
test_intersect (void)
|
test_intersect (void)
|
||||||
{
|
{
|
||||||
MetaRectangle a = {100, 200, 50, 40};
|
MtkRectangle a = {100, 200, 50, 40};
|
||||||
MetaRectangle b = { 0, 50, 110, 152};
|
MtkRectangle b = { 0, 50, 110, 152};
|
||||||
MetaRectangle c = { 0, 0, 10, 10};
|
MtkRectangle c = { 0, 0, 10, 10};
|
||||||
MetaRectangle d = {100, 100, 50, 50};
|
MtkRectangle d = {100, 100, 50, 50};
|
||||||
MetaRectangle b_intersect_d = {100, 100, 10, 50};
|
MtkRectangle b_intersect_d = {100, 100, 10, 50};
|
||||||
MetaRectangle temp;
|
MtkRectangle temp;
|
||||||
MetaRectangle temp2;
|
MtkRectangle temp2;
|
||||||
|
|
||||||
mtk_rectangle_intersect (&a, &b, &temp);
|
mtk_rectangle_intersect (&a, &b, &temp);
|
||||||
temp2 = MTK_RECTANGLE_INIT (100, 200, 10, 2);
|
temp2 = MTK_RECTANGLE_INIT (100, 200, 10, 2);
|
||||||
@ -146,12 +146,12 @@ test_intersect (void)
|
|||||||
static void
|
static void
|
||||||
test_equal (void)
|
test_equal (void)
|
||||||
{
|
{
|
||||||
MetaRectangle a = {10, 12, 4, 18};
|
MtkRectangle a = {10, 12, 4, 18};
|
||||||
MetaRectangle b = a;
|
MtkRectangle b = a;
|
||||||
MetaRectangle c = {10, 12, 4, 19};
|
MtkRectangle c = {10, 12, 4, 19};
|
||||||
MetaRectangle d = {10, 12, 7, 18};
|
MtkRectangle d = {10, 12, 7, 18};
|
||||||
MetaRectangle e = {10, 62, 4, 18};
|
MtkRectangle e = {10, 62, 4, 18};
|
||||||
MetaRectangle f = {27, 12, 4, 18};
|
MtkRectangle f = {27, 12, 4, 18};
|
||||||
|
|
||||||
g_assert ( mtk_rectangle_equal (&a, &b));
|
g_assert ( mtk_rectangle_equal (&a, &b));
|
||||||
g_assert (!mtk_rectangle_equal (&a, &c));
|
g_assert (!mtk_rectangle_equal (&a, &c));
|
||||||
@ -163,7 +163,7 @@ test_equal (void)
|
|||||||
static void
|
static void
|
||||||
test_overlap_funcs (void)
|
test_overlap_funcs (void)
|
||||||
{
|
{
|
||||||
MetaRectangle temp1, temp2;
|
MtkRectangle temp1, temp2;
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; i < NUM_RANDOM_RUNS; i++)
|
for (i = 0; i < NUM_RANDOM_RUNS; i++)
|
||||||
{
|
{
|
||||||
@ -184,7 +184,7 @@ test_overlap_funcs (void)
|
|||||||
static void
|
static void
|
||||||
test_basic_fitting (void)
|
test_basic_fitting (void)
|
||||||
{
|
{
|
||||||
MetaRectangle temp1, temp2, temp3;
|
MtkRectangle temp1, temp2, temp3;
|
||||||
int i;
|
int i;
|
||||||
/* Four cases:
|
/* Four cases:
|
||||||
* case temp1 fits temp2 temp1 could fit temp2
|
* case temp1 fits temp2 temp1 could fit temp2
|
||||||
@ -274,7 +274,7 @@ get_screen_region (int which)
|
|||||||
{
|
{
|
||||||
GList *ret;
|
GList *ret;
|
||||||
GSList *struts;
|
GSList *struts;
|
||||||
MetaRectangle basic_rect;
|
MtkRectangle basic_rect;
|
||||||
|
|
||||||
basic_rect = MTK_RECTANGLE_INIT (0, 0, 1600, 1200);
|
basic_rect = MTK_RECTANGLE_INIT (0, 0, 1600, 1200);
|
||||||
ret = NULL;
|
ret = NULL;
|
||||||
@ -291,7 +291,7 @@ get_screen_edges (int which)
|
|||||||
{
|
{
|
||||||
GList *ret;
|
GList *ret;
|
||||||
GSList *struts;
|
GSList *struts;
|
||||||
MetaRectangle basic_rect;
|
MtkRectangle basic_rect;
|
||||||
|
|
||||||
basic_rect = MTK_RECTANGLE_INIT (0, 0, 1600, 1200);
|
basic_rect = MTK_RECTANGLE_INIT (0, 0, 1600, 1200);
|
||||||
ret = NULL;
|
ret = NULL;
|
||||||
@ -382,14 +382,14 @@ test_merge_regions (void)
|
|||||||
|
|
||||||
while (compare && compare->next)
|
while (compare && compare->next)
|
||||||
{
|
{
|
||||||
MetaRectangle *a = compare->data;
|
MtkRectangle *a = compare->data;
|
||||||
GList *other = compare->next;
|
GList *other = compare->next;
|
||||||
|
|
||||||
g_assert (a->width > 0 && a->height > 0);
|
g_assert (a->width > 0 && a->height > 0);
|
||||||
|
|
||||||
while (other)
|
while (other)
|
||||||
{
|
{
|
||||||
MetaRectangle *b = other->data;
|
MtkRectangle *b = other->data;
|
||||||
GList *delete_me = NULL;
|
GList *delete_me = NULL;
|
||||||
|
|
||||||
g_assert (b->width > 0 && b->height > 0);
|
g_assert (b->width > 0 && b->height > 0);
|
||||||
@ -469,7 +469,7 @@ test_merge_regions (void)
|
|||||||
if (delete_me != NULL)
|
if (delete_me != NULL)
|
||||||
{
|
{
|
||||||
#ifdef PRINT_DEBUG
|
#ifdef PRINT_DEBUG
|
||||||
MetaRectangle *bla = delete_me->data;
|
MtkRectangle *bla = delete_me->data;
|
||||||
printf (" Deleting rect %s\n",
|
printf (" Deleting rect %s\n",
|
||||||
meta_rectangle_to_string (bla, rect1));
|
meta_rectangle_to_string (bla, rect1));
|
||||||
#endif
|
#endif
|
||||||
@ -525,8 +525,8 @@ verify_lists_are_equal (GList *code, GList *answer)
|
|||||||
|
|
||||||
while (code && answer)
|
while (code && answer)
|
||||||
{
|
{
|
||||||
MetaRectangle *a = code->data;
|
MtkRectangle *a = code->data;
|
||||||
MetaRectangle *b = answer->data;
|
MtkRectangle *b = answer->data;
|
||||||
|
|
||||||
if (a->x != b->x ||
|
if (a->x != b->x ||
|
||||||
a->y != b->y ||
|
a->y != b->y ||
|
||||||
@ -549,7 +549,7 @@ verify_lists_are_equal (GList *code, GList *answer)
|
|||||||
/* Ought to be at the end of both lists; check if we aren't */
|
/* Ought to be at the end of both lists; check if we aren't */
|
||||||
if (code)
|
if (code)
|
||||||
{
|
{
|
||||||
MetaRectangle *tmp = code->data;
|
MtkRectangle *tmp = code->data;
|
||||||
g_error ("code list longer than answer list by %d items; "
|
g_error ("code list longer than answer list by %d items; "
|
||||||
"first extra item: %d,%d +%d,%d\n",
|
"first extra item: %d,%d +%d,%d\n",
|
||||||
g_list_length (code),
|
g_list_length (code),
|
||||||
@ -558,7 +558,7 @@ verify_lists_are_equal (GList *code, GList *answer)
|
|||||||
|
|
||||||
if (answer)
|
if (answer)
|
||||||
{
|
{
|
||||||
MetaRectangle *tmp = answer->data;
|
MtkRectangle *tmp = answer->data;
|
||||||
g_error ("answer list longer than code list by %d items; "
|
g_error ("answer list longer than code list by %d items; "
|
||||||
"first extra item: %d,%d +%d,%d\n",
|
"first extra item: %d,%d +%d,%d\n",
|
||||||
g_list_length (answer),
|
g_list_length (answer),
|
||||||
@ -656,7 +656,7 @@ static void
|
|||||||
test_region_fitting (void)
|
test_region_fitting (void)
|
||||||
{
|
{
|
||||||
GList *region;
|
GList *region;
|
||||||
MetaRectangle rect;
|
MtkRectangle rect;
|
||||||
|
|
||||||
/* See test_basic_fitting() for how/why these automated random tests work */
|
/* See test_basic_fitting() for how/why these automated random tests work */
|
||||||
int i;
|
int i;
|
||||||
@ -698,8 +698,8 @@ static void
|
|||||||
test_clamping_to_region (void)
|
test_clamping_to_region (void)
|
||||||
{
|
{
|
||||||
GList *region;
|
GList *region;
|
||||||
MetaRectangle rect;
|
MtkRectangle rect;
|
||||||
MetaRectangle min_size;
|
MtkRectangle min_size;
|
||||||
FixedDirections fixed_directions;
|
FixedDirections fixed_directions;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@ -709,7 +709,7 @@ test_clamping_to_region (void)
|
|||||||
region = get_screen_region (3);
|
region = get_screen_region (3);
|
||||||
for (i = 0; i < NUM_RANDOM_RUNS; i++)
|
for (i = 0; i < NUM_RANDOM_RUNS; i++)
|
||||||
{
|
{
|
||||||
MetaRectangle temp;
|
MtkRectangle temp;
|
||||||
get_random_rect (&rect);
|
get_random_rect (&rect);
|
||||||
temp = rect;
|
temp = rect;
|
||||||
meta_rectangle_clamp_to_fit_into_region (region,
|
meta_rectangle_clamp_to_fit_into_region (region,
|
||||||
@ -796,7 +796,7 @@ test_clamping_to_region (void)
|
|||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
rect_overlaps_region (const GList *spanning_rects,
|
rect_overlaps_region (const GList *spanning_rects,
|
||||||
const MetaRectangle *rect)
|
const MtkRectangle *rect)
|
||||||
{
|
{
|
||||||
/* FIXME: Should I move this to boxes.[ch]? */
|
/* FIXME: Should I move this to boxes.[ch]? */
|
||||||
const GList *temp;
|
const GList *temp;
|
||||||
@ -819,7 +819,7 @@ static void
|
|||||||
test_clipping_to_region (void)
|
test_clipping_to_region (void)
|
||||||
{
|
{
|
||||||
GList *region;
|
GList *region;
|
||||||
MetaRectangle rect, temp;
|
MtkRectangle rect, temp;
|
||||||
FixedDirections fixed_directions = 0;
|
FixedDirections fixed_directions = 0;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@ -879,7 +879,7 @@ static void
|
|||||||
test_shoving_into_region (void)
|
test_shoving_into_region (void)
|
||||||
{
|
{
|
||||||
GList *region;
|
GList *region;
|
||||||
MetaRectangle rect, temp;
|
MtkRectangle rect, temp;
|
||||||
FixedDirections fixed_directions = 0;
|
FixedDirections fixed_directions = 0;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@ -1211,7 +1211,7 @@ test_find_nonintersected_monitor_edges (void)
|
|||||||
static void
|
static void
|
||||||
test_gravity_resize (void)
|
test_gravity_resize (void)
|
||||||
{
|
{
|
||||||
MetaRectangle oldrect, rect, temp;
|
MtkRectangle oldrect, rect, temp;
|
||||||
|
|
||||||
rect.x = -500; /* Some random amount not equal to oldrect.x to ensure that
|
rect.x = -500; /* Some random amount not equal to oldrect.x to ensure that
|
||||||
* the resize is done with respect to oldrect instead of rect
|
* the resize is done with respect to oldrect instead of rect
|
||||||
|
@ -121,7 +121,7 @@ meta_get_mode_fixed_rect_16 (MetaKmsMode *mode)
|
|||||||
meta_kms_mode_get_height (mode));
|
meta_kms_mode_get_height (mode));
|
||||||
}
|
}
|
||||||
|
|
||||||
MetaRectangle
|
MtkRectangle
|
||||||
meta_get_mode_rect (MetaKmsMode *mode)
|
meta_get_mode_rect (MetaKmsMode *mode)
|
||||||
{
|
{
|
||||||
return MTK_RECTANGLE_INIT (0, 0,
|
return MTK_RECTANGLE_INIT (0, 0,
|
||||||
|
@ -38,4 +38,4 @@ MetaDrmBuffer * meta_create_test_mode_dumb_buffer (MetaKmsDevice *device,
|
|||||||
|
|
||||||
MetaFixed16Rectangle meta_get_mode_fixed_rect_16 (MetaKmsMode *mode);
|
MetaFixed16Rectangle meta_get_mode_fixed_rect_16 (MetaKmsMode *mode);
|
||||||
|
|
||||||
MetaRectangle meta_get_mode_rect (MetaKmsMode *mode);
|
MtkRectangle meta_get_mode_rect (MetaKmsMode *mode);
|
||||||
|
@ -208,7 +208,7 @@ check_current_monitor_mode (MetaMonitor *monitor,
|
|||||||
|
|
||||||
static MetaLogicalMonitor *
|
static MetaLogicalMonitor *
|
||||||
logical_monitor_from_layout (MetaMonitorManager *monitor_manager,
|
logical_monitor_from_layout (MetaMonitorManager *monitor_manager,
|
||||||
MetaRectangle *layout)
|
MtkRectangle *layout)
|
||||||
{
|
{
|
||||||
GList *l;
|
GList *l;
|
||||||
|
|
||||||
|
@ -165,7 +165,7 @@ typedef struct _MonitorTestCaseMonitor
|
|||||||
|
|
||||||
typedef struct _MonitorTestCaseLogicalMonitor
|
typedef struct _MonitorTestCaseLogicalMonitor
|
||||||
{
|
{
|
||||||
MetaRectangle layout;
|
MtkRectangle layout;
|
||||||
float scale;
|
float scale;
|
||||||
int monitors[MAX_N_MONITORS];
|
int monitors[MAX_N_MONITORS];
|
||||||
int n_monitors;
|
int n_monitors;
|
||||||
|
@ -221,7 +221,7 @@ assert_software_rendered (ClutterStageView *stage_view)
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
capture_view_into (ClutterStageView *view,
|
capture_view_into (ClutterStageView *view,
|
||||||
MetaRectangle *rect,
|
MtkRectangle *rect,
|
||||||
uint8_t *buffer,
|
uint8_t *buffer,
|
||||||
int stride)
|
int stride)
|
||||||
{
|
{
|
||||||
@ -277,7 +277,7 @@ on_after_paint (MetaStage *stage,
|
|||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
CaptureViewData *data = user_data;
|
CaptureViewData *data = user_data;
|
||||||
MetaRectangle rect;
|
MtkRectangle rect;
|
||||||
float view_scale;
|
float view_scale;
|
||||||
int texture_width, texture_height;
|
int texture_width, texture_height;
|
||||||
cairo_surface_t *image;
|
cairo_surface_t *image;
|
||||||
|
@ -92,7 +92,7 @@ typedef struct _DisplayTilePreview
|
|||||||
{
|
{
|
||||||
ClutterActor *actor;
|
ClutterActor *actor;
|
||||||
|
|
||||||
MetaRectangle tile_rect;
|
MtkRectangle tile_rect;
|
||||||
} DisplayTilePreview;
|
} DisplayTilePreview;
|
||||||
|
|
||||||
G_DEFINE_TYPE (MetaTestShell, meta_test_shell, META_TYPE_PLUGIN)
|
G_DEFINE_TYPE (MetaTestShell, meta_test_shell, META_TYPE_PLUGIN)
|
||||||
@ -262,7 +262,7 @@ on_monitors_changed (MetaMonitorManager *monitor_manager,
|
|||||||
{
|
{
|
||||||
MetaBackgroundContent *background_content;
|
MetaBackgroundContent *background_content;
|
||||||
ClutterContent *content;
|
ClutterContent *content;
|
||||||
MetaRectangle rect;
|
MtkRectangle rect;
|
||||||
ClutterActor *background_actor;
|
ClutterActor *background_actor;
|
||||||
MetaBackground *background;
|
MetaBackground *background;
|
||||||
uint8_t red;
|
uint8_t red;
|
||||||
@ -720,7 +720,7 @@ get_display_tile_preview (MetaDisplay *display)
|
|||||||
static void
|
static void
|
||||||
meta_test_shell_show_tile_preview (MetaPlugin *plugin,
|
meta_test_shell_show_tile_preview (MetaPlugin *plugin,
|
||||||
MetaWindow *window,
|
MetaWindow *window,
|
||||||
MetaRectangle *tile_rect,
|
MtkRectangle *tile_rect,
|
||||||
int tile_monitor_number)
|
int tile_monitor_number)
|
||||||
{
|
{
|
||||||
MetaDisplay *display = meta_plugin_get_display (plugin);
|
MetaDisplay *display = meta_plugin_get_display (plugin);
|
||||||
|
@ -53,7 +53,7 @@ typedef struct _MonitorStoreTestCaseMonitor
|
|||||||
|
|
||||||
typedef struct _MonitorStoreTestCaseLogicalMonitor
|
typedef struct _MonitorStoreTestCaseLogicalMonitor
|
||||||
{
|
{
|
||||||
MetaRectangle layout;
|
MtkRectangle layout;
|
||||||
float scale;
|
float scale;
|
||||||
MetaMonitorTransform transform;
|
MetaMonitorTransform transform;
|
||||||
gboolean is_primary;
|
gboolean is_primary;
|
||||||
|
@ -7968,7 +7968,7 @@ meta_test_monitor_custom_lid_switch_config (void)
|
|||||||
test_case.expect.crtcs[1].x = 1024;
|
test_case.expect.crtcs[1].x = 1024;
|
||||||
test_case.expect.crtcs[1].transform = META_MONITOR_TRANSFORM_270;
|
test_case.expect.crtcs[1].transform = META_MONITOR_TRANSFORM_270;
|
||||||
test_case.expect.logical_monitors[0].layout =
|
test_case.expect.logical_monitors[0].layout =
|
||||||
(MetaRectangle) { .width = 1024, .height = 768 };
|
(MtkRectangle) { .width = 1024, .height = 768 };
|
||||||
test_case.expect.logical_monitors[0].transform = META_MONITOR_TRANSFORM_NORMAL;
|
test_case.expect.logical_monitors[0].transform = META_MONITOR_TRANSFORM_NORMAL;
|
||||||
test_case.expect.logical_monitors[1].transform = META_MONITOR_TRANSFORM_270;
|
test_case.expect.logical_monitors[1].transform = META_MONITOR_TRANSFORM_270;
|
||||||
test_case.expect.n_logical_monitors = 2;
|
test_case.expect.n_logical_monitors = 2;
|
||||||
@ -7990,7 +7990,7 @@ meta_test_monitor_custom_lid_switch_config (void)
|
|||||||
test_case.expect.crtcs[1].x = 0;
|
test_case.expect.crtcs[1].x = 0;
|
||||||
test_case.expect.monitors[0].current_mode = -1;
|
test_case.expect.monitors[0].current_mode = -1;
|
||||||
test_case.expect.logical_monitors[0].layout =
|
test_case.expect.logical_monitors[0].layout =
|
||||||
(MetaRectangle) { .width = 768, .height = 1024 };
|
(MtkRectangle) { .width = 768, .height = 1024 };
|
||||||
test_case.expect.logical_monitors[0].monitors[0] = 1;
|
test_case.expect.logical_monitors[0].monitors[0] = 1;
|
||||||
test_case.expect.logical_monitors[0].transform = META_MONITOR_TRANSFORM_90;
|
test_case.expect.logical_monitors[0].transform = META_MONITOR_TRANSFORM_90;
|
||||||
test_case.expect.n_logical_monitors = 1;
|
test_case.expect.n_logical_monitors = 1;
|
||||||
@ -8015,7 +8015,7 @@ meta_test_monitor_custom_lid_switch_config (void)
|
|||||||
test_case.expect.crtcs[1].x = 1024;
|
test_case.expect.crtcs[1].x = 1024;
|
||||||
test_case.expect.monitors[0].current_mode = 0;
|
test_case.expect.monitors[0].current_mode = 0;
|
||||||
test_case.expect.logical_monitors[0].layout =
|
test_case.expect.logical_monitors[0].layout =
|
||||||
(MetaRectangle) { .width = 1024, .height = 768 };
|
(MtkRectangle) { .width = 1024, .height = 768 };
|
||||||
test_case.expect.logical_monitors[0].monitors[0] = 0;
|
test_case.expect.logical_monitors[0].monitors[0] = 0;
|
||||||
test_case.expect.logical_monitors[0].transform = META_MONITOR_TRANSFORM_NORMAL;
|
test_case.expect.logical_monitors[0].transform = META_MONITOR_TRANSFORM_NORMAL;
|
||||||
test_case.expect.logical_monitors[1].transform = META_MONITOR_TRANSFORM_270;
|
test_case.expect.logical_monitors[1].transform = META_MONITOR_TRANSFORM_270;
|
||||||
|
@ -264,7 +264,7 @@ meta_test_kms_device_mode_set (void)
|
|||||||
g_autoptr (MetaDrmBuffer) primary_buffer = NULL;
|
g_autoptr (MetaDrmBuffer) primary_buffer = NULL;
|
||||||
MetaKmsCrtcState crtc_state;
|
MetaKmsCrtcState crtc_state;
|
||||||
MetaKmsConnectorState connector_state;
|
MetaKmsConnectorState connector_state;
|
||||||
MetaRectangle mode_rect;
|
MtkRectangle mode_rect;
|
||||||
MetaKmsFeedback *feedback;
|
MetaKmsFeedback *feedback;
|
||||||
|
|
||||||
device = meta_get_test_kms_device (test_context);
|
device = meta_get_test_kms_device (test_context);
|
||||||
|
@ -64,7 +64,7 @@ meta_test_headless_monitor_getters (void)
|
|||||||
display = meta_context_get_display (test_context);
|
display = meta_context_get_display (test_context);
|
||||||
|
|
||||||
index = meta_display_get_monitor_index_for_rect (display,
|
index = meta_display_get_monitor_index_for_rect (display,
|
||||||
&(MetaRectangle) { 0 });
|
&(MtkRectangle) { 0 });
|
||||||
g_assert_cmpint (index, ==, -1);
|
g_assert_cmpint (index, ==, -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -78,7 +78,7 @@ meta_test_headless_monitor_connect (void)
|
|||||||
g_autolist (GObject) udev_devices = NULL;
|
g_autolist (GObject) udev_devices = NULL;
|
||||||
GList *logical_monitors;
|
GList *logical_monitors;
|
||||||
MetaLogicalMonitor *logical_monitor;
|
MetaLogicalMonitor *logical_monitor;
|
||||||
MetaRectangle monitor_layout;
|
MtkRectangle monitor_layout;
|
||||||
ClutterActor *stage;
|
ClutterActor *stage;
|
||||||
g_autoptr (GError) error = NULL;
|
g_autoptr (GError) error = NULL;
|
||||||
|
|
||||||
|
@ -245,7 +245,7 @@ meta_test_switch_config (void)
|
|||||||
g_autoptr (ClutterVirtualInputDevice) virtual_keyboard = NULL;
|
g_autoptr (ClutterVirtualInputDevice) virtual_keyboard = NULL;
|
||||||
g_autoptr (MetaVirtualMonitor) virtual_monitor = NULL;
|
g_autoptr (MetaVirtualMonitor) virtual_monitor = NULL;
|
||||||
GList *logical_monitors;
|
GList *logical_monitors;
|
||||||
MetaRectangle logical_monitor_layout;
|
MtkRectangle logical_monitor_layout;
|
||||||
gulong after_paint_handler_id;
|
gulong after_paint_handler_id;
|
||||||
gulong presented_handler_id;
|
gulong presented_handler_id;
|
||||||
gboolean monitors_changed;
|
gboolean monitors_changed;
|
||||||
|
@ -229,8 +229,8 @@ meta_test_kms_render_client_scanout (void)
|
|||||||
gulong paint_view_handler_id;
|
gulong paint_view_handler_id;
|
||||||
gulong presented_handler_id;
|
gulong presented_handler_id;
|
||||||
MetaWindow *window;
|
MetaWindow *window;
|
||||||
MetaRectangle view_rect;
|
MtkRectangle view_rect;
|
||||||
MetaRectangle buffer_rect;
|
MtkRectangle buffer_rect;
|
||||||
|
|
||||||
test_driver = meta_wayland_test_driver_new (wayland_compositor);
|
test_driver = meta_wayland_test_driver_new (wayland_compositor);
|
||||||
meta_wayland_test_driver_set_property (test_driver,
|
meta_wayland_test_driver_set_property (test_driver,
|
||||||
|
@ -39,7 +39,7 @@ wait_for_paint (gpointer user_data)
|
|||||||
GList *monitors;
|
GList *monitors;
|
||||||
GList *logical_monitors;
|
GList *logical_monitors;
|
||||||
MetaLogicalMonitor *logical_monitor;
|
MetaLogicalMonitor *logical_monitor;
|
||||||
MetaRectangle layout;
|
MtkRectangle layout;
|
||||||
|
|
||||||
loop = g_main_loop_new (NULL, FALSE);
|
loop = g_main_loop_new (NULL, FALSE);
|
||||||
g_signal_connect_swapped (stage, "presented",
|
g_signal_connect_swapped (stage, "presented",
|
||||||
|
@ -350,7 +350,7 @@ test_case_assert_size (TestCase *test,
|
|||||||
int expected_height,
|
int expected_height,
|
||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
MetaRectangle frame_rect;
|
MtkRectangle frame_rect;
|
||||||
|
|
||||||
meta_window_get_frame_rect (window, &frame_rect);
|
meta_window_get_frame_rect (window, &frame_rect);
|
||||||
|
|
||||||
@ -449,7 +449,7 @@ parse_window_size (MetaWindow *window,
|
|||||||
const char *size_str)
|
const char *size_str)
|
||||||
{
|
{
|
||||||
MetaLogicalMonitor *logical_monitor;
|
MetaLogicalMonitor *logical_monitor;
|
||||||
MetaRectangle logical_monitor_layout;
|
MtkRectangle logical_monitor_layout;
|
||||||
int value;
|
int value;
|
||||||
|
|
||||||
logical_monitor = meta_window_find_monitor_from_frame_rect (window);
|
logical_monitor = meta_window_find_monitor_from_frame_rect (window);
|
||||||
@ -889,7 +889,7 @@ test_case_do (TestCase *test,
|
|||||||
MetaDisplay *display = meta_context_get_display (test->context);
|
MetaDisplay *display = meta_context_get_display (test->context);
|
||||||
MetaWorkspaceManager *workspace_manager =
|
MetaWorkspaceManager *workspace_manager =
|
||||||
meta_display_get_workspace_manager (display);
|
meta_display_get_workspace_manager (display);
|
||||||
MetaRectangle rect = { x, y, width, height };
|
MtkRectangle rect = { x, y, width, height };
|
||||||
MetaStrut strut = { rect, side };
|
MetaStrut strut = { rect, side };
|
||||||
GSList *struts = g_slist_append (NULL, &strut);
|
GSList *struts = g_slist_append (NULL, &strut);
|
||||||
GList *workspaces =
|
GList *workspaces =
|
||||||
@ -999,7 +999,7 @@ test_case_do (TestCase *test,
|
|||||||
if (!window)
|
if (!window)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
MetaRectangle frame_rect;
|
MtkRectangle frame_rect;
|
||||||
meta_window_get_frame_rect (window, &frame_rect);
|
meta_window_get_frame_rect (window, &frame_rect);
|
||||||
int x = atoi (argv[2]);
|
int x = atoi (argv[2]);
|
||||||
int y = atoi (argv[3]);
|
int y = atoi (argv[3]);
|
||||||
|
@ -202,8 +202,8 @@ meta_test_util_later_schedule_from_later (void)
|
|||||||
static void
|
static void
|
||||||
meta_test_adjacent_to (void)
|
meta_test_adjacent_to (void)
|
||||||
{
|
{
|
||||||
MetaRectangle base = { .x = 10, .y = 10, .width = 10, .height = 10 };
|
MtkRectangle base = { .x = 10, .y = 10, .width = 10, .height = 10 };
|
||||||
MetaRectangle adjacent[] = {
|
MtkRectangle adjacent[] = {
|
||||||
{ .x = 20, .y = 10, .width = 10, .height = 10 },
|
{ .x = 20, .y = 10, .width = 10, .height = 10 },
|
||||||
{ .x = 0, .y = 10, .width = 10, .height = 10 },
|
{ .x = 0, .y = 10, .width = 10, .height = 10 },
|
||||||
{ .x = 0, .y = 1, .width = 10, .height = 10 },
|
{ .x = 0, .y = 1, .width = 10, .height = 10 },
|
||||||
@ -211,7 +211,7 @@ meta_test_adjacent_to (void)
|
|||||||
{ .x = 10, .y = 20, .width = 10, .height = 10 },
|
{ .x = 10, .y = 20, .width = 10, .height = 10 },
|
||||||
{ .x = 10, .y = 0, .width = 10, .height = 10 },
|
{ .x = 10, .y = 0, .width = 10, .height = 10 },
|
||||||
};
|
};
|
||||||
MetaRectangle not_adjacent[] = {
|
MtkRectangle not_adjacent[] = {
|
||||||
{ .x = 0, .y = 0, .width = 10, .height = 10 },
|
{ .x = 0, .y = 0, .width = 10, .height = 10 },
|
||||||
{ .x = 20, .y = 20, .width = 10, .height = 10 },
|
{ .x = 20, .y = 20, .width = 10, .height = 10 },
|
||||||
{ .x = 21, .y = 10, .width = 10, .height = 10 },
|
{ .x = 21, .y = 10, .width = 10, .height = 10 },
|
||||||
|
@ -65,7 +65,7 @@ fractional_scale (void)
|
|||||||
MetaMonitorManager *monitor_manager =
|
MetaMonitorManager *monitor_manager =
|
||||||
meta_backend_get_monitor_manager (backend);
|
meta_backend_get_monitor_manager (backend);
|
||||||
MetaLogicalMonitor *logical_monitor;
|
MetaLogicalMonitor *logical_monitor;
|
||||||
MetaRectangle layout;
|
MtkRectangle layout;
|
||||||
|
|
||||||
wait_for_sync_point (0);
|
wait_for_sync_point (0);
|
||||||
assert_wayland_surface_size (test_window, 1920, 1080);
|
assert_wayland_surface_size (test_window, 1920, 1080);
|
||||||
|
@ -105,7 +105,7 @@ wait_for_window_added (MetaWindow *window)
|
|||||||
static void
|
static void
|
||||||
toplevel_fullscreen (void)
|
toplevel_fullscreen (void)
|
||||||
{
|
{
|
||||||
MetaRectangle rect;
|
MtkRectangle rect;
|
||||||
|
|
||||||
wait_for_first_frame (test_window);
|
wait_for_first_frame (test_window);
|
||||||
|
|
||||||
@ -121,7 +121,7 @@ static void
|
|||||||
toplevel_fullscreen_ref_test (void)
|
toplevel_fullscreen_ref_test (void)
|
||||||
{
|
{
|
||||||
MetaWindowWayland *wl_window = META_WINDOW_WAYLAND (test_window);
|
MetaWindowWayland *wl_window = META_WINDOW_WAYLAND (test_window);
|
||||||
MetaRectangle rect;
|
MtkRectangle rect;
|
||||||
|
|
||||||
wait_for_window_added (test_window);
|
wait_for_window_added (test_window);
|
||||||
assert_wayland_surface_size (test_window, 10, 10);
|
assert_wayland_surface_size (test_window, 10, 10);
|
||||||
|
@ -148,7 +148,7 @@ on_effects_completed_idle (gpointer user_data)
|
|||||||
MetaBackend *backend = meta_context_get_backend (test_context);
|
MetaBackend *backend = meta_context_get_backend (test_context);
|
||||||
ClutterActor *stage = meta_backend_get_stage (backend);
|
ClutterActor *stage = meta_backend_get_stage (backend);
|
||||||
MetaWindow *window = meta_window_actor_get_meta_window (actor);
|
MetaWindow *window = meta_window_actor_get_meta_window (actor);
|
||||||
MetaRectangle buffer_rect;
|
MtkRectangle buffer_rect;
|
||||||
|
|
||||||
/* Move the window to a known position and perform a mouse click, allowing a
|
/* Move the window to a known position and perform a mouse click, allowing a
|
||||||
* popup to be mapped. */
|
* popup to be mapped. */
|
||||||
@ -244,7 +244,7 @@ on_unmap_sync_point (MetaWaylandTestDriver *test_driver,
|
|||||||
ClutterActor *actor = CLUTTER_ACTOR (meta_wayland_surface_get_actor (surface));
|
ClutterActor *actor = CLUTTER_ACTOR (meta_wayland_surface_get_actor (surface));
|
||||||
MetaWindowActor *window_actor = meta_window_actor_from_actor (actor);
|
MetaWindowActor *window_actor = meta_window_actor_from_actor (actor);
|
||||||
MetaWindow *window = meta_window_actor_get_meta_window (window_actor);
|
MetaWindow *window = meta_window_actor_get_meta_window (window_actor);
|
||||||
MetaRectangle buffer_rect;
|
MtkRectangle buffer_rect;
|
||||||
|
|
||||||
/* Click inside the window to allow mapping a popup. */
|
/* Click inside the window to allow mapping a popup. */
|
||||||
|
|
||||||
@ -424,7 +424,7 @@ wait_until_after_paint (void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
set_struts (MetaRectangle rect,
|
set_struts (MtkRectangle rect,
|
||||||
MetaSide side)
|
MetaSide side)
|
||||||
{
|
{
|
||||||
MetaDisplay *display = meta_context_get_display (test_context);
|
MetaDisplay *display = meta_context_get_display (test_context);
|
||||||
@ -465,7 +465,7 @@ clear_struts (void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static MetaRectangle
|
static MtkRectangle
|
||||||
get_primary_logical_monitor_layout (void)
|
get_primary_logical_monitor_layout (void)
|
||||||
{
|
{
|
||||||
MetaBackend *backend = meta_context_get_backend (test_context);
|
MetaBackend *backend = meta_context_get_backend (test_context);
|
||||||
@ -483,8 +483,8 @@ toplevel_bounds_struts (void)
|
|||||||
{
|
{
|
||||||
MetaWaylandTestClient *wayland_test_client;
|
MetaWaylandTestClient *wayland_test_client;
|
||||||
MetaWindow *window;
|
MetaWindow *window;
|
||||||
MetaRectangle logical_monitor_layout;
|
MtkRectangle logical_monitor_layout;
|
||||||
MetaRectangle work_area;
|
MtkRectangle work_area;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This test case makes sure that setting and changing struts result in the
|
* This test case makes sure that setting and changing struts result in the
|
||||||
@ -492,7 +492,7 @@ toplevel_bounds_struts (void)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
logical_monitor_layout = get_primary_logical_monitor_layout ();
|
logical_monitor_layout = get_primary_logical_monitor_layout ();
|
||||||
set_struts ((MetaRectangle) {
|
set_struts ((MtkRectangle) {
|
||||||
.x = 0,
|
.x = 0,
|
||||||
.y = 0,
|
.y = 0,
|
||||||
.width = logical_monitor_layout.width,
|
.width = logical_monitor_layout.width,
|
||||||
@ -566,8 +566,8 @@ toplevel_bounds_monitors (void)
|
|||||||
ClutterSeat *seat;
|
ClutterSeat *seat;
|
||||||
g_autoptr (MetaVirtualMonitor) second_virtual_monitor = NULL;
|
g_autoptr (MetaVirtualMonitor) second_virtual_monitor = NULL;
|
||||||
MetaWaylandTestClient *wayland_test_client;
|
MetaWaylandTestClient *wayland_test_client;
|
||||||
MetaRectangle logical_monitor_layout;
|
MtkRectangle logical_monitor_layout;
|
||||||
MetaRectangle work_area;
|
MtkRectangle work_area;
|
||||||
MetaWindow *window;
|
MetaWindow *window;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -584,7 +584,7 @@ toplevel_bounds_monitors (void)
|
|||||||
300, 200, 60.0);
|
300, 200, 60.0);
|
||||||
|
|
||||||
logical_monitor_layout = get_primary_logical_monitor_layout ();
|
logical_monitor_layout = get_primary_logical_monitor_layout ();
|
||||||
set_struts ((MetaRectangle) {
|
set_struts ((MtkRectangle) {
|
||||||
.x = 0,
|
.x = 0,
|
||||||
.y = 0,
|
.y = 0,
|
||||||
.width = logical_monitor_layout.width,
|
.width = logical_monitor_layout.width,
|
||||||
|
@ -334,7 +334,7 @@ meta_wayland_actor_surface_is_on_logical_monitor (MetaWaylandSurfaceRole *surfac
|
|||||||
MetaBackend *backend = meta_context_get_backend (context);
|
MetaBackend *backend = meta_context_get_backend (context);
|
||||||
MetaRenderer *renderer = meta_backend_get_renderer (backend);
|
MetaRenderer *renderer = meta_backend_get_renderer (backend);
|
||||||
ClutterActor *actor = CLUTTER_ACTOR (priv->actor);
|
ClutterActor *actor = CLUTTER_ACTOR (priv->actor);
|
||||||
MetaRectangle logical_monitor_layout;
|
MtkRectangle logical_monitor_layout;
|
||||||
GList *l;
|
GList *l;
|
||||||
|
|
||||||
logical_monitor_layout = meta_logical_monitor_get_layout (logical_monitor);
|
logical_monitor_layout = meta_logical_monitor_get_layout (logical_monitor);
|
||||||
@ -342,7 +342,7 @@ meta_wayland_actor_surface_is_on_logical_monitor (MetaWaylandSurfaceRole *surfac
|
|||||||
for (l = meta_renderer_get_views (renderer); l; l = l->next)
|
for (l = meta_renderer_get_views (renderer); l; l = l->next)
|
||||||
{
|
{
|
||||||
ClutterStageView *stage_view = l->data;
|
ClutterStageView *stage_view = l->data;
|
||||||
MetaRectangle view_layout;
|
MtkRectangle view_layout;
|
||||||
|
|
||||||
clutter_stage_view_get_layout (stage_view, &view_layout);
|
clutter_stage_view_get_layout (stage_view, &view_layout);
|
||||||
|
|
||||||
|
@ -608,7 +608,7 @@ send_xdg_output_events (struct wl_resource *resource,
|
|||||||
gboolean need_all_events,
|
gboolean need_all_events,
|
||||||
gboolean *pending_done_event)
|
gboolean *pending_done_event)
|
||||||
{
|
{
|
||||||
MetaRectangle layout;
|
MtkRectangle layout;
|
||||||
MetaLogicalMonitor *logical_monitor;
|
MetaLogicalMonitor *logical_monitor;
|
||||||
int version;
|
int version;
|
||||||
|
|
||||||
|
@ -44,16 +44,16 @@ G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (MetaWaylandShellSurface,
|
|||||||
|
|
||||||
void
|
void
|
||||||
meta_wayland_shell_surface_calculate_geometry (MetaWaylandShellSurface *shell_surface,
|
meta_wayland_shell_surface_calculate_geometry (MetaWaylandShellSurface *shell_surface,
|
||||||
MetaRectangle *out_geometry)
|
MtkRectangle *out_geometry)
|
||||||
{
|
{
|
||||||
MetaWaylandSurfaceRole *surface_role =
|
MetaWaylandSurfaceRole *surface_role =
|
||||||
META_WAYLAND_SURFACE_ROLE (shell_surface);
|
META_WAYLAND_SURFACE_ROLE (shell_surface);
|
||||||
MetaWaylandSurface *surface =
|
MetaWaylandSurface *surface =
|
||||||
meta_wayland_surface_role_get_surface (surface_role);
|
meta_wayland_surface_role_get_surface (surface_role);
|
||||||
MetaRectangle geometry;
|
MtkRectangle geometry;
|
||||||
MetaWaylandSurface *subsurface_surface;
|
MetaWaylandSurface *subsurface_surface;
|
||||||
|
|
||||||
geometry = (MetaRectangle) {
|
geometry = (MtkRectangle) {
|
||||||
.width = meta_wayland_surface_get_width (surface),
|
.width = meta_wayland_surface_get_width (surface),
|
||||||
.height = meta_wayland_surface_get_height (surface),
|
.height = meta_wayland_surface_get_height (surface),
|
||||||
};
|
};
|
||||||
@ -74,11 +74,11 @@ meta_wayland_shell_surface_calculate_geometry (MetaWaylandShellSurface *shell_su
|
|||||||
|
|
||||||
void
|
void
|
||||||
meta_wayland_shell_surface_determine_geometry (MetaWaylandShellSurface *shell_surface,
|
meta_wayland_shell_surface_determine_geometry (MetaWaylandShellSurface *shell_surface,
|
||||||
MetaRectangle *set_geometry,
|
MtkRectangle *set_geometry,
|
||||||
MetaRectangle *out_geometry)
|
MtkRectangle *out_geometry)
|
||||||
{
|
{
|
||||||
MetaRectangle bounding_geometry = { 0 };
|
MtkRectangle bounding_geometry = { 0 };
|
||||||
MetaRectangle intersected_geometry = { 0 };
|
MtkRectangle intersected_geometry = { 0 };
|
||||||
|
|
||||||
meta_wayland_shell_surface_calculate_geometry (shell_surface,
|
meta_wayland_shell_surface_calculate_geometry (shell_surface,
|
||||||
&bounding_geometry);
|
&bounding_geometry);
|
||||||
|
@ -51,11 +51,11 @@ void meta_wayland_shell_surface_managed (MetaWaylandShellSurface *shell_surface,
|
|||||||
MetaWindow *window);
|
MetaWindow *window);
|
||||||
|
|
||||||
void meta_wayland_shell_surface_calculate_geometry (MetaWaylandShellSurface *shell_surface,
|
void meta_wayland_shell_surface_calculate_geometry (MetaWaylandShellSurface *shell_surface,
|
||||||
MetaRectangle *out_geometry);
|
MtkRectangle *out_geometry);
|
||||||
|
|
||||||
void meta_wayland_shell_surface_determine_geometry (MetaWaylandShellSurface *shell_surface,
|
void meta_wayland_shell_surface_determine_geometry (MetaWaylandShellSurface *shell_surface,
|
||||||
MetaRectangle *set_geometry,
|
MtkRectangle *set_geometry,
|
||||||
MetaRectangle *out_geometry);
|
MtkRectangle *out_geometry);
|
||||||
|
|
||||||
void meta_wayland_shell_surface_set_window (MetaWaylandShellSurface *shell_surface,
|
void meta_wayland_shell_surface_set_window (MetaWaylandShellSurface *shell_surface,
|
||||||
MetaWindow *window);
|
MetaWindow *window);
|
||||||
|
@ -111,15 +111,15 @@ void
|
|||||||
meta_wayland_subsurface_union_geometry (MetaWaylandSubsurface *subsurface,
|
meta_wayland_subsurface_union_geometry (MetaWaylandSubsurface *subsurface,
|
||||||
int parent_x,
|
int parent_x,
|
||||||
int parent_y,
|
int parent_y,
|
||||||
MetaRectangle *out_geometry)
|
MtkRectangle *out_geometry)
|
||||||
{
|
{
|
||||||
MetaWaylandSurfaceRole *surface_role = META_WAYLAND_SURFACE_ROLE (subsurface);
|
MetaWaylandSurfaceRole *surface_role = META_WAYLAND_SURFACE_ROLE (subsurface);
|
||||||
MetaWaylandSurface *surface =
|
MetaWaylandSurface *surface =
|
||||||
meta_wayland_surface_role_get_surface (surface_role);
|
meta_wayland_surface_role_get_surface (surface_role);
|
||||||
MetaRectangle geometry;
|
MtkRectangle geometry;
|
||||||
MetaWaylandSurface *subsurface_surface;
|
MetaWaylandSurface *subsurface_surface;
|
||||||
|
|
||||||
geometry = (MetaRectangle) {
|
geometry = (MtkRectangle) {
|
||||||
.x = surface->offset_x + surface->sub.x,
|
.x = surface->offset_x + surface->sub.x,
|
||||||
.y = surface->offset_y + surface->sub.y,
|
.y = surface->offset_y + surface->sub.y,
|
||||||
.width = meta_wayland_surface_get_width (surface),
|
.width = meta_wayland_surface_get_width (surface),
|
||||||
|
@ -42,7 +42,7 @@ typedef struct
|
|||||||
void meta_wayland_subsurface_union_geometry (MetaWaylandSubsurface *subsurface,
|
void meta_wayland_subsurface_union_geometry (MetaWaylandSubsurface *subsurface,
|
||||||
int parent_x,
|
int parent_x,
|
||||||
int parent_y,
|
int parent_y,
|
||||||
MetaRectangle *out_geometry);
|
MtkRectangle *out_geometry);
|
||||||
|
|
||||||
void meta_wayland_subsurface_parent_destroyed (MetaWaylandSurface *surface);
|
void meta_wayland_subsurface_parent_destroyed (MetaWaylandSurface *surface);
|
||||||
|
|
||||||
|
@ -2272,7 +2272,7 @@ meta_wayland_surface_can_scanout_untransformed (MetaWaylandSurface *surface,
|
|||||||
|
|
||||||
if (surface->viewport.has_dst_size)
|
if (surface->viewport.has_dst_size)
|
||||||
{
|
{
|
||||||
MetaRectangle view_layout;
|
MtkRectangle view_layout;
|
||||||
float view_scale;
|
float view_scale;
|
||||||
float untransformed_layout_width;
|
float untransformed_layout_width;
|
||||||
float untransformed_layout_height;
|
float untransformed_layout_height;
|
||||||
|
@ -100,7 +100,7 @@ struct _MetaWaylandSurfaceState
|
|||||||
/* wl_surface.frame */
|
/* wl_surface.frame */
|
||||||
struct wl_list frame_callback_list;
|
struct wl_list frame_callback_list;
|
||||||
|
|
||||||
MetaRectangle new_geometry;
|
MtkRectangle new_geometry;
|
||||||
gboolean has_new_geometry;
|
gboolean has_new_geometry;
|
||||||
|
|
||||||
gboolean has_acked_configure_serial;
|
gboolean has_acked_configure_serial;
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user