From 696ce96e9b459cfc6c402be814cc87efb5269f5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Wed, 21 Dec 2016 19:55:48 +0100 Subject: [PATCH] Show notification when pointer gets confined/locked Summary: Inform user how the pointer constraint can be ended. Reviewers: #plasma, #kwin Subscribers: plasma-devel, kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D3780 --- pointer_input.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/pointer_input.cpp b/pointer_input.cpp index e84cfd2990..83b2405e65 100644 --- a/pointer_input.cpp +++ b/pointer_input.cpp @@ -21,6 +21,7 @@ along with this program. If not, see . #include "platform.h" #include "effects.h" #include "input_event.h" +#include "osd.h" #include "screens.h" #include "shell_client.h" #include "wayland_cursor_theme.h" @@ -41,6 +42,8 @@ along with this program. If not, see . // screenlocker #include +#include + #include #include // Wayland @@ -596,7 +599,9 @@ void PointerInputRedirection::enablePointerConstraints() } } ); - // TODO: show notification + OSD::show(i18nc("notification about mouse pointer confined", + "Pointer motion confined to the current window.\nTo release pointer hold Escape for 3 seconds."), + QStringLiteral("preferences-desktop-mouse"), 5000); return; } } else { @@ -611,7 +616,9 @@ void PointerInputRedirection::enablePointerConstraints() if (r.contains(m_pos.toPoint())) { lock->setLocked(true); m_locked = true; - // TODO: show notification + OSD::show(i18nc("notification about mouse pointer locked", + "Pointer locked to current position.\nTo end pointer lock hold Escape for 3 seconds."), + QStringLiteral("preferences-desktop-mouse"), 5000); // TODO: connect to region change - is it needed at all? If the pointer is locked it's always in the region } }