Use a saner sanity check for floating_reposition.
The function contained_by_output checks whether any output contains any parts of a give rect. Rather than relying on the central point of the rect.
This commit is contained in:
committed by
Michael Stapelberg
parent
5b4ff1804d
commit
5adb09c5fc
@ -659,11 +659,7 @@ void drag_pointer(Con *con, const xcb_button_press_event_t *event, xcb_window_t
|
||||
void floating_reposition(Con *con, Rect newrect) {
|
||||
/* Sanity check: Are the new coordinates on any output? If not, we
|
||||
* ignore that request. */
|
||||
Output *output = get_output_containing(
|
||||
newrect.x + (newrect.width / 2),
|
||||
newrect.y + (newrect.height / 2));
|
||||
|
||||
if (!output) {
|
||||
if (!contained_by_output(newrect)) {
|
||||
ELOG("No output found at destination coordinates. Not repositioning.\n");
|
||||
return;
|
||||
}
|
||||
|
Reference in New Issue
Block a user