mirror of https://github.com/polybar/polybar.git
fix(cursor): add lock to motion handler
This commit is contained in:
parent
3ea60ace91
commit
39c12edc8a
|
@ -610,6 +610,12 @@ void bar::handle(const evt::leave_notify&) {
|
|||
* Used to change the cursor depending on the module
|
||||
*/
|
||||
void bar::handle(const evt::motion_notify& evt) {
|
||||
if (!m_mutex.try_lock()) {
|
||||
return;
|
||||
}
|
||||
|
||||
std::lock_guard<std::mutex> guard(m_mutex, std::adopt_lock);
|
||||
|
||||
m_log.trace("bar: Detected motion: %i at pos(%i, %i)", evt->detail, evt->event_x, evt->event_y);
|
||||
#if WITH_XCURSOR
|
||||
m_motion_pos = evt->event_x;
|
||||
|
|
Loading…
Reference in New Issue