window_focus 1.2.1
window_focus: ^1.2.1 copied to clipboard
Window Focus is a convenient plugin for Flutter that allows you to track user inactivity and obtain information about the title of the active window on Mac OS and Windows.
1.2.1 - 2026-01-22 #
Changed #
- macOS Window Titles:
- Improved active window title tracking using
CGWindowListCopyWindowInfo. - Added periodical (1s) check for window title changes within the same application.
- Added fallback to application name if window title is unavailable.
- Improved active window title tracking using
Fixed #
- macOS Idle Tracking:
- Fixed issue where user status could get stuck in "idle".
- Implemented combined monitoring using system session timers, HID timers, and manual event tracking for maximum reliability.
- Example App:
- Fixed idle timeout saving and loading from
UserDefaultson macOS. - Fixed UI logic for displaying activity status.
- Renamed internal state variables for better clarity (
isUserActiveinstead ofuserIdle).
- Fixed idle timeout saving and loading from
1.2.0 - 2026-01-22 #
Added #
- Screenshot Capture:
- New method
takeScreenshot({bool activeWindowOnly})to capture the entire screen or just the active window. - Added
checkScreenRecordingPermission()andrequestScreenRecordingPermission()for macOS 10.15+.
- New method
- Global Keyboard Activity (macOS):
- Implemented global keyboard tracking via
CGEventTapfor more accurate idle detection. - Added detailed logs for event monitoring in debug mode.
- Implemented global keyboard tracking via
- Example App Enhancements:
- Added auto-screenshot feature with customizable intervals.
- Added screenshot logging and preview in the UI.
- Improved UI with app usage statistics and activity logs.
Changed #
- Improved Active Window Capture:
- macOS: Now dynamically detects the frontmost application and its main window for screenshots.
- Windows: Switched to
BitBltfrom screen context for more reliable capture of hardware-accelerated windows (e.g., Chrome).
- Refined Idle Tracking:
- Expanded event mask on macOS to include system modifier keys (Shift, Cmd, etc.).
- Improved resources cleanup and lifecycle management in native code.
Fixed #
- Fixed macOS compilation error related to
CFRunLoopSourceCreate. - Fixed various syntax errors and widget hierarchy issues in the example app.
- Fixed issue where screenshot was always capturing the app itself instead of the active window.
1.1.0 - 2025-01-12 #
Added #
-
Debug Mode:
- Added the ability to enable debug mode (
debug) via the plugin constructor or thesetDebug(bool debug)method. In debug mode, detailed logs of user activity and window changes are printed to the console.
- Added the ability to enable debug mode (
-
Customizable Idle Timeout:
- You can now set the user idle timeout (
idleThreshold) in the plugin constructor or using thesetIdleThreshold(Duration duration)method.
- You can now set the user idle timeout (
Changed #
-
Improved Project Structure:
- Updated project structure to improve readability and support for new features.
- Methods for tracking user activity and active windows now work correctly on the Windows platform.
-
Documentation Updates:
- Added detailed descriptions for methods and classes, including usage examples.
Fixed #
- Fixed issues with tracking user activity on the Windows platform.
- Improved error handling for invalid arguments passed to native methods.
Template #
- Updated the usage example in the
example/folder. The example demonstrates:- How to use the debug mode.
- How to set and retrieve the idle timeout.
- How to track active windows and user activity.
1.0.0 #
- Initial release