Skip to content

Commit

Permalink
Fix cursor construction error
Browse files Browse the repository at this point in the history
Part of #202
  • Loading branch information
otsaloma committed Jan 15, 2023
1 parent dd082bc commit f39bb02
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ PENDING: Gaupol 1.12

* Don't remember window position on screen (seems more common and better
left to the window manager)
* Fix cursor construction error (#202)

2022-04-03: Gaupol 1.11
=======================
Expand Down
12 changes: 2 additions & 10 deletions gaupol/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,21 +333,13 @@ def separate_combo(store, itr, data=None):

def set_cursor_busy(window):
"""Set mouse pointer busy when above window."""
cursor = window.get_window().get_cursor()
if (cursor is not None and cursor.get_cursor_type() ==
Gdk.CursorType.WATCH): return
cursor = Gdk.Cursor.new_for_display(
Gdk.Display.get_default(), Gdk.CursorType.WATCH)
cursor = Gdk.Cursor.new_from_name(Gdk.Display.get_default(), "wait")
window.get_window().set_cursor(cursor)
iterate_main()

def set_cursor_normal(window):
"""Set mouse pointer normal when above window."""
cursor = window.get_window().get_cursor()
if (cursor is not None and cursor.get_cursor_type() ==
Gdk.CursorType.LEFT_PTR): return
cursor = Gdk.Cursor.new_for_display(
Gdk.Display.get_default(), Gdk.CursorType.LEFT_PTR)
cursor = Gdk.Cursor.new_from_name(Gdk.Display.get_default(), "default")
window.get_window().set_cursor(cursor)
iterate_main()

Expand Down

0 comments on commit f39bb02

Please sign in to comment.