Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

deermichel
Copy link
Contributor

Description of Change

Fixes #19611.

Use gfx::ScreenRectFromNSRect to refer to the window's top-left corner as origin instead of the bottom-left one.

No tests since will-resize cannot be triggered programmatically - correct me if i'm wrong :)

cc @codebytere @pmkary

Checklist

Release Notes

Notes: Fixed BrowserWindow's will-resize event returning wrong bounds on macOS.

@alitaheri
Copy link

Will this also take position change into account?

I'm not a expert at reading the electron code base. What I'm worried about is that when the user grabs one of the top, top-left, top-right, left, bottom-left corners and tries to resize from there. it's not only the size that changes. the position will change too.

For example:

If I have a window at (x=10, y=10, width=20, height=30) and drag the left edge and move my mouse 5 pixels the newBounds passed to the will-resize callback must be (x=5, y=10, width=25, height=30) this is to keep the right edge at it's place. and it's crucial for our application to actually receive the correct newBounds. otherwise it won't be able to figure out which edge is being dragged.

So, please check this and make sure this behavior is provided. it is on windows.

Thank you very much 👍

@deermichel
Copy link
Contributor Author

I think so:

jj

@alitaheri
Copy link

Perfect 😍 Thank you

@codebytere codebytere self-requested a review August 6, 2019 17:11
@deermichel deermichel force-pushed the intern/fix-will-resize branch from 3ca3ae9 to 45b8cb2 Compare August 6, 2019 20:14
@electron-cation electron-cation bot removed the new-pr 🌱 PR opened recently label Aug 7, 2019
@codebytere codebytere merged commit 9eb89b4 into master Aug 8, 2019
@release-clerk
Copy link

release-clerk bot commented Aug 8, 2019

Release Notes Persisted

Fixed BrowserWindow's will-resize event returning wrong bounds on macOS.

@codebytere codebytere deleted the intern/fix-will-resize branch August 8, 2019 02:59
@trop
Copy link
Contributor

trop bot commented Aug 8, 2019

I was unable to backport this PR to "5-0-x" cleanly;
you will need to perform this backport manually.

@trop trop bot removed the target/5-0-x label Aug 8, 2019
@trop
Copy link
Contributor

trop bot commented Aug 8, 2019

I was unable to backport this PR to "6-0-x" cleanly;
you will need to perform this backport manually.

@trop
Copy link
Contributor

trop bot commented Aug 8, 2019

I have automatically backported this PR to "7-0-x", please check out #19680

@pouyakary
Copy link

So nice, thanks a lot @deermichel 😍

@trop
Copy link
Contributor

trop bot commented Aug 9, 2019

A maintainer has manually backported this PR to "6-0-x", please check out #19704

@trop
Copy link
Contributor

trop bot commented Aug 9, 2019

A maintainer has manually backported this PR to "5-0-x", please check out #19705

@davej
Copy link
Contributor

davej commented Apr 27, 2020

I believe there is a bug here. The y value changes on newBounds when the window is dragged from the bottom edge. It can be seen in @deermichel's gif above. This behaviour is also inconsistent with Windows where the y value doesn't change (correctly IMO).

@nrajinikanth
Copy link

+1 to @davej comment. When resizing from the bottom edge, I see y origin in newBounds differs from y origin in current bounds. Is there any way to workaround this issue and/or a plan to fix? Looking for some way to detect that a user has dragged the browser window from the bottom edge.

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.

BrowserWindow's "will-resize" event's callback is provided with bizarre newBounds value

8 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.