Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Focus window on scrolling #8361

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

nickodei
Copy link
Contributor

@nickodei nickodei commented Nov 5, 2024

Describe your PR, what does it fix/add?

This is the new PR for #8279. The other PR introduced a regression on merge which this implementation addresses as well.

In short: You are now able to focus a window on scroll (like with mouse-movement and button-clicks). This particularly happens, after you switched your workspace and returned back.

What does it better? It now calls the simulateMouseMovement only once when the window differ and also when mouse_follow event is set to 1. This should avoid weard touchpad behaviour happening in firefox when you constantly call simulateMouseMovement.

Is it ready for merging, or does it need work?

  • Tested it locally with mouse and touchpad on my Surface Pro 8
  • Scrolling in Firefox works also on touchpad (was the regression)

Copy link
Member

@vaxerski vaxerski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic makes sense to me

g_pSeatManager->sendPointerMotion(e.timeMs, Vector2D{TEMPCURX, TEMPCURY} - BOX.pos());
g_pSeatManager->sendPointerFrame();
const auto PCURRWINDOW = g_pCompositor->getWindowFromSurface(g_pCompositor->m_pLastFocus.lock());
if (*PFOLLOWMOUSE == 1 && PCURRWINDOW && PWINDOW != PCURRWINDOW) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no {}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

got it

if (PWINDOW && PWINDOW->checkInputOnDecos(INPUT_TYPE_AXIS, MOUSECOORDS, e))
return;
if (PWINDOW) {
if (PWINDOW->checkInputOnDecos(INPUT_TYPE_AXIS, MOUSECOORDS, e)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no {}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

got it

@nickodei
Copy link
Contributor Author

nickodei commented Nov 6, 2024

For now I daily drive this version on my pc and surface and everything looks fine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants