@@ -15,7 +15,11 @@ import Store from "electron-store";
15
15
import cron from "node-cron" ;
16
16
import fs from "node:fs/promises" ;
17
17
import path from "node:path" ;
18
- import { gt as semverGreaterThan } from "semver" ;
18
+ import os from "node:os" ;
19
+ import {
20
+ gt as semverGreaterThan ,
21
+ gte as semverGreaterThanOrEqual ,
22
+ } from "semver" ;
19
23
import { setTimeout as setTimeoutAsync } from "timers/promises" ;
20
24
21
25
import {
@@ -716,7 +720,7 @@ const setContextMenu = () => {
716
720
checked : config . get ( "sendFiles" , true ) ,
717
721
click : ( checkBox ) => handleCheckBoxClick ( checkBox , "sendFiles" ) ,
718
722
toolTip : "Whether to enable sending copied files or not" ,
719
- visible : clipboardEx ,
723
+ visible : ! ! clipboardEx ,
720
724
} ,
721
725
] ,
722
726
} ,
@@ -745,7 +749,7 @@ const setContextMenu = () => {
745
749
checked : config . get ( "receiveFiles" , true ) ,
746
750
click : ( checkBox ) => handleCheckBoxClick ( checkBox , "receiveFiles" ) ,
747
751
toolTip : "Whether to enable receiving files or not" ,
748
- visible : clipboardEx ,
752
+ visible : ! ! clipboardEx ,
749
753
} ,
750
754
] ,
751
755
} ,
@@ -810,12 +814,20 @@ const setContextMenu = () => {
810
814
} ;
811
815
812
816
const createAppIcon = async ( ) => {
813
- appIcon = new Tray (
814
- getTrayIcon ( "clipboard" )
815
- // This GUID should not be changed. It ensures the tray icon position is kept between app updates.
816
- // TODO: restore GUID, see:
817
- // "72812af2-6bcc-40d9-b35d-0b43e72ac346"
818
- ) ;
817
+ // guid only works on Windows 11+
818
+ // https://github.com/electron/electron/issues/41773
819
+ if (
820
+ os . platform ( ) === "win32" &&
821
+ semverGreaterThanOrEqual ( os . release ( ) , "10.0.22000" )
822
+ ) {
823
+ appIcon = new Tray (
824
+ getTrayIcon ( "clipboard" ) ,
825
+ // This GUID should not be changed. It ensures the tray icon position is kept between app updates.
826
+ "72812af2-6bcc-40d9-b35d-0b43e72ac346"
827
+ ) ;
828
+ } else {
829
+ appIcon = new Tray ( getTrayIcon ( "clipboard" ) ) ;
830
+ }
819
831
setContextMenu ( ) ;
820
832
appIcon . setToolTip ( `${ app . name } v${ app . getVersion ( ) } ` ) ;
821
833
0 commit comments