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

[Windows] Cannot move window after a COptionMenu has been popped up #302

Closed
nickdowell opened this issue Jun 30, 2023 · 2 comments · Fixed by #303
Closed

[Windows] Cannot move window after a COptionMenu has been popped up #302

nickdowell opened this issue Jun 30, 2023 · 2 comments · Fixed by #303

Comments

@nickdowell
Copy link
Contributor

nickdowell commented Jun 30, 2023

Steps to reproduce

  1. Build & Run vstgui standalone target
  2. Click on one of the COptionMenu controls on the right hand side
  3. Select one of the menu items
  4. Try to move the window by clicking & dragging its title bar
  5. Observe that the window doesn't move. It will move on the second attempt.

This bug does not occur if the menu is dismissed by clicking outside the popup.

Note: it also occurs when using vstgui in a plug-in, not just standalone.

Does not occur on macOS.

Environment

  • vstgui latest develop: 6e4c78f
  • Windows 10 Pro x64 22H2 build 19045.3086
@nickdowell
Copy link
Contributor Author

Update: this is a regression introduced in release 4.11

Using git bisect I have tracked it down to commit e0acde7

e0acde7fef744eae9010713a0de2c4ad72712b4f is the first bad commit
commit e0acde7fef744eae9010713a0de2c4ad72712b4f
Author: scheffle <scheffle@users.noreply.github.com>
Date:   Sat Apr 24 17:59:09 2021 +0200

    new mouse event handling

 vstgui/lib/cframe.cpp                              | 269 +++++++++++----------
 vstgui/lib/cframe.h                                |  10 +-
 vstgui/lib/cview.cpp                               | 105 ++++++++
 vstgui/lib/cview.h                                 |  14 +-
 vstgui/lib/cviewcontainer.cpp                      | 195 ++++++++-------
 vstgui/lib/cviewcontainer.h                        |  11 +-
 vstgui/lib/events.h                                | 245 ++++++++++++++++++-
 vstgui/lib/platform/iplatformframecallback.h       |   3 -
 vstgui/lib/platform/mac/cocoa/nsviewframe.mm       |  81 ++++---
 vstgui/lib/platform/win32/win32frame.cpp           | 105 ++++----
 vstgui/lib/vstguifwd.h                             |   5 +
 .../examples/standalone/resource/resources.uidesc  |   2 +-
 .../examples/standalone/resource/test.uidesc       |  12 +-
 vstgui/tests/unittest/lib/cframe_test.cpp          |  91 ++++---
 vstgui/tests/unittest/lib/csplitview_test.cpp      |  68 +++---
 vstgui/tests/unittest/lib/cview_test.cpp           |   9 +-
 vstgui/tests/unittest/lib/cviewcontainer_test.cpp  |  58 +++--
 vstgui/tests/unittest/unittests.cpp                |   6 +
 vstgui/tests/unittest/unittests.h                  |   2 +-
 19 files changed, 874 insertions(+), 417 deletions(-)

@nickdowell
Copy link
Contributor Author

The root cause is that Win32Frame::proc is calling SetCapture when handling WM_XBUTTONDOWN for option menus. COptionMenu returns kMouseDownEventHandledButDontNeedMovedOrUpEvents so this wasn't the case before the offending commit. Pull Request with fix incoming!

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

Successfully merging a pull request may close this issue.

1 participant