diff options
author | Kae <80987908+Novaenia@users.noreply.github.com> | 2025-06-03 12:51:51 +1000 |
---|---|---|
committer | Kae <80987908+Novaenia@users.noreply.github.com> | 2025-06-03 12:51:51 +1000 |
commit | 1720277e9f35d0b7357c77b6a566778874fc2da8 (patch) | |
tree | 276a2bb223b1429e3fe5b6419326e9ba3ccfea21 | |
parent | b4ecfab5b893d08d0d5784ef0b567b8cf0564a7e (diff) |
unlock clipboard during button widget presses
-rw-r--r-- | source/windowing/StarButtonWidget.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/source/windowing/StarButtonWidget.cpp b/source/windowing/StarButtonWidget.cpp index 0412ae5..72019f0 100644 --- a/source/windowing/StarButtonWidget.cpp +++ b/source/windowing/StarButtonWidget.cpp @@ -3,6 +3,7 @@ #include "StarJsonExtra.hpp" #include "StarRandom.hpp" #include "StarAssets.hpp" +#include "StarInput.hpp" namespace Star { @@ -47,9 +48,12 @@ ButtonWidget::~ButtonWidget() { } void ButtonWidget::renderImpl() { - if (isPressed() && sustainCallbackOnDownHold()) - if (m_callback) + if (isPressed() && sustainCallbackOnDownHold()) { + if (m_callback) { + auto unlocker = Input::singleton().unlockClipboard(); m_callback(this); + } + } Vec2F position = Vec2F(screenPosition()); Vec2F textPosition = position + Vec2F(m_textOffset); @@ -224,6 +228,7 @@ void ButtonWidget::setPressed(bool pressed) { if (m_pressed) { check(); if (m_callback) { + auto unlocker = Input::singleton().unlockClipboard(); m_callback(this); } } |