 Hello my fellow KDEers or something. Today we're trying to fix this bug which I'm going to show you. If I have a virtual desktop with a maximized window, as you know, I think I keep repeating that the panel is going to become transparent. Well, sorry, opaque. Whereas if you don't have that window open it's going to be transparent. This is adaptive transparency. However, if we do open another window, still you can see that it's opaque, if we switch from this workspace to this workspace, well it's very subtle, but you can see that the panel just flashes becoming from opaque to transparent to opaque again, whereas it should just stay opaque. Actually it's way, way more visible if I try to use the dark color scheme. So if we pop up system settings, which of course won't pop up because here we are. And we change to breeze dark. We can see that we have got a transparent panel. And then see it becomes from opaque to transparent and then opaque again, which is weird. It shouldn't happen. So we should try to fix it. Let's do it like this just so it's even more visible. Look at the panel. You can see that it flashes. It shouldn't. So why is this? Well, let's first of all give a look to the code. Just look at the panel right now in changing the workspace and you can see it's flashing. So the reason for this, let me show you the code that manages the transparency first of all, which is and I have to start guessing things again in containment panel contents UI main command. I think it was probably, yeah, it was the other one. I keep on confusing the panel files. See last video I've done if you don't know why I confuse panels. So views panel. Here we are. And we've got this thing. And we've got actually two SVGs that are used for the panel, the translucent one, which is the transparent one and the opaque one. And we switch between the two. So what happens is that while we're switching virtual desktops, something happens for which the panel goes from being opaque to transparent and then opaque again. And of course, these things are set in a function which let me find is somewhere around here. What is it? This one. So this is the issue. So what we have here is we check whether the opacity mode is zero. And what that means is we check whether we actually have adaptive transparency enabled because as you know, we can just turn it off. And if we do, then we check how many windows full screen windows are there. If there are more than zero, then we and we are not showing the desktop, which is what allows me to change the transparency when I do this, then we go from for an opaque panel, otherwise transparent. Now I've done some debugging around here and the issue seems to be in the fact that this count instead of going from one to one, as it's supposed to, because we're going from a desktop with one maximized window to another desktop with one maximized window, it goes from one to zero to one for no reason whatsoever. So where is this from? There's this thingy, which is, well, first of all, we have this, which is the task model, which just tells us how many windows are there in our current virtual desktop. And then we apply a sort filter model to actually sort away the minimized ones. So apparently something happens in all of this and we actually get virtual desktops with more than like one, more than one server that I'm just thinking with we just the task model just goes from one window to something that's zero, maybe it's minimized, maybe it's no windows at all, things that we don't have windows, and then back again to the actual window we're seeing. So if we try to do a bit of debugging, we can actually try to check for changes on this thingy here. We can actually try to see when the virtual desktop is changing. And what seems weird is that it seems like it's changing virtual desktop two times because we're only supposed to receive one update when we change the virtual desktop. Instead, we already we receive two with zero and then the correct number. So we can actually check when it's changing the number and it's here using, I don't know, I don't remember what was it again, on current desktop changed, I think it's changed. So this will actually work that again. This will run when we change the virtual desktop, which is supposed to happen one time. And if we do that like this, and we copy paste this line like 10 times, we go into these, we compile everything that should be compiled. Where was I? Yes, here. Plasma desktop, sorry, Plasma desktop make install. I need to throw a pseudo at it for some reason. Okay, it's working. What we are going to see, because I've already tried this, I'm just adding the lines back because I'll need them in the future today, is just one of that console log turning on every time we know we switch from one place to another. So we source the prefix and then start Plasma shell like this. Now we can change the virtual desktop and then back to here. And we'll see two of those things that we've added. Yeah, let's give it a second to actually boot up everything. Okay, let's try again. As you can see, two of them, because we've changed it to this and then back again. Makes sense. Sounds good. Then what happens? Well, when this desktop changes, let's get this one. Well, this info is used here. So basically, we're saying, hey task manager, we have task model. And this task model was it contains all of the window which are on this virtual desktop, which contains the current desktop. When this changes, it also makes these changes change, which actually calls a C++. Today, as well, I cannot pronounce a word correctly. When this changes, it calls it also makes this one change, which calls a C++ function, which I've asked a developer to point out to me because I was not going to find it by myself, but it did. And I know it's Plasma workspace, Lib task manager, something, something, where this something, something is I've got blah, blah, blah, blah, blah, blah, ah, task filter proxy model, task filter proxy model. Task filter proxy model. Come on I don't want to use Q creaters. Stop trying to show it. Come on. Just use skateboard. Okay. And there's a particular line that interest is us which is of course a virtual desktop set filter by no not this one it was something along these lines virtual desktop yes set virtual desktop okay so when we change the virtual desktop this function gets called and it does what you would expect which is let's zoom into it check if we actually we are actually trying to set a different desktop than before if so we actually change the desktop and then if we are actually filtering by virtual desktop which we do we invalidate the filter which should you know make the filter filter again which should give us the correct results and then we emit that the virtual desktop has changed so now we need to check that this function is actually happening just one time and not two because that's really the issue all of this should happen just one time and something happens two instead of one so we go for I don't know this and we throw a bunch of it okay so now we need to compile this which is in kedy build kedy workspace plasma workspace lib task manager make install like this magic magic magic and then we can slowly okay source the prefix and then restart blood mesh so we can check that it's indeed it's the it's indeed only happening one time and right after the console log that we inserted before which was telling us when the virtual desktop was changing so we go for it we give it a couple of seconds and it's already run one time which makes sense because the first time it actually has to set the initial value for the virtual desktop even if even if it didn't change and then we switch to another one and what happened okay so we had this which tells us that the virtual desktop changed and then with this and this two times so something went wrong along these lines apparently which is weird it's actually really weird and I have no clue what could be the issue but we also have to ask ourselves is actually this the problem because maybe it's just running two times but it's not actually the cause of we getting two different results so what we have to do is also check what what this double call causes so the important part here is this invalidate filter and I've again asked the developer to tell me what does invalidate invalidate filter do and where is my message where is my message I asked what does invalid filter call it sends all of the source model indices through filter filter accepts row so let's look for that function and see what it does so we're going where is it here to the source code of this we're opening up kfine which is like the coolest kde app and we search for filter accept row which is both in this file and in task model so let's open up both of them and first of all see how it's called here so we've got filter accepts row it's a very small function it just tells us that it's not actually using source parent at all and then it just returns accept row source row what is accept row what okay so it's this thing what is this and this is where I stopped last time so from this point on is my real like trying to understand what the hell is going on so we have a q model index which I don't know what is our CD source model blah blah blah index source row blah blah if it's not valid we return so accepts row source row I guess we're checking the windows row by row which is element by element makes sense I guess and filter tasks that are not being shown on the taskbar filter task okay so the most important question here is how many times is this function called and when so same as before and we go for uh we go for uh this was was called with source row and then without it source source row I'm probably using KB wrong I keep on doing that if so sorry I'll discover pretty soon so again Lib task manager make install and whoops I never mind it's just one file it won't change and hopefully we'll be able to see we also need to restart plasmash if it's like going through oh look at this pretty good isn't it okay so well we now that I think about it we also need to like um that's not we're not only going to call these things from our panel file these filter stuff is probably going to be called also from other uploads and stuff which makes sense so we can probably we can't probably filter out everything that we want to can I actually open up system settings I cannot that's very good let's try to change and this and see what happens so now we've got a lot of debugging to do okay so so in the qml file here the virtual desktop was changed and then in the c++ file we get we get we get what do we get we get a function called to the c++ function to change the virtual desktop and then we trigger this thingy that actually checks all of the source row rows and then lots of other stuff that I don't know we're probably not the case because of if we think about it the task manager here down left probably also needs to know about the new windows in the new virtual desktop can we actually ask it not to filter by virtual desktop that might help remove the background noise so like this does this help whatever that I have changed that was not what I want to do okay okay so now there's still the same amount of noise as before so how many windows do we have one two three four five six seven eight nine so we're missing something this list okay oh come on today I'm a bit sleepy okay so let's try to see what actually happens with these source rows filter tasks that are not being shown on the taskbar fine filter tasks that are not to be shown on the pager fine filter by virtual desktop this is what interests us if we are filtering by virtual desktop and we actually have a virtual desktop if source cdx data abstract that is on the ball and not demanding attention skip filters honestly this thing that demanding attention skips filters annoys me because now that I read this line of code I realize that's the cause of another bug of the opacity of the panel we'll see if we can fix that later or not what the hell this is a super big if or not source edx data blah blah blah blah blah virtual desktop is whatever okay so we basically check if it's okay we basically check let me actually finish the sentence let me if the checks whether the list of desktops a window is in because a window could be in multiple virtual desktops well for now it just it just it just fetches the list and then it actually checks whether the list of virtual desktop contains the virtual desktop we are in and if not it returns false which means it filters the row out so what do we do we console dot sorry we cue the bug this sorry this window was on another virtual desktop very very sad indeed this way we can check whether these source rows are true or false and if they're false why are they false maybe it's some reason why the new window is being filtered out even though it shouldn't so now we compile with the same wrong command as before and we check the new output i'm hoping that i'm i'm trying to keep this interesting as much as it's it's possible to keep this interesting anyway we do have our desired output which is this one so as you can see they are all feared filtered out except the window number three which could be either telegram or dolphin so let's like check let me do this okay and if you go back yes we can see that this window three is indeed surviving and in this case the window one is survive surviving the filtering which means that these two windows should in theory get to the final count but looks like they aren't because we actually receive a zero eventually so let's see if there's something weird that filters them out so first of all we filter by screen they shouldn't get filtered by screen so let's add it just for sure this window was filtered by screen what then we filter by activity again it doesn't make any sense whatsoever right now to filter by activity but let's check anyway we filter not maximize not minimize not maximize not minimize whether they are hidden and if not and let's add a feedback here as well this is the true window to roll them or and now we actually compile everything and check well what's the life of all these windows that we're trying to understand where is my maximite window let's maximize this one so we can actually know test things out with that one we're start plasmashal I should not hit accidentally the tripod okay so let's switch up okay changed in virtual desktop changed in the panel virtual desktop changed in the filter and as you can see this was called resource seven and this is the true window to the mall which means that window seven which I can only guess is system settings survived the counting but then why do we get zero let's go so one also seems to survive but there are other filters that like are fine with getting all of the windows and are not actually filtering by anything this one is filtering by screen again this shouldn't interest us there are probably other things what does interest us is this one okay but then what's going on in this case we can see that all of them gets filtered out because you know they're not maximized and I don't know why but this dolphin window that we're moving around doesn't count so there's no other window okay now that we know that this function is working what the hell is wrong with you honestly I have no clue task filter proxy model task model do we have the same what is it do we have the same filter accepts row stuff in here accepts row we do have some filter accepts row in here nothing interesting though at least doesn't seem to be interesting okay honestly I have no clue what's what was going on let me do another change to the panel code which is here which is to actually check when the numbers are going wrong and to do that we get to the function I was talking about before this which is here and when it gets called we console.log the amount I don't know like let's go with we like this the amount of good windows is and then this so we can actually check what is the amount of windows that our panel code is receiving and when it is receiving them so we can you know check that out with the code this was in plasma desktop so we need to compile that one okay my password okay if we do not understand anything from that we are going to get to add that and because I don't know what else could we check honestly so let's hope that something pops up here again it's setting up stuff we don't really interest we don't really have any interest in this we go up and see what happened okay so okay so okay we have the qml file change we have the virtual desktop change in the qml we have all of this stuff and at the end the amount of good windows is one which is correct because you know what I forgot that these bugs only happens when going from a virtual desktop that's full to another virtual desktop that's full and I'm going from an empty one to a full one so of course I won't get the back so let's get back and open up a window here something that's not like super laggy please I have hundreds of windows open at this point okay so let's see if we managed to get the back like this let's read the log there's more stuff happening this time okay look at here panel changes c++ changes we filter windows 7 is the true window true the more we get the value from the panel and it's zero and then nothing nothing happens nothing and and it immediately becomes one I don't know honestly this is upsetting honestly upsetting how much how long is this devlog 30 minutes I think that's a good length for a devlog I'll stop it here and maybe do a second one on this because I don't want to get make them too long so see you in the next one and you know donate stuff like that bye