Various fixes

This commit is contained in:
crschnick
2026-01-28 16:21:20 +00:00
parent d4fb1a7cf8
commit c02c9947a6
5 changed files with 26 additions and 23 deletions

View File

@@ -46,27 +46,6 @@ public class AppDesktopIntegration {
b.runOnWake();
}
});
Desktop.getDesktop().addAppEventListener(new UserSessionListener() {
@Override
public void userSessionDeactivated(UserSessionEvent e) {
if (AppPrefs.get() == null) {
return;
}
var b = AppPrefs.get().hibernateBehaviour().getValue();
if (b == null) {
return;
}
b.runOnSleep();
}
@Override
public void userSessionActivated(UserSessionEvent e) {
}
});
}
// This will initialize the toolkit on macOS and create the dock icon

View File

@@ -4,6 +4,7 @@ import io.xpipe.app.core.mode.AppOperationMode;
import io.xpipe.app.issue.ErrorEventFactory;
import io.xpipe.app.issue.TrackEvent;
import io.xpipe.app.platform.PlatformState;
import io.xpipe.app.prefs.AppPrefs;
import io.xpipe.app.util.ThreadHelper;
import com.sun.jna.*;
@@ -17,6 +18,8 @@ import java.util.List;
public class AppWindowsShutdown {
public static final int WTS_SESSION_LOCK = 0x7;
public static final int WTS_SESSION_UNLOCK = 0x8;
public static final int WM_ENDSESSION = 0x16;
public static final int WM_QUERYENDSESSION = 0x11;
public static final long ENDSESSION_CRITICAL = 0x40000000L;
@@ -103,6 +106,26 @@ public class AppWindowsShutdown {
return new WinDef.LRESULT(0);
}
// The awt UserSessionListener does not work, so do it manually
if (hookProcStruct.message.longValue() == WinUser.WM_SESSION_CHANGE) {
var type = hookProcStruct.wParam.longValue();
if (type == WTS_SESSION_LOCK || type == WTS_SESSION_UNLOCK) {
if (AppPrefs.get() != null) {
var b = AppPrefs.get().hibernateBehaviour().getValue();
if (b != null) {
ThreadHelper.runAsync(() -> {
if (type == WTS_SESSION_LOCK) {
b.runOnSleep();
} else {
b.runOnWake();
}
});
return new WinDef.LRESULT(0);
}
}
}
}
}
return User32.INSTANCE.CallNextHookEx(
hhook, nCode, wParam, new WinDef.LPARAM(Pointer.nativeValue(hookProcStruct.getPointer())));

View File

@@ -110,6 +110,7 @@ open module io.xpipe.app {
requires org.kordamp.ikonli.bootstrapicons;
requires jdk.zipfs;
requires org.int4.fx.builders;
requires io.xpipe.app;
uses TerminalLauncher;
uses ActionProvider;

View File

@@ -56,7 +56,7 @@ The scripting system has been completely reworked with the goal of becoming simp
- Fix SSH config write, e.g. for vscode SSH, not properly passing all configured options
- Fix SSH config identity detection not working for patterns in host entries
- Fix custom SSH agent setting not always overriding other agents configured in SSH config
- Fix SSH config files include wildcards failing to parse in soe cases
- Fix SSH config files include wildcards failing to parse in some cases
- Fix mstsc certificates trust status not persisting for tunneled RDP connections
- Fix vscode-based editors not working when cmd.exe was disabled on the system
- Fix various issues with the Keeper password manager and 2FA support

View File

@@ -1607,7 +1607,7 @@ gitRepoOverwriteLocalDescription=Replace all local changes with changes from the
gitRepoForcePush=Overwrite remote repository
gitRepoForcePushDescription=Use git push --force to apply your local changes to the remote
gitRepoDontWarn=Don't warn anymore
gitRepoDontWarnDescription=If this is intentional, ignore this error in the future
gitRepoDontWarnDescription=If this is expected, make XPipe ignore this error in the future
gitRepoTryAgain=Try again
gitRepoTryAgainDescription=Attempt the same operation again
gitRepoDisable=Disable git vault for now