D15272: [effects/trackmouse] Allow to use both modifiers and shortcut

Vlad Zagorodniy <[email protected]>
Newsgroups gmane.comp.kde.devel.kwin
Message-ID <[email protected]>
zzag added inline comments.

INLINE COMMENTS

> davidedmundson wrote in trackmouse.cpp:220
> One comment I forgot to save.
> 
> There's an inbalance here:
> 
> If you activate by shortcut, then pressing a modifier on and off won't disable it
> But if you activate by modifier then toggling the shortcut will disable it
> 
> This might become an issue if a user has it bound to both meta modifier and shortcut meta+a and pressed whilst moving the mouse.
> 
> They would hit meta, activate it by modifier, press the shortcut which then turns it off, release the keys and then it would stay off even though they hit the shortcut once.
> 
> /maybe/ we actually want
> 
> case State::ActivatedByModifiers:
> 
>   m_state = ActivatedByShortcut
>   break;
> 
> but it's an extreme edge case

> If you activate by shortcut, then pressing a modifier on and off won't disable it. But if you activate by modifier then toggling the shortcut will disable it

That's totally intentional.

> They would hit meta, activate it by modifier, press the shortcut which then turns it off, release the keys and then it would stay off even though they hit the shortcut once.

mouseChanged is emitted when, for example, mouse has been moved. If you press a modifier key, mouseChanged is not emitted. So, that's fine.

Also, this leads to a bug in some sense, e.g. if you stop moving mouse and **then** release modifiers, the effect will be still active even though modifiers are not pressed anymore.

REPOSITORY
  R108 KWin

BRANCH
  effects-trackmouse-shortcut

REVISION DETAIL
  https://phabricator.kde.org/D15272

To: zzag, #kwin, #plasma, #vdg, davidedmundson
Cc: broulik, abetts, ngraham, kwin, mkulinski, ragreen, jackyalcine, Pitel, iodelay, bwowk, ZrenBot, lesliezhai, ali-mohamed, hardening, jensreuterberg, sebas, apol, mart
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.