blue-systems / plasma-ideas

Keeping track of various ideas for plasma
0 stars 0 forks source link

mouse pointer: change shape on hover for single-click #19

Open star-buck opened 10 years ago

star-buck commented 10 years ago

mouse-pointer-single-click

eikehein commented 10 years ago

I investigated this, and I'm sad to say it's not looking good at all, as I had suspected.

I'm afraid I need to explain the technical background a bit, but I will try to keep it simple.

In KDE 4, the KDE library API for applications contains an API called "KGlobalSettings". KGlobalSettings allows application authors to look up some desktop-wide settings, many of which can be changed in System Settings. KGlobalSettings also contains the D-Bus-based magic that allows System Settings to notify already-running applications when the settings change.

KGlobalSettings is also the place where application authors can look up and get informed of the state of the "changeCursorOverIcon" setting.

You can guess where this is leading to: Every application that needs to be aware of this setting has to have code that is mindful of it. And right now, nothing does, only a few odd apps where developers accidentally became aware the setting exists, like a widget in Digikam. Dolphin, System Settings, file dialogs - none of these things looks at the setting right now.

Here is how this could happen: KDE's libraries contain a number of UI widgets for applications to use. In KDE 2/3, it contained a lot more, including list and icon view classes. When KDE 4 came around, we dropped our own classes for this, because Qt had improved and we could use Qt ones. However, the KDE ones had code to follow this setting, and so apps using standard KDE UI widgets had support for the setting automatically. The Qt ones on the other hand are not aware of the setting.

This is part of the reason why in KDE 5, we have eliminated KGlobalSettings. Instead, we have upstreamed a lot of settings into Qt's QStyle and platform plugin system, so KDE's platform plugin and Oxygen can implement following our settings. The benefit is that application authors don't need to know the settings exist in many common cases, similar to the KDE 3 situation. I am currently not on top of what specifically was done for the "changeCursorOverIcon" setting, however. Someone who worked more on the KF5 upstreaming tasks has to be asked.

In any case, I highly recommend that we postpone trying to solve this to KDE 5 / 2014. Right now, the alternative would be writing a lot of patches for kdelibs, Dolphin, and many other codebases, adding support for the setting everywhere. While that is doable in principle, it also means writing new code that has to be thrown away for KDE 5 again (since KGlobalSettings is gone there), and it would be a distraction from our M2 goal. There is also not enough time until the upcoming Netrunner release to do it before then.

star-buck commented 7 years ago

since singleclick is really great in kde plasma, this still is awesome when working to match internet mouse point shape. @davidedmundson : any chance after 3.5 years?

davidedmundson commented 7 years ago

If you want it, I'll have a go. I can't say how feasible it is yet.

I don't think we want to go down the route of changing every single item view. There are literally thousands of them.

It might be possible with a QStyle feature that I can then add to our breeze patches.

star-buck commented 7 years ago

Please give it a shot and evaluate how this is doable.

davidedmundson commented 7 years ago

I've been investigating

I've made a QStyle that implements this in 95% of cases. I've added it to that breeze patches folder.

This works in systemsettings, file open dialogs, gwenview's file browse, the sidebars in most config dialogs.

It doesn't work in Dolphin, because they are special and fork the basic item views from Qt - at which point things can pretty much only be patched in Dolphin.

It also doesn't work in the places where we've done things in QtQuick; I can't find any solution other than patching all of those separately :(

star-buck commented 7 years ago

Any chance we can restore that setting, like it was there in kde4? Maybe then people are encouraged to make it consistent again in those 5% special cases.

star-buck commented 7 years ago

ping ^^

davidedmundson commented 7 years ago

I can restore the UI setting easily, but it's hard to restore the part of kdelibs responsible for reading this setting in a way usable by apps.

The way setting used to be exposed to apps is through this class called KGlobalSettings, which was got rid of intentionally as frameworks shouldn't be doing Plasma specific things. Style settings, should be proxied through Qt API. This mostly works perfectly except there's no Qt setting for one for this specific option, like there is for single click activate.

There was so much work in getting this split, that I know if I submit a patch that goes in the face of that it'd get rejected.

In addition the option was removed because (quoting the commit) "Since they actually do nothing" [1] based on a bug report[2] that was even before frameworks. If no-one bothered doing it when there was a nice piece of API in kdelibs to get the setting, there's even less chance now.

I'm happy to do the work, I can patch Netrunner easily, but I honestly don't think there's a nice solution that could get into upstream.

[1]https://cgit.kde.org/plasma-desktop.git/commit/?id=ef882aba3799182e5899cfb9f47616b5d6ef7c4a [2]https://bugs.kde.org/show_bug.cgi?id=311594

notmart commented 7 years ago

it will always be incomplete, but could make sense to have this just as default/only behavior in the parts that can be done, so breeze,plasma,dolphin? the setting yeah, probably not going to really work

star-buck commented 7 years ago

There was a setting in kde4, and the idea gets more relevant with each day people expect internet apps, websites, etc. to work more seamless in an environment with native apps. It would be nice to restore the setting and even encourage a freedesktop standard for others to follow/incorporate in their apps/DEs.

notmart commented 7 years ago

on Qt side, a place that could make sense would be expanding QPlatformTheme to do so (like QPlatformTheme::themeHint(SingleClickMouseCursor) ) then would be our implementation of it returning either the arrow or the hand cursor depending on the setting. tough this would need Qt people accepting this (and still every application then explicitly following it)

eikehein commented 7 years ago

We've expanded QStyleHints with similar things upstream in the past.

davidedmundson commented 7 years ago

I'll make a Qt patch and see where that takes us.

davidedmundson commented 7 years ago

Qt patch here: https://codereview.qt-project.org/#/c/198940/

As well as the style hint I've also moved the code affecting item views from breeze into Qt itself, because of that it'll work a bit better and is a lot neater.