GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Wed Aug 27, 2014 8:50 am

All times are UTC




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: motion notify wins
PostPosted: Wed May 29, 2013 11:58 pm 
Offline
Familiar Face

Joined: Wed May 29, 2013 10:30 am
Posts: 5
(got logged out before finishing the post; now faster)

GTK 1.2. Drawing area with motion notify and mouse button
callbacks. Main window with key press callback.

When I update the rendering at every motion notify,
all other callbacks jams. E.g., I make a polyline
at interactive rates; polyline piece follows the pointer.
Then I press a key; nothing happens. I continue
moving the pointer and rendering is updated;
polyline pieces follows the pointer. After 5 sec to 5 minutes,
the key press is processed.

Motion notify wins greatly. All other callbacks, including
menues and app destroy, looses.

Motion notify calls gdk_draw_rgb_image_dithalign().


Top
 Profile  
 
 Post subject: Re: motion notify wins
PostPosted: Thu May 30, 2013 6:01 am 
Offline
Never Seen the Sunlight

Joined: Mon Apr 28, 2008 5:52 am
Posts: 745
Location: UK
Hello,

Not sure what your post is about.

I would also switch from using GTK+ v1.2 to a more modern version as that version is now not supported. The last release was in the year 2001 and the GIT repository shows the last modification in 2003.

I would advise to change to GTK+ v2.24 or use GTK+ 3.xx

_________________
E.


Top
 Profile  
 
 Post subject: Re: motion notify wins
PostPosted: Thu May 30, 2013 10:37 am 
Offline
Familiar Face

Joined: Wed May 29, 2013 10:30 am
Posts: 5
(When I installed Ubuntu, GTK2 dev failed to install. Cannot update.)

Is there a way to get mouse button and keyboard events by overriding
X and GTK? Because motion notify and drawing is ok, I could
process buttons/keys in the motion notify callback.


Top
 Profile  
 
 Post subject: Re: motion notify wins
PostPosted: Thu May 30, 2013 5:39 pm 
Offline
Never Seen the Sunlight

Joined: Mon Apr 28, 2008 5:52 am
Posts: 745
Location: UK
Your problem could be that you are blocking the system with too many redraws and so the events are queued by priority. If you try to over ride the X system or GTK+ you will make you code non portable and cause further problems with the X and GTK+ systems as you will probably break the internal workings.

GTK+ 1.2 is totally unsupported and you must upgrade. Even the function you mentioned has been removed. There are more distributions available than Ubuntu.

_________________
E.


Top
 Profile  
 
 Post subject: Re: motion notify wins
PostPosted: Fri May 31, 2013 12:17 am 
Offline
Familiar Face

Joined: Wed May 29, 2013 10:30 am
Posts: 5
Solved. gtk_timeout_add(200,). No drawing in motion notify.


Top
 Profile  
 
 Post subject: Re: motion notify wins
PostPosted: Fri May 31, 2013 5:42 am 
Offline
Never Seen the Sunlight

Joined: Mon Apr 28, 2008 5:52 am
Posts: 745
Location: UK
There is a lot that you are not telling us about your application about the performance issues that you are having.

You say that motion notify does not do any drawing, yet you say
Quote:
Motion notify calls gdk_draw_rgb_image_dithalign().
and gdk_draw_rgb_image_dithalign() does do drawing.

Also why does adding gtk_timeout_add() help? Are you actively polling for events or just leaving it to the main loop?

_________________
E.


Top
 Profile  
 
 Post subject: Re: motion notify wins
PostPosted: Fri May 31, 2013 10:04 am 
Offline
Familiar Face

Joined: Wed May 29, 2013 10:30 am
Posts: 5
As solution, I moved the rendering and redrawing of the pixmap
to a timeout callback. Timeout is created just before going to
the GTK main.

Problem was that motion notify rendered and draw too much.
Now polyline editing is drawn in the timeout callback.
And nothing is drawn in motion notify callback.

The app is massive image compositor. When I move
the view or individual images, then rendering and
drawing is done in motion notify. That is fast because
I use pixmap copying of parts which does not change.


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 4 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:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group