Merge lp:~ksamak/compiz/showmouse_autostart_option into lp:compiz/0.9.13

Proposed by ksamak
Status: Superseded
Proposed branch: lp:~ksamak/compiz/showmouse_autostart_option
Merge into: lp:compiz/0.9.13
Diff against target: 63 lines (+24/-0)
3 files modified
plugins/showmouse/showmouse.xml.in (+5/-0)
plugins/showmouse/src/showmouse.cpp (+16/-0)
plugins/showmouse/src/showmouse.h (+3/-0)
To merge this branch: bzr merge lp:~ksamak/compiz/showmouse_autostart_option
Reviewer Review Type Date Requested Status
Sam Spilsbury Pending
Marco Trevisan (TreviƱo) Pending
Review via email: mp+315652@code.launchpad.net

This proposal supersedes a proposal from 2017-01-19.

This proposal has been superseded by a proposal from 2017-03-02.

Commit message

showmouse: added autostart option

Description of the change

added startup option to showmouse plugin

To post a comment you must log in.
Revision history for this message
Sam Spilsbury (smspillaz) : Posted in a previous version of this proposal
review: Needs Fixing
Revision history for this message
Sam Spilsbury (smspillaz) :
4108. By ksamak <ksamak@ksalaptop>

fix indentation

Revision history for this message
ksamak (ksamak) wrote :

hi,
fixed indentation, and commented on timer use.
thanks for your time.

4109. By ksamak <ksamak@ksalaptop>

showmouse: used Notify trick to implement startup mechanism

4110. By ksamak <ksamak@ksalaptop>

coding style

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/showmouse/showmouse.xml.in'
2--- plugins/showmouse/showmouse.xml.in 2016-05-31 17:30:42 +0000
3+++ plugins/showmouse/showmouse.xml.in 2017-03-02 07:54:34 +0000
4@@ -19,6 +19,11 @@
5 <options>
6 <group>
7 <_short>General</_short>
8+ <option name="activate_at_startup" type="bool">
9+ <_short>plugin should be active at startup</_short>
10+ <_long>If active, the plugin will start active, with the mouse enhanced</_long>
11+ <default>false</default>
12+ </option>
13 <option name="initiate" type="key">
14 <_short>Initiate</_short>
15 <_long>Toggle the mouse pointer trail.</_long>
16
17=== modified file 'plugins/showmouse/src/showmouse.cpp'
18--- plugins/showmouse/src/showmouse.cpp 2016-05-31 17:30:42 +0000
19+++ plugins/showmouse/src/showmouse.cpp 2017-03-02 07:54:34 +0000
20@@ -660,6 +660,17 @@
21 return true;
22 }
23
24+bool ShowmouseScreen::checkStartup () {
25+ if (optionGetActivateAtStartup()) {
26+ active = true;
27+ toggleFunctions (true);
28+ gScreen->glPaintOutputSetEnabled (gScreen, true);
29+ }
30+ timeoutHandle.stop();
31+ return false;
32+}
33+
34+
35 ShowmouseScreen::ShowmouseScreen (CompScreen *screen) :
36 PluginClassHandler <ShowmouseScreen, CompScreen> (screen),
37 cScreen (CompositeScreen::get (screen)),
38@@ -687,6 +698,11 @@
39 this, _1, _2, _3));
40 optionSetInitiateEdgeTerminate (boost::bind (&ShowmouseScreen::terminate,
41 this, _1, _2, _3));
42+
43+
44+ timeoutHandle.setTimes (1, 2);
45+ timeoutHandle.setCallback (boost::bind (&ShowmouseScreen::checkStartup, this));
46+ timeoutHandle.start ();
47 }
48
49 ShowmouseScreen::~ShowmouseScreen ()
50
51=== modified file 'plugins/showmouse/src/showmouse.h'
52--- plugins/showmouse/src/showmouse.h 2016-05-31 17:30:42 +0000
53+++ plugins/showmouse/src/showmouse.h 2017-03-02 07:54:34 +0000
54@@ -138,6 +138,9 @@
55 float rot;
56
57 MousePoller pollHandle;
58+ CompTimer timeoutHandle;
59+
60+ bool checkStartup ();
61
62 void
63 preparePaint (int);

Subscribers

People subscribed via source and target branches