Code::Blocks

User forums => Help => Topic started by: Chrushev on February 07, 2018, 11:32:55 pm

Title: Keep getting prompt to reload file when window loses focus (Windows 7, CB 17.12)
Post by: Chrushev on February 07, 2018, 11:32:55 pm
Keep getting this window: https://imgur.com/a/ELVLe on Windows 7 with CB 17.12 whenever CB goes into background.

I am running same version on Windows 10 on another PC and have no issues like this, only the Win 7 installation.

Title: Re: Keep getting prompt to reload file when window loses focus (Windows 7, CB 17.12)
Post by: oBFusCATed on February 08, 2018, 12:10:11 am
What are the time stamps of the file that are reported as modified?
Do you reload them?
Title: Re: Keep getting prompt to reload file when window loses focus (Windows 7, CB 17.12)
Post by: Chrushev on February 09, 2018, 12:18:06 am
What are the time stamps of the file that are reported as modified?
Do you reload them?

Im not sure what you mean? Timestamps are current it doesnt seem to matter if I click yes or not it does it again next time the window is out of focus.
Title: Re: Keep getting prompt to reload file when window loses focus (Windows 7, CB 17.12)
Post by: BlueHazzard on February 09, 2018, 12:36:36 am
Codeblocks should show this dialog only if the time stamps of the file differ from the time stamp the file had before codeblocks is going out of focus. So if the time stamp of the file is newer then you or codeblocks modified the file there is something other modifying the file (anti virus, drop box, other file sync things....)
Title: Re: Keep getting prompt to reload file when window loses focus (Windows 7, CB 17.12)
Post by: Chrushev on February 09, 2018, 02:48:32 am
Codeblocks should show this dialog only if the time stamps of the file differ from the time stamp the file had before codeblocks is going out of focus. So if the time stamp of the file is newer then you or codeblocks modified the file there is something other modifying the file (anti virus, drop box, other file sync things....)

Seems like CB itself is modifying the file. I have a bunch of code opened, saved it, had 24 hours go by without touching it and no message.

I added a few blank lines (pressed enter a few times and didnt save). Changed focus, come back and that window is up and timestamp is changed to today. Its definitely done by CB. Because the file retained yesterday's timestamp until I added a few lines in CB. Nothing else interacted with file, and I didnt save, so AV or whatever else on the PC still saw it as yesterday's file, only CB knew of the changes.
Title: Re: Keep getting prompt to reload file when window loses focus (Windows 7, CB 17.12)
Post by: oBFusCATed on February 09, 2018, 03:22:44 am
Is the time stamp in the future after a save?
Title: Re: Keep getting prompt to reload file when window loses focus (Windows 7, CB 17.12)
Post by: Chrushev on February 09, 2018, 03:32:52 am
Is the time stamp in the future after a save?

I dont think so. Think its right when the message pops up.

EDIT - Whats interesting is that if I click yes to reload, then it reloads the last file that was saved (yesterday) without the extra lines.

So its more like a file is saved. Then i change code in CB without saving, and it keeps wanting to revert back to that saved file and timestamps are being changed to current time on the file every time it does a check.
Title: Re: Keep getting prompt to reload file when window loses focus (Windows 7, CB 17.12)
Post by: oBFusCATed on February 09, 2018, 09:34:00 am
Does it happen with all file? Can you create a new file in another folder and tells us if it does it?
What happens if you try with an older build 16.01, older night build?
Title: Re: Keep getting prompt to reload file when window loses focus (Windows 7, CB 17.12)
Post by: Chrushev on February 09, 2018, 09:38:57 pm
Does it happen with all file? Can you create a new file in another folder and tells us if it does it?
What happens if you try with an older build 16.01, older night build?

Create a file in another folder via CB? ive done multiple projects from scratch and this issue happened every time (new folder for each project).
Im in the middle of doing some development so cant really be uninstalling/trying new IDEs.
Title: Re: Keep getting prompt to reload file when window loses focus (Windows 7, CB 17.12)
Post by: BlueHazzard on February 09, 2018, 10:43:27 pm
You are the only one with this problem, so it has to be something on your pc...

Was this always the same? Did it worked some time, or was it always with this behavior?

You can use this microsoft tool to monitor if a other program modifies the file.
https://technet.microsoft.com/en-us/sysinternals/bb896645.aspx

Add a filter via Filter->Filter->Select path from the drop down menu -> Add the path to the file in the text entry and click "Add"

If again only codeblocks accesses the file we have to think about something else....
Title: Re: Keep getting prompt to reload file when window loses focus (Windows 7, CB 17.12)
Post by: Chrushev on February 14, 2018, 10:19:25 pm
You are the only one with this problem, so it has to be something on your pc...

Was this always the same? Did it worked some time, or was it always with this behavior?

You can use this microsoft tool to monitor if a other program modifies the file.
https://technet.microsoft.com/en-us/sysinternals/bb896645.aspx

Add a filter via Filter->Filter->Select path from the drop down menu -> Add the path to the file in the text entry and click "Add"

If again only codeblocks accesses the file we have to think about something else....

Ran Process Monitor, looks like Windows Indexing is doing it? SearchProtocolHost.exe is accessing the file while its in background. This only happens when CB is in the background window (another window is focused).

Screenshot --> https://i.imgur.com/87Qo8ek.png
Title: Re: Keep getting prompt to reload file when window loses focus (Windows 7, CB 17.12)
Post by: BlueHazzard on February 15, 2018, 01:52:04 am
Have you set the filter to the project path, or to a specific source file?
It would be suspicious if the windows indexer modifies the file...

Can you try to exclude the project path from the indexer? https://www.sevenforums.com/tutorials/17854-index-locations-add-remove.html

Do you have a other drive, where you can try to create a project?

There seems that the WS modifies the date time code of some files... (PST and more bellow there are reports for other files to)
https://social.technet.microsoft.com/Forums/windows/en-US/36748ed1-595f-4d85-98f6-442662752cf9/searchprotocolhostexe-appears-to-be-modifying-pst-file?forum=w7itprogeneral
but there is no solution in this thread