Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
godot
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
community
godot
Commits
1702fb7a
Unverified
Commit
1702fb7a
authored
May 16, 2020
by
Rémi Verschelde
Committed by
GitHub
May 16, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #37519 from HaSa1002/fix-duplicate-inputs-win
Fix input event being dispatched multiple times on Windows
parents
e669aa30
434bf057
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
0 deletions
+10
-0
display_server_windows.cpp
platform/windows/display_server_windows.cpp
+9
-0
display_server_windows.h
platform/windows/display_server_windows.h
+1
-0
No files found.
platform/windows/display_server_windows.cpp
View file @
1702fb7a
...
...
@@ -1695,6 +1695,12 @@ void DisplayServerWindows::_dispatch_input_events(const Ref<InputEvent> &p_event
}
void
DisplayServerWindows
::
_dispatch_input_event
(
const
Ref
<
InputEvent
>
&
p_event
)
{
_THREAD_SAFE_METHOD_
if
(
in_dispatch_input_event
)
{
return
;
}
in_dispatch_input_event
=
true
;
Variant
ev
=
p_event
;
Variant
*
evp
=
&
ev
;
Variant
ret
;
...
...
@@ -1706,6 +1712,7 @@ void DisplayServerWindows::_dispatch_input_event(const Ref<InputEvent> &p_event)
ERR_FAIL_COND
(
!
windows
.
has
(
event_from_window
->
get_window_id
()));
Callable
callable
=
windows
[
event_from_window
->
get_window_id
()].
input_event_callback
;
if
(
callable
.
is_null
())
{
in_dispatch_input_event
=
false
;
return
;
}
callable
.
call
((
const
Variant
**
)
&
evp
,
1
,
ret
,
ce
);
...
...
@@ -1719,6 +1726,8 @@ void DisplayServerWindows::_dispatch_input_event(const Ref<InputEvent> &p_event)
callable
.
call
((
const
Variant
**
)
&
evp
,
1
,
ret
,
ce
);
}
}
in_dispatch_input_event
=
false
;
}
LRESULT
DisplayServerWindows
::
WndProc
(
HWND
hWnd
,
UINT
uMsg
,
WPARAM
wParam
,
LPARAM
lParam
)
{
...
...
platform/windows/display_server_windows.h
View file @
1702fb7a
...
...
@@ -388,6 +388,7 @@ class DisplayServerWindows : public DisplayServer {
uint32_t
last_button_state
=
0
;
bool
use_raw_input
=
false
;
bool
drop_events
=
false
;
bool
in_dispatch_input_event
=
false
;
bool
console_visible
=
false
;
WNDCLASSEXW
wc
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment