Giter VIP home page Giter VIP logo

Comments (9)

Letiliel avatar Letiliel commented on June 7, 2024

Can you reproduce this?
It's a bug or bad design inherent to GTK (rather a bug since the TreeView doesn't have the issue). I have the same behavior with this example browser.

from lutris.

strycore avatar strycore commented on June 7, 2024

Yup, able to reproduce. If I put a couple of print statements in the signals, in can see that the on_selection_changed is called twice (once for each click) where as, if the game is already selected then the first click trigger on_selection_changed and the second one triggers on_item_activated

from lutris.

strycore avatar strycore commented on June 7, 2024

This is indeed a problem with GTK, if we want to workaround this issue, we'd have to basically re-implement double-clicking: Keep track of currently selected game and what time it was selected, on selection changed, check if the current selected game is the same as previously selected game and current_time - last_selection_time < n milliseconds, if so we trigger the on_item_activated signal.

from lutris.

Letiliel avatar Letiliel commented on June 7, 2024

Yes and reimplement activation with Enter and Space or keep on_activation and add double-click detection on top.

Meanwhile, I'll report the bug to GTK.

from lutris.

Letiliel avatar Letiliel commented on June 7, 2024

It was already reported since 2007, yay ! There is a patch though, maybe we can use it... somehow ?

from lutris.

strycore avatar strycore commented on June 7, 2024

You mean by shipping a patched version of GTK? I don't think that's even possible! No, the best we can do is wait for the patch to be merged and released downstream. Meanwhile we can go with the double-click reimplementation option, even if it feels a bit hackish.

from lutris.

Letiliel avatar Letiliel commented on June 7, 2024

Not shipping GTK, no, I just had the quick unaware thought that maybe it was possible to override the guilty function.

from lutris.

strycore avatar strycore commented on June 7, 2024

If it were written in Python, you could monkey patch that bit. Actually, it may be possible to monkey patch even if it was written in C (but it would need a python re-implementation of this function and possibly everything around it).
My advice is: don't open that door, do not ever go there, it's not worth it.

from lutris.

Letiliel avatar Letiliel commented on June 7, 2024

My advice is: don't open that door, do not ever go there, it's not worth it.

Stop tempting me ! :P

from lutris.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.