-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Completly breaking ST3 process and GUI #15
Comments
Hi @Romarain , I'm very sorry for what happened. I hope you didn't lose too much time. This plugin is making use of Windows API which uses string pointer and is generally "unsafe" in the sense that it can segfault if wrongly used. @robertcollier4 and @bahanonu could you try to use
That's unfortunately how Package Control works. You have a |
Also could you tell me if it worked before changing the settings ? Also the error message seems related to the Compare Side By Side package. Could you try with a brand new portable ST, with only SublimeSetWindowTitle package ? |
Hi, PS : do you confirm that we can use your plugin several times, to rename several opened windows ? |
@gwenzek @Romarain Tested three
When I changed my entire
I have attached the old working Windows 10 build below if you want to check the diff to see where things might have changed leading to the issue. Can take a look at this again sometime this week. |
I'd bet on this part of the code, https://github.com/gwenzek/SublimeSetWindowTitle/pull/10/files#r320254055 |
@Romarain
With the default configuration you will have each windows named |
Tested on WinXP-32bit and Win7-32bit with multiple open windows to have the same name - it is working fine with "template":"Pages" for me. Can someone try on Windows 10 the following change recommended on PR #10:
Test screen_ capture with Licecap of current version working fine in Win7-32bit: |
There is no such rule in Windows that different windows cannot have the same Title. Windows are referenced by ID, not by Class or Title (both which can be duplicate). Also very odd that this is causing a SublimeText error of loading colour scheme which is totally unrelated so I suggest we keep looking. |
This works fine on a fresh Windows 10, Sublime Build 3207 on my end with issues noted below. Sublime will crash if I edit The above behavior does not occur with the SetWindowTitle build I attached in #15 (comment). I checked by swapping the |
I took a look at the This seemed like the most obvious area causing the crash based on what this section of code is doing. I removed the below lines (see https://github.com/gwenzek/SublimeSetWindowTitle/blob/master/set_window_title.py#L44-L57) and now the plugin works as expected when changing the settings with the same/different Sublime instance or Notepad (Windows 10, Sublime build 3207) except it will only change after switching focus or changing tabs. # Update all window titles on setting change.
settings = sublime.load_settings("set_window_title.sublime-settings")
setting_keys = [
"unregistered",
"template",
"has_project_true",
"has_project_false",
"is_dirty_true",
"is_dirty_false",
"path_display",
"untitled",
]
for k in setting_keys:
settings.add_on_change(k, refresh_all) |
There is a existing note that "refresh_all" is "Only enabled on Linux because for some reason it freezes ST on Windows.". So this is a existing bug not one introduced by the recent commit. We should not be running refresh_all on Windows then. The solution is to add "if PLATFORM == "linux":" above the code that bahanou has posted in the post just above this. Then "refresh_all" will not run on Windows on changing settings while SublimeText is open. |
Or we might not need that "add_on_change" snippet that bahanou posted at all. Is there any reason that is there? I cant even find any documentation on "add_on_change" and it seems unnecessary. Perhaps we should remove the entire section bahanou has posted since "add_on_change" is unnecessary. The plugin reloads itself just fine. |
Also, "refresh_all" is being called 8 times - once for every item in the array settings_key - this is completely unnecessary. Lets disable refresh_all from being called in Windows at all as per the note and if we want to keep it we can have it called only once on Linux. |
the But it's true that it looks like |
* Remove repeated calls to refresh_all in Windows on settings change. Fixes Issue #15 * On Windows update window title on plugin_loaded for top window * add_on_change for Linux only * Remove update window title on plugin_loaded in Windows due to freezes
This should be fixed by #16 |
After installation, I opened the SublimeSetWindowTitle's settings, and added this to my user :
, to rename the actual window with the workspace/project's name (I had several opened, but I supposed that because I had called the plugin's settings from one of them, it would assign the name on it).
Unfortunately for me, the shit started to hit the fan : everything broke up, and some strange error window appeared, followed by the ST UI being stuck and the process frozen.
Then it was a hard time for me to figure out how to end the nightmare, because I could not exit the workspace by hitting the close button (was frozen), and I had to kill the ST process tree ; but each time I reopened ST, the package tried again to rename the window(s), and the cycle started again.
So at a moment, I managed to reach the Control Palette for removing the plugin, but it was freezing the UI again. I tried to delete the package's file directly, but unsuccessfully given that it reinstalled it automatically at ST's reopening (strange virus feeling).
After several attempts, I succeed in removing the package in the Control Palette and closed all the windows pseudo-correctly (one had the theme's broken, and completly white !).
So please do something to block downloading that package until you fix it. It could lead to drama for some hurry developers that haven't my patience.
PS : Btw I'm on Windows 10, with ST portable v3.2.1 build 3207.
The text was updated successfully, but these errors were encountered: