~ubuntuone-control-tower/software-center/trunk

« back to all changes in this revision

Viewing changes to softwarecenter/view/appview.py

  • Committer: Gary Lasker
  • Date: 2010-09-29 20:05:00 UTC
  • mfrom: (1241.1.1 software-center)
  • Revision ID: gary.lasker@canonical.com-20100929200500-te3cljxyuzbdr38l
* softwarecenter/view/appview.py:
  - fix intermittent crash in _set_cursor (LP: #617004) 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1541
1541
        return False
1542
1542
 
1543
1543
    def _set_cursor(self, btn, cursor):
1544
 
        pointer = gtk.gdk.device_get_core_pointer()
1545
 
        x, y = pointer.get_state(self.window)[0]
1546
 
        if btn.point_in(int(x), int(y)):
1547
 
            self.window.set_cursor(cursor)
 
1544
        # make sure we have a window instance (LP: #617004)
 
1545
        if isinstance(self.window, gtk.gdk.Window):
 
1546
            pointer = gtk.gdk.device_get_core_pointer()
 
1547
            x, y = pointer.get_state(self.window)[0]
 
1548
            if btn.point_in(int(x), int(y)):
 
1549
                self.window.set_cursor(cursor)
1548
1550
 
1549
1551
    def _on_transaction_started(self, backend, tr):
1550
1552
        """ callback when an application install/remove transaction has started """