window: Rename the requested_rect to the unconstrained_rect
The requested_rect is a strange name for it, because it's not actually the rect that the user or client requested all the time: in the case of a simple move or a simple resize, we calculate some of the fields ourselves. To the MetaWindow subclass implementations, it just means "the rect before we constrained it", so just use the name unconstrained_rect. This also makes it match the name of the MetaWindow field.
This commit is contained in:
parent
9df5b17940
commit
cbffbb0be0
@ -478,7 +478,7 @@ struct _MetaWindowClass
|
||||
void (*current_workspace_changed) (MetaWindow *window);
|
||||
void (*move_resize_internal) (MetaWindow *window,
|
||||
int gravity,
|
||||
MetaRectangle requested_rect,
|
||||
MetaRectangle unconstrained_rect,
|
||||
MetaRectangle constrained_rect,
|
||||
MetaMoveResizeFlags flags,
|
||||
MetaMoveResizeResultFlags *result);
|
||||
|
@ -3651,8 +3651,8 @@ meta_window_move_resize_internal (MetaWindow *window,
|
||||
* windows, this is the root position of the client area of the window.
|
||||
*/
|
||||
gboolean did_placement;
|
||||
MetaRectangle new_rect;
|
||||
MetaRectangle requested_rect;
|
||||
MetaRectangle unconstrained_rect;
|
||||
MetaRectangle constrained_rect;
|
||||
MetaMoveResizeResultFlags result = 0;
|
||||
|
||||
g_return_if_fail (!window->override_redirect);
|
||||
@ -3676,48 +3676,47 @@ meta_window_move_resize_internal (MetaWindow *window,
|
||||
|
||||
meta_window_get_client_root_coords (window, &old_rect);
|
||||
meta_rectangle_resize_with_gravity (&old_rect,
|
||||
&requested_rect,
|
||||
&unconstrained_rect,
|
||||
gravity,
|
||||
client_rect.width,
|
||||
client_rect.height);
|
||||
}
|
||||
else
|
||||
{
|
||||
requested_rect = client_rect;
|
||||
unconstrained_rect = client_rect;
|
||||
}
|
||||
|
||||
/* If this is only a move, then ignore the passed in size and
|
||||
* just use the existing size of the window. */
|
||||
if ((flags & (META_IS_MOVE_ACTION | META_IS_RESIZE_ACTION)) == META_IS_MOVE_ACTION)
|
||||
{
|
||||
requested_rect.width = window->rect.width;
|
||||
requested_rect.height = window->rect.height;
|
||||
unconstrained_rect.width = window->rect.width;
|
||||
unconstrained_rect.height = window->rect.height;
|
||||
}
|
||||
|
||||
new_rect = requested_rect;
|
||||
|
||||
/* Save the unconstrained rectangle to the position we should be at
|
||||
* before constraints kick in. */
|
||||
window->unconstrained_rect = new_rect;
|
||||
window->unconstrained_rect = unconstrained_rect;
|
||||
|
||||
constrained_rect = unconstrained_rect;
|
||||
if (flags & (META_IS_MOVE_ACTION | META_IS_RESIZE_ACTION))
|
||||
{
|
||||
MetaRectangle old_rect;
|
||||
meta_window_get_frame_rect (window, &old_rect);
|
||||
|
||||
meta_window_client_rect_to_frame_rect (window, &new_rect, &new_rect);
|
||||
meta_window_client_rect_to_frame_rect (window, &constrained_rect, &constrained_rect);
|
||||
|
||||
meta_window_constrain (window,
|
||||
flags,
|
||||
gravity,
|
||||
&old_rect,
|
||||
&new_rect);
|
||||
&constrained_rect);
|
||||
|
||||
meta_window_frame_rect_to_client_rect (window, &new_rect, &new_rect);
|
||||
meta_window_frame_rect_to_client_rect (window, &constrained_rect, &constrained_rect);
|
||||
}
|
||||
|
||||
/* Do the protocol-specific move/resize logic */
|
||||
META_WINDOW_GET_CLASS (window)->move_resize_internal (window, gravity, requested_rect, new_rect, flags, &result);
|
||||
META_WINDOW_GET_CLASS (window)->move_resize_internal (window, gravity, unconstrained_rect, constrained_rect, flags, &result);
|
||||
|
||||
if (result & META_MOVE_RESIZE_RESULT_MOVED)
|
||||
g_signal_emit (window, window_signals[POSITION_CHANGED], 0);
|
||||
|
@ -150,7 +150,7 @@ meta_window_wayland_grab_op_ended (MetaWindow *window,
|
||||
static void
|
||||
meta_window_wayland_move_resize_internal (MetaWindow *window,
|
||||
int gravity,
|
||||
MetaRectangle requested_rect,
|
||||
MetaRectangle unconstrained_rect,
|
||||
MetaRectangle constrained_rect,
|
||||
MetaMoveResizeFlags flags,
|
||||
MetaMoveResizeResultFlags *result)
|
||||
@ -177,8 +177,8 @@ meta_window_wayland_move_resize_internal (MetaWindow *window,
|
||||
*/
|
||||
|
||||
*result |= META_MOVE_RESIZE_RESULT_RESIZED;
|
||||
window->rect.width = requested_rect.width;
|
||||
window->rect.height = requested_rect.height;
|
||||
window->rect.width = unconstrained_rect.width;
|
||||
window->rect.height = unconstrained_rect.height;
|
||||
|
||||
/* This is a commit of an attach. We should move the window to match the
|
||||
* new position the client wants. */
|
||||
|
@ -995,7 +995,7 @@ meta_window_x11_current_workspace_changed (MetaWindow *window)
|
||||
static void
|
||||
meta_window_x11_move_resize_internal (MetaWindow *window,
|
||||
int gravity,
|
||||
MetaRectangle requested_rect,
|
||||
MetaRectangle unconstrained_rect,
|
||||
MetaRectangle constrained_rect,
|
||||
MetaMoveResizeFlags flags,
|
||||
MetaMoveResizeResultFlags *result)
|
||||
|
Loading…
Reference in New Issue
Block a user