Skip to content

Commit

Permalink
Merge pull request #313 from MirServer/dont-incorrectly-error-on-part…
Browse files Browse the repository at this point in the history
…ial-pointer-events

wlcs::Client: Handle incomplete logical pointer/touch events better.
  • Loading branch information
AlanGriffiths authored Nov 22, 2023
2 parents ce00652 + c4aa6a0 commit 06d324f
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions src/in_process_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -878,8 +878,6 @@ class wlcs::Client::Impl

wl_surface* window_under_cursor() const
{
if (pointer_events_pending())
BOOST_THROW_EXCEPTION(std::runtime_error("Pointer events pending"));
if (current_pointer_location)
{
return current_pointer_location->surface;
Expand All @@ -889,8 +887,6 @@ class wlcs::Client::Impl

wl_surface* touched_window() const
{
if (touch_events_pending())
BOOST_THROW_EXCEPTION(std::runtime_error("Touch events pending"));
wl_surface* surface = nullptr;
for (auto const& touch : current_touches)
{
Expand All @@ -904,15 +900,11 @@ class wlcs::Client::Impl

std::pair<wl_fixed_t, wl_fixed_t> pointer_position() const
{
if (pointer_events_pending())
BOOST_THROW_EXCEPTION(std::runtime_error("Pointer events pending"));
return current_pointer_location.value().coordinates;
};

std::pair<wl_fixed_t, wl_fixed_t> touch_position() const
{
if (touch_events_pending())
BOOST_THROW_EXCEPTION(std::runtime_error("Touch events pending"));
if (current_touches.empty())
BOOST_THROW_EXCEPTION(std::runtime_error("No touches"));
else if (current_touches.size() == 1)
Expand Down

0 comments on commit 06d324f

Please # to comment.