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

Prevent the event loop from pausing when entering modal loop (eventloop-2.0) #839

Merged
merged 2 commits into from
Apr 14, 2019

Conversation

aloucks
Copy link
Contributor

@aloucks aloucks commented Apr 13, 2019

After clicking the window title bar or border (for a drag or resize), the event loop pauses until the mouse is moved. This change relays the WM_NCLBUTTONDOWN message to the dummy window where it queues a redraw and consumes the message. This effectively jumpstarts the modal loop and it continues to fire draw requests.

  • Tested on all platforms changed

After clicking the window title bar or border (for a drag or resize),
the event loop pauses until the mouse is moved. This change relays
the WM_NCLBUTTONDOWN message to the dummy window where it queues
a redraw and consumes the message. This effectively jumpstarts
the modal loop and it continues to fire draw requests.
@aloucks aloucks changed the title Prevent the event loop from pausing after entering modal loop Prevent the event loop from pausing after entering modal loop (eventloop-2.0) Apr 13, 2019
@aloucks aloucks changed the title Prevent the event loop from pausing after entering modal loop (eventloop-2.0) Prevent the event loop from pausing when entering modal loop (eventloop-2.0) Apr 13, 2019
Copy link
Contributor

@Osspial Osspial left a comment

Choose a reason for hiding this comment

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

Hi, and thanks for the PR!

There's one point that confused me a bit about this change, which I've commented on below. Once that's resolved, this should be good to merge.

}
drop(runner);
commctrl::DefSubclassProc(window, msg, wparam, lparam)
},
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do you forward the WM_NCLBUTTONDOWN message to the dummy window and trigger a redraw in there, instead of asking it to redraw directly from here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I checked again and also came to the conclusion that it's not necessary. I've pushed a new commit to remove the forwarding. I think it was leftover from sorting out the relationship with the dummy modal window.

Relaying the WM_NCLBUTTONDOWN message to the modal window turned out
to be unnecessary.
@Osspial Osspial merged commit 2253565 into rust-windowing:eventloop-2.0 Apr 14, 2019
felixrabe pushed a commit to felixrabe/winit that referenced this pull request Jun 30, 2019
…op-2.0) (rust-windowing#839)

* Prevent the event loop from pausing after entering modal loop

After clicking the window title bar or border (for a drag or resize),
the event loop pauses until the mouse is moved. This change relays
the WM_NCLBUTTONDOWN message to the dummy window where it queues
a redraw and consumes the message. This effectively jumpstarts
the modal loop and it continues to fire draw requests.

* Handle WM_NCLBUTTONDOWN in public_window_callback instead of relaying.

Relaying the WM_NCLBUTTONDOWN message to the modal window turned out
to be unnecessary.
kosyak pushed a commit to kosyak/winit that referenced this pull request Jul 10, 2019
…op-2.0) (rust-windowing#839)

* Prevent the event loop from pausing after entering modal loop

After clicking the window title bar or border (for a drag or resize),
the event loop pauses until the mouse is moved. This change relays
the WM_NCLBUTTONDOWN message to the dummy window where it queues
a redraw and consumes the message. This effectively jumpstarts
the modal loop and it continues to fire draw requests.

* Handle WM_NCLBUTTONDOWN in public_window_callback instead of relaying.

Relaying the WM_NCLBUTTONDOWN message to the modal window turned out
to be unnecessary.
aloucks added a commit to aloucks/winit that referenced this pull request Feb 23, 2025
When clicking the title bar on Windows, to drag the window, there is
a noticible pause in continuous redraw requests. This was fixed
in rust-windowing#839 and then regressed in rust-windowing#1852. The cursor blinks in both
cases and is unrelated. The regression made the blink happen after
the pause instead of immediately.
aloucks added a commit to aloucks/winit that referenced this pull request Feb 23, 2025
When clicking the title bar on Windows, to drag the window, there is
a noticible pause in continuous redraw requests. This was fixed
in rust-windowing#839 and then regressed in rust-windowing#1852. The cursor blinks in both
cases and is unrelated. The regression made the blink happen after
the pause instead of immediately.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants