-
Notifications
You must be signed in to change notification settings - Fork 665
DYN-9829: Fix hidden resize grip in ScriptEditorWindow #16756
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
base: master
Are you sure you want to change the base?
DYN-9829: Fix hidden resize grip in ScriptEditorWindow #16756
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See the ticket for this pull request: https://jira.autodesk.com/browse/DYN-9829
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds a custom resize grip to the ScriptEditorWindow to improve visual alignment. The default resize grip was being overlapped by the window border, so this change implements a custom grip positioned inside the visible window area using Win32 API calls.
Key Changes:
- Changed the window's
ResizeModefromCanResizeWithGriptoCanResizeto disable the default grip - Added a custom
ResizeGripcontrol with manual positioning and event handling - Implemented Win32 interop to trigger window resizing when the custom grip is dragged
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| ScriptEditorWindow.xaml.cs | Added Win32 interop constants, P/Invoke declaration, and mouse event handler to implement custom resize functionality |
| ScriptEditorWindow.xaml | Replaced default resize mode with custom ResizeGrip control positioned inside window border |
| private const int WM_SYSCOMMAND = 0x0112; | ||
| private const int SC_SIZE = 0xF000; | ||
| private const int HTBOTTOMRIGHT = 0x0008; |
Copilot
AI
Nov 26, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The constant names follow Win32 convention but are not sufficiently descriptive for C# code. Consider renaming to WindowsMessageSystemCommand, SystemCommandSize, and HitTestBottomRight respectively, or add XML documentation comments explaining what these magic values represent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are standard Win32 names. I've added comment above to clarify their use
| private void WindowResizeGrip_OnPreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e) | ||
| { | ||
| if (WindowState != WindowState.Normal) | ||
| return; | ||
|
|
||
| var helper = new WindowInteropHelper(this); | ||
| SendMessage(helper.Handle, WM_SYSCOMMAND, (IntPtr)(SC_SIZE + HTBOTTOMRIGHT), IntPtr.Zero); | ||
| e.Handled = true; | ||
| } |
Copilot
AI
Nov 26, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The event handler lacks XML documentation. Add a summary comment explaining that this method triggers Win32-based window resizing when the custom resize grip is clicked, and why the custom implementation is necessary (to keep the grip inside the window border).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OTT but now addressed.
Update ScriptEditorWindow.xaml.cs
…m/ivaylo-matov/Dynamo into Python-script-editor-resize-thumb
Purpose
Small PR following that can be logged under DYN-9829.
Added a custom resize grip in
ScriptEditorWindowso the resize handle stays inside the visible window border. Previously, the window border overlapped the default resize grip.Declarations
Check these if you believe they are true
Release Notes
Added a custom resize grip in
ScriptEditorWindowso the resize handle stays inside the visible window border. Previously, the window border overlapped the default resize grip.Reviewers
@zeusongit
@DynamoDS/eidos
FYIs
@dnenov
@achintyabhat