Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • May 11 2015 14:08
    GuillaumeGomez commented #71
Nils Petter Skålerud
@Didgy74
But I can't find this in the GDK bindings anywhere
Nils Petter Skålerud
@Didgy74
I just want the raw handle to a GDK window basically
Russel Winder
@russel
@Didgy74 Although there is no ready-made wrapper for this function in the gtk-rs-sys crate, this doesn't stop you calling the function in an unsafe block. I am not surprised the crate misses out this function since it is Windows specific – as I understand it the idea of gtk-rs is to create UIs that run on any platform that supports GTK+.
@Krysme I would suggest that attempting to use a handle to a GTK+ window after it has been destroyed is always going to lead to problems – destruction really is a fairly terminal operation.
Nils Petter Skålerud
@Didgy74
@russel I actually want access to the raw handle regardless of the platform, so I would want the raw handle to Xlib and Xcb windows also. I was basically trying to get a external Vulkan renderer integrates as a GTK widget
But I looked into it, and GDK doesn't seem to have been designed with external Vulkan renderers in mind. I found the documentation on GdkVulkanContext, but it is severely limited in terms of functionality
So I ended up using Qt instead, the support for external Vulkan renderers has been good so far
Nils Petter Skålerud
@Didgy74
I was hoping you could get around it by creating and empty GdkWindow, creating the surface by using raw handles and then embedding that window within another
But I didn't bother looking into it since I would've had to change the C source code and the bindings
Ideally this crate would support the raw-window-handle crate
Russel Winder
@russel
I had understood that Vulkan support is part of GTK+ 4. If there is a GIR file then when gtk-rs is updated for GTK+ 4 then the Vulkan support comes. If though Qt already has Vulkan support then using Qt is the right direction – though for me Qt seems usable only from C++ and Python.
Nils Petter Skålerud
@Didgy74
I'm keeping the Qt interfacing code in C++ and making bindings
GTKs Vulkan support is misleading
They will use Vulkan to render the GUI
But inserting your own Vulkan renderer into a GTK widget is impossible unless you accept severe limitations and massive performance hits
I asked over at the GTK IRC, the answer I got was that GTK was just not designed for that usecase and none of the developers care about supporting it
So GTK is just not for me atm
Russel Winder
@russel
@Didgy74 GTK is not for many, Qt has a lot of upsides, especially in terms of multi-platform usage. To date though Qt has been a C++ and Python only framework. D and Rust should be able to handle it though.
Nils Petter Skålerud
@Didgy74
I'm writing all the Qt interface code in C++, then making Rust bindings for a few entry points
So it's working fine, but it is additional hassle
Russel Winder
@russel
Were the officially listed Rust Qt bindings not usable directly?
Nils Petter Skålerud
@Didgy74
I might look over them again now that I know about the Qt structure a bit better. But let me put it this way, they were bad enough that I thought doing C++ - Rust interop manually would be the better choice
Nils Petter Skålerud
@Didgy74
Alright, I looked over the "ritual" crate for Rust, which is the closest thing I found to any official Qt Rust bindings
It's listed on the Qt wiki anyways
I guess it might be usable, emphasis on the might, however, it's generated from Qt 5.8
I'm using Qt with Vulkan, so I need Qt 5.10 at the very least
Nils Petter Skålerud
@Didgy74
Hmm, I'm running their codegen tool on 5.13 now. I'll see how it turns out
Nils Petter Skålerud
@Didgy74
It didn't work. It wasn't able to generate bindings for Qt Vulkan
stedingan
@stedingan
hello, i'm a bit confused and clueless, so here's my full application so you have all sources. https://github.com/stedingan/tmp what i don't understand is, how can i clear the liststore and add new data to it?
this should happen if i click the button so this would be the right place https://github.com/stedingan/tmp/blob/master/src/main.rs#L30
but all i can find is a .get_columns() and a .get_cells(), and by now i'm super confused and or probably did something major wrong, would appreciate any help
stedingan
@stedingan
probably i just create a new liststore and do a .set_model()?
DilsonHiga
@DilsonHiga_twitter
Hello. How can I get data out of a glib::SendValue when I know (from the c docs) it contains a GstValueList of GFloat from the gstreamer lib?
stedingan
@stedingan
Hello, i followed the instructions on https://gtk-rs.org/docs-src/tutorial/cross and if i want to crosscompile my example app for windows with cargo build --target=x86_64-pc-windows-gnu --release
i get a lot of linker errors of the form... https://paste.xinu.at/ey3/ where did i mess up or where can i start to get a running cross build configuration?
forget to mention i'm on arch aswell so i followed the archlinux guide
Dirk Van Haerenborgh
@vhdirk
Hi guys. Any plans to implement AsyncRead for gio?
Ville Hakulinen
@vhakulinen
I'm also interested on AsyncRead and AsyncWrite with gio. I suppose it depends on the async story of rust's std (related: https://async.rs/blog/announcing-async-std/#)
Oli Larkin
@olilarkin
Hello, i'm using cairo-rs on macos. Is there a way to build it specifying a custom cairo installation (not using brew) ?
Paul Delafosse
@oknozor
Hello, i just bumped the gtk-rs and glib (respectively from 0.5 to 0.7 and from 0.6 to 0.8) on an old project a i got the following error :
webview_lock
                            .get()
                            .run_javascript(js_scroll, None, move |_msg| {
                                info!("webkit window scrolling to : {} px", scroll_target);
                            });
with error :
error[E0283]: type annotations required: cannot resolve `_: gtk::IsA<gio::auto::cancellable::Cancellable>`
   --> src/nvim/handler.rs:120:30
    |
120 |                             .run_javascript(js_scroll, None, move |_msg| {
    |                              ^^^^^^^^^^^^^^
I have no idea what type i shall use here, any hint ?
hecaex
@hecaex
Hi, is it possible to dynamically link to GTK instead of statically? My app is about 120mb on Windows just for a simple window.
Evgenii Pashkin
@EPashkin
@oknozor Try use NONE_CANCELLABLE or add type hint to None https://github.com/gtk-rs/gio/blob/master/src/auto/cancellable.rs#L46
Evgenii Pashkin
@EPashkin
@hecaex Currently seems no normal way to link std dynamically (not gtk),
release is smaller ~6Mb, stripped even smaller, also see https://users.rust-lang.org/t/rust-binary-sizes-once-again/16287
Paul Delafosse
@oknozor
@EPashkin thank you !
Paul Delafosse
@oknozor
Hello, how to you add pkg-config dependencies to run your gtk app in a CI environment? I am trying to use travis but pango is missing.
Ali
@Strongsaxophone
Please explain me why we have "widget struct" and " widgetExt trait" or a link that I can get it quickly what is what ? thanks
Evgenii Pashkin
@EPashkin
@Strongsaxophone See https://gtk-rs.org/docs/glib/
Häcker Felix
@haecker-felix

Hi, I'm using "data_input_stream.read_upto_async_future("", glib::PRIORITY_LOW)". If the stream is empty, my app crashes with:

thread 'main' panicked at 'assertion failed: !ptr.is_null()

It's because Gstring is NULL. Is there any way to to handle this? Is there any way to check if the datainputstream has content? Complete backtrace: https://paste.gnome.org/pbcsm0guy