~cairo-dock-team/ubuntu/quantal/cairo-dock-plug-ins/3.0.2

« back to all changes in this revision

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

Tags: upstream-2.2.0~0beta4
ImportĀ upstreamĀ versionĀ 2.2.0~0beta4

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
double xgamma_get_gamma (XF86VidModeGamma *pGamma)
27
27
{
28
28
        g_return_val_if_fail (pGamma != NULL, 1);
29
 
        const Display *dpy = cairo_dock_get_Xdisplay ();
 
29
        Display *dpy = gdk_x11_get_default_xdisplay ();
30
30
        
31
31
        g_return_val_if_fail (XF86VidModeGetGamma != NULL, 1.);
32
32
        if (!XF86VidModeGetGamma (dpy, DefaultScreen (dpy), pGamma))
41
41
void xgamma_set_gamma (XF86VidModeGamma *pGamma)
42
42
{
43
43
        g_return_if_fail (pGamma != NULL);
44
 
        const Display *dpy = cairo_dock_get_Xdisplay ();
 
44
        Display *dpy = cairo_dock_get_Xdisplay ();
45
45
        
46
46
        g_return_if_fail (XF86VidModeSetGamma != NULL);
47
47
        if (!XF86VidModeSetGamma(dpy, DefaultScreen (dpy), pGamma))
101
101
        }
102
102
        xgamma_set_gamma (&myData.Xgamma);
103
103
}
104
 
static GtkWidget *_xgamma_add_channel_widget (GtkWidget *pInteractiveWidget, gchar *cLabel, int iChannelNumber, guint *iSignalID, double fChannelGamma)
 
104
static GtkWidget *_xgamma_add_channel_widget (GtkWidget *pInteractiveWidget, const gchar *cLabel, int iChannelNumber, guint *iSignalID, double fChannelGamma)
105
105
{
106
106
        GtkWidget *pLabel = gtk_label_new (cLabel);
107
107
        gtk_table_attach_defaults (GTK_TABLE (pInteractiveWidget), pLabel, 0, 1, iChannelNumber, iChannelNumber+1);
156
156
{
157
157
        CairoDialogAttribute attr;
158
158
        memset (&attr, 0, sizeof (CairoDialogAttribute));
159
 
        attr.cText = D_("Set up gamma :");
 
159
        attr.cText = D_("Set up gamma:");
160
160
        attr.pInteractiveWidget = myData.pWidget;
161
 
        gchar *cButtons[3] = {"ok", "cancel", NULL};
 
161
        const gchar *cButtons[3] = {"ok", "cancel", NULL};
162
162
        attr.cButtonsImage = cButtons;
163
163
        attr.pActionFunc = (CairoDockActionOnAnswerFunc) xgamma_apply_values;
164
164
        attr.pUserData = myApplet;
179
179
        else
180
180
        {
181
181
                cairo_dock_add_interactive_widget_to_desklet (myData.pWidget, myDesklet);
182
 
                cairo_dock_set_desklet_renderer_by_name (myDesklet, NULL, NULL, ! CAIRO_DOCK_LOAD_ICONS_FOR_DESKLET, NULL);
 
182
                CD_APPLET_SET_DESKLET_RENDERER (NULL);  // pour empecher le clignotement du au double-buffer.
 
183
                CD_APPLET_SET_STATIC_DESKLET;
183
184
        }
184
185
}