new_sub_window and propagating data. [druid] - TagMerge

new_sub_window and propagating data. [druid]

james-lawrenceAsked 5 months ago

when spawning a sub window, whats the intended behavior for updating the sub window if data within the spawning parent changes while the sub window is open?

using a Label within the parent and TextBox within the subwindow I'd expect the label to update when the data is changed. however that doesn't seem to happen. closing and reopening the sub window shows the data is being saved properly but not triggering updates.

the newsubwindow documentation states:

    /// The sub-window will have its app data synchronised with caller's nearest ancestor [`WidgetPod`].
    /// 'U' must be the type of the nearest surrounding [`WidgetPod`]. The 'data' argument should be
    /// the current value of data  for that widget.**

I do not see the data synchronization happening.

digging further the SubWindowDesc has documentation around a "sync" field, but no idea whats its referencing. there doesn't seem to by a sync field anywhere.

    /// Creates a subwindow requirement that hosts the provided widget within a sub window host.
    /// It will synchronise data updates with the provided parent_id if "sync" is true, and it will expect to be sent
    /// SUB_WINDOW_PARENT_TO_HOST commands to update the provided data for the widget.

Source: link

sjoshidAnswered 5 months ago

I do not see the data synchronization happening.

There are two commands that do the sync.

  1. SUB_WINDOW_PARENT_TO_HOST. When data (or env) change is detected in parent, it is cloned and sent to all sub windows with this command. Payload being cloned data (or env).
  2. SUB_WINDOW_HOST_TO_PARENT: That does the reverse.

As to why it is not happening in your case Im not sure. Maybe you can share code?

james-lawrenceAnswered 5 months ago

yes but I'll see if I can reproduce with a toy example first. just wanted some context on the expected behavior before I went down that route.

edit: based on your description I believe i know what the issue is and its my own fault.

james-lawrenceAnswered 5 months ago

was a bug in the wayland backend.

Recent Issues

    Programming Languages