From ef171c2e226444eed2b10d8296993284b42195a3 Mon Sep 17 00:00:00 2001 From: Toad-Dev <748280+toad-dev@users.noreply.github.com> Date: Mon, 24 Jan 2022 14:42:46 -0800 Subject: [PATCH] Fix mouse_up events not firing - deja vu --- .../computercraft/client/gui/ComputerScreenBase.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main/java/dan200/computercraft/client/gui/ComputerScreenBase.java b/src/main/java/dan200/computercraft/client/gui/ComputerScreenBase.java index 8d337baa4..91603b30c 100644 --- a/src/main/java/dan200/computercraft/client/gui/ComputerScreenBase.java +++ b/src/main/java/dan200/computercraft/client/gui/ComputerScreenBase.java @@ -102,6 +102,16 @@ public abstract class ComputerScreenBase extend renderTooltip( stack, mouseX, mouseY ); } + // Fabric note: Forge patches some behavior in AbstractContainerScreen and so doesn't need this override. Fabric + // needs it as the vanilla mouseReleased override in AbstractContainerScreen (the super method from here) always + // consumes the event and doesn't forward it on. + @Override + public boolean mouseReleased( double x, double y, int button ) + { + return (getFocused() != null && getFocused().mouseReleased( x, y, button )) + || super.mouseReleased( x, y, button ); + } + @Override public final boolean mouseDragged( double x, double y, int button, double deltaX, double deltaY ) {