Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feat: allow to launch coco across multi monitors #135

Merged
merged 3 commits into from
Feb 11, 2025
Merged

feat: allow to launch coco across multi monitors #135

merged 3 commits into from
Feb 11, 2025

Conversation

medcl
Copy link
Member

@medcl medcl commented Feb 11, 2025

This pull request includes several changes to the src-tauri/src/lib.rs file to improve the application's initialization and window management processes. The most important changes include adding a new function to move the application window to the active monitor, running initialization tasks in the background, and making minor adjustments to function calls and imports.

Improvements to window management:

  • Added the move_window_to_active_monitor function to move the application window to the active monitor when the "Open Coco" menu is clicked. This function handles monitor detection and cursor position gracefully. (src-tauri/src/lib.rs)
  • Updated the handle_open_coco function to call move_window_to_active_monitor before showing the window and setting its properties. (src-tauri/src/lib.rs)

Background initialization tasks:

  • Cloned app_handle to move it into a background task for initializing the application search source. (src-tauri/src/lib.rs)
  • Registered the application search source in the background task to improve performance. (src-tauri/src/lib.rs)

Minor adjustments:

  • Modified the run function to pass a reference to enable_shortcut. (src-tauri/src/lib.rs)
  • Updated imports to include PhysicalPosition and Window. (src-tauri/src/lib.rs)

@medcl medcl changed the title feat: allow to launch coco across multi monitors WIP feat: allow to launch coco across multi monitors Feb 11, 2025
@medcl medcl changed the title WIP feat: allow to launch coco across multi monitors feat: allow to launch coco across multi monitors Feb 11, 2025
@RainyNight9 RainyNight9 merged commit e6afce6 into main Feb 11, 2025
@RainyNight9 RainyNight9 deleted the shorts branch February 11, 2025 06:53
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants