diff --git a/geometry.cpp b/geometry.cpp index 3bf8da29aa..198d12a30b 100644 --- a/geometry.cpp +++ b/geometry.cpp @@ -3126,6 +3126,11 @@ void Client::setQuickTileMode(QuickTileMode mode, bool keyboard) if (!isResizable() && maximizeMode() != MaximizeFull) return; + // this might move the window away from the cursor pos what will cause a leave event + // since this is not due to a cursor move and we didn't receive motion events in the active + // window, we need to udpate the focus mouse position here + workspace()->updateFocusMousePosition(Cursor::pos()); + GeometryUpdatesBlocker blocker(this); if (mode == QuickTileMaximize) { diff --git a/placement.cpp b/placement.cpp index c193657cf4..2f936f6d65 100644 --- a/placement.cpp +++ b/placement.cpp @@ -663,6 +663,11 @@ const char* Placement::policyToString(Policy policy) void Client::packTo(int left, int top) { + // this might move the window away from the cursor pos what will cause a leave event + // since this is not due to a cursor move and we didn't receive motion events in the active + // window, we need to udpate the focus mouse position here + workspace()->updateFocusMousePosition(Cursor::pos()); + const int oldScreen = screen(); move(left, top); if (screen() != oldScreen) { @@ -725,6 +730,11 @@ void Client::growHorizontal() geom.setRight(newright); } geom.setSize(adjustedSize(geom.size(), SizemodeFixedW)); + geom.setSize(adjustedSize(geom.size(), SizemodeFixedH)); + // this might move an inactive window under the cursor pos what will cause an enter event + // since this is not due to a cursor move and we didn't receive motion events in the active + // window, we need to udpate the focus mouse position here + workspace()->updateFocusMousePosition(Cursor::pos()); setGeometry(geom); } @@ -743,8 +753,13 @@ void Client::shrinkHorizontal() if (geom.width() <= 1) return; geom.setSize(adjustedSize(geom.size(), SizemodeFixedW)); - if (geom.width() > 20) + if (geom.width() > 20) { + // this might move the window away from the cursor pos what will cause a leave event + // since this is not due to a cursor move and we didn't receive motion events in the active + // window, we need to udpate the focus mouse position here + workspace()->updateFocusMousePosition(Cursor::pos()); setGeometry(geom); + } } void Workspace::slotWindowGrowVertical() @@ -768,6 +783,10 @@ void Client::growVertical() geom.setBottom(newbottom); } geom.setSize(adjustedSize(geom.size(), SizemodeFixedH)); + // this might move an inactive window under the cursor pos what will cause an enter event + // since this is not due to a cursor move and we didn't receive motion events in the active + // window, we need to udpate the focus mouse position here + workspace()->updateFocusMousePosition(Cursor::pos()); setGeometry(geom); } @@ -787,8 +806,13 @@ void Client::shrinkVertical() if (geom.height() <= 1) return; geom.setSize(adjustedSize(geom.size(), SizemodeFixedH)); - if (geom.height() > 20) + if (geom.height() > 20) { + // this might move the window away from the cursor pos what will cause a leave event + // since this is not due to a cursor move and we didn't receive motion events in the active + // window, we need to udpate the focus mouse position here + workspace()->updateFocusMousePosition(Cursor::pos()); setGeometry(geom); + } }