Re: Emitting signals from threads

2019-03-08 Thread Luca Bacci via gtk-list
Hi, yes you should file a bug Of course, the sizing of the column is also marked as > "AUTOMATIC", which may be the reason why. I am assuming that it works > for you because you are overriding the "AUTOMATIC" sizing by calling > gtk_tree_view_column_set_resizable() after the UI has been processed.

Re: Emitting signals from threads

2019-03-07 Thread Mitko Haralanov via gtk-list
I just tried this and it doesn't work. I set the first column as resizable in the main.ui (through Glade) and the bad behavior is still present. Of course, the sizing of the column is also marked as "AUTOMATIC", which may be the reason why. I am assuming that it works for you because you are overri

Re: Emitting signals from threads

2019-03-07 Thread Mitko Haralanov via gtk-list
OK, I can do that but I think it might be still worth the bug. Thanks for looking into this! On Thu, Mar 7, 2019 at 10:47 AM Luca Bacci wrote: > > try adding the line > gtk_tree_view_column_set_resizable (gtk_tree_view_get_column(view, 0), TRUE); > > Il giorno gio 7 mar 2019 alle ore 19:43 Luca

Re: Emitting signals from threads

2019-03-07 Thread Luca Bacci via gtk-list
try adding the line gtk_tree_view_column_set_resizable (gtk_tree_view_get_column(view, 0), TRUE); Il giorno gio 7 mar 2019 alle ore 19:43 Luca Bacci ha scritto: > just setting column1 as resizable >

Re: Emitting signals from threads

2019-03-07 Thread Luca Bacci via gtk-list
just setting column1 as resizable fixes the issue Il giorno gio 7 mar 2019 alle ore 18:35 Luca Bacci ha scritto: > Yes, go ahead. > > I don't know if that can be useful to you, but if you increase

Re: Emitting signals from threads

2019-03-07 Thread Luca Bacci via gtk-list
Yes, go ahead. I don't know if that can be useful to you, but if you increase the time spent in usleep() to something greater it works correctly. With usleep(1) I get mixed results: Third column activated Third column activated Activated an other column Activated an other column Third column

Re: Emitting signals from threads

2019-03-06 Thread Mitko Haralanov via gtk-list
OK, thank you. Please, let me know if you'd like me to file a bug for this? Thanks On Wed, Mar 6, 2019 at 10:27 AM Luca Bacci wrote: > > I'm working on it. But yes, this really seems a bug in Gtk. > > Il mer 6 mar 2019, 18:40 Mitko Haralanov ha scritto: >> >> Hi, >> >> Any update? Does anyone t

Re: Emitting signals from threads

2019-03-06 Thread Luca Bacci via gtk-list
I'm working on it. But yes, this really seems a bug in Gtk. Il mer 6 mar 2019, 18:40 Mitko Haralanov ha scritto: > Hi, > > Any update? Does anyone think this is a bug that should be filed against > Gtk? > > Thanks > > On Thu, Feb 28, 2019 at 2:05 AM Luca Bacci > wrote: > > > > Hi, I can't promi

Re: Emitting signals from threads

2019-03-06 Thread Mitko Haralanov via gtk-list
Hi, Any update? Does anyone think this is a bug that should be filed against Gtk? Thanks On Thu, Feb 28, 2019 at 2:05 AM Luca Bacci wrote: > > Hi, I can't promise I will find a solution but I'll certainly take a look at > this > > Il gio 28 feb 2019, 02:13 Paul Davis ha scritto: >> >> You are

Re: Emitting signals from threads

2019-02-28 Thread Luca Bacci via gtk-list
Hi, I can't promise I will find a solution but I'll certainly take a look at this Il gio 28 feb 2019, 02:13 Paul Davis ha scritto: > You are right, and I withdraw my remarks. As noted, I didn't read it > carefully enough. > > But yes, g_idle_add_full() runs in the worker thread, however that's o

Re: Emitting signals from threads

2019-02-27 Thread Paul Davis
You are right, and I withdraw my remarks. As noted, I didn't read it carefully enough. But yes, g_idle_add_full() runs in the worker thread, however that's one thing that is always OK. On Wed, Feb 27, 2019 at 6:03 PM Mitko Haralanov wrote: > But that's not how the code is written: > > g_task_ru

Re: Emitting signals from threads

2019-02-27 Thread Mitko Haralanov via gtk-list
But that's not how the code is written: g_task_run_in_thread(obj->task, custom_object_work) -> custom_object_worker() -> signal_emit() -> g_idle_add_full(..., signal_emitter, ...); signal_emitter() is the function that *actually* emits the signal. signal_emitter() is supposed to be

Re: Emitting signals from threads

2019-02-27 Thread Paul Davis
On Wed, Feb 27, 2019 at 5:46 PM Mitko Haralanov wrote: > How is that? The update is happening from a callback executed by the > main context thread? > g_task_run_in_thread(obj->task, custom_object_worker); custom_object_worker() emits the "updated" signal. the handler modifies the model. __

Re: Emitting signals from threads

2019-02-27 Thread Mitko Haralanov via gtk-list
How is that? The update is happening from a callback executed by the main context thread? On Wed, Feb 27, 2019 at 4:24 PM Paul Davis wrote: > > > > On Wed, Feb 27, 2019 at 5:17 PM Mitko Haralanov via gtk-list > wrote: >> >> Here is a small program that illustrates the issue: >> > > Yep. You're

Re: Emitting signals from threads

2019-02-27 Thread Paul Davis
On Wed, Feb 27, 2019 at 5:17 PM Mitko Haralanov via gtk-list < gtk-list@gnome.org> wrote: > Here is a small program that illustrates the issue: > > Yep. You're updating a treemodel from your own thread while the treeview is connected to it. You can't do this. __

Re: Emitting signals from threads

2019-02-27 Thread Mitko Haralanov via gtk-list
Here is a small program that illustrates the issue: #include G_BEGIN_DECLS #define CUSTOM_OBJECT_TYPE (custom_object_get_type()) G_DECLARE_FINAL_TYPE(CustomObject, custom_object, CUSTOM, OBJECT, GObject); enum _CustomObjectSignals { SIGNAL_UPDATE, N_SIGNALS, }; struct _CustomOb

Re: Emitting signals from threads

2019-02-27 Thread Paul Davis
It is possible that I haven't read this thread carefully enough. You cannot update a GtkTreeModel or any other similar data structure that is currently being used as "the model" by a GtkTreeView or other similar widget, from a worker thread. The model will emit signals reflecting what you've done

Re: Emitting signals from threads

2019-02-27 Thread Mitko Haralanov via gtk-list
I could start a new thread but will be confusing for anyone who may be reading this thread a year from now researching a similar problem. So, with that said, let me try to clarify: The application has a GtkTreeView being populated by a GtkTreeModel. The TreeView has 3 columns, the last one having

Re: Emitting signals from threads

2019-02-27 Thread Chris Vine via gtk-list
On Wed, 27 Feb 2019 14:08:34 -0800 Mitko Haralanov wrote: > On Wed, Feb 27, 2019 at 1:10 PM Chris Vine via gtk-list > wrote: > > > > On Wed, 27 Feb 2019 09:49:43 -0800 > > Mitko Haralanov via gtk-list wrote: > > [snip] > > > However, as I understand it, if my signal is running in the main > > >

Re: Emitting signals from threads

2019-02-27 Thread Fontana Nicola
Il giorno mar, 08/01/2019 alle 10.02 -0800, Mitko Haralanov via gtk-list ha scritto: > Thanks for the reply. > ... Hi, I find this mail thread really confusing and with a lot of misleading guesses. As already stated elsewhere, a minimal working example would likely be a *much* quicker way to solv

Re: Emitting signals from threads

2019-02-27 Thread Mitko Haralanov via gtk-list
Hi Chris, I am not expecting g_idle_add() to emit the signal. I am calling a separate function scheduled by g_idle_add() or g_main_context_invoke_full(), which does the signal emission. I use g_idle_add()/g_main_context_invoke_full() to ensure that this callback is, in fact, running in the main co

Re: Emitting signals from threads

2019-02-27 Thread Chris Vine via gtk-list
On Wed, 27 Feb 2019 09:49:43 -0800 Mitko Haralanov via gtk-list wrote: [snip] > However, as I understand it, if my signal is running in the main > context, the signal handler should not be running at the same time as > Gtk is recalculating/repainting the TreeView. It seems as if the > threaded sig

Re: Emitting signals from threads

2019-02-27 Thread Mitko Haralanov via gtk-list
I haven't had much time to work on this but I did figure out the following: The reason that the "Edit" dialog is being opened is that when the click is processed by the button-press-event handler, the width of the first column in the TreeView is 0. As a result, the calculation of where the click o

Re: Emitting signals from threads

2019-01-09 Thread Mitko Haralanov via gtk-list
Sure, let me try to come up with something and if successful, I'll post it. Thank you. On Wed, Jan 9, 2019 at 10:33 AM Luca Bacci wrote: > > Hi Mitko, > last time I tried creating a simple C application for testing but I did get > always correct values. (Btw I used g_idle_add) > Can you try to

Re: Emitting signals from threads

2019-01-09 Thread Mitko Haralanov via gtk-list
I never said it worked with g_idle_add() (or if I did, I made a typing mistake). Actually, what I said is that it *doesn't* work with g_idle_add(). I am not entirely sure what bug "in my code" I could have found since my code is not responsible for managing and/or painting the columns. This should

Re: Emitting signals from threads

2019-01-09 Thread Luca Bacci via gtk-list
Hi Mitko, last time I tried creating a simple C application for testing but I did get always correct values. (Btw I used g_idle_add) Can you try to write a minimal test application that still exhibits the problem? That would be very helpful! ___ gtk-list

Re: Emitting signals from threads

2019-01-09 Thread Luca Bacci via gtk-list
ess, i.e.: > > >> > > > > * setup a function "update_progress" > > >> > > > > * on the first threaded update event, call idle_add for the > function > > >> > > > > and put the new progress and the row number in your own

Re: Emitting signals from threads

2019-01-09 Thread Chris Vine via gtk-list
On Tue, 8 Jan 2019 10:02:58 -0800 Mitko Haralanov via gtk-list wrote: > Thanks for the reply. > > When calling g_main_context_invoke_full(), I am using NULL as the > context pointer. According to the documentation of > g_main_context_invoke(): > > "If context is NULL then the global defa

Re: Emitting signals from threads

2019-01-09 Thread Mitko Haralanov via gtk-list
> > and put the new progress and the row number in your own data > >> > > > > structure > >> > > > > * while the function is still "planned in for idle_add", just add > >> > > > > new > >> > > > >

Re: Emitting signals from threads

2019-01-08 Thread Mitko Haralanov via gtk-list
gt; > > > > > > > > > > Il giorno mar 18 dic 2018 alle ore 18:47 Mitko Haralanov via gtk- > > > > list < > > > > gtk-list@gnome.org > > > > > ha scritto: > > > > > > > > > I mistakenly replied only to L

Re: Emitting signals from threads

2019-01-07 Thread ente
lanov via gtk- > > > list < > > > gtk-list@gnome.org > > > > ha scritto: > > > > > > > I mistakenly replied only to Luca!! Forwarding to the list. > > > > > > > > (Sorry, Luca, my bad) > > > > - Mitko > > > > > >

Re: Emitting signals from threads

2019-01-07 Thread Mitko Haralanov via gtk-list
;> (Sorry, Luca, my bad) >>> - Mitko >>> >>> -- Forwarded message - >>> From: Mitko Haralanov >>> Date: Tue, Dec 18, 2018 at 9:37 AM >>> Subject: Re: Emitting signals from threads >>> To: Luca Bacci >>>

Re: Emitting signals from threads

2018-12-18 Thread Mitko Haralanov via gtk-list
; I mistakenly replied only to Luca!! Forwarding to the list. >> >> (Sorry, Luca, my bad) >> - Mitko >> >> -- Forwarded message - >> From: Mitko Haralanov >> Date: Tue, Dec 18, 2018 at 9:37 AM >> Subject: Re: Emitting signals from threa

Re: Emitting signals from threads

2018-12-18 Thread Luca Bacci via gtk-list
message - > From: Mitko Haralanov > Date: Tue, Dec 18, 2018 at 9:37 AM > Subject: Re: Emitting signals from threads > To: Luca Bacci > > > I found something that is different between the two cases - button click > with signals and without. > > Using the code

Fwd: Emitting signals from threads

2018-12-18 Thread Mitko Haralanov via gtk-list
I mistakenly replied only to Luca!! Forwarding to the list. (Sorry, Luca, my bad) - Mitko -- Forwarded message - From: Mitko Haralanov Date: Tue, Dec 18, 2018 at 9:37 AM Subject: Re: Emitting signals from threads To: Luca Bacci I found something that is different between the

Re: Emitting signals from threads

2018-12-18 Thread Luca Bacci via gtk-list
Hi Mitko! Can you post here the code for the button-press event handler? It should more or less follow the code here: http://scentric.net/tutorial/sec-misc-get-renderer-from-click.html Luca Il giorno lun 17 dic 2018 alle ore 20:28 Mitko Haralanov via gtk-list < gtk-list@gnome.org> ha scritto: >

Emitting signals from threads

2018-12-17 Thread Mitko Haralanov via gtk-list
Hi, In my application, I want to be able to update a treeview from a separate thread. Each treeview row was a column that is a progress bar. The progress to be displayed is generated by a separate thread as to not block the UI. Since GTK is not thread-safe, the way the application is written is t