apprt/gtk: only set cursor on shape change if its visible

This commit is contained in:
Mitchell Hashimoto
2024-06-03 15:07:33 -07:00
parent 30c1ab737c
commit 67c17cba1a

View File

@ -803,8 +803,12 @@ pub fn setMouseShape(
};
errdefer c.g_object_unref(cursor);
// Set our new cursor
// Set our new cursor. We only do this if the cursor we currently
// have is NOT set to "none" because setting the cursor causes it
// to become visible again.
if (c.gtk_widget_get_cursor(@ptrCast(self.gl_area)) != self.app.cursor_none) {
c.gtk_widget_set_cursor(@ptrCast(self.gl_area), cursor);
}
// Free our existing cursor
if (self.cursor) |old| c.g_object_unref(old);