alexmercerind / windows_taskbar

Flutter library serving utilities related to Windows taskbar.
MIT License
158 stars 16 forks source link

Setting tooltip has broken application #10

Closed JaffaKetchup closed 2 years ago

JaffaKetchup commented 2 years ago

For some reason, setting a tooltip has broken my application completely.

It's supposed to be a little always-on-top transparent widget that uses Python internally to display the status of music playing. However, after trying to set a tooltip, the window is completely invisible, and the preview in the toolbar looks like this: image

I've tried removing this plugin, but the issue persists. I know this plugin has caused issues as it first made an overflow error (my window is intentionally very small).

This is main():

WidgetsFlutterBinding.ensureInitialized();
  await Window.initialize();
  await windowManager.ensureInitialized();

  await windowManager.setAlwaysOnTop(true);
  await windowManager.setIgnoreMouseEvents(true);
  await windowManager.setAsFrameless();
  await windowManager.setHasShadow(false);

  // Setting tooltip here broke everything

  await Window.setEffect(
    effect: WindowEffect.transparent,
    color: Colors.transparent,
  );

  doWhenWindowReady(() {
    const initialSize = Size(600, 80);
    appWindow.maxSize = const Size(5000, 80);
    appWindow.minSize = initialSize;
    appWindow.size = initialSize;
    appWindow.alignment = Alignment.topRight;
    appWindow.title = "Spotify Music Widget";
    appWindow.show();
  });

  runApp(const AppContainer());

How can I go back to how my application used to be? Many thanks!

JaffaKetchup commented 2 years ago

If it helps, a previous version of the application (all compiled to an exe) still works as expected, and looks like this: image

JaffaKetchup commented 2 years ago

Hmm, this actually seems to be a problem in another library. For some reason however, this just triggered it.

alexmercerind commented 2 years ago

There's a single functional call from ITaskbarList3 interface available on Windows 7+ used for tooltip. I don't think it would've caused anything. Other than that, I think having a thumbnail tooltip is bit of redundant (isn't it?), I wonder how many apps even have it & users don't generally hover over thumbnail to see a piece of text. I made this plugin primarily for setting those taskbar icon thumbnail buttons & badges in my app. The code in this plugin is rather minimal, feel free to submit a patch. Thanks.

https://github.com/alexmercerind/windows_taskbar/blob/75d9a986ba8f2810e33a78db77438434356b2f4e/windows/windows_taskbar.cc#L108-L110

JaffaKetchup commented 2 years ago

Thanks for that info. It turned out that I had to use a full restart to install this plugin properly, which reset and broke something else. It wasn't this. This is a great plugin, the progress indicator works nicely.