~ubuntu-branches/ubuntu/saucy/cairo-dock-plug-ins/saucy

« back to all changes in this revision

Viewing changes to Xgamma/src/applet-init.c

Tags: upstream-3.0.0.0beta1
ImportĀ upstreamĀ versionĀ 3.0.0.0beta1

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
#include <X11/extensions/xf86vmode.h>
26
26
#include <ctype.h>
27
27
#include <stdlib.h>
 
28
#include <gdk/gdkx.h>
28
29
 
29
30
#include <cairo-dock.h>
30
31
 
58
59
        CD_APPLET_REGISTER_FOR_MIDDLE_CLICK_EVENT;
59
60
        CD_APPLET_REGISTER_FOR_SCROLL_EVENT;
60
61
        
 
62
        // shortkey
 
63
        myData.pKeyBinding = CD_APPLET_BIND_KEY (myConfig.cShortkey,
 
64
                D_("Increase the brightness"),
 
65
                "Configuration", "shortkey",
 
66
                (CDBindkeyHandler) cd_xgamma_on_keybinding_pull);
 
67
        myData.pKeyBinding2 = CD_APPLET_BIND_KEY (myConfig.cShortkey2,
 
68
                D_("Decrease the brightness"),
 
69
                "Configuration", "shortkey",
 
70
                (CDBindkeyHandler) cd_xgamma_on_keybinding_pull2);
 
71
        
61
72
        if (! s_bVideoExtensionChecked)
62
73
        {
63
74
                s_bVideoExtensionChecked = TRUE;
124
135
        CD_APPLET_UNREGISTER_FOR_MIDDLE_CLICK_EVENT;
125
136
        CD_APPLET_UNREGISTER_FOR_SCROLL_EVENT;
126
137
        
 
138
        cd_keybinder_unbind (myData.pKeyBinding);
 
139
        cd_keybinder_unbind (myData.pKeyBinding2);
 
140
        
127
141
        if (myData.iSidScrollAction != 0)
128
142
                g_source_remove (myData.iSidScrollAction);
129
143
CD_APPLET_STOP_END
162
176
                        double fGamma = xgamma_get_gamma (&myData.Xgamma);
163
177
                        cd_gamma_display_gamma_on_label (fGamma);
164
178
                }
 
179
                
 
180
                cd_keybinder_rebind (myData.pKeyBinding, myConfig.cShortkey, NULL);
 
181
                cd_keybinder_rebind (myData.pKeyBinding2, myConfig.cShortkey2, NULL);
165
182
        }
166
183
        
167
184
        if (myDock)