Skip to content

Commit 5aba763

Browse files
Copilotphilstopford
andcommitted
Fix DrawingArea widget embedding by removing premature visibility setting that caused separate window appearance
Co-authored-by: philstopford <1983851+philstopford@users.noreply.github.com>
1 parent ccc34b0 commit 5aba763

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

Eto/Eto.Veldrid.Gtk/GtkVeldridSurfaceHandler.cs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -191,13 +191,6 @@ private void DrawingArea_InitializeGraphicsBackend(object? sender, EventArgs e)
191191
Console.WriteLine("[DEBUG] Ensured native window for DrawingArea");
192192
}
193193

194-
// Ensure the widget is visible within its parent container
195-
if (drawingArea != null && !drawingArea.Visible)
196-
{
197-
Console.WriteLine("[DEBUG] Making DrawingArea visible within parent container");
198-
drawingArea.Visible = true;
199-
}
200-
201194
// Get display info for debugging
202195
var gdkDisplay = drawingArea!.Display.Handle;
203196
bool isWayland = X11Interop.IsWaylandDisplay(gdkDisplay);
@@ -426,8 +419,8 @@ private void TriggerVulkanDraw()
426419
// This is critical for Wayland support
427420
drawingArea.AppPaintable = true;
428421

429-
// Make sure the widget is visible
430-
drawingArea.Visible = true;
422+
// Don't manually set visibility - let GTK handle this through parent container hierarchy
423+
// Setting visibility prematurely can cause the widget to appear as a top-level window
431424

432425
// Use Map event for initialization - ensures widget is visible and ready for graphics operations
433426
drawingArea.Mapped += DrawingArea_InitializeGraphicsBackend;

0 commit comments

Comments
 (0)