google-code-export / labyrinth

Automatically exported from code.google.com/p/labyrinth
GNU General Public License v2.0
2 stars 0 forks source link

Enter one-line summary #51

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Move mouse pointer over a node

What is the expected output? What do you see instead?
There should be no "blinking", now the cursor is not "stable"

What version of the product are you using? On what operating system?
Ubuntu 6.10

Please provide any additional information below.

I think this problem can be solved by:
- keeping "current_cursor" field in MMapArea
- setting cursor to new value only when old value is different
- keeping a hash of (lazily) created cursors so that no new objects are
created if not necessary

The appropriate patch in the attachment. Changes:
- MMapArea has current_cursor field initialized to None
- added method in MMapArea: set_cursor(self, kind) which checks if
current_cursor has different kind than required; if so, it gets form
CursorFactory cursor of given kind and sets it on the self.window
- set_cursor() method uses internally a (Borg design pattern) class
CursorFactory which creates cursors lazily (when needed)

Original issue reported on code.google.com by kamila.chyla on 29 Mar 2007 at 5:37

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks for the patch.  I thought gtk took care of not updating the cursor (it 
doesn't
blink on my system).  However, I've applied the patch and committed.  Marking 
as fixed.

2007-04-05 Don Scorgie <Don@Scorgie.org>

    * src/MMapArea.py:
    Only update cursor type when the type has changes
    (Patch from Kamila Chyla)

Original comment by DonScor...@gmail.com on 5 Apr 2007 at 8:40