From 3e9a8482912b26a82739149058bb86c3bf7382c4 Mon Sep 17 00:00:00 2001 From: Alex O'Neill <35673674+alcatrazEscapee@users.noreply.github.com> Date: Tue, 21 Nov 2023 20:06:39 -0500 Subject: [PATCH] Fix focus sticking on next/previous page buttons #696 (#697) --- .../java/vazkii/patchouli/client/book/gui/GuiBook.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Xplat/src/main/java/vazkii/patchouli/client/book/gui/GuiBook.java b/Xplat/src/main/java/vazkii/patchouli/client/book/gui/GuiBook.java index 663369d1..d2c253ad 100644 --- a/Xplat/src/main/java/vazkii/patchouli/client/book/gui/GuiBook.java +++ b/Xplat/src/main/java/vazkii/patchouli/client/book/gui/GuiBook.java @@ -312,7 +312,15 @@ public boolean mouseClickedScaled(double mouseX, double mouseY, int mouseButton) } } - return super.mouseClicked(mouseX, mouseY, mouseButton); + for (GuiEventListener listener : children()) { + if (listener.mouseClicked(mouseX, mouseY, mouseButton)) { + if (mouseButton == GLFW.GLFW_MOUSE_BUTTON_LEFT) { + setDragging(true); + } + return true; + } + } + return false; } @Override