Giter VIP home page Giter VIP logo

Comments (9)

sdroege avatar sdroege commented on August 24, 2024 2

Yeah, we're just going to remove the functions :) They're only duplicating the behaviour of the functions with the same names from glib.

from gtk3-rs.

cmyr avatar cmyr commented on August 24, 2024

I also just ran into this.

Not only is this function safe to call from other threads, it is the recommended way of communicating back to the main thread from another thread.

I'd be happy to come up with a patch, but I'm not sure how that works with the generated bindings?

from gtk3-rs.

EPashkin avatar EPashkin commented on August 24, 2024

@cmyr: So issue need be renamed to "threads_add_idle asserts if is running not on the main thread" ?

from gtk3-rs.

EPashkin avatar EPashkin commented on August 24, 2024

It need fix in gir, I will do it on the weekend

from gtk3-rs.

sdroege avatar sdroege commented on August 24, 2024

@cmyr You can use glib::source::idle_add(), or for a slightly different pattern glib::MainContext::channel() or any approach using futures (the main context is a futures executor).

I think we should simply ignore this and similar functions from gdk. They don't bring any additional advantage.

from gtk3-rs.

sdroege avatar sdroege commented on August 24, 2024

I think we should simply ignore this and similar functions from gdk. They don't bring any additional advantage.

I.e. all gdk_threads_.* functions should be ignored.

from gtk3-rs.

sdroege avatar sdroege commented on August 24, 2024

@EPashkin You make a PR for that?

from gtk3-rs.

cmyr avatar cmyr commented on August 24, 2024

idle_add() looks like it would probably work. I don't have enough context to offer a strong opinion; I don't use gtk much, I'm just maintaining some code.

In terms of naming of this thread title, well lets not spend too much time on it 😉 but I think the current phrasing is reasonable; there is an assert that checks if the function is running on the main thread, which fails otherwise, even though it should be okay to call this function on other threads.

from gtk3-rs.

sdroege avatar sdroege commented on August 24, 2024

The functions were removed.

from gtk3-rs.

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.