-
Notifications
You must be signed in to change notification settings - Fork 151
bugfix(mouse): Make Cursor Capture opt-in to prevent capture in GUIEdit #2187
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
bugfix(mouse): Make Cursor Capture opt-in to prevent capture in GUIEdit #2187
Conversation
|
Works as intended. Cursor is free! |
Greptile Overview
|
| Filename | Overview |
|---|---|
| Generals/Code/GameEngine/Include/GameClient/Mouse.h | moved initCapture() from protected to public API to enable explicit initialization |
| Generals/Code/GameEngine/Source/GameClient/Input/Mouse.cpp | set default m_cursorCaptureMode to 0 and removed automatic initCapture() call from init() |
| Generals/Code/GameEngine/Source/GameClient/GameClient.cpp | added explicit initCapture() call after init() in game client initialization |
| GeneralsMD/Code/GameEngine/Include/GameClient/Mouse.h | moved initCapture() from protected to public API to enable explicit initialization |
| GeneralsMD/Code/GameEngine/Source/GameClient/Input/Mouse.cpp | set default m_cursorCaptureMode to 0 and removed automatic initCapture() call from init() |
| GeneralsMD/Code/GameEngine/Source/GameClient/GameClient.cpp | added explicit initCapture() call after init() in game client initialization |
Sequence Diagram
sequenceDiagram
participant GC as GameClient::init()
participant M as Mouse
participant CB as CaptureBlock
Note over GC: Game Client Initialization
GC->>M: init()
activate M
Note over M: m_cursorCaptureMode = 0<br/>(capture disabled by default)
Note over M: m_captureBlockReasonBits<br/>has NoInit bit set
M-->>GC: initialized
deactivate M
GC->>M: initCapture()
activate M
M->>CB: unblockCapture(NoInit)
Note over M: Reads prefs.getCursorCaptureMode()
Note over M: m_cursorCaptureMode = user prefs
Note over M: Clears NoInit block bit
M-->>GC: capture enabled
deactivate M
Note over GC: Cursor capture now active
participant GE as GUIEdit::initEditor()
participant M2 as Mouse (GUIEdit)
Note over GE: GUIEdit Tool Initialization
GE->>M2: init()
activate M2
Note over M2: m_cursorCaptureMode = 0<br/>(capture disabled)
Note over M2: m_captureBlockReasonBits<br/>has NoInit bit set
M2-->>GE: initialized
deactivate M2
Note over GE: NO initCapture() call
Note over M2: Cursor remains free<br/>(NoInit bit blocks capture)
Skyaero42
left a comment
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.
Ok
|
Replicated in Generals without conflicts |
This changes makes the Cursor Capture opt-in to prevent capture in GUIEdit.
TODO