This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Duplicate mouse mark effect

Tags: None
(comma "," separated)
VeraS
Registered Member
Posts
11
Karma
0

Duplicate mouse mark effect

Fri Apr 04, 2014 8:48 pm
Hi,

I'd like to have different mouse mark effects activated by different keyboard shortcuts so that I can change the mark color "on the fly" while I'm recording video tutorials.

Since it is not possible to change the mark color without opening systemsettings, etc. I thought that I could create another effect with a different name copying the code of actual mouse mark effect. Then I would set a different color for the "mouse mark2" effect and call it via a different shortcut.

However, it turned out that cloning the effect is not as simple as I thought, because if I simply take the code in kwin/effects/mousemark/ and try to compile it as if it was a standalone effect it does not compile.

So my questions are: how could I achieve my goal? How difficult would it be to make the mouse mark effect a standalone effect? Is there a better solution?
luebking
Karma
0

Re: Duplicate mouse mark effect

Sat Apr 05, 2014 1:47 pm
Since it is not possible to change the mark color without opening systemsettings, etc.

That's not entirely correct. It's possible to write the config and trigger a reload in eg. a bash script or something like that and bind this to a global shortcut.

Code: Select all
kwriteconfig --file kwinrc --group Effect-MouseMark --key Color "<r>,<g>,<b>"
qdbus org.kde.kwin /Effects reconfigureEffect kwin4_effect_mousemark


Ensure that qdbus is found and DBUS_SESSION_BUS_ADDRESS is exported in "env" when running this from a script.
Also notice that the color of the already marked region will change as well.

IIRC there's been a bugwish to have more colors an make the effect touch-compatible etc. what wil require some rewrite.
To make it compile standalone, you'll need to write a proper CMakeLists.txt, eg. compare present 3rd party effects from eg. kde-look.org for this.
VeraS
Registered Member
Posts
11
Karma
0

Re: Duplicate mouse mark effect

Sat Apr 05, 2014 6:59 pm
This is a nice workaround but unfortunately has a big drawback: if you write a, say, red mark on the screen and then change the mark color via the shortcut, in some scenarios all the red marks already drawn will be changed to the new color. This happens for example if you are viewing a pdf and switch to the next page, or if you "touch" a previous mark with a new one.

Do you know if cloning the effect would produce the same drawback?
luebking
Karma
0

Re: Duplicate mouse mark effect

Sat Apr 05, 2014 7:18 pm
Yes, I actually mentioned that ;-)

Just "cloning" the effect would cause the same, you'd at least have to adapt it to read/write different config settings, but the sane solution here would probably be to fix/extend the present effect to allow for more colors/layers etc.
VeraS
Registered Member
Posts
11
Karma
0

Re: Duplicate mouse mark effect

Sat Apr 05, 2014 10:00 pm
whoops! I was so happy for the workaround that I missed that part of your post, sorry o)

Anyway, I searched for a feature request about multi-color mouse mark and could not find any. I found this list of wishes. Should I open a new wish for this specific issue?
luebking
Karma
0

Re: Duplicate mouse mark effect

Sun Apr 06, 2014 8:38 am
That would be the list - may have just been on the forum, sorry - my bad this time ;-)


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], q.ignora, watchstar