egui icon indicating copy to clipboard operation
egui copied to clipboard

Hyperlinks not working on Windows with request_repaint_after

Open JosuGZ opened this issue 3 years ago • 2 comments

Describe the bug

When clicking on an hyperlink on Windows, on version 0.19.0, I'm getting the following error:

thread 'main' panicked at 'either event handler is re-entrant (likely), or no event handler is registered (very unlikely)', <PATH_TO_REPO>\vendor\winit\src\platform_impl\windows\event_loop\runner.rs:242:18

To Reproduce

Create an agui app with an hyperlink, call request_repaint_after, and click it:

  fn update(&mut self, ctx: &egui::Context, _frame: &mut eframe::Frame) {

    CentralPanel::default().show(ctx, |ui| {
      let text = "Google";
      let url = "https://www.google.com";
      let link = Hyperlink::from_label_and_url(text, url);
      ui.add(link);
    });

    ctx.request_repaint_after(Duration::from_millis(100));
  }

JosuGZ avatar Sep 05 '22 10:09 JosuGZ

Interesting!

Does it still happen if you replace request_repaint_after with request_repaint? Does it still happen if you remove request_repaint_after?

emilk avatar Sep 05 '22 10:09 emilk

Interesting!

Does it still happen if you replace request_repaint_after with request_repaint? Does it still happen if you remove request_repaint_after?

With ctx.request_repaint(); it does not happen. I've realized that after downgrading to 0.18 as I had tried links on that version before.

JosuGZ avatar Sep 05 '22 10:09 JosuGZ