Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@

**Compatibility:** Apps built with `flet build` and the macOS desktop client now require macOS 12 or later, and iOS apps require iOS 15 or later. Custom build templates keep building, because Flutter 3.47 raises the deployment targets during the build; apply the same `Podfile` and Xcode project changes to skip that step. See the [macOS 12 and iOS 15 minimum](/docs/updates/breaking-changes/v1-1-0/minimum-macos-12-ios-15) guide.

* Fix setting `Window.skip_task_bar` to `True` not hiding the app from the taskbar on Windows ([#6302](https://github.com/flet-dev/flet/issues/6302), [#6946](https://github.com/flet-dev/flet/pull/6946)) by @ndonkoHenri.
* Fix the desktop window flashing endlessly after a `flet run` hot reload ([#6913](https://github.com/flet-dev/flet/issues/6913), [#6945](https://github.com/flet-dev/flet/pull/6945)) by @ndonkoHenri.
* Fix `flet run -r` restarting the app whenever it writes to its working directory or temp directory, which also left `flet run -r --web` pages blank ([#6944](https://github.com/flet-dev/flet/pull/6944)) by @ndonkoHenri.
* Fix `flet run --ignore-dirs` not ignoring directories on Linux when the project is opened through a symlink ([#6944](https://github.com/flet-dev/flet/pull/6944)) by @ndonkoHenri.
Expand Down
2 changes: 1 addition & 1 deletion packages/flet/lib/src/models/window_state.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class WindowState {
bool maximizable;
bool resizable;
bool preventClose;
bool skipTaskBar;
bool? skipTaskBar;
double width;
double height;
double top;
Expand Down
16 changes: 15 additions & 1 deletion packages/flet/lib/src/utils/desktop.dart
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,22 @@ Future setWindowTitleBarVisibility(
}
}

/// Whether the window is hidden from the Windows taskbar, as last applied by
/// [setWindowSkipTaskBar], or `null` until a value is applied.
///
/// On Windows, `window_manager`'s `isSkipTaskbar()` returns a flag that only
/// its `setSkipTaskbar()` updates and that starts out `true`, although a new
/// window has a taskbar button. [getWindowState] reports this value instead.
/// It starts as unknown (null) rather than `false` because the native window can
/// outlive it, e.g. across a Flutter hot restart, so the first requested
/// value is always applied.
bool? _windowsSkipTaskBar;

Future setWindowSkipTaskBar(bool skipTaskBar) async {
if (isDesktopPlatform()) {
debugPrint("setWindowSkipTaskBar($skipTaskBar)");
await windowManager.setSkipTaskbar(skipTaskBar);
_windowsSkipTaskBar = skipTaskBar;
}
}

Expand Down Expand Up @@ -341,7 +353,9 @@ Future<WindowState> getWindowState() async {
maximizable: await windowManager.isMaximizable(),
resizable: await windowManager.isResizable(),
preventClose: await windowManager.isPreventClose(),
skipTaskBar: await windowManager.isSkipTaskbar(),
skipTaskBar: isWindowsDesktop()
? _windowsSkipTaskBar
: await windowManager.isSkipTaskbar(),
width: size.width.toDouble(),
height: size.height.toDouble(),
top: pos.dy.toDouble(),
Expand Down
9 changes: 7 additions & 2 deletions sdk/python/packages/flet/src/flet/controls/core/window.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,8 +263,13 @@ class Window(BaseControl):

skip_task_bar: bool = False
"""
Whether the app window should be hidden from the Task Bar (on Windows) or Dock (on \
macOS).
Whether the app window should be hidden from the
Task Bar (on Windows) or Dock (on macOS).
Note:
On Windows 11, the window is also hidden from the Alt+Tab switcher, so a
window that is minimized while hidden can only be restored by the app itself.
Keep a way to bring it back, such as a tray icon.
"""

title_bar_hidden: bool = False
Expand Down
Loading