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

x64 Replacement/Alternative to Microsoft's IntelliMouse application.
Forum rules
Please read the forum rules before posting for the first time.
The more information you can provide, the quicker and more accurately someone can help.
Post Reply
99999
New User
Posts: 5
Joined: Thu Jan 03, 2019 11:56 am

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

Post by 99999 » Thu Jan 03, 2019 12:05 pm

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

User avatar
phil
Site Admin
Posts: 5847
Joined: Sun Apr 06, 2003 11:12 pm

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

Post by phil » Thu Jan 03, 2019 1:42 pm

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!
--[ Phil ]--
--[ Administrator & XMBC Author ]--
Logitech G9, Logitech MX518, Microsoft Intellimouse, Trust 16341 BT Mouse
Windows 10 x64, Intel i5-9600k, Asus Z390-ROG, 16GB DDR4,
nVidia GeForce GTX 970, Evo 970 500Gb NVME, 2x2TB WD Black (RAID1)

User avatar
phil
Site Admin
Posts: 5847
Joined: Sun Apr 06, 2003 11:12 pm

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

Post by phil » Thu Jan 03, 2019 1:51 pm

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).
--[ Phil ]--
--[ Administrator & XMBC Author ]--
Logitech G9, Logitech MX518, Microsoft Intellimouse, Trust 16341 BT Mouse
Windows 10 x64, Intel i5-9600k, Asus Z390-ROG, 16GB DDR4,
nVidia GeForce GTX 970, Evo 970 500Gb NVME, 2x2TB WD Black (RAID1)

99999
New User
Posts: 5
Joined: Thu Jan 03, 2019 11:56 am

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

Post by 99999 » Thu Jan 03, 2019 2:11 pm

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

User avatar
phil
Site Admin
Posts: 5847
Joined: Sun Apr 06, 2003 11:12 pm

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

Post by phil » Thu Jan 03, 2019 2:42 pm

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!).
--[ Phil ]--
--[ Administrator & XMBC Author ]--
Logitech G9, Logitech MX518, Microsoft Intellimouse, Trust 16341 BT Mouse
Windows 10 x64, Intel i5-9600k, Asus Z390-ROG, 16GB DDR4,
nVidia GeForce GTX 970, Evo 970 500Gb NVME, 2x2TB WD Black (RAID1)

Post Reply