~walkerlee/totem/pre-interview

« back to all changes in this revision

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