Skip to content

Commit

Permalink
Use the widget name from widget placement
Browse files Browse the repository at this point in the history
The WidgetPlacement structure contains the name of the widget. When
building the name for the native widgets we were using a combination
of "Widget-" prefix + the widget handle. That was not useful at all
for debugging as it was not possible to differentiate between widgets
by name.

Instead it's much better to use the widget name that is passed in
WidgetPlacement. That way we can identify whether a widget is a
TrayWidget, a WindowWidget... We keep the widget handle in the name
as it's useful to differentiate widgets that may have multiple
instances (like Windows for example).
  • Loading branch information
svillar committed Nov 15, 2024
1 parent 7ba2410 commit 86abf88
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/src/main/cpp/Widget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ struct Widget::State {
void Initialize(const int aHandle, const WidgetPlacementPtr& aPlacement, const int32_t aTextureWidth, const int32_t aTextureHeight,
const QuadPtr& aQuad, const CylinderPtr& aCylinder) {
handle = (uint32_t)aHandle;
name = "crow::Widget-" + std::to_string(handle);
name = aPlacement->name + '_' + std::to_string(handle);
vrb::RenderContextPtr render = context.lock();
if (!render) {
return;
Expand Down

0 comments on commit 86abf88

Please sign in to comment.