Nux

Merge lp:~nick-dedekind/nux/double-click-fix into lp:nux

Proposed by Nick Dedekind
Status: Merged
Approved by: Andrea Azzarone
Approved revision: 782
Merged at revision: 784
Proposed branch: lp:~nick-dedekind/nux/double-click-fix
Merge into: lp:nux
Diff against target: 49 lines (+9/-1)
3 files modified
Nux/WindowCompositor.cpp (+1/-1)
NuxGraphics/Events.h (+2/-0)
NuxGraphics/GraphicsDisplayX11.cpp (+6/-0)
To merge this branch: bzr merge lp:~nick-dedekind/nux/double-click-fix
Reviewer Review Type Date Requested Status
Andrea Azzarone (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+162001@code.launchpad.net

Commit message

Do not send second click event when double-clicking mouse.

Description of the change

Do not send second click event when double-clicking mouse.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Andrea Azzarone (azzar1) wrote :

LGTM.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'Nux/WindowCompositor.cpp'
--- Nux/WindowCompositor.cpp 2012-12-08 01:03:38 +0000
+++ Nux/WindowCompositor.cpp 2013-05-02 00:08:38 +0000
@@ -611,7 +611,7 @@
611 event.GetMouseState(),611 event.GetMouseState(),
612 event.GetKeyState());612 event.GetKeyState());
613613
614 if (mouse_owner_area_.IsValid() && mouse_over_area_ == mouse_owner_area_)614 if (mouse_owner_area_.IsValid() && mouse_over_area_ == mouse_owner_area_ && (event.mouse_state & NUX_STATE_FIRST_EVENT) != 0)
615 {615 {
616 mouse_owner_area_->EmitMouseClickSignal(mouse_owner_x, mouse_owner_y,616 mouse_owner_area_->EmitMouseClickSignal(mouse_owner_x, mouse_owner_y,
617 event.GetMouseState(),617 event.GetMouseState(),
618618
=== modified file 'NuxGraphics/Events.h'
--- NuxGraphics/Events.h 2012-10-18 10:23:45 +0000
+++ NuxGraphics/Events.h 2013-05-02 00:08:38 +0000
@@ -135,6 +135,8 @@
135#define NUX_EVENT_BUTTON4 0x00080000135#define NUX_EVENT_BUTTON4 0x00080000
136136
137#define NUX_EVENT_MOUSEWHEEL 0x00100000137#define NUX_EVENT_MOUSEWHEEL 0x00100000
138// Describes the event as the first press in the double click event.
139#define NUX_STATE_FIRST_EVENT 0x00200000
138// These flags describe the state of the mouse buttons.140// These flags describe the state of the mouse buttons.
139// They persist over several frame until the mouse buttons change state.141// They persist over several frame until the mouse buttons change state.
140// Go in mouse_state.142// Go in mouse_state.
141143
=== modified file 'NuxGraphics/GraphicsDisplayX11.cpp'
--- NuxGraphics/GraphicsDisplayX11.cpp 2013-05-01 18:14:05 +0000
+++ NuxGraphics/GraphicsDisplayX11.cpp 2013-05-02 00:08:38 +0000
@@ -1091,6 +1091,7 @@
1091 }1091 }
1092 else1092 else
1093 {1093 {
1094 _mouse_state |= NUX_STATE_FIRST_EVENT;
1094 double_click_counter_ = 1;1095 double_click_counter_ = 1;
1095 }1096 }
10961097
@@ -1182,6 +1183,11 @@
1182 _mouse_state |= (xevent.xbutton.state & Button2Mask) ? NUX_STATE_BUTTON2_DOWN : 0;1183 _mouse_state |= (xevent.xbutton.state & Button2Mask) ? NUX_STATE_BUTTON2_DOWN : 0;
1183 _mouse_state |= (xevent.xbutton.state & Button3Mask) ? NUX_STATE_BUTTON3_DOWN : 0;1184 _mouse_state |= (xevent.xbutton.state & Button3Mask) ? NUX_STATE_BUTTON3_DOWN : 0;
11841185
1186 if (double_click_counter_ == 1)
1187 {
1188 _mouse_state |= NUX_STATE_FIRST_EVENT;
1189 }
1190
1185 if (xevent.xbutton.type == ButtonRelease)1191 if (xevent.xbutton.type == ButtonRelease)
1186 {1192 {
1187 if (xevent.xbutton.button == Button1)1193 if (xevent.xbutton.button == Button1)

Subscribers

People subscribed via source and target branches