picoe / Eto

Cross platform GUI framework for desktop and mobile applications in .NET
Other
3.54k stars 320 forks source link

Eto.Forms - Visibility property is broken [GTK] #2341

Open lr-devx opened 1 year ago

lr-devx commented 1 year ago

So basically when I try to modify the visibility of a control, I need to unfocus-focus the window to make this specific control appears/disappears.

Expected Behavior

The control should immediatly appear or disappear after changing the property.

Actual Behavior

Control's visibility (it is UPDATED in the CODE but NOT visually) is only updated after the window is unfocused and focused afterwards.

Steps to Reproduce the Problem

  1. Add two buttons
  2. Add a button event in one of them and make it so it toggles the second button's visibility
  3. Notice the issue

Specifications

lr-devx commented 1 year ago

I've found a trick to fix this but it's very messy.

await Task.Delay(1000);
MainWindow window = new MainWindow();
await Task.Delay(10);
window.Show();
await Task.Delay(10);
Focus();
await Task.Delay(10);
BringToFront();
await Task.Delay(10);
window.Focus();
await Task.Delay(10);
window.BringToFront();
await Task.Delay(10);
Close();

Please fix this bug asap, I'm working on a big project.