chore: small changes

This commit is contained in:
deechael 2024-10-12 12:42:20 +08:00
parent f868af2020
commit 981c21e3ce
2 changed files with 6 additions and 3 deletions

View File

@ -56,7 +56,6 @@ public class SodiumVideoOptionsScreenMixin {
ConcentrationConfigFabric.getInstance().fullscreen = value; ConcentrationConfigFabric.getInstance().fullscreen = value;
ConcentrationConfigFabric.getInstance().save(); ConcentrationConfigFabric.getInstance().save();
if (options.fullscreen().get()) { if (options.fullscreen().get()) {
// If fullscreen turns on, re-toggle to changing the fullscreen mode instantly
Concentration.toggleFullScreenMode(options, true); Concentration.toggleFullScreenMode(options, true);
} }
}, },

View File

@ -51,6 +51,10 @@ public abstract class WindowMixin {
@Shadow @Shadow
public abstract boolean isFullscreen(); public abstract boolean isFullscreen();
@Shadow public abstract int getScreenWidth();
@Shadow public abstract int getScreenHeight();
@Inject(method = "onMove", at = @At("HEAD")) @Inject(method = "onMove", at = @At("HEAD"))
private void inject$onMove$head(long window, int x, int y, CallbackInfo ci) { private void inject$onMove$head(long window, int x, int y, CallbackInfo ci) {
if (!this.fullscreen) { if (!this.fullscreen) {
@ -134,8 +138,8 @@ public abstract class WindowMixin {
} else { } else {
finalX = monitorInstance.getX(); finalX = monitorInstance.getX();
finalY = monitorInstance.getY() - 1; finalY = monitorInstance.getY() - 1;
finalWidth = width; finalWidth = ignored$width;
finalHeight = height + 1; finalHeight = ignored$height + 1;
} }
} }