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

Proposed by ksamak
Status: Superseded
Proposed branch: lp:~ksamak/compiz/obs_default_spawn_values
Merge into: lp:compiz/0.9.13
Diff against target: 106 lines (+35/-2)
3 files modified
plugins/obs/obs.xml.in (+21/-0)
plugins/obs/src/obs.cpp (+10/-2)
plugins/obs/src/obs.h (+4/-0)
To merge this branch: bzr merge lp:~ksamak/compiz/obs_default_spawn_values
Reviewer Review Type Date Requested Status
Marco Trevisan (TreviƱo) Pending
Review via email: mp+315107@code.launchpad.net

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

Commit message

obs: added default o/b/s spawn values for new windows

Description of the change

added default spawn values for new windows to obs plugin

To post a comment you must log in.
4107. By ksamak <ksamak@ksalaptop>

fix 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/obs/obs.xml.in'
2--- plugins/obs/obs.xml.in 2013-05-08 16:25:57 +0000
3+++ plugins/obs/obs.xml.in 2017-03-02 08:02:32 +0000
4@@ -35,6 +35,13 @@
5 <_long>Decrease the opacity of the window the pointer hovers.</_long>
6 <default>&lt;Alt&gt;Button5</default>
7 </option>
8+ <option name="default_opacity_spawn_value" type="int">
9+ <_short>New window default opacity value</_short>
10+ <_long>Default opacity when a new window is created (in percent).</_long>
11+ <min>1</min>
12+ <max>100</max>
13+ <default>100</default>
14+ </option>
15 <option name="opacity_step" type="int">
16 <_short>Step Size</_short>
17 <_long>Opacity increment and decrement amount (in percent).</_long>
18@@ -84,6 +91,13 @@
19 <_long>Decrease the brightness of the window the pointer hovers.</_long>
20 <default/>
21 </option>
22+ <option name="default_brightness_spawn_value" type="int">
23+ <_short>New window default brightness value</_short>
24+ <_long>Default brightness when a new window is created (in percent).</_long>
25+ <min>1</min>
26+ <max>100</max>
27+ <default>100</default>
28+ </option>
29 <option name="brightness_step" type="int">
30 <_short>Step Size</_short>
31 <_long>Brightness increment and decrement amount (in percent).</_long>
32@@ -133,6 +147,13 @@
33 <_long>Decrease the saturation of the window the pointer hovers.</_long>
34 <default/>
35 </option>
36+ <option name="default_saturation_spawn_value" type="int">
37+ <_short>New window default saturation value</_short>
38+ <_long>Default saturation when a new window is created (in percent).</_long>
39+ <min>1</min>
40+ <max>100</max>
41+ <default>100</default>
42+ </option>
43 <option type="int" name="saturation_step">
44 <_short>Step Size</_short>
45 <_long>Saturation increment and decrement amount (in percent).</_long>
46
47=== modified file 'plugins/obs/src/obs.cpp'
48--- plugins/obs/src/obs.cpp 2013-05-10 06:33:42 +0000
49+++ plugins/obs/src/obs.cpp 2017-03-02 08:02:32 +0000
50@@ -24,6 +24,7 @@
51 */
52
53 #include "obs.h"
54+#include "obs_options.h"
55
56 COMPIZ_PLUGIN_20090315 (obs, ObsPluginVTable);
57
58@@ -60,7 +61,7 @@
59 if (modifier == MODIFIER_OPACITY &&
60 (window->type ()& CompWindowTypeDesktopMask))
61 {
62- customFactor[modifier] = 100;
63+ customFactor[modifier] = startFactor[modifier];
64 matchFactor[modifier] = 100;
65 }
66 else
67@@ -279,11 +280,18 @@
68 oScreen (ObsScreen::get (screen))
69 {
70 GLWindowInterface::setHandler (gWindow, false);
71+ OBS_SCREEN(screen);
72+ startFactor[MODIFIER_OPACITY] = os->optionGetDefaultOpacitySpawnValue ();
73+ startFactor[MODIFIER_BRIGHTNESS] = os->optionGetDefaultBrightnessSpawnValue ();
74+ startFactor[MODIFIER_SATURATION] = os->optionGetDefaultSaturationSpawnValue ();
75
76 for (unsigned int i = 0; i < MODIFIER_COUNT; ++i)
77 {
78- customFactor[i] = 100;
79+ customFactor[i] = startFactor[i];
80 matchFactor[i] = 100;
81+ if (customFactor[i] != 100) {
82+ modifierChanged (i);
83+ }
84
85 /* defer initializing the factors from window matches as match evalution
86 * means wrapped function calls */
87
88=== modified file 'plugins/obs/src/obs.h'
89--- plugins/obs/src/obs.h 2013-05-08 16:05:43 +0000
90+++ plugins/obs/src/obs.h 2017-03-02 08:02:32 +0000
91@@ -87,11 +87,15 @@
92 ObsScreen *oScreen;
93
94 int customFactor[MODIFIER_COUNT];
95+ int startFactor[MODIFIER_COUNT];
96 int matchFactor[MODIFIER_COUNT];
97
98 CompTimer updateHandle;
99 };
100
101+#define OBS_SCREEN(s) \
102+ ObsScreen *os = ObsScreen::get (s);
103+
104 class ObsPluginVTable :
105 public CompPlugin::VTableForScreenAndWindow<ObsScreen, ObsWindow>
106 {

Subscribers

People subscribed via source and target branches