[ZeroBrane Studio] Re: save icon remains disabled

  • From: Paul K <paul@xxxxxxxxxxxxx>
  • To: "zerobrane@xxxxxxxxxxxxx" <zerobrane@xxxxxxxxxxxxx>
  • Date: Mon, 11 Jan 2016 09:11:23 -0800

Hi Thijs,

Does it happen all the time on all (edited) tabs? Only on new
(untitled) tabs?

2 tabs, both existing files, both the same problem
Tested it by simply typing into the file

Just to confirm; you just launch the IDE and type something into an
existing file and the toolbar save icons are not updated. Does it ever
update later to a correct state?

If only toolbars are
disabled, can you run
"ide:GetToolBar():UpdateWindowUI(wx.wxUPDATE_UI_FROMIDLE)" in the console
to see if this refreshes the toolbar?

Yes, that updated both buttons and they get enabled.

Ok, so it's the toolbar only. I can only think of one thing that may
be related to the toolbar refresh: I disable UI updates when the app
is inactive, but maybe there are cases when the app activate is not
correctly detected. Could you apply the following patch to see if this
fixes the issue:

diff --git a/src/editor/commands.lua b/src/editor/commands.lua
index 8695659..ac390cd 100644
--- a/src/editor/commands.lua
+++ b/src/editor/commands.lua
@@ -1002,8 +1002,8 @@ ide.editorApp:Connect(wx.wxEVT_ACTIVATE_APP,
       if not active then saveAutoRecovery(true) end

       -- disable UI refresh when app is inactive, but only when not running
-      wx.wxUpdateUIEvent.SetUpdateInterval(
-        (active or ide:GetLaunchedProcess()) and updateInterval or -1)
+--      wx.wxUpdateUIEvent.SetUpdateInterval(
+--        (active or ide:GetLaunchedProcess()) and updateInterval or -1)

       PackageEventHandle(active and "onAppFocusSet" or
"onAppFocusLost", ide.editorApp)
     end

Paul.

Other related posts: