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
1=== modified file 'Nux/WindowCompositor.cpp'
2--- Nux/WindowCompositor.cpp 2012-12-08 01:03:38 +0000
3+++ Nux/WindowCompositor.cpp 2013-05-02 00:08:38 +0000
4@@ -611,7 +611,7 @@
5 event.GetMouseState(),
6 event.GetKeyState());
7
8- if (mouse_owner_area_.IsValid() && mouse_over_area_ == mouse_owner_area_)
9+ if (mouse_owner_area_.IsValid() && mouse_over_area_ == mouse_owner_area_ && (event.mouse_state & NUX_STATE_FIRST_EVENT) != 0)
10 {
11 mouse_owner_area_->EmitMouseClickSignal(mouse_owner_x, mouse_owner_y,
12 event.GetMouseState(),
13
14=== modified file 'NuxGraphics/Events.h'
15--- NuxGraphics/Events.h 2012-10-18 10:23:45 +0000
16+++ NuxGraphics/Events.h 2013-05-02 00:08:38 +0000
17@@ -135,6 +135,8 @@
18 #define NUX_EVENT_BUTTON4 0x00080000
19
20 #define NUX_EVENT_MOUSEWHEEL 0x00100000
21+// Describes the event as the first press in the double click event.
22+#define NUX_STATE_FIRST_EVENT 0x00200000
23 // These flags describe the state of the mouse buttons.
24 // They persist over several frame until the mouse buttons change state.
25 // Go in mouse_state.
26
27=== modified file 'NuxGraphics/GraphicsDisplayX11.cpp'
28--- NuxGraphics/GraphicsDisplayX11.cpp 2013-05-01 18:14:05 +0000
29+++ NuxGraphics/GraphicsDisplayX11.cpp 2013-05-02 00:08:38 +0000
30@@ -1091,6 +1091,7 @@
31 }
32 else
33 {
34+ _mouse_state |= NUX_STATE_FIRST_EVENT;
35 double_click_counter_ = 1;
36 }
37
38@@ -1182,6 +1183,11 @@
39 _mouse_state |= (xevent.xbutton.state & Button2Mask) ? NUX_STATE_BUTTON2_DOWN : 0;
40 _mouse_state |= (xevent.xbutton.state & Button3Mask) ? NUX_STATE_BUTTON3_DOWN : 0;
41
42+ if (double_click_counter_ == 1)
43+ {
44+ _mouse_state |= NUX_STATE_FIRST_EVENT;
45+ }
46+
47 if (xevent.xbutton.type == ButtonRelease)
48 {
49 if (xevent.xbutton.button == Button1)

Subscribers

People subscribed via source and target branches