Fix DOWN click misbehavior when using Clique #692


  • Accepted
  • Patch
  • Started
Closed
  • humfras created this issue Aug 3, 2019

    Currently on login, due to line 118 in GridFrame.lua, Grid2 overwrites the registered click set by Clique because it calls frame:RegisterForClicks("AnyUp") after registering via Clique.

    The easiest solution would be to change it from


    frame:RegisterForClicks("AnyUp")

     

    to

     

    frame:RegisterForClicks("AnyUp")

    if Clique then Clique:UpdateRegisteredClicks(frame) end

     

    original discussion: https://eu.forums.blizzard.com/de/wow/t/der-clique-entwickler-ich-moechte-mit-ihm-reden/41786/7

    Greetings
    Chris

  • humfras added a tag Patch Aug 3, 2019
  • humfras edited description Aug 3, 2019
  • humfras edited description Aug 3, 2019
  • michaelsp posted a comment Aug 4, 2019

    i think its dangerous to call Clique internal functions like Clique:UpdateRegisteredClicks(), because this function could change in future Clique versions, breaking Grid2. i don't know what is allowed and not allowed to do with Clique, is there some public api/documentation about clique registration methods  ?  i found nothing.

    I will try to use some tricky workaround, but avoiding to use things that could break Grid2 in the future.


    Edited Aug 4, 2019
  • michaelsp posted a comment Aug 4, 2019

    A possible cheap fix is to check Clique downclick setting:

    frame:RegisterForClicks( (Clique and Clique.settings and Clique.settings.downclick) and "AnyDown" or "AnyUp" )

  • michaelsp added a tag Accepted Aug 4, 2019
  • humfras posted a comment Aug 4, 2019

    Well, that's defenitely not more secure and much more important, that ignores if the Grid2 frames are blacklisted in Clique's configuration.

    And this would not break Grid2 in any case.
    You can simply check via 

    if Clique and Clique.UpdateRegisteredClicks then Clique:UpdateRegisteredClicks(frame) end

    and you're safe.

     

    And I highly doubt James will remove/change that function since it's an intregral part of Clique.

     

    ---------------------------------------------------------------------------------------------------------------------------------

     

    There currently is no real documentation for Clique, sadly.

     

    The registration for Clique is correcly done via the frame header attribute in GridLayout.lua line 28-31 and 44-48.

     

    You can savely call Clique:UpdateRegisteredClicks(button or nil) because it checks for combat lockdown and if the button/frame is blacklisted by the user's configuration.

     

    ---------------------------------------------------------------------------------------------------------------------------------

     

    And thanks for the quick response.


    Edited Aug 4, 2019
  • michaelsp posted a comment Aug 4, 2019

    Implemented the suggested patch in version 897-alpha, thanks for the help.


    Edited Aug 4, 2019
  • michaelsp added a tag Started Aug 4, 2019
  • humfras closed issue Aug 4, 2019
  • humfras posted a comment Aug 4, 2019

    Thank you very much.


To post a comment, please login or register a new account.