Skip to content

Commit

Permalink
only use a default cursor (X_CURSOR) when we failed to create one, no…
Browse files Browse the repository at this point in the history
…t when we are meant to use a "None" value!

git-svn-id: https://xpra.org/svn/Xpra/trunk@4906 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Dec 10, 2013
1 parent 5519311 commit 33b96d8
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions src/xpra/client/gtk2/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,8 +296,6 @@ def get_root_size(self):
return gdk.get_default_root_window().get_size()

def make_cursor(self, cursor_data):
if not cursor_data:
return None
#if present, try cursor ny name:
if len(cursor_data)>=9 and cursor_names:
cursor_name = cursor_data[8]
Expand Down Expand Up @@ -327,15 +325,16 @@ def make_cursor(self, cursor_data):
y = int(y/ratio)
return gdk.Cursor(gdk.display_get_default(), pixbuf, x, y)

def set_windows_cursor(self, gtkwindows, new_cursor):
try:
cursor = self.make_cursor(new_cursor)
except Exception, e:
log.warn("error creating cursor: %s (using default)", e, exc_info=True)
cursor = None
if cursor is None:
#use default:
cursor = gdk.Cursor(gtk.gdk.X_CURSOR)
def set_windows_cursor(self, gtkwindows, cursor_data):
cursor = None
if cursor_data:
try:
cursor = self.make_cursor(cursor_data)
except Exception, e:
log.warn("error creating cursor: %s (using default)", e, exc_info=True)
if cursor is None:
#use default:
cursor = gdk.Cursor(gtk.gdk.X_CURSOR)
for gtkwindow in gtkwindows:
if gtk.gtk_version>=(2,14):
gdkwin = gtkwindow.get_window()
Expand Down

0 comments on commit 33b96d8

Please sign in to comment.