diff options
author | Weseung Hwang <weseung@gmail.com> | 2011-01-11 19:42:33 -0800 |
---|---|---|
committer | Weseung Hwang <weseung@gmail.com> | 2011-01-11 19:42:33 -0800 |
commit | 6e4c4dde1c298a74ff75ad93dee2299c6b6cd811 (patch) | |
tree | 1611db2ab042ee54e496bc03c31b2ffc1c66268a | |
parent | 6ccda311b4d612eed78eac045d854b2d1d0c7a9f (diff) |
Added pointer motion event checking and prints strings based on location of cursor (and "root" cursor)
-rw-r--r-- | src/xlibclient.c | 9 | ||||
-rw-r--r-- | src/xlibclient.c~ | 2 |
2 files changed, 9 insertions, 2 deletions
diff --git a/src/xlibclient.c b/src/xlibclient.c index 6562954..e1159ad 100644 --- a/src/xlibclient.c +++ b/src/xlibclient.c @@ -115,7 +115,7 @@ NestedvClientCreateScreen(int scrnIndex, XMapWindow(pPriv->display, pPriv->window); - XSelectInput(pPriv->display, pPriv->window, ExposureMask); + XSelectInput(pPriv->display, pPriv->window, ExposureMask | PointerMotionMask); if (XShmQueryExtension(pPriv->display)) { if (XShmQueryVersion(pPriv->display, &shmMajor, &shmMinor, @@ -231,6 +231,9 @@ void NestedvClientTimerCallback(NestedvClientPrivatePtr pPriv) { XEvent ev; + char *msg = "Cursor"; + char *msg2 = "Root"; + while(XCheckMaskEvent(pPriv->display, ~0, &ev)) { if (ev.type == Expose) { NestedvClientUpdateScreen(pPriv, @@ -239,6 +242,10 @@ NestedvClientTimerCallback(NestedvClientPrivatePtr pPriv) ((XExposeEvent*)&ev)->x + ((XExposeEvent*)&ev)->width, ((XExposeEvent*)&ev)->y + ((XExposeEvent*)&ev)->height); } + if (ev.type == MotionNotify) { + XDrawString(pPriv->display, pPriv->window, DefaultGC(pPriv->display, pPriv->screenNumber), ((XMotionEvent*)&ev)->x, ((XMotionEvent*)&ev)->y, msg, strlen(msg)); + XDrawString(pPriv->display, pPriv->window, DefaultGC(pPriv->display, pPriv->screenNumber), ((XMotionEvent*)&ev)->x_root, ((XMotionEvent*)&ev)->y_root, msg2, strlen(msg2)); + } } } diff --git a/src/xlibclient.c~ b/src/xlibclient.c~ index 4e9f182..6562954 100644 --- a/src/xlibclient.c~ +++ b/src/xlibclient.c~ @@ -1,4 +1,4 @@ -/ +/* * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation |