Skip to content

Commit

Permalink
disable jna
Browse files Browse the repository at this point in the history
  • Loading branch information
MORIMORI0317 committed Dec 28, 2022
1 parent 156fbc3 commit 6a9ee26
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import net.morimori0317.bettertaskbar.api.BetterTaskbarAPI;
import net.morimori0317.bettertaskbar.taskbar.DummyTaskbarAccess;
import net.morimori0317.bettertaskbar.taskbar.ITaskbarAccess;
import net.morimori0317.bettertaskbar.taskbar.windows.jna.WindowsTaskbarJNAAccess;
import net.morimori0317.bettertaskbar.taskbar.windows.jni.WindowsTaskbarJNIAccess;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
Expand Down Expand Up @@ -32,8 +31,10 @@ private static ITaskbarAccess createTaskbarAccess() {
String arc = System.getProperty("os.arch").toLowerCase();

if (os.contains("windows") && arc.contains("amd64")) {
if (WindowsTaskbarJNAAccess.check() && processCheck(WindowsTaskbarJNAAccess.getInstance()))
return WindowsTaskbarJNAAccess.getInstance();

//Disabled as it may crash in some environments
/* if (WindowsTaskbarJNAAccess.check() && processCheck(WindowsTaskbarJNAAccess.getInstance()))
return WindowsTaskbarJNAAccess.getInstance();*/

if (WindowsTaskbarJNIAccess.check() && processCheck(WindowsTaskbarJNIAccess.getInstance()))
return WindowsTaskbarJNIAccess.getInstance();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ public String getName() {

private void taskbarList3(BiConsumer<ITaskbarList3, WinDef.HWND> consumer) {
var window = Minecraft.getInstance().getWindow();
if (window == null) return;
long id = GLFWNativeWin32.glfwGetWin32Window(window.getWindow());
var hwnd = new WinDef.HWND(new Pointer(id));
var clsid = new Guid.CLSID("56FDF344-FD6D-11d0-958A-006097C9A090");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,13 @@ public static WindowsTaskbarJNIAccess getInstance() {
@Override
public void setProgress(int comp, int total) {
var window = Minecraft.getInstance().getWindow();
if (window == null) return;
long id = GLFWNativeWin32.glfwGetWin32Window(window.getWindow());
WindowsLibrary.setTaskbarProgress(id, comp, total);
}

@Override
public void setState(BetterTaskbarAPI.State state) {
var window = Minecraft.getInstance().getWindow();
if (window == null) return;
long id = GLFWNativeWin32.glfwGetWin32Window(window.getWindow());
WindowsLibrary.setTaskbarProgressState(id, WindowsLibrary.ProgressState.getByState(state));
}
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ enabled_platforms=fabric,forge
#-Mod-#
archives_base_name=bettertaskbar
mod_display_name=BetterTaskbar
mod_version=1.6.0
mod_version=1.6.1
#-Dependencies-#
architectury_version=7.0.64
fabric_loader_version=0.14.11
Expand Down

0 comments on commit 6a9ee26

Please sign in to comment.