Update to use needs_repaint? to reduce cpu/gpu load of launcher

This commit is contained in:
2023-02-05 16:43:24 -06:00
parent c73bd2d88b
commit ff8387be6d
2 changed files with 6 additions and 10 deletions

View File

@@ -70,6 +70,10 @@ class W3DHub
@task_index += 1 if @tasks.dig(@tasks.keys[@task_index], :complete)
end
def needs_repaint?
true
end
def refresh_user_token
if Store.settings[:account, :data]
account = Api::Account.new(Store.settings[:account, :data], {})

View File

@@ -40,16 +40,8 @@ class W3DHub
sleep(update_interval / 1000.0) if W3DHub::BackgroundWorker.busy? || Store.application_manager.busy?
end
def gain_focus
super
self.update_interval = 1000.0 / 60
end
def lose_focus
super
self.update_interval = 1000.0 / 10
def needs_redraw?
states.any?(&:needs_repaint?)
end
def close