From 5be8c5074659b3501821f285c21e91f4e2b7b126 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Tue, 27 Sep 2022 16:54:29 +0200 Subject: [PATCH] window-actor: Rename confusing variable name A "window rect" in most places refers to the rectangle the window corresponds to when it comes to window management. MetaWindow::rect also refers to this window management related rectangle. However in the geometry sync functions, it instead called what was to be the rectangle the actor should have as "window rect", which is arguably a bit confusing. Fix this by renaming it "actor_rect" so that it becomes clear that it's the rectangle the actor should get on the stage. Part-of: --- src/compositor/meta-window-actor.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/compositor/meta-window-actor.c b/src/compositor/meta-window-actor.c index 650fe12ef..b39bfc632 100644 --- a/src/compositor/meta-window-actor.c +++ b/src/compositor/meta-window-actor.c @@ -843,17 +843,17 @@ meta_window_actor_sync_actor_geometry (MetaWindowActor *self, { MetaWindowActorPrivate *priv = meta_window_actor_get_instance_private (self); - MetaRectangle window_rect; + MetaRectangle actor_rect; ClutterActor *actor = CLUTTER_ACTOR (self); MetaWindowActorChanges changes = 0; - meta_window_get_buffer_rect (priv->window, &window_rect); + meta_window_get_buffer_rect (priv->window, &actor_rect); /* When running as a Wayland compositor we catch size changes when new * buffers are attached */ if (META_IS_SURFACE_ACTOR_X11 (priv->surface)) meta_surface_actor_x11_set_size (META_SURFACE_ACTOR_X11 (priv->surface), - window_rect.width, window_rect.height); + actor_rect.width, actor_rect.height); /* Normally we want freezing a window to also freeze its position; this allows * windows to atomically move and resize together, either under app control, @@ -878,10 +878,10 @@ meta_window_actor_sync_actor_geometry (MetaWindowActor *self, old_width = box.x2 - box.x1; old_height = box.y2 - box.y1; - if (old_x != window_rect.x || old_y != window_rect.y) + if (old_x != actor_rect.x || old_y != actor_rect.y) changes |= META_WINDOW_ACTOR_CHANGE_POSITION; - if (old_width != window_rect.width || old_height != window_rect.height) + if (old_width != actor_rect.width || old_height != actor_rect.height) changes |= META_WINDOW_ACTOR_CHANGE_SIZE; } else @@ -890,10 +890,10 @@ meta_window_actor_sync_actor_geometry (MetaWindowActor *self, } if (changes & META_WINDOW_ACTOR_CHANGE_POSITION) - clutter_actor_set_position (actor, window_rect.x, window_rect.y); + clutter_actor_set_position (actor, actor_rect.x, actor_rect.y); if (changes & META_WINDOW_ACTOR_CHANGE_SIZE) - clutter_actor_set_size (actor, window_rect.width, window_rect.height); + clutter_actor_set_size (actor, actor_rect.width, actor_rect.height); return changes; }