View Full Version : As using compiz as a wm, could I get the pointer position on the screen?
Magicloud
February 27th, 2008, 02:13 AM
I used dbus-inspector to looked into org.freedesktop.compiz, nothing useful.
Should I use C API?
Thanks.
crdlb
February 27th, 2008, 05:44 AM
In master (but not in 0.6), there is a mousepoll plugin which can be used to poll the mouse cursor position for another plugin. The mag and showmouse plugins both use mousepoll for this purpose.
SmSpillaz
February 27th, 2008, 02:05 PM
If you push a screengrab, you can get MotionNotify event. Have a look at how freewins does it. Resort to mouse polling later as it is costly on the CPU
Magicloud
February 28th, 2008, 01:14 AM
Thank you all.
I am looking mousepoll's source. While SmSpillaz metioned CPU costs, I would think about it.
I want to make a application (or plugin?) that draw a fancy clock beside (I mean following) mouse pointer. So I need to know every time mouse moved.
Maybe paintCursorProc would help?
b0le
February 28th, 2008, 03:19 AM
You may want to look at show-mouse plugin (which uses mousepoll to find the mouse location)
Magicloud
February 28th, 2008, 06:55 AM
As its name, mousepoll uses a polling mechanism. I do not know if it is better than an "event driven" paintCursorProc.
I have written some code, whic makes my compiz hung. Could someone help me?
pointerclock.c (http://magiclouds.googlepages.com/pointerclock.c.html)
Thanks.
b0le
February 28th, 2008, 07:46 AM
I noticed that you don't use any of the standard structs and macros (which may or may not be related to the problem). Probably the best place to find help would be on IRC - #compiz-fusion-dev on Freenode
SmSpillaz
February 28th, 2008, 09:07 AM
If you aren't pushing screen-grabs (locking the input to compiz) then use mousepoll.
woowmen
April 13th, 2008, 08:39 AM
Thanks for this valuable discussion, this is removing my confusions :) please continue :)
vBulletin® v3.7.3, Copyright ©2000-2008, Jelsoft Enterprises Ltd.