Bug 401768 - [feature] - show app number overlay earlier
Summary: [feature] - show app number overlay earlier
Status: RESOLVED FIXED
Alias: None
Product: lattedock
Classification: Plasma
Component: application (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR wishlist
Target Milestone: ---
Assignee: Michail Vourlakos
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-12-05 13:50 UTC by Tinu
Modified: 2019-02-01 17:14 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tinu 2018-12-05 13:50:55 UTC
SUMMARY
Shortcut for start a new instance should display the number of an App in the Dock earlier. It should displayed when I press Meta+Ctrl.

STEPS TO REPRODUCE
1. Press the Keystroke meta+Ctrl+1
2. An instance of the App at the index 1 starts
3. And displays the number each App have as an overlay (this should be appear in the 2 Step.

I love Latte Dock!!

OBSERVED RESULT


EXPECTED RESULT


SOFTWARE/OS VERSIONS
Windows: 
MacOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 Michail Vourlakos 2018-12-05 14:59:41 UTC
You can use Meta+' for showing numbers for what you are requesting can be only X11 specific and I don't think a solution exists, 

Feel free of course for anyone to play with this and send any patch for review...
Comment 2 Michail Vourlakos 2018-12-05 14:59:46 UTC
You can use Meta+' for showing numbers for what you are requesting can be only X11 specific and I don't think a solution exists, 

Feel free of course for anyone to play with this and send any patch for review...
Comment 3 trmdi 2019-01-05 03:13:33 UTC
Is there any way to display shortcut badges while holding the Meta button?
Because when users are holding it, that means they arr not remembering what the needed key is, Latte should display badges in that case to guide them. Press Meta+` is a bit inconvenient.
Comment 4 Michail Vourlakos 2019-01-05 11:25:01 UTC
(In reply to trmdi from comment #3)
> Is there any way to display shortcut badges while holding the Meta button?

I thought this was not possible but now I remembered that global menu plasmoid is showing underscores when Alt is hold down. I can check if this could some how enabled also for Meta.
Comment 5 Michail Vourlakos 2019-01-05 11:27:48 UTC
(In reply to trmdi from comment #3)
> Is there any way to display shortcut badges while holding the Meta button?

ok not possible, this is achieved through :

        PlasmaCore.DataSource {
            id: keystateSource
            engine: "keystate"
            connectedSources: ["Alt"]
        }

in global menu plasmoid. For Meta is does not work.
Comment 6 trmdi 2019-01-05 11:55:59 UTC
Hmm, we should ask @mgraesslin because he is a Kwin master. I guess it relates to Kwin. Is it possible?
Comment 7 trmdi 2019-01-05 12:00:34 UTC
Unity can do it, why can't KDE do?
Comment 8 Michail Vourlakos 2019-01-05 12:01:37 UTC
(In reply to trmdi from comment #7)
> Unity can do it, why can't KDE do?

asking plasma devs how this could be achieved both for X11 and wayland is a good idea
Comment 9 Martin Flöser 2019-01-05 12:44:25 UTC
(In reply to trmdi from comment #6)
> Hmm, we should ask @mgraesslin because he is a Kwin master. I guess it
> relates to Kwin. Is it possible?

I'm sorry, but I don't understand what this bug report is about.
Comment 10 trmdi 2019-01-05 12:53:02 UTC
(In reply to Martin Flöser from comment #9)
> I'm sorry, but I don't understand what this bug report is about.

Thanks for your reply.
The question is: Can we make the thing Unity did? Catch the Meta/Super/Win key holding event from Latte dock?
Comment 11 Martin Flöser 2019-01-05 18:24:22 UTC
I have no idea what unity did, I have no idea what Latte does. Please explain things so that someone not knowing the feature can understand.
Comment 12 trmdi 2019-01-05 18:38:34 UTC
(In reply to Martin Flöser from comment #11)
> I have no idea what unity did, I have no idea what Latte does. Please
> explain things so that someone not knowing the feature can understand.

Sorry, I meant, we want to detect when the user holds the Meta key in about x seconds (and when he releases the key afterwards). Is it possible? Could you please suggest some idea?
Comment 13 Martin Flöser 2019-01-06 08:15:22 UTC
It's possible on X11, it's impossible on Wayland without support from KWin. On X11 it's a mess and I strongly advise against trying to do anything about it. KWin has detection on X11 for when Meta is pressed, but the code is still not correct - after years.
Comment 14 Michail Vourlakos 2019-01-06 11:24:47 UTC
(In reply to Martin Flöser from comment #13)
> It's possible on X11, it's impossible on Wayland without support from KWin.
> On X11 it's a mess and I strongly advise against trying to do anything about
> it. KWin has detection on X11 for when Meta is pressed, but the code is
> still not correct - after years.

yeah I agree, I do not also like X11-only-centric solutions.

Plasma is using an approach for this when is trying to catch the Alt key pressing, the following code is found in the Global menu plasmoid:


        PlasmaCore.DataSource {
            id: keystateSource
            engine: "keystate"
            connectedSources: ["Alt"]
        }

I suppose that this should not work under wayland...

Best approach for this is:

1. make engine: "keystate" to support "Meta" under X11
2. make engine: "keystate" to support this also under wayland probably through kwin.
Comment 15 Martin Flöser 2019-01-06 15:51:11 UTC
The KeyState datasource is using KModifierKeyInfo internally. This class is currently not yet ported to Wayland and can - in it's current way - not support Wayland. On Wayland modifier state is only sent to the application having the keyboard focus. For something like Latte this is no solution, you normally don't have keyboard focus. KModifierKeyInfo will still work for many other things in applications, but not for things like global listening.

Please note that I doubt that this class handles all corner cases correctly (as that's impossible) on X11.
Comment 16 Michail Vourlakos 2019-01-19 16:32:11 UTC
as discussed this should be handled first upstream in order to reach in a state that Latte can support it
Comment 17 trmdi 2019-01-29 17:59:29 UTC
(In reply to Michail Vourlakos from comment #5)
> (In reply to trmdi from comment #3)
> > Is there any way to display shortcut badges while holding the Meta button?
> 
> ok not possible, this is achieved through :
> 
>         PlasmaCore.DataSource {
>             id: keystateSource
>             engine: "keystate"
>             connectedSources: ["Alt"]
>         }
> 
> in global menu plasmoid. For Meta is does not work.

If you change these lines like this, it works:

102 -> connectedSources: ["Super"]
118 -> var alt = keystateSource.data.Super;

Can you apply it in Latte ?
Comment 18 Michail Vourlakos 2019-01-29 19:19:18 UTC
(In reply to trmdi from comment #17)
> (In reply to Michail Vourlakos from comment #5)
> > (In reply to trmdi from comment #3)
> > > Is there any way to display shortcut badges while holding the Meta button?
> > 
> > ok not possible, this is achieved through :
> > 
> >         PlasmaCore.DataSource {
> >             id: keystateSource
> >             engine: "keystate"
> >             connectedSources: ["Alt"]
> >         }
> > 
> > in global menu plasmoid. For Meta is does not work.
> 
> If you change these lines like this, it works:
> 
> 102 -> connectedSources: ["Super"]
> 118 -> var alt = keystateSource.data.Super;
> 
> Can you apply it in Latte ?

It needs to be in c++, the responsible class is globalshortcuts.cpp and needs to be considered how to not break, Meta activates the application launcher,. I could accept any help for this
Comment 19 Michail Vourlakos 2019-02-01 17:14:26 UTC
Git commit 6f1c66f7d20283dc6fec4ff56fc682d75bf69eb2 by Michail Vourlakos.
Committed on 01/02/2019 at 17:14.
Pushed by mvourlakos into branch 'master'.

Display shortcut badges while holding Super

Summary:
Use `KModifierKeyInfo` to display shortcut badges while holding Super

Test Plan:
Just playing with it.
I still don't understand the `GlobalShortcut` class very well, correct me if I make any mistake.

Reviewers: #latte_dock, mvourlakos

Reviewed By: #latte_dock, mvourlakos

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D18620

M  +1    -1    CMakeLists.txt
M  +1    -0    README.md
M  +1    -0    app/CMakeLists.txt
M  +17   -0    app/globalshortcuts.cpp
M  +6    -0    app/globalshortcuts.h

https://commits.kde.org/latte-dock/6f1c66f7d20283dc6fec4ff56fc682d75bf69eb2