Page 1 of 1

"Only match if there is no parent class" broken after update

Posted: Thu Jan 03, 2019 12:05 pm
by 99999
XMBC Version: 2.18
Windows Version: Windows 10 17763 (1809)
Mouse Information (brand/model): Logitech
Computer Information:
Did the problem occur after an upgrade of XMBC or Windows?: Yes, of XMBC
How long have you used XMBC?: Several years
What language and keyboard layout do you use in Windows?: English

Clear description of the problem:
I had "Only match if there is no parent class" on in one of the rules, so that it will only match top-level windows. After updating to 2.18, the rule doesn't work at all unless I remove the checkbox.

I use it to scroll between tabs of Chrome with my mouse. Here's a screenshot:
https://i.imgur.com/660yDUb.png

Re: "Only match if there is no parent class" broken after update

Posted: Thu Jan 03, 2019 1:42 pm
by phil
Hi, this functionality *was* changed between 2.17 and 2.18 so I maybe something got missed in testing (we did try to test profile detection thoroughly).

This option should cause the window/profile to match IF the window under the cursor has no parent class name (or no parent window).

However, looking at Chrome, it would appear that it always has a parent class (even the apparently "top most" window has a parent!!!) - what exactly are you trying to activate the profile on (hover the mouse over to trigger the profile).

In my chrome, no matter where I hover the mouse, it ALWAYS returns a valid parent class (usually "Chrome_WidgetWin_1"). And therefore it will NEVER match because that parent class is never empty. (Im using Spy++ to examine the window structure and that confirms what XMBC is seeing). Now that window itself has no parent, but that is not the window reported by Windows as the window under the cursor (window hierarchy may be the problem here, and it may also be a change in Chrome to the way it layers its rendering windows/tabs).

In theory changing the match type to "parent" might work - but I have just found a bug there with the "only match if no parent" option because in that case it needs to look at the parent of the parent. I'm working on that, but right now I'm struggling to see how/why it should have ever worked with the screenshot you have sent - I'm wondering if it worked before because the logic was wrong... I'll continue to look at what I changed on that one!

Re: "Only match if there is no parent class" broken after update

Posted: Thu Jan 03, 2019 1:51 pm
by phil
The reason it worked before, is a bug in earlier versions that was fixed in 2.18...
If you did not specify a parent class name to match (i.e. leave the field empty as you have) it skipped checking the parent class.
And the "Only match if there is no parent class" option simply was not even checked unless you used regular expression matching.
So effectively it always incorrectly matched, even though there WAS a parent class that was not empty!

In 2.18 it now honors the "Only match if there is no parent class" for any type of matching (Regex or regular).
And as there *IS* a parent class (always it would seem) for Chrome, it now fails to match because "Only match if there is no parent class" *is* ticked and honored!

So to get the same behavior as 2.17, simply untick the box. This will match, but it is not really correct because this chrome window is *not* top level and does have parent. To get it to work as you *want* it to work I need to fix the bug I have just found... And then you can tell XMBC to match the parent window details and only if the parent has no parent (if that makes sense).

Re: "Only match if there is no parent class" broken after update

Posted: Thu Jan 03, 2019 2:11 pm
by 99999
Thank you for the detailed reply. For now I configured it like this and it seems to work properly.
https://i.imgur.com/GPcXqhu.png

Re: "Only match if there is no parent class" broken after update

Posted: Thu Jan 03, 2019 2:42 pm
by phil
Yes that looks like I did it here - so its good, but at least it pointed me to a bug with the "Parent window" match option (which you are not using). I will fix that in the next release (and beta!).