1,569
questions
2
votes
1
answer
78
views
Cannot free result from g_date_time_format()
In the following code I create a date string from the current system time. The documentation for GLib DateTime format says I need to free the result with g_free(). When I attempt to do that, I get an ...
2
votes
2
answers
62
views
How to decrease the width of a GtkEntry in Gtk3.0?
I have a GTK program with 2 GtkButtons and one GtkEntry. I would like to dynamically resize the width of the entry by clicking a button to increase/decrease it. The program I have so far is able to ...
1
vote
1
answer
51
views
How do I get an element by index from a GLib GArray?
I'm writing an application which depends on GLib, so I am using its dynamic arrays as well. Reading the docs for GLib.Array, it looks like I should be able to access the array's data via the data ...
0
votes
1
answer
18
views
Integrating libpulse's pa_threaded_mainloop in a Qt application (hacking pavucontrol-qt)
I'm trying to get pavucontrol-qt (pvcq) to work properly on Mac (yes, PulseAudio works there).
The hurdle here is that the Qt/Mac event dispatcher is not based on GLib, so qvcq's current ...
0
votes
0
answers
30
views
GLib.Variant For the Type String 'ai' Giving Error On First Run
Here is the code from a gnome extension:
try {
log(``);
global.set_persistent_state('int_val', GLib.Variant.new_int16(0));
let state = global.get_persistent_state('n', 'int_val').get_int16(...
0
votes
0
answers
28
views
Integrating sdbus-cpp with the GLib event loop
I need to integrate some code written using sdbus-cpp with my application's event loop, which is the GLib's GMainLoop.
sdbus-cpp's IConnection interface declares the getEventLoopPollData() function ...
1
vote
0
answers
50
views
What is the best way to wait GIO objects updated in GTK application?
I wait socket updation with IOChannel of GLib because g_io_add_watch function of IOChannel adds the GIOChannel into the default main loop context. This is so nice I do not need to make an additional ...
0
votes
2
answers
60
views
String representation of GVariant
Is there a function to parse a generic glib GVariant pointer into a const char*?
Such as the way it's done in DBus?
signal time=1717768489.237441 sender=:1.22 -> destination=(null destination) ...
1
vote
0
answers
62
views
how to serialize a thrift object properly in C (glib)?
I need to serialize a thrift struct in C (glib) such that I can deserialize it in python. Note that I am using my own transport here.
Suppose I have a structed defined in thrift such as the following:
...
1
vote
1
answer
50
views
Write to a file from gnome extension
In order to write to a file from the gnome extension, I use replace_contents_bytes_async, as in the example here https://gjs.guide/guides/gio/file-operations.html
extension.js:
import { Extension } ...
0
votes
1
answer
80
views
Reconnecting to Dbus daemon after a failover from an application written in vala
I have an application written in vala which communicates to another process (written in vala) using dbus-daemon. It works fine. But it fails to communicate after dbus-daemon is restarted.
My ...
0
votes
1
answer
50
views
How to display the bluetooth devices near a raspberry pi for a limited amount of time?
I would like that the following script runs for a certain time (let's say 10 sec) e lists the available bluetooth devices near a RaspBerry Pi 4.
When I run the following script (adapted from this ...
0
votes
1
answer
57
views
How to fix Package 'gtk4' requires 'gio-2.0 >= 2.76.0' but version of gio-2.0 is 2.74.4
Trying to compile a c program that uses the GTK library and getting the following error:
Package 'gtk4' requires 'gio-2.0 >= 2.76.0' but version of gio-2.0 is 2.74.4
gtk4 (and all other versions ...
1
vote
0
answers
68
views
Get result from Eval gnome dbus API method
I'm using the Eval method from the gnome dbus API to get the name of the window that is currently in focus. https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/main/data/dbus-interfaces/org.gnome.Shell....
0
votes
1
answer
148
views
Take screenshot in gnome environment via its dbus api
I'm trying to take a screenshot using the gnome dbus api https://gitlab.gnome.org/GNOME/xdg-desktop-portal-gnome/-/blob/main/data/org.gnome.Shell.Screenshot.xml
#include <stdbool.h>
#include <...
0
votes
0
answers
18
views
How to return string array in GLibSharp SignalArgs
I'm using GStreamer 1.24.2 and I'm trying to utilize the splitmuxsrc to concatenate some mp4 files together. I have a list of specific files, so I believe I need to use the format-location signal. ...
2
votes
0
answers
52
views
How can I connect g signals directly?
I can connect a signal with g_signal_connect(entry, "icon-press", (GCallback)show_input, NULL); and handle it with
static void show_input(GtkEntry *entry, GtkEntryIconPosition position, ...
0
votes
1
answer
100
views
Correct handling of GMainContext acquired from NetworkManager object iterating in thread
I am trying to use the libnm library to call NetworkManager calls from one thread while another thread takes care of iterating the context and handling the callbacks of the asynchronous methods. Yet ...
0
votes
1
answer
890
views
PkgConfig can't find 'glib-2.0' when trying to build with CMake
I am trying to compile a program that's written in C++ by using CMake.
The contents of the CMakeLists.txt file it the code came with are:
cmake_minimum_required(VERSION 3.21)
project(<redacted> ...
0
votes
0
answers
108
views
Why is dnf throwing a GLib-ERROR when running under docker
I'm seeing a strange error on docker running Amazon Linux 2023. My host's a Slackware 15 machine running the static versions of the latest docker (26.1) - although the same issue occurred on previous ...
2
votes
3
answers
4k
views
DaVinci Resolve 19.0b1 will not start on Ubuntu 24.04 [closed]
After installing DaVinci Resolve 19.0b1 on Ubuntu 24.04, nothing happens when you try to run the desktop app.
Attempting to run the application in a terminal gives the following error message and then ...
2
votes
1
answer
297
views
GStreamer 1.24 Python bindings are blacklisted
I am trying to install Python bindings for GStreamer, but the library is blacklisted. My Dockerfile is below. Everything installs without issue, but the libgstpython.so library is blacklisted. I have ...
2
votes
0
answers
230
views
Suppress GLib-GIO-WARNING originating from Weasyprint/GTK3
I'm using Weasyprint in Python to generate PDF files from HTML files.
After a recent system update of my Windows machine, I started to observe waring log messages printed on the console such as this ...
0
votes
1
answer
165
views
GLib Object failed to create derivable type object, getting "GLib-GObject-CRITICAL: invalid unclassed type"
I try to create a simple derivable type but i seem to miss something.
When i try to call the virtual method, "MY_ITEM_CLASS(result)" throws the critical error.
Compile with
gcc `pkg-config ...
0
votes
1
answer
61
views
Segmentation fault when displaying Popover triggered from custom CellRenderer in PyGTK
I created a custom widget inheriting from Gtk.CellRenderer, where I define a custom signal which I emit from the overridden do_active. When I try to show a Gtk.Popover with popup() in the connected ...
0
votes
0
answers
15
views
GCOV showing coverage for functions more than 100%
I built glib link with coverage.
glib uses the meson build system which requires the build to be generated in a separate directory.
I run gcov on each gcno file generated in order to get function ...
0
votes
2
answers
120
views
Parsing DBUS response type as Array of Dictionary or Map using C++
I am working on Linux DBUS APIs using C++ code, trying to run a dbus method and parse response message typeof (a{sv}) But having few problems. I am using glib and glibmm libraries.
here is my code:
...
0
votes
1
answer
124
views
How to resolve Yocto build error for Glib-2.0 for Qt?
I'm building an image using Yocto for my toradex imx8 board with my QT program. But when I'm running "bitbake displaymod(image name)" I'm getting the following error:
ERROR: displaymod-1.0.0-...
0
votes
0
answers
26
views
how do I change the alpha channel along a path in cairo?
In an application using gtk3, I use cairo to do some drawing. What I would like to do is increase the transparency along the path. The path can have any shape.
In very simplified terms, I have ...
0
votes
0
answers
85
views
Static assertion failure when compiling GStreamer 1.24.0
I'm using mingw32 to compile GStreamer 1.24.0 but it fails with the following error:
In file included from D:/msys64/mingw32/lib/glib-2.0/include/glibconfig.h:9,
from D:/msys64/...
0
votes
0
answers
36
views
How to implement Label/TextVIew with giraffe library in SML
I hope to create a Label/TextView here and can setText or getText at any time. But I can't find the relevant interface documentation and can query how to implement it.
val textEntry = Entry.new () val ...
0
votes
1
answer
73
views
Embed gettext translation (po) data into binary
Is there a way to embed the contents of po files and bind the text domain (~ bindtextdomain(GETTEXT_PACKAGE,...)) to that embedded data?
The background is that I'm building a GTK application with ...
1
vote
3
answers
855
views
Memory leak in a C program
I am learning C programming. As a newbie, I have to say this language is really tough, especially memory management. I used to program with Java and Python, which you don't have to worry about memory ...
2
votes
1
answer
379
views
How can I use GObject Introspection to generate Java bindings?
I need to use the GLib library in the spice-gtk. Since, it’s a GLib library, that means I can use GObject introspection to generate Java bindings. I have found out that I need to get GIR XML files ...
0
votes
0
answers
210
views
Adding metadata to a GStreamer pipeline containing jpegenc
I'm bashing my head against this problem for a while now. What I'd like to ultimately acomplish is to have a Gstreamer pipeline that streams jpeg encoded video over UDP to a different PC while adding ...
0
votes
1
answer
47
views
strange behavior of GHashTable in GLib
i am writing an program like:
typedef struct _DsSourceBin {
gint index;
gchar *name;
GstElement *bin;
GstElement *src;
gchar *uri;
GHashTable *config;
} DsSourceBin;
...
0
votes
0
answers
168
views
Collecting GStreamer logs in Python ends with Segmentation fault [duplicate]
I try to process logs from Gstreamer using Python.
I created file test_logging.py
import gi
gi.require_version("Gst", "1.0")
from gi.repository import GLib, Gst
def ...
1
vote
2
answers
61
views
Is it possible to integrate GLib mainloop into another?
I have a 3rd party library with mainloop. I want to use GLib/Gtk with the app I'm developing. Is it possible to integrate GLib mainloop into another host?
The host loop allows to register an fd and ...
0
votes
0
answers
129
views
why does gcc (installed via brew) not recognize glib (also installed via brew)?
test.c
#include <glib.h>
int main() {}
// test program to verify glib can be included
brew update
brew install gcc
brew install glib
gcc-13 test.c
I get this error.
test.c:5:10: fatal error: ...
0
votes
1
answer
34
views
Bind more than one source properties to a target property in Vala?
Say I have a GLib BindingGroup called location_binds which has properties city-name and country-name. I want to have a property that holds something like "City name, Country name".
I know ...
0
votes
0
answers
52
views
GMime Parser memory access violation
So basically I'm trying to extract the “From:”, “To:”, “Subject:” and body of an MIME encoded e-mail message and show it in the console window. I'm using the GMime library to do that. I have the email ...
0
votes
0
answers
57
views
How to use glib-networking to carry out a HTTP POST to a https URL?
I'm trying to write a function to carry out a HTTP POST request to a https:// URL.
So far my code is:
GError *error = NULL;
GSocketClient *client = NULL;
GTlsConnection *tls_conn = NULL;
...
1
vote
1
answer
42
views
Check if signal is processed for GObject
[Gtk4] In some thread, I was change label of widget and next call window destroy function. Problem was, X11 backend raise BadAccess error on painting function. I need to check if signal for widget/...
0
votes
1
answer
24
views
Appliction command line int option with value 0 not availible
I'm trying to use the command line option handler that comes with GLib/GTK so that the other GTK options are also available in my appliction.
When I have a GLib.OptionArg.INT option, and the value of ...
0
votes
1
answer
100
views
GLIB recompiled but GIO doesn't support attribute metadata
I compiled Glib for myself under Linux Mint 21.1. The new version of gio doesn't support setting attribute metadata.
If I try to do this :
gio set "$(xdg-user-dir PROJECTS)" "metadata::...
0
votes
0
answers
37
views
How I can update a gtk label with change in a bash command in lua-lgi?
I am trying to make some widgets using gtk layer shell and lua-lgi in hyprland. I want to have a label that listens to a terminal command and when a new line appears in the command output, the label ...
0
votes
0
answers
52
views
How do I insert a string in a struct that is on an hashtable
typedef struct user {
char* id; //username
char* name;
char* email;
char* phone_number;
char* birth_date;
char* sex; // M e F
char* passport; // e.g: LK12938
char* ...
0
votes
0
answers
73
views
Write into stdin, read from stdout Subprocess/Process in Glib/GTK Vala
I have a test bash/sh script. It simply shows a question and reads answer from console, then it shows output:
#!/bin/bash
# Ask the user for their name
echo Hello, who am I talking to?
read varname
...
-2
votes
1
answer
409
views
GStreamer: TLS/SSL support not available; install glib-networking
I'm trying to make a secure WebRTC connection using GStreamer 1.22 on macOS, based on this example. When trying to connect to the signaling server via wss://, I get the following error:
HTTP/1.1 6 ...
0
votes
2
answers
267
views
Cannot include Libnm and Glib properly
I tried to use libnm for a small hobby-tool. (a cli tool e. g. for connecting via ssid with a network)
To my setup: I use fedora linux and installed NetworkManager-libnm-devel. (glib was already ...