Merge lp:~azzar1/nux/please-dont-focus-me-on-mouse-down into lp:nux/2.0
- please-dont-focus-me-on-mouse-down
- Merge into 2.0
Status: | Merged |
---|---|
Approved by: | Jay Taoko |
Approved revision: | 533 |
Merged at revision: | 533 |
Proposed branch: | lp:~azzar1/nux/please-dont-focus-me-on-mouse-down |
Merge into: | lp:nux/2.0 |
Diff against target: |
326 lines (+193/-5) 8 files modified
Nux/BaseWindow.cpp (+2/-0) Nux/InputArea.cpp (+11/-0) Nux/InputArea.h (+4/-0) Nux/WindowCompositor.cpp (+1/-1) configure.ac (+1/-1) tests/Makefile.am (+15/-2) tests/Readme.txt (+2/-1) tests/focus-on-mouse-down-test.cpp (+157/-0) |
To merge this branch: | bzr merge lp:~azzar1/nux/please-dont-focus-me-on-mouse-down |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Jay Taoko (community) | Approve | ||
Tim Penhey (community) | Approve | ||
Review via email: mp+86175@code.launchpad.net |
Commit message
Description of the change
Adds a way to disable the focus on mouse down behaviour. Adds a simple test too.
Jay Taoko (jaytaoko) wrote : | # |
There is no need to have Area::AcceptKey
Area::AcceptKey
I propose the following
class InputArea
{
virtual bool AcceptKeyNavFoc
void SetAcceptKeyNav
bool accept_
}
InputArea:
{
accept_
}
bool InputArea:
{
return accept_
}
void InputArea:
{
accept_
}
BaseWindow:
{
SetAcceptKeyN
}
That way we can also get other Views to not get the focus on mouse down events if there is a need for it. Not just BaseWindows. Let me know if this still works with your branch.
There is a similar problem with InputArea:
Andrea Azzarone (azzar1) wrote : | # |
Done.
- 530. By Andrea Azzarone
-
Makes sure that the scroll wheel works with nux::VScrollbar. Fixes: https:/
/bugs.launchpad .net/bugs/ 888819. Appoved by Jay Taoko. - 531. By Jay Taoko
-
Added separate file for GLib main loop functions
* Cleanup: variable renaming
* Marked some functions as obsolete
* Core objects take the WindowThread as a constructor parameters: Painter, WindowCompositor.... Fixes: . Appoved by Jason Smith. - 532. By Jay Taoko
-
* Removed API:
GraphicsDisplay& GetWindow();
GraphicsEngine& GetGraphicsEngine();
NThread* GetThreadApplication() ;
WindowThread* GetGraphicsThread(); * Modified code to to use GetWindowThread() to access its internal objects.
* Added tests:
- WindowThread
- StaticText
. Fixes: . Appoved by Jason Smith. - 533. By Andrea Azzarone
-
Adds the possiblity to don't get the focus on mouse down.
Jay Taoko (jaytaoko) : | # |
Preview Diff
1 | === modified file 'Nux/BaseWindow.cpp' | |||
2 | --- Nux/BaseWindow.cpp 2011-12-06 16:29:06 +0000 | |||
3 | +++ Nux/BaseWindow.cpp 2012-01-03 14:49:27 +0000 | |||
4 | @@ -68,6 +68,8 @@ | |||
5 | 68 | _entering_hidden_state = false; | 68 | _entering_hidden_state = false; |
6 | 69 | _enter_focus_input_area = NULL; | 69 | _enter_focus_input_area = NULL; |
7 | 70 | accept_key_nav_focus_ = false; | 70 | accept_key_nav_focus_ = false; |
8 | 71 | |||
9 | 72 | SetAcceptKeyNavFocusOnMouseDown(false); | ||
10 | 71 | 73 | ||
11 | 72 | // Should be at the end of the constructor | 74 | // Should be at the end of the constructor |
12 | 73 | GetWindowThread()->GetWindowCompositor().RegisterWindow(this); | 75 | GetWindowThread()->GetWindowCompositor().RegisterWindow(this); |
13 | 74 | 76 | ||
14 | === modified file 'Nux/InputArea.cpp' | |||
15 | --- Nux/InputArea.cpp 2011-12-06 22:44:57 +0000 | |||
16 | +++ Nux/InputArea.cpp 2012-01-03 14:49:27 +0000 | |||
17 | @@ -43,6 +43,7 @@ | |||
18 | 43 | InputArea::InputArea(NUX_FILE_LINE_DECL) | 43 | InputArea::InputArea(NUX_FILE_LINE_DECL) |
19 | 44 | : Area(NUX_FILE_LINE_PARAM) | 44 | : Area(NUX_FILE_LINE_PARAM) |
20 | 45 | , m_AreaColor(color::Green) | 45 | , m_AreaColor(color::Green) |
21 | 46 | , accept_key_nav_focus_on_mouse_down_(true) | ||
22 | 46 | { | 47 | { |
23 | 47 | SetGeometry(0, 0, 1, 1); | 48 | SetGeometry(0, 0, 1, 1); |
24 | 48 | _has_keyboard_focus = false; | 49 | _has_keyboard_focus = false; |
25 | @@ -82,6 +83,11 @@ | |||
26 | 82 | { | 83 | { |
27 | 83 | _has_keyboard_focus = b; | 84 | _has_keyboard_focus = b; |
28 | 84 | } | 85 | } |
29 | 86 | |||
30 | 87 | void InputArea::SetAcceptKeyNavFocusOnMouseDown(bool accept) | ||
31 | 88 | { | ||
32 | 89 | accept_key_nav_focus_on_mouse_down_ = accept; | ||
33 | 90 | } | ||
34 | 85 | 91 | ||
35 | 86 | int InputArea::GetMouseX() | 92 | int InputArea::GetMouseX() |
36 | 87 | { | 93 | { |
37 | @@ -418,5 +424,10 @@ | |||
38 | 418 | { | 424 | { |
39 | 419 | return false; | 425 | return false; |
40 | 420 | } | 426 | } |
41 | 427 | |||
42 | 428 | bool InputArea::AcceptKeyNavFocusOnMouseDown() | ||
43 | 429 | { | ||
44 | 430 | return accept_key_nav_focus_on_mouse_down_; | ||
45 | 431 | } | ||
46 | 421 | } | 432 | } |
47 | 422 | 433 | ||
48 | 423 | 434 | ||
49 | === modified file 'Nux/InputArea.h' | |||
50 | --- Nux/InputArea.h 2011-10-17 21:23:50 +0000 | |||
51 | +++ Nux/InputArea.h 2012-01-03 14:49:27 +0000 | |||
52 | @@ -61,6 +61,7 @@ | |||
53 | 61 | 61 | ||
54 | 62 | bool HasKeyboardFocus(); | 62 | bool HasKeyboardFocus(); |
55 | 63 | void SetKeyboardFocus(bool b); | 63 | void SetKeyboardFocus(bool b); |
56 | 64 | void SetAcceptKeyNavFocusOnMouseDown(bool accept); | ||
57 | 64 | int GetMouseX(); | 65 | int GetMouseX(); |
58 | 65 | int GetMouseY(); | 66 | int GetMouseY(); |
59 | 66 | 67 | ||
60 | @@ -154,6 +155,8 @@ | |||
61 | 154 | 155 | ||
62 | 155 | int _dnd_safety_x; | 156 | int _dnd_safety_x; |
63 | 156 | int _dnd_safety_y; | 157 | int _dnd_safety_y; |
64 | 158 | |||
65 | 159 | bool accept_key_nav_focus_on_mouse_down_; | ||
66 | 157 | 160 | ||
67 | 158 | protected: | 161 | protected: |
68 | 159 | 162 | ||
69 | @@ -314,6 +317,7 @@ | |||
70 | 314 | protected: | 317 | protected: |
71 | 315 | 318 | ||
72 | 316 | virtual bool AcceptKeyNavFocus(); | 319 | virtual bool AcceptKeyNavFocus(); |
73 | 320 | virtual bool AcceptKeyNavFocusOnMouseDown(); | ||
74 | 317 | 321 | ||
75 | 318 | // == Signals with 1 to 1 mapping to input device == | 322 | // == Signals with 1 to 1 mapping to input device == |
76 | 319 | virtual void EmitMouseDownSignal (int x, int y, unsigned long mouse_button_state, unsigned long special_keys_state); | 323 | virtual void EmitMouseDownSignal (int x, int y, unsigned long mouse_button_state, unsigned long special_keys_state); |
77 | 320 | 324 | ||
78 | === modified file 'Nux/WindowCompositor.cpp' | |||
79 | --- Nux/WindowCompositor.cpp 2011-12-29 18:06:53 +0000 | |||
80 | +++ Nux/WindowCompositor.cpp 2012-01-03 14:49:27 +0000 | |||
81 | @@ -473,7 +473,7 @@ | |||
82 | 473 | // In the case of a mouse down event, if there is currently a keyboard event receiver and it is different | 473 | // In the case of a mouse down event, if there is currently a keyboard event receiver and it is different |
83 | 474 | // from the area returned by GetAreaUnderMouse, then stop that receiver from receiving anymore keyboard events and switch | 474 | // from the area returned by GetAreaUnderMouse, then stop that receiver from receiving anymore keyboard events and switch |
84 | 475 | // make mouse_over_area_ the new receiver(if it accept keyboard events). | 475 | // make mouse_over_area_ the new receiver(if it accept keyboard events). |
86 | 476 | if (mouse_over_area_ != GetKeyFocusArea()) | 476 | if (mouse_over_area_ != GetKeyFocusArea() and mouse_over_area_->AcceptKeyNavFocusOnMouseDown()) |
87 | 477 | { | 477 | { |
88 | 478 | InputArea* grab_area = GetKeyboardGrabArea(); | 478 | InputArea* grab_area = GetKeyboardGrabArea(); |
89 | 479 | if (grab_area) | 479 | if (grab_area) |
90 | 480 | 480 | ||
91 | === modified file 'configure.ac' | |||
92 | --- configure.ac 2012-01-03 03:10:54 +0000 | |||
93 | +++ configure.ac 2012-01-03 14:49:27 +0000 | |||
94 | @@ -22,7 +22,7 @@ | |||
95 | 22 | # The number format is : year/month/day | 22 | # The number format is : year/month/day |
96 | 23 | # e.g.: december 5th, 2011 is: 20111205 | 23 | # e.g.: december 5th, 2011 is: 20111205 |
97 | 24 | # So far there is no provision for more than one break in a day. | 24 | # So far there is no provision for more than one break in a day. |
99 | 25 | m4_define([nux_abi_version], [20111211]) | 25 | m4_define([nux_abi_version], [20111212]) |
100 | 26 | 26 | ||
101 | 27 | m4_define([nux_version], | 27 | m4_define([nux_version], |
102 | 28 | [nux_major_version.nux_minor_version.nux_micro_version]) | 28 | [nux_major_version.nux_minor_version.nux_micro_version]) |
103 | 29 | 29 | ||
104 | === modified file 'tests/Makefile.am' | |||
105 | --- tests/Makefile.am 2012-01-03 03:10:54 +0000 | |||
106 | +++ tests/Makefile.am 2012-01-03 14:49:27 +0000 | |||
107 | @@ -11,7 +11,8 @@ | |||
108 | 11 | hgrid-key-navigation-test \ | 11 | hgrid-key-navigation-test \ |
109 | 12 | hlayout-key-navigation-test \ | 12 | hlayout-key-navigation-test \ |
110 | 13 | vlayout-key-navigation-test \ | 13 | vlayout-key-navigation-test \ |
112 | 14 | scrollbar-test | 14 | scrollbar-test \ |
113 | 15 | focus-on-mouse-down-test | ||
114 | 15 | 16 | ||
115 | 16 | # Please keep alphabetical | 17 | # Please keep alphabetical |
116 | 17 | test_nux_SOURCES = \ | 18 | test_nux_SOURCES = \ |
117 | @@ -208,6 +209,17 @@ | |||
118 | 208 | vlayout_key_navigation_test_LDADD = $(TestLibs) | 209 | vlayout_key_navigation_test_LDADD = $(TestLibs) |
119 | 209 | vlayout_key_navigation_test_LDFLAGS = -lpthread -lXtst | 210 | vlayout_key_navigation_test_LDFLAGS = -lpthread -lXtst |
120 | 210 | 211 | ||
121 | 212 | focus_on_mouse_down_test_SOURCES = focus-on-mouse-down-test.cpp \ | ||
122 | 213 | nux_test_framework.cpp \ | ||
123 | 214 | nux_test_framework.h \ | ||
124 | 215 | nux_automated_test_framework.cpp \ | ||
125 | 216 | nux_automated_test_framework.h \ | ||
126 | 217 | test-view.cpp \ | ||
127 | 218 | test-view.h | ||
128 | 219 | |||
129 | 220 | focus_on_mouse_down_test_CPPFLAGS = $(TestFlags) | ||
130 | 221 | focus_on_mouse_down_test_LDADD = $(TestLibs) | ||
131 | 222 | focus_on_mouse_down_test_LDFLAGS = -lpthread -lXtst | ||
132 | 211 | 223 | ||
133 | 212 | scrollbar_test_SOURCES = scrollbar-test.cpp \ | 224 | scrollbar_test_SOURCES = scrollbar-test.cpp \ |
134 | 213 | nux_test_framework.cpp \ | 225 | nux_test_framework.cpp \ |
135 | @@ -234,7 +246,7 @@ | |||
136 | 234 | ./gtest-nux-core | 246 | ./gtest-nux-core |
137 | 235 | ./gtest-nux | 247 | ./gtest-nux |
138 | 236 | 248 | ||
140 | 237 | test-apps: test-graphics-display test-empty-window button-xtest mouse-events-test mouse-buttons-test hgrid-key-navigation-test hlayout-key-navigation-test vlayout-key-navigation-test scrollbar-test | 249 | test-apps: test-graphics-display test-empty-window button-xtest mouse-events-test mouse-buttons-test hgrid-key-navigation-test hlayout-key-navigation-test vlayout-key-navigation-test scrollbar-test focus-on-mouse-down-test |
141 | 238 | ./test-graphics-display | 250 | ./test-graphics-display |
142 | 239 | ./test-empty-window | 251 | ./test-empty-window |
143 | 240 | ./button-xtest | 252 | ./button-xtest |
144 | @@ -244,6 +256,7 @@ | |||
145 | 244 | ./hlayout-key-navigation-test | 256 | ./hlayout-key-navigation-test |
146 | 245 | ./vlayout-key-navigation-test | 257 | ./vlayout-key-navigation-test |
147 | 246 | ./scrollbar-test | 258 | ./scrollbar-test |
148 | 259 | ./focus-on-mouse-down-test | ||
149 | 247 | 260 | ||
150 | 248 | check-report: | 261 | check-report: |
151 | 249 | @gtester -k -o=test-nux-results.xml -k ./test-nux \ | 262 | @gtester -k -o=test-nux-results.xml -k ./test-nux \ |
152 | 250 | 263 | ||
153 | === modified file 'tests/Readme.txt' | |||
154 | --- tests/Readme.txt 2011-12-12 07:21:11 +0000 | |||
155 | +++ tests/Readme.txt 2012-01-03 14:49:27 +0000 | |||
156 | @@ -42,6 +42,7 @@ | |||
157 | 42 | vlayout_key_navigation_test | 42 | vlayout_key_navigation_test |
158 | 43 | Make sure that the key navigation works well in a VLayout. | 43 | Make sure that the key navigation works well in a VLayout. |
159 | 44 | 44 | ||
161 | 45 | 45 | focus_on_mouse_down_test | |
162 | 46 | Make sure that AcceptKeyNavFocusOnMouseDown works well. | ||
163 | 46 | 47 | ||
164 | 47 | 48 | ||
165 | 48 | 49 | ||
166 | === added file 'tests/focus-on-mouse-down-test.cpp' | |||
167 | --- tests/focus-on-mouse-down-test.cpp 1970-01-01 00:00:00 +0000 | |||
168 | +++ tests/focus-on-mouse-down-test.cpp 2012-01-03 14:49:27 +0000 | |||
169 | @@ -0,0 +1,157 @@ | |||
170 | 1 | /* | ||
171 | 2 | * Copyright 2011 Inalogic Inc. | ||
172 | 3 | * | ||
173 | 4 | * This program is free software: you can redistribute it and/or modify it | ||
174 | 5 | * under the terms of the GNU General Public License version 3, as published | ||
175 | 6 | * by the Free Software Foundation. | ||
176 | 7 | * | ||
177 | 8 | * This program is distributed in the hope that it will be useful, but | ||
178 | 9 | * WITHOUT ANY WARRANTY; without even the implied warranties of | ||
179 | 10 | * MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR | ||
180 | 11 | * PURPOSE. See the GNU General Public License for more details. | ||
181 | 12 | * | ||
182 | 13 | * You should have received a copy of the GNU General Public License | ||
183 | 14 | * version 3 along with this program. If not, see | ||
184 | 15 | * <http://www.gnu.org/licenses/> | ||
185 | 16 | * | ||
186 | 17 | * Authored by: Andrea Azzarone <azzaronea@gmail.com> | ||
187 | 18 | * | ||
188 | 19 | */ | ||
189 | 20 | |||
190 | 21 | #include "Nux/Nux.h" | ||
191 | 22 | #include "Nux/WindowThread.h" | ||
192 | 23 | #include "Nux/VLayout.h" | ||
193 | 24 | #include <X11/extensions/XTest.h> | ||
194 | 25 | #include <X11/keysym.h> | ||
195 | 26 | #include "nux_test_framework.h" | ||
196 | 27 | #include "nux_automated_test_framework.h" | ||
197 | 28 | #include "test-view.h" | ||
198 | 29 | |||
199 | 30 | class FocusOnMouseDownTest: public NuxTestFramework | ||
200 | 31 | { | ||
201 | 32 | public: | ||
202 | 33 | FocusOnMouseDownTest(const char *program_name, int window_width, int window_height, int program_life_span); | ||
203 | 34 | ~FocusOnMouseDownTest(); | ||
204 | 35 | |||
205 | 36 | virtual void UserInterfaceSetup(); | ||
206 | 37 | |||
207 | 38 | TestView* focus_view_; | ||
208 | 39 | TestView* no_focus_view_; | ||
209 | 40 | }; | ||
210 | 41 | |||
211 | 42 | FocusOnMouseDownTest::FocusOnMouseDownTest(const char* program_name, | ||
212 | 43 | int window_width, | ||
213 | 44 | int window_height, | ||
214 | 45 | int program_life_span) | ||
215 | 46 | : NuxTestFramework(program_name, window_width, window_height, program_life_span) | ||
216 | 47 | , focus_view_(nullptr) | ||
217 | 48 | , no_focus_view_(nullptr) | ||
218 | 49 | { | ||
219 | 50 | } | ||
220 | 51 | |||
221 | 52 | FocusOnMouseDownTest::~FocusOnMouseDownTest() | ||
222 | 53 | { | ||
223 | 54 | } | ||
224 | 55 | |||
225 | 56 | void FocusOnMouseDownTest::UserInterfaceSetup() | ||
226 | 57 | { | ||
227 | 58 | nux::VLayout* main_layout = new nux::VLayout(NUX_TRACKER_LOCATION); | ||
228 | 59 | main_layout->SetSpaceBetweenChildren(10); | ||
229 | 60 | main_layout->SetPadding(10, 10); | ||
230 | 61 | |||
231 | 62 | focus_view_ = new TestView(NUX_TRACKER_LOCATION); | ||
232 | 63 | focus_view_->can_focus_ = true; | ||
233 | 64 | focus_view_->SetAcceptKeyNavFocusOnMouseDown(true); | ||
234 | 65 | main_layout->AddView(focus_view_, 1, nux::MINOR_POSITION_CENTER, nux::MINOR_SIZE_FULL); | ||
235 | 66 | |||
236 | 67 | no_focus_view_ = new TestView(NUX_TRACKER_LOCATION); | ||
237 | 68 | no_focus_view_->can_focus_ = true; | ||
238 | 69 | no_focus_view_->SetAcceptKeyNavFocusOnMouseDown(false); | ||
239 | 70 | main_layout->AddView(no_focus_view_, 1, nux::MINOR_POSITION_CENTER, nux::MINOR_SIZE_FULL); | ||
240 | 71 | |||
241 | 72 | static_cast<nux::WindowThread*>(window_thread_)->SetLayout(main_layout); | ||
242 | 73 | |||
243 | 74 | nux::ColorLayer background(nux::Color(0xFF4D4D4D)); | ||
244 | 75 | static_cast<nux::WindowThread*>(window_thread_)->SetWindowBackgroundPaintLayer(&background); | ||
245 | 76 | } | ||
246 | 77 | |||
247 | 78 | FocusOnMouseDownTest* focus_on_mouse_down_test = nullptr; | ||
248 | 79 | |||
249 | 80 | void TestingThread(nux::NThread* thread, void* user_data) | ||
250 | 81 | { | ||
251 | 82 | while (focus_on_mouse_down_test->ReadyToGo() == false) | ||
252 | 83 | { | ||
253 | 84 | nuxDebugMsg("Waiting to start"); | ||
254 | 85 | nux::SleepForMilliseconds(300); | ||
255 | 86 | } | ||
256 | 87 | |||
257 | 88 | nux::SleepForMilliseconds(1000); | ||
258 | 89 | |||
259 | 90 | nux::WindowThread *wnd_thread = static_cast<nux::WindowThread*>(user_data); | ||
260 | 91 | |||
261 | 92 | NuxAutomatedTestFramework test(wnd_thread); | ||
262 | 93 | |||
263 | 94 | test.Startup(); | ||
264 | 95 | |||
265 | 96 | // Set the mouse at coordinates (0, 0) (top-left corner) on the display | ||
266 | 97 | test.PutMouseAt(0, 0); | ||
267 | 98 | |||
268 | 99 | test.TestReportMsg(focus_on_mouse_down_test->focus_view_, "Focus view created"); | ||
269 | 100 | test.TestReportMsg(focus_on_mouse_down_test->no_focus_view_, "No focus view created"); | ||
270 | 101 | |||
271 | 102 | // Move mouse to center of focus_view | ||
272 | 103 | test.ViewSendMouseMotionToCenter(focus_on_mouse_down_test->focus_view_); | ||
273 | 104 | |||
274 | 105 | // Mouse down/up on focus_view_ | ||
275 | 106 | test.ViewSendMouseClick(focus_on_mouse_down_test->focus_view_, 1); | ||
276 | 107 | nux::SleepForMilliseconds(500); | ||
277 | 108 | test.TestReportMsg(focus_on_mouse_down_test->focus_view_->has_focus_, "Mouse down: focus_view_ got the focus"); | ||
278 | 109 | test.ViewSendMouseUp(focus_on_mouse_down_test->focus_view_, 1); | ||
279 | 110 | nux::SleepForMilliseconds(500); | ||
280 | 111 | test.TestReportMsg(focus_on_mouse_down_test->focus_view_->has_focus_, "Mouse up: focus is still on focus_view_"); | ||
281 | 112 | |||
282 | 113 | // Move mouse to center of no_focus_view | ||
283 | 114 | test.ViewSendMouseMotionToCenter(focus_on_mouse_down_test->no_focus_view_); | ||
284 | 115 | |||
285 | 116 | // Mouse down/up on no_focus_view_ | ||
286 | 117 | test.ViewSendMouseDown(focus_on_mouse_down_test->no_focus_view_, 1); | ||
287 | 118 | nux::SleepForMilliseconds(500); | ||
288 | 119 | test.TestReportMsg(!focus_on_mouse_down_test->no_focus_view_->has_focus_, "Mouse down: no_focus_view_ did not take the focus"); | ||
289 | 120 | test.TestReportMsg(focus_on_mouse_down_test->focus_view_->has_focus_, "Mouse down: focus is still on focus_view_"); | ||
290 | 121 | test.ViewSendMouseUp(focus_on_mouse_down_test->no_focus_view_, 1); | ||
291 | 122 | nux::SleepForMilliseconds(500); | ||
292 | 123 | test.TestReportMsg(!focus_on_mouse_down_test->no_focus_view_->has_focus_, "Mouse up: no_focus_view_ still doesn't have the focus"); | ||
293 | 124 | test.TestReportMsg(focus_on_mouse_down_test->focus_view_->has_focus_, "Mouse up: focus is still on focus_view_"); | ||
294 | 125 | |||
295 | 126 | |||
296 | 127 | if (test.WhenDoneTerminateProgram()) | ||
297 | 128 | { | ||
298 | 129 | nux::SleepForMilliseconds(1000); | ||
299 | 130 | wnd_thread->ExitMainLoop(); | ||
300 | 131 | } | ||
301 | 132 | nuxDebugMsg("Exit testing thread"); | ||
302 | 133 | } | ||
303 | 134 | |||
304 | 135 | int main(int argc, char **argv) | ||
305 | 136 | { | ||
306 | 137 | int xstatus = XInitThreads(); | ||
307 | 138 | nuxAssertMsg(xstatus > 0, "XInitThreads has failed"); | ||
308 | 139 | |||
309 | 140 | focus_on_mouse_down_test = new FocusOnMouseDownTest("Focus On Mouse Down Test", 300, 300, 15000); | ||
310 | 141 | focus_on_mouse_down_test->Startup(); | ||
311 | 142 | focus_on_mouse_down_test->UserInterfaceSetup(); | ||
312 | 143 | |||
313 | 144 | nux::SystemThread *test_thread = nux::CreateSystemThread(focus_on_mouse_down_test->GetWindowThread(), | ||
314 | 145 | &TestingThread, | ||
315 | 146 | focus_on_mouse_down_test->GetWindowThread()); | ||
316 | 147 | |||
317 | 148 | test_thread->Start(focus_on_mouse_down_test); | ||
318 | 149 | |||
319 | 150 | focus_on_mouse_down_test->Run(); | ||
320 | 151 | |||
321 | 152 | delete test_thread; | ||
322 | 153 | delete focus_on_mouse_down_test; | ||
323 | 154 | |||
324 | 155 | return 0; | ||
325 | 156 | } | ||
326 | 157 |
Looks good.