mirror of
https://github.com/cyberarm/w3d_hub_linux_launcher.git
synced 2025-12-16 01:02:34 +00:00
Update to use needs_repaint? to reduce cpu/gpu load of launcher
This commit is contained in:
@@ -70,6 +70,10 @@ class W3DHub
|
|||||||
@task_index += 1 if @tasks.dig(@tasks.keys[@task_index], :complete)
|
@task_index += 1 if @tasks.dig(@tasks.keys[@task_index], :complete)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def needs_repaint?
|
||||||
|
true
|
||||||
|
end
|
||||||
|
|
||||||
def refresh_user_token
|
def refresh_user_token
|
||||||
if Store.settings[:account, :data]
|
if Store.settings[:account, :data]
|
||||||
account = Api::Account.new(Store.settings[:account, :data], {})
|
account = Api::Account.new(Store.settings[:account, :data], {})
|
||||||
|
|||||||
@@ -40,16 +40,8 @@ class W3DHub
|
|||||||
sleep(update_interval / 1000.0) if W3DHub::BackgroundWorker.busy? || Store.application_manager.busy?
|
sleep(update_interval / 1000.0) if W3DHub::BackgroundWorker.busy? || Store.application_manager.busy?
|
||||||
end
|
end
|
||||||
|
|
||||||
def gain_focus
|
def needs_redraw?
|
||||||
super
|
states.any?(&:needs_repaint?)
|
||||||
|
|
||||||
self.update_interval = 1000.0 / 60
|
|
||||||
end
|
|
||||||
|
|
||||||
def lose_focus
|
|
||||||
super
|
|
||||||
|
|
||||||
self.update_interval = 1000.0 / 10
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def close
|
def close
|
||||||
|
|||||||
Reference in New Issue
Block a user