~walkerlee/totem/pre-interview

« back to all changes in this revision

Viewing changes to lib/totem-scrsaver.c

  • Committer: Package Import Robot
  • Author(s): Jeremy Bicha
  • Date: 2013-05-26 00:07:51 UTC
  • mfrom: (1.6.1) (24.1.4 experimental)
  • Revision ID: package-import@ubuntu.com-20130526000751-kv8ap3x1di4qq8j2
Tags: 3.8.2-0ubuntu1
* Sync with Debian. Remaining changes: 
* debian/control.in:
  - Drop build-depends on libepc-ui-dev and libgrilo-0.2-dev (in universe)
  - Drop libxtst-dev build-depends so that the (redundant) fake key presses
    for inhibiting the screensaver are disabled (LP: #1007438)
  - Build-depend on libzeitgeist-dev
  - Suggest rather than recommend gstreamer components in universe
  - Add totem-plugins-extra
  - Add XB-Npp-Description and XB-Npp-Filename header to the 
    totem-mozilla package to improve ubufox/ubuntu plugin db integration 
  - Refer to Firefox in totem-mozilla description instead of Iceweasel
  - Don't have totem-mozilla recommend any particular browser
  - Drop obsolete python library dependencies since iplayer is no longer
    included
* debian/totem-common.install, debian/source_totem.py:
  - Install Ubuntu apport debugging hook
* debian/totem-plugins-extra.install:
  - Universe plugins split out of totem-plugins (currently only gromit)
* debian/totem-plugins.install:    
  - Skip the plugins split to -extra and add the zeitgeist plugin
* debian/rules:
  - Build with --fail-missing, to ensure we install everything. 
    + Ignore libtotem.{,l}a since we delibrately don't install these.
  - Re-enable hardening, make sure both PIE and BINDNOW are used
    by setting hardening=+all. (LP: #1039604)
* debian/patches/91_quicklist_entries.patch:
  - Add static quicklist
* debian/patches/92_gst-plugins-good.patch:
  - Build without unnecessary gstreamer1.0-bad dependency
* debian/patches/93_grilo_optional.patch:
  - Allow building without grilo while grilo MIR is still pending
* debian/patches/correct_desktop_mimetypes.patch:
  - Don't list the mimetypes after the unity lists
* debian/patches/revert_shell_menu.patch: 
  - revert the use of a shell menu until indicator-appmenu can handle
    the mixed shell/traditional menus itself
* New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
2
 
 
3
 
   Copyright (C) 2004-2006 Bastien Nocera <hadess@hadess.net>
4
 
   Copyright © 2010 Christian Persch
5
 
   Copyright © 2010 Carlos Garcia Campos
6
 
 
7
 
   The Gnome Library is free software; you can redistribute it and/or
8
 
   modify it under the terms of the GNU Library General Public License as
9
 
   published by the Free Software Foundation; either version 2 of the
10
 
   License, or (at your option) any later version.
11
 
 
12
 
   The Gnome Library is distributed in the hope that it will be useful,
13
 
   but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15
 
   Library General Public License for more details.
16
 
 
17
 
   You should have received a copy of the GNU Library General Public
18
 
   License along with the Gnome Library; see the file COPYING.LIB.  If not,
19
 
   write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20
 
   Boston, MA 02110-1301  USA.
21
 
 
22
 
   Authors: Bastien Nocera <hadess@hadess.net>
23
 
            Christian Persch
24
 
            Carlos Garcia Campos
25
 
 */
26
 
 
27
 
#include "config.h"
28
 
 
29
 
#include <glib/gi18n.h>
30
 
 
31
 
#include <gtk/gtk.h>
32
 
 
33
 
#ifdef GDK_WINDOWING_X11
34
 
#include <gdk/gdkx.h>
35
 
#include <X11/keysym.h>
36
 
 
37
 
#undef HAVE_XTEST
38
 
 
39
 
#ifdef HAVE_XTEST
40
 
#include <X11/extensions/XTest.h>
41
 
#endif /* HAVE_XTEST */
42
 
#endif /* GDK_WINDOWING_X11 */
43
 
 
44
 
#include "totem-scrsaver.h"
45
 
 
46
 
#define GS_SERVICE   "org.gnome.SessionManager"
47
 
#define GS_PATH      "/org/gnome/SessionManager"
48
 
#define GS_INTERFACE "org.gnome.SessionManager"
49
 
/* From org.gnome.SessionManager.xml */
50
 
#define GS_NO_IDLE_FLAG 8
51
 
 
52
 
#define XSCREENSAVER_MIN_TIMEOUT 60
53
 
 
54
 
enum {
55
 
        PROP_0,
56
 
        PROP_REASON,
57
 
        PROP_WINDOW
58
 
};
59
 
 
60
 
static void totem_scrsaver_finalize   (GObject *object);
61
 
 
62
 
struct TotemScrsaverPrivate {
63
 
        /* Whether the screensaver is disabled */
64
 
        gboolean disabled;
65
 
        /* The reason for the inhibition */
66
 
        char *reason;
67
 
 
68
 
        GDBusProxy *gs_proxy;
69
 
        gboolean have_session_dbus;
70
 
        guint32 cookie;
71
 
        GtkWindow *window;
72
 
 
73
 
        /* To save the screensaver info */
74
 
        int timeout;
75
 
        int interval;
76
 
        int prefer_blanking;
77
 
        int allow_exposures;
78
 
 
79
 
        /* For use with XTest */
80
 
        int keycode1, keycode2;
81
 
        int *keycode;
82
 
        gboolean have_xtest;
83
 
};
84
 
 
85
 
G_DEFINE_TYPE(TotemScrsaver, totem_scrsaver, G_TYPE_OBJECT)
86
 
 
87
 
static gboolean
88
 
screensaver_is_running_dbus (TotemScrsaver *scr)
89
 
{
90
 
        return scr->priv->have_session_dbus;
91
 
}
92
 
 
93
 
static void
94
 
on_inhibit_cb (GObject      *source_object,
95
 
               GAsyncResult *res,
96
 
               gpointer      user_data)
97
 
{
98
 
        GDBusProxy    *proxy = G_DBUS_PROXY (source_object);
99
 
        TotemScrsaver *scr = TOTEM_SCRSAVER (user_data);
100
 
        GVariant      *value;
101
 
        GError        *error = NULL;
102
 
 
103
 
        value = g_dbus_proxy_call_finish (proxy, res, &error);
104
 
        if (!value) {
105
 
                g_warning ("Problem inhibiting the screensaver: %s", error->message);
106
 
                g_object_unref (scr);
107
 
                g_error_free (error);
108
 
 
109
 
                return;
110
 
        }
111
 
 
112
 
        /* save the cookie */
113
 
        if (g_variant_is_of_type (value, G_VARIANT_TYPE ("(u)")))
114
 
                g_variant_get (value, "(u)", &scr->priv->cookie);
115
 
        else
116
 
                scr->priv->cookie = 0;
117
 
        g_variant_unref (value);
118
 
 
119
 
        g_object_unref (scr);
120
 
}
121
 
 
122
 
static void
123
 
on_uninhibit_cb (GObject      *source_object,
124
 
                 GAsyncResult *res,
125
 
                 gpointer      user_data)
126
 
{
127
 
        GDBusProxy    *proxy = G_DBUS_PROXY (source_object);
128
 
        TotemScrsaver *scr = TOTEM_SCRSAVER (user_data);
129
 
        GVariant      *value;
130
 
        GError        *error = NULL;
131
 
 
132
 
        value = g_dbus_proxy_call_finish (proxy, res, &error);
133
 
        if (!value) {
134
 
                g_warning ("Problem uninhibiting the screensaver: %s", error->message);
135
 
                g_object_unref (scr);
136
 
                g_error_free (error);
137
 
 
138
 
                return;
139
 
        }
140
 
 
141
 
        /* clear the cookie */
142
 
        scr->priv->cookie = 0;
143
 
        g_variant_unref (value);
144
 
 
145
 
        g_object_unref (scr);
146
 
}
147
 
 
148
 
static void
149
 
screensaver_inhibit_dbus (TotemScrsaver *scr,
150
 
                          gboolean       inhibit)
151
 
{
152
 
        TotemScrsaverPrivate *priv = scr->priv;
153
 
        GdkWindow *window;
154
 
 
155
 
        if (!priv->have_session_dbus)
156
 
                return;
157
 
 
158
 
        g_object_ref (scr);
159
 
 
160
 
        if (inhibit) {
161
 
                guint xid;
162
 
 
163
 
                g_return_if_fail (scr->priv->reason != NULL);
164
 
 
165
 
                xid = 0;
166
 
                if (scr->priv->window != NULL) {
167
 
                        window = gtk_widget_get_window (GTK_WIDGET (scr->priv->window));
168
 
                        if (window != NULL)
169
 
                                xid = gdk_x11_window_get_xid (window);
170
 
                }
171
 
 
172
 
 
173
 
                g_dbus_proxy_call (priv->gs_proxy,
174
 
                                   "Inhibit",
175
 
                                   g_variant_new ("(susu)",
176
 
                                                  g_get_application_name (),
177
 
                                                  xid,
178
 
                                                  scr->priv->reason,
179
 
                                                  GS_NO_IDLE_FLAG),
180
 
                                   G_DBUS_CALL_FLAGS_NO_AUTO_START,
181
 
                                   -1,
182
 
                                   NULL,
183
 
                                   on_inhibit_cb,
184
 
                                   scr);
185
 
        } else {
186
 
                if (priv->cookie > 0) {
187
 
                        g_dbus_proxy_call (priv->gs_proxy,
188
 
                                           "Uninhibit",
189
 
                                           g_variant_new ("(u)", priv->cookie),
190
 
                                           G_DBUS_CALL_FLAGS_NO_AUTO_START,
191
 
                                           -1,
192
 
                                           NULL,
193
 
                                           on_uninhibit_cb,
194
 
                                           scr);
195
 
                }
196
 
        }
197
 
}
198
 
 
199
 
static void
200
 
screensaver_enable_dbus (TotemScrsaver *scr)
201
 
{
202
 
        screensaver_inhibit_dbus (scr, FALSE);
203
 
}
204
 
 
205
 
static void
206
 
screensaver_disable_dbus (TotemScrsaver *scr)
207
 
{
208
 
        screensaver_inhibit_dbus (scr, TRUE);
209
 
}
210
 
 
211
 
static void
212
 
screensaver_dbus_proxy_new_cb (GObject      *source,
213
 
                               GAsyncResult *result,
214
 
                               gpointer      user_data)
215
 
{
216
 
        TotemScrsaver *scr = TOTEM_SCRSAVER (user_data);
217
 
        TotemScrsaverPrivate *priv = scr->priv;
218
 
 
219
 
        priv->gs_proxy = g_dbus_proxy_new_for_bus_finish (result, NULL);
220
 
        if (!priv->gs_proxy)
221
 
                return;
222
 
 
223
 
        priv->have_session_dbus = TRUE;
224
 
        if (priv->reason != NULL && scr->priv->disabled)
225
 
                screensaver_disable_dbus (scr);
226
 
}
227
 
 
228
 
static void
229
 
screensaver_init_dbus (TotemScrsaver *scr)
230
 
{
231
 
        g_dbus_proxy_new_for_bus (G_BUS_TYPE_SESSION,
232
 
                                  G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES | G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START,
233
 
                                  NULL,
234
 
                                  GS_SERVICE,
235
 
                                  GS_PATH,
236
 
                                  GS_INTERFACE,
237
 
                                  NULL,
238
 
                                  screensaver_dbus_proxy_new_cb,
239
 
                                  scr);
240
 
}
241
 
 
242
 
static void
243
 
screensaver_finalize_dbus (TotemScrsaver *scr)
244
 
{
245
 
        if (scr->priv->gs_proxy) {
246
 
                g_object_unref (scr->priv->gs_proxy);
247
 
        }
248
 
}
249
 
 
250
 
#ifdef GDK_WINDOWING_X11
251
 
static void
252
 
screensaver_enable_x11 (TotemScrsaver *scr)
253
 
{
254
 
 
255
 
#ifdef HAVE_XTEST
256
 
        if (scr->priv->have_xtest != FALSE)
257
 
        {
258
 
                g_source_remove_by_user_data (scr);
259
 
                return;
260
 
        }
261
 
#endif /* HAVE_XTEST */
262
 
 
263
 
        XLockDisplay (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()));
264
 
        XSetScreenSaver (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()),
265
 
                        scr->priv->timeout,
266
 
                        scr->priv->interval,
267
 
                        scr->priv->prefer_blanking,
268
 
                        scr->priv->allow_exposures);
269
 
        XUnlockDisplay (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()));
270
 
}
271
 
 
272
 
#ifdef HAVE_XTEST
273
 
static gboolean
274
 
fake_event (TotemScrsaver *scr)
275
 
{
276
 
        if (scr->priv->disabled)
277
 
        {
278
 
                /* If the video window isn't focused, don't send out the
279
 
                 * events. Note that it probably breaks when popups are used
280
 
                 * but we can't do much about that... */
281
 
                if (scr->priv->window != NULL &&
282
 
                    gtk_window_has_toplevel_focus (scr->priv->window) == FALSE)
283
 
                        return TRUE;
284
 
 
285
 
                XLockDisplay (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()));
286
 
                XTestFakeKeyEvent (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), *scr->priv->keycode,
287
 
                                True, CurrentTime);
288
 
                XTestFakeKeyEvent (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), *scr->priv->keycode,
289
 
                                False, CurrentTime);
290
 
                XUnlockDisplay (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()));
291
 
                /* Swap the keycode */
292
 
                if (scr->priv->keycode == &scr->priv->keycode1)
293
 
                        scr->priv->keycode = &scr->priv->keycode2;
294
 
                else
295
 
                        scr->priv->keycode = &scr->priv->keycode1;
296
 
        }
297
 
 
298
 
        return TRUE;
299
 
}
300
 
#endif /* HAVE_XTEST */
301
 
 
302
 
static void
303
 
screensaver_disable_x11 (TotemScrsaver *scr)
304
 
{
305
 
 
306
 
#ifdef HAVE_XTEST
307
 
        if (scr->priv->have_xtest != FALSE)
308
 
        {
309
 
                XLockDisplay (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()));
310
 
                XGetScreenSaver(GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), &scr->priv->timeout,
311
 
                                &scr->priv->interval,
312
 
                                &scr->priv->prefer_blanking,
313
 
                                &scr->priv->allow_exposures);
314
 
                XUnlockDisplay (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()));
315
 
 
316
 
                if (scr->priv->timeout != 0) {
317
 
                        g_timeout_add_seconds (scr->priv->timeout / 2,
318
 
                                               (GSourceFunc) fake_event, scr);
319
 
                } else {
320
 
                        g_timeout_add_seconds (XSCREENSAVER_MIN_TIMEOUT / 2,
321
 
                                               (GSourceFunc) fake_event, scr);
322
 
                }
323
 
 
324
 
                return;
325
 
        }
326
 
#endif /* HAVE_XTEST */
327
 
 
328
 
        XLockDisplay (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()));
329
 
        XGetScreenSaver(GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), &scr->priv->timeout,
330
 
                        &scr->priv->interval,
331
 
                        &scr->priv->prefer_blanking,
332
 
                        &scr->priv->allow_exposures);
333
 
        XSetScreenSaver(GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), 0, 0,
334
 
                        DontPreferBlanking, DontAllowExposures);
335
 
        XUnlockDisplay (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()));
336
 
}
337
 
 
338
 
static void
339
 
screensaver_init_x11 (TotemScrsaver *scr)
340
 
{
341
 
#ifdef HAVE_XTEST
342
 
        int a, b, c, d;
343
 
 
344
 
        XLockDisplay (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()));
345
 
        scr->priv->have_xtest = (XTestQueryExtension (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), &a, &b, &c, &d) == True);
346
 
        if (scr->priv->have_xtest != FALSE)
347
 
        {
348
 
                scr->priv->keycode1 = XKeysymToKeycode (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), XK_Alt_L);
349
 
                if (scr->priv->keycode1 == 0) {
350
 
                        g_warning ("scr->priv->keycode1 not existant");
351
 
                }
352
 
                scr->priv->keycode2 = XKeysymToKeycode (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), XK_Alt_R);
353
 
                if (scr->priv->keycode2 == 0) {
354
 
                        scr->priv->keycode2 = XKeysymToKeycode (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), XK_Alt_L);
355
 
                        if (scr->priv->keycode2 == 0) {
356
 
                                g_warning ("scr->priv->keycode2 not existant");
357
 
                        }
358
 
                }
359
 
                scr->priv->keycode = &scr->priv->keycode1;
360
 
        }
361
 
        XUnlockDisplay (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()));
362
 
#endif /* HAVE_XTEST */
363
 
}
364
 
 
365
 
static void
366
 
screensaver_finalize_x11 (TotemScrsaver *scr)
367
 
{
368
 
        g_source_remove_by_user_data (scr);
369
 
}
370
 
#endif
371
 
 
372
 
static void
373
 
totem_scrsaver_get_property (GObject *object,
374
 
                             guint property_id,
375
 
                             GValue *value,
376
 
                             GParamSpec *pspec)
377
 
{
378
 
        TotemScrsaver *scr;
379
 
 
380
 
        scr = TOTEM_SCRSAVER (object);
381
 
 
382
 
        switch (property_id)
383
 
        {
384
 
        case PROP_REASON:
385
 
                g_value_set_string (value, scr->priv->reason);
386
 
                break;
387
 
        case PROP_WINDOW:
388
 
                g_value_set_object (value, scr->priv->window);
389
 
                break;
390
 
        default:
391
 
                G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
392
 
        }
393
 
}
394
 
 
395
 
static void
396
 
totem_scrsaver_set_property (GObject *object,
397
 
                             guint property_id,
398
 
                             const GValue *value,
399
 
                             GParamSpec *pspec)
400
 
{
401
 
        TotemScrsaver *scr;
402
 
 
403
 
        scr = TOTEM_SCRSAVER (object);
404
 
 
405
 
        switch (property_id)
406
 
        {
407
 
        case PROP_REASON:
408
 
                g_free (scr->priv->reason);
409
 
                scr->priv->reason = g_value_dup_string (value);
410
 
                break;
411
 
        case PROP_WINDOW:
412
 
                if (scr->priv->window)
413
 
                        g_object_unref (scr->priv->window);
414
 
                scr->priv->window = g_value_dup_object (value);
415
 
                break;
416
 
        default:
417
 
                G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
418
 
        }
419
 
}
420
 
 
421
 
static void
422
 
totem_scrsaver_class_init (TotemScrsaverClass *klass)
423
 
{
424
 
        GObjectClass *object_class = G_OBJECT_CLASS (klass);
425
 
 
426
 
        g_type_class_add_private (klass, sizeof (TotemScrsaverPrivate));
427
 
 
428
 
        object_class->set_property = totem_scrsaver_set_property;
429
 
        object_class->get_property = totem_scrsaver_get_property;
430
 
        object_class->finalize = totem_scrsaver_finalize;
431
 
 
432
 
        g_object_class_install_property (object_class, PROP_REASON,
433
 
                                         g_param_spec_string ("reason", NULL, NULL,
434
 
                                                              NULL, G_PARAM_READWRITE));
435
 
        g_object_class_install_property (object_class, PROP_WINDOW,
436
 
                                         g_param_spec_object ("window", NULL, NULL,
437
 
                                                              GTK_TYPE_WINDOW, G_PARAM_READWRITE));
438
 
}
439
 
 
440
 
/**
441
 
 * totem_scrsaver_new:
442
 
 *
443
 
 * Creates a #TotemScrsaver object.
444
 
 * If the GNOME screen saver is running, it uses its DBUS interface to
445
 
 * inhibit the screensaver; otherwise it falls back to using the X
446
 
 * screensaver functionality for this.
447
 
 *
448
 
 * Returns: a newly created #TotemScrsaver
449
 
 */
450
 
TotemScrsaver *
451
 
totem_scrsaver_new (void)
452
 
{
453
 
        return TOTEM_SCRSAVER (g_object_new (TOTEM_TYPE_SCRSAVER, NULL));
454
 
}
455
 
 
456
 
static void
457
 
totem_scrsaver_init (TotemScrsaver *scr)
458
 
{
459
 
        scr->priv = G_TYPE_INSTANCE_GET_PRIVATE (scr,
460
 
                                                 TOTEM_TYPE_SCRSAVER,
461
 
                                                 TotemScrsaverPrivate);
462
 
 
463
 
        screensaver_init_dbus (scr);
464
 
#ifdef GDK_WINDOWING_X11
465
 
        screensaver_init_x11 (scr);
466
 
#else
467
 
#warning Unimplemented
468
 
#endif
469
 
}
470
 
 
471
 
void
472
 
totem_scrsaver_disable (TotemScrsaver *scr)
473
 
{
474
 
        g_return_if_fail (TOTEM_IS_SCRSAVER (scr));
475
 
 
476
 
        if (scr->priv->disabled != FALSE)
477
 
                return;
478
 
 
479
 
        scr->priv->disabled = TRUE;
480
 
 
481
 
        if (screensaver_is_running_dbus (scr) != FALSE)
482
 
                screensaver_disable_dbus (scr);
483
 
        else
484
 
#ifdef GDK_WINDOWING_X11
485
 
                screensaver_disable_x11 (scr);
486
 
#else
487
 
#warning Unimplemented
488
 
        {}
489
 
#endif
490
 
}
491
 
 
492
 
void
493
 
totem_scrsaver_enable (TotemScrsaver *scr)
494
 
{
495
 
        g_return_if_fail (TOTEM_IS_SCRSAVER (scr));
496
 
 
497
 
        if (scr->priv->disabled == FALSE)
498
 
                return;
499
 
 
500
 
        scr->priv->disabled = FALSE;
501
 
 
502
 
        if (screensaver_is_running_dbus (scr) != FALSE)
503
 
                screensaver_enable_dbus (scr);
504
 
        else
505
 
#ifdef GDK_WINDOWING_X11
506
 
                screensaver_enable_x11 (scr);
507
 
#else
508
 
#warning Unimplemented
509
 
        {}
510
 
#endif
511
 
}
512
 
 
513
 
void
514
 
totem_scrsaver_set_state (TotemScrsaver *scr, gboolean enable)
515
 
{
516
 
        g_return_if_fail (TOTEM_IS_SCRSAVER (scr));
517
 
 
518
 
        if (scr->priv->disabled == !enable)
519
 
                return;
520
 
 
521
 
        if (enable == FALSE)
522
 
                totem_scrsaver_disable (scr);
523
 
        else
524
 
                totem_scrsaver_enable (scr);
525
 
}
526
 
 
527
 
static void
528
 
totem_scrsaver_finalize (GObject *object)
529
 
{
530
 
        TotemScrsaver *scr = TOTEM_SCRSAVER (object);
531
 
 
532
 
        g_free (scr->priv->reason);
533
 
        if (scr->priv->window != NULL)
534
 
                g_object_unref (scr->priv->window);
535
 
 
536
 
        screensaver_finalize_dbus (scr);
537
 
#ifdef GDK_WINDOWING_X11
538
 
        screensaver_finalize_x11 (scr);
539
 
#else
540
 
#warning Unimplemented
541
 
        {}
542
 
#endif
543
 
 
544
 
        G_OBJECT_CLASS (totem_scrsaver_parent_class)->finalize (object);
545
 
}