@@ -62,7 +62,7 @@ public class DownApplication extends Application {
6262
6363 private static final String OS = OsUtil .isWindows () ? "windows"
6464 : (OsUtil .isMac () ? "mac" : "linux" );
65- private static final String ICON_NAME = OS + "/ logo.png" ;
65+ private static final String ICON_PATH = OS + ( OsUtil . isWindowsXP () ? "/logo_xp.png" : "/ logo.png") ;
6666
6767 public static DownApplication INSTANCE ;
6868
@@ -91,8 +91,11 @@ public void start(Stage primaryStage) throws Exception {
9191 initEmbedHttpServer ();
9292 initExtension ();
9393 initTray ();
94- initWindow ();
95- initBrowser ();
94+ //xp不支持webview
95+ if (!OsUtil .isWindowsXP ()) {
96+ initWindow ();
97+ initBrowser ();
98+ }
9699 loadUri (null , true , true );
97100 }
98101
@@ -217,7 +220,7 @@ private void initTray() throws AWTException {
217220 // 获得系统托盘对象
218221 SystemTray systemTray = SystemTray .getSystemTray ();
219222 // 获取图片所在的URL
220- URL url = Thread .currentThread ().getContextClassLoader ().getResource (ICON_NAME );
223+ URL url = Thread .currentThread ().getContextClassLoader ().getResource (ICON_PATH );
221224 // 为系统托盘加托盘图标
222225 Image trayImage = Toolkit .getDefaultToolkit ().getImage (url );
223226 Dimension trayIconSize = systemTray .getTrayIconSize ();
@@ -280,7 +283,7 @@ private void initWindow() {
280283 stage .setY ((bounds .getHeight () - height ) / 2 );
281284 stage .setMinWidth (width );
282285 stage .setMinHeight (height );
283- stage .getIcons ().add (new javafx .scene .image .Image (Thread .currentThread ().getContextClassLoader ().getResourceAsStream (ICON_NAME )));
286+ stage .getIcons ().add (new javafx .scene .image .Image (Thread .currentThread ().getContextClassLoader ().getResourceAsStream (ICON_PATH )));
284287 stage .setResizable (true );
285288 //关闭窗口监听
286289 stage .setOnCloseRequest (event -> {
@@ -319,7 +322,7 @@ public void show(boolean isTray) {
319322 public void loadUri (String uri , boolean isTray , boolean isStartup ) {
320323 String url = "http://127.0.0.1:" + FRONT_PORT + (uri == null ? "" : uri );
321324 boolean autoOpen = PDownConfigContent .getInstance ().get ().isAutoOpen ();
322- if (PDownConfigContent .getInstance ().get ().getUiMode () == 0 ) {
325+ if (OsUtil . isWindowsXP () || PDownConfigContent .getInstance ().get ().getUiMode () == 0 ) {
323326 if (!isStartup || autoOpen ) {
324327 try {
325328 Desktop .getDesktop ().browse (URI .create (url ));
0 commit comments