#Brave-laptop dev: interesting issue and how I attempted to fix it

So I came across this issue that causes the icon to flicker when the mouse moves back and forth on a tab, but only for certain sites,

 the fix I discovered is removing one line of code that set the next frame to null for the animation to setup for the next frame, but from my guess that was causing issues with the icon frame being null every split second.


I fixed this in record time, only about 45 min... if only all bugs were that easy to fix. 


How did I find the code required? well glad you asked, First off I used the inspector of the dev tools (opened by pressing shift-F8 and selecting the ) and selected the favicon and scrolled up so I could see the class information for the tabs.

noticing the --tab-mouse-x changes I decided to look that up in the project using "Atom" as my editor pressing ctrl-shift-f allows me to search the whole project for a keyword.


lucky me it only found 1 match, this is unusual, pressing on the match it bought me here (link brings you to github page with the actual code)

noticing on (line 192 or press the link "here" from above)

this.nextFrameSetTabMouseX = window.requestAnimationFrame(() => {
this.nextFrameSetTabMouseX = null

that line struck me as odd... why set something to null within the statement used to define it, wondering if this was causing a moment that the frame might be null to cause the icon to disappear for a sec I tried commenting it out and wallah!!! it works!!!

Here's hoping my fix didn't break anything else.

Update: upon closer inspection I realize that my "fix" broke the gradient shading that's applied from the mouse moving around, since it needs to be set to null to update, might need a further patch to fix this.


Popular posts from this blog

#Brave-laptop dev: Being brave with my first issue (WIP)

#Python-dev: First contribution to (c)python

#Brave-laptop dev: interesting issue part 2