diff options
author | scroggo <scroggo@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-03-22 14:03:21 +0000 |
---|---|---|
committer | scroggo <scroggo@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-03-22 14:03:21 +0000 |
commit | 08526c07f4f530e56b70d4b22f5a4af35d9ebcca (patch) | |
tree | b29c4708aa394dafaac4f66e96af4f8006d2e670 /unix_test_app | |
parent | 86c92b3d8f68641c6e01a5985208ad02fb038f7b (diff) |
Add a 'fatbits' mode to unix sample app.
git-svn-id: http://skia.googlecode.com/svn/trunk@978 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'unix_test_app')
-rw-r--r-- | unix_test_app/main.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/unix_test_app/main.cpp b/unix_test_app/main.cpp index dace89ef76..deb95bc95e 100644 --- a/unix_test_app/main.cpp +++ b/unix_test_app/main.cpp @@ -73,7 +73,7 @@ int main(){ // Determine which events to listen for. eventMask = StructureNotifyMask|ButtonPressMask|ButtonReleaseMask - |ExposureMask|Button1MotionMask|KeyPressMask|KeyReleaseMask; + |ExposureMask|PointerMotionMask|KeyPressMask|KeyReleaseMask; XSelectInput(dsp, win, eventMask); bool loop = true; @@ -96,9 +96,10 @@ int main(){ window->handleClick(evt.xbutton.x, evt.xbutton.y, SkView::Click::kUp_State); break; case MotionNotify: - // Since we are only masking to get the motion events for when Button1 is pressed, - // we can assume the pointer is moving with Button1 pressed. - window->handleClick(evt.xmotion.x, evt.xmotion.y, SkView::Click::kMoved_State); + // FIXME: 272 corresponds to the left mouse button, but should be a constant. + if (evt.xmotion.state == 272) + window->handleClick(evt.xmotion.x, evt.xmotion.y, SkView::Click::kMoved_State); + window->updatePointer(evt.xmotion.x, evt.xmotion.y); break; case KeyPress: { |