GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Fri Jul 25, 2014 6:44 am

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: move mouse cursor
PostPosted: Mon May 27, 2013 10:52 am 
Offline
Familiar Face

Joined: Tue Apr 02, 2013 9:40 am
Posts: 5
Hi All,


I am trying to use gdk_display_warp_pointer inside function and I got X11 fatal error, when I put it in main ,
it worked any idea please? mybe I am doing something wrong?

Best Regards,
DrCode


Top
 Profile  
 
 Post subject: Re: move mouse cursor
PostPosted: Tue May 28, 2013 7:03 am 
Offline
Never Seen the Sunlight

Joined: Mon Apr 28, 2008 5:52 am
Posts: 733
Location: UK
Hi,

gdk_display_warp_pointer () is now deprecated since GTK+ v3.0 and you should use gdk_device_warp () instead from GTK+ v3.0.

Quoting from the GTK+ documentation for these functions:-
Quote:
Note that the pointer should normally be under the control of the user. This function was added to cover some rare use cases like keyboard navigation support for the color picker in the GtkColorSelectionDialog.

Nearly all applications will not need to use these functions. Unless you are creating a special widget which needs extra help then it is best not to use them.

_________________
E.


Top
 Profile  
 
 Post subject: Re: move mouse cursor
PostPosted: Wed May 29, 2013 11:05 am 
Offline
Familiar Face

Joined: Tue Apr 02, 2013 9:40 am
Posts: 5
Hi,

Thank You,

In my code , I am grabbing my desktop screen in realtime:

GdkWindow *rootWindow;
GdkImage *image;
gint x_orig, y_orig;
rootWindow = gdk_get_default_root_window();
gint width, height;
width = gdk_window_get_width(rootWindow);
height = gdk_window_get_height(rootWindow);
gdk_window_get_origin(rootWindow,&x_orig,&y_orig);
image = gdk_drawable_get_image (rootWindow, 1, 1,width , height);

Is there better way to do it in gtk3?


Best Regards,
DrCode


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group