window: Fix cursor anchoring issues when drag-unmaximizing windows
The cursor was anchored wrongly when trying to unmaximize windows from dragging them from the top of the screen because of a few think-o's and some code that forgot to be updated when we moved to the frame rect coordinate system. The cursor is still offset for windows that start dragging from the top panel. This is technically correct, but looks wrong. We'll fix this in the next commit.
This commit is contained in:
parent
35e0982e35
commit
bce5f3f108
@ -5602,19 +5602,10 @@ update_move (MetaWindow *window,
|
|||||||
((double)(x - display->grab_initial_window_pos.x)) /
|
((double)(x - display->grab_initial_window_pos.x)) /
|
||||||
((double)display->grab_initial_window_pos.width);
|
((double)display->grab_initial_window_pos.width);
|
||||||
|
|
||||||
display->grab_initial_window_pos.x =
|
display->grab_initial_window_pos.x = x - window->saved_rect.width * prop;
|
||||||
x - window->saved_rect.width * prop;
|
|
||||||
display->grab_initial_window_pos.y = y;
|
|
||||||
|
|
||||||
if (window->frame)
|
|
||||||
{
|
|
||||||
display->grab_initial_window_pos.y += window->frame->child_y / 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
window->saved_rect.x = display->grab_initial_window_pos.x;
|
window->saved_rect.x = display->grab_initial_window_pos.x;
|
||||||
window->saved_rect.y = display->grab_initial_window_pos.y;
|
window->saved_rect.y = display->grab_initial_window_pos.y;
|
||||||
display->grab_anchor_root_x = x;
|
|
||||||
display->grab_anchor_root_y = y;
|
|
||||||
|
|
||||||
meta_window_unmaximize (window, META_MAXIMIZE_BOTH);
|
meta_window_unmaximize (window, META_MAXIMIZE_BOTH);
|
||||||
return;
|
return;
|
||||||
@ -5661,14 +5652,15 @@ update_move (MetaWindow *window,
|
|||||||
window->unconstrained_rect.y = window->saved_rect.y;
|
window->unconstrained_rect.y = window->saved_rect.y;
|
||||||
|
|
||||||
meta_window_unmaximize (window, META_MAXIMIZE_BOTH);
|
meta_window_unmaximize (window, META_MAXIMIZE_BOTH);
|
||||||
|
|
||||||
|
display->grab_initial_window_pos = work_area;
|
||||||
|
display->grab_anchor_root_x = x;
|
||||||
|
display->grab_anchor_root_y = y;
|
||||||
|
window->shaken_loose = FALSE;
|
||||||
|
|
||||||
|
meta_window_maximize (window, META_MAXIMIZE_BOTH);
|
||||||
}
|
}
|
||||||
|
|
||||||
display->grab_initial_window_pos = work_area;
|
|
||||||
display->grab_anchor_root_x = x;
|
|
||||||
display->grab_anchor_root_y = y;
|
|
||||||
window->shaken_loose = FALSE;
|
|
||||||
|
|
||||||
meta_window_maximize (window, META_MAXIMIZE_BOTH);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user