Files
oak-gpui/crates
张小白 3c53832141 windows: Implement single instance (#15371)
This PR implements a single instance mechanism using the `CreateEventW`
function to create a mutex. If the identifier name begins with `Local`,
the single instance applies only to processes under the same user. If
the identifier begins with `Global`, it applies to all users.

Additionally, I was thinking that perhaps we should integrate the single
instance functionality into `gpui`. I believe applications developed
using `gpui` would benefit from this feature. Furthermore, incorporating
the single instance implementation into `gpui` would facilitate the
`set_dock_menu` functionality. As I mentioned in #12068, the
implementation of `set_dock_menu` on Windows depends on the single
instance feature. When a user clicks the "dock menu", Windows will open
a new application instance. To achieve behavior similar to macOS, we
need to prevent the new instance from launching and instead pass the
parameters to the existing instance.

Any advice and suggestions are welcome.




https://github.com/user-attachments/assets/c46f7e92-4411-4fa9-830e-383798a9dd93



Release Notes:

- N/A
2024-08-28 19:26:24 -07:00
..
2024-05-29 18:06:45 -07:00
2024-07-23 15:01:05 -07:00
2024-04-30 23:31:59 -06:00
2024-08-13 23:06:07 -07:00
2024-08-28 19:10:49 -04:00
2024-03-11 10:45:57 +01:00
2024-07-15 17:04:15 -06:00
2024-08-09 13:37:54 -04:00
2024-04-15 14:21:52 +02:00