]> Pileus Git - ~andy/gtk/blob - gdk/gdkoffscreenwindow.c
Change FSF Address
[~andy/gtk] / gdk / gdkoffscreenwindow.c
1 /* GDK - The GIMP Drawing Kit
2  * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library. If not, see <http://www.gnu.org/licenses/>.
16  */
17
18 /*
19  * Modified by the GTK+ Team and others 1997-2005.  See the AUTHORS
20  * file for a list of people on the GTK+ Team.  See the ChangeLog
21  * files for a list of changes.  These files are distributed with
22  * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
23  */
24
25 #include "config.h"
26
27 #include "gdkwindow.h"
28 #include "gdkinternals.h"
29 #include "gdkwindowimpl.h"
30
31 #include <math.h>
32
33 /* LIMITATIONS:
34  *
35  * Offscreen windows can't be the child of a foreign window,
36  *   nor contain foreign windows
37  * GDK_POINTER_MOTION_HINT_MASK isn't effective
38  */
39
40 typedef struct _GdkOffscreenWindow      GdkOffscreenWindow;
41 typedef struct _GdkOffscreenWindowClass GdkOffscreenWindowClass;
42
43 struct _GdkOffscreenWindow
44 {
45   GdkWindowImpl parent_instance;
46
47   GdkWindow *wrapper;
48
49   cairo_surface_t *surface;
50   GdkWindow *embedder;
51 };
52
53 struct _GdkOffscreenWindowClass
54 {
55   GdkWindowImplClass parent_class;
56 };
57
58 #define GDK_TYPE_OFFSCREEN_WINDOW            (gdk_offscreen_window_get_type())
59 #define GDK_OFFSCREEN_WINDOW(object)         (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_OFFSCREEN_WINDOW, GdkOffscreenWindow))
60 #define GDK_IS_OFFSCREEN_WINDOW(object)      (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_OFFSCREEN_WINDOW))
61 #define GDK_OFFSCREEN_WINDOW_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_OFFSCREEN_WINDOW, GdkOffscreenWindowClass))
62 #define GDK_IS_OFFSCREEN_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_OFFSCREEN_WINDOW))
63 #define GDK_OFFSCREEN_WINDOW_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_OFFSCREEN_WINDOW, GdkOffscreenWindowClass))
64
65 static void       gdk_offscreen_window_hide               (GdkWindow                  *window);
66
67 G_DEFINE_TYPE (GdkOffscreenWindow, gdk_offscreen_window, GDK_TYPE_WINDOW_IMPL)
68
69
70 static void
71 gdk_offscreen_window_finalize (GObject *object)
72 {
73   GdkOffscreenWindow *offscreen = GDK_OFFSCREEN_WINDOW (object);
74
75   if (offscreen->surface)
76     cairo_surface_destroy (offscreen->surface);
77
78   G_OBJECT_CLASS (gdk_offscreen_window_parent_class)->finalize (object);
79 }
80
81 static void
82 gdk_offscreen_window_init (GdkOffscreenWindow *window)
83 {
84 }
85
86 static void
87 gdk_offscreen_window_destroy (GdkWindow *window,
88                               gboolean   recursing,
89                               gboolean   foreign_destroy)
90 {
91   gdk_offscreen_window_set_embedder (window, NULL);
92
93   if (!recursing)
94     gdk_offscreen_window_hide (window);
95 }
96
97 static cairo_surface_t *
98 get_surface (GdkOffscreenWindow *offscreen)
99 {
100   if (! offscreen->surface)
101     {
102       GdkWindow *window = offscreen->wrapper;
103
104       g_signal_emit_by_name (window, "create-surface",
105                              window->width,
106                              window->height,
107                              &offscreen->surface);
108     }
109
110   return offscreen->surface;
111 }
112
113 static gboolean
114 is_parent_of (GdkWindow *parent,
115               GdkWindow *child)
116 {
117   GdkWindow *w;
118
119   w = child;
120   while (w != NULL)
121     {
122       if (w == parent)
123         return TRUE;
124
125       w = gdk_window_get_parent (w);
126     }
127
128   return FALSE;
129 }
130
131 static cairo_surface_t *
132 gdk_offscreen_window_ref_cairo_surface (GdkWindow *window)
133 {
134   GdkOffscreenWindow *offscreen = GDK_OFFSCREEN_WINDOW (window->impl);
135
136   return cairo_surface_reference (get_surface (offscreen));
137 }
138
139 cairo_surface_t *
140 _gdk_offscreen_window_create_surface (GdkWindow *offscreen,
141                                       gint       width,
142                                       gint       height)
143 {
144   cairo_surface_t *similar;
145   cairo_surface_t *surface;
146
147   g_return_val_if_fail (GDK_IS_OFFSCREEN_WINDOW (offscreen->impl), NULL);
148
149   similar = _gdk_window_ref_cairo_surface (offscreen->parent);
150
151   surface = cairo_surface_create_similar (similar, CAIRO_CONTENT_COLOR_ALPHA, width, height);
152
153   cairo_surface_destroy (similar);
154
155   return surface;
156 }
157
158 void
159 _gdk_offscreen_window_new (GdkWindow     *window,
160                            GdkWindowAttr *attributes,
161                            gint           attributes_mask)
162 {
163   GdkOffscreenWindow *offscreen;
164
165   g_return_if_fail (attributes != NULL);
166
167   if (attributes->wclass != GDK_INPUT_OUTPUT)
168     return; /* Can't support input only offscreens */
169
170   if (window->parent != NULL && GDK_WINDOW_DESTROYED (window->parent))
171     return;
172
173   window->impl = g_object_new (GDK_TYPE_OFFSCREEN_WINDOW, NULL);
174   offscreen = GDK_OFFSCREEN_WINDOW (window->impl);
175   offscreen->wrapper = window;
176 }
177
178 static gboolean
179 gdk_offscreen_window_reparent (GdkWindow *window,
180                                GdkWindow *new_parent,
181                                gint       x,
182                                gint       y)
183 {
184   GdkWindow *old_parent;
185   gboolean was_mapped;
186
187   if (new_parent)
188     {
189       /* No input-output children of input-only windows */
190       if (new_parent->input_only && !window->input_only)
191         return FALSE;
192
193       /* Don't create loops in hierarchy */
194       if (is_parent_of (window, new_parent))
195         return FALSE;
196     }
197
198   was_mapped = GDK_WINDOW_IS_MAPPED (window);
199
200   gdk_window_hide (window);
201
202   if (window->parent)
203     window->parent->children = g_list_remove (window->parent->children, window);
204
205   old_parent = window->parent;
206   window->parent = new_parent;
207   window->x = x;
208   window->y = y;
209
210   if (new_parent)
211     window->parent->children = g_list_prepend (window->parent->children, window);
212
213   _gdk_synthesize_crossing_events_for_geometry_change (window);
214   if (old_parent)
215     _gdk_synthesize_crossing_events_for_geometry_change (old_parent);
216
217   return was_mapped;
218 }
219
220 static void
221 from_embedder (GdkWindow *window,
222                double embedder_x, double embedder_y,
223                double *offscreen_x, double *offscreen_y)
224 {
225   g_signal_emit_by_name (window->impl_window,
226                          "from-embedder",
227                          embedder_x, embedder_y,
228                          offscreen_x, offscreen_y,
229                          NULL);
230 }
231
232 static void
233 to_embedder (GdkWindow *window,
234              double offscreen_x, double offscreen_y,
235              double *embedder_x, double *embedder_y)
236 {
237   g_signal_emit_by_name (window->impl_window,
238                          "to-embedder",
239                          offscreen_x, offscreen_y,
240                          embedder_x, embedder_y,
241                          NULL);
242 }
243
244 static gint
245 gdk_offscreen_window_get_root_coords (GdkWindow *window,
246                                       gint       x,
247                                       gint       y,
248                                       gint      *root_x,
249                                       gint      *root_y)
250 {
251   GdkOffscreenWindow *offscreen;
252   int tmpx, tmpy;
253
254   tmpx = x;
255   tmpy = y;
256
257   offscreen = GDK_OFFSCREEN_WINDOW (window->impl);
258   if (offscreen->embedder)
259     {
260       double dx, dy;
261       to_embedder (window,
262                    x, y,
263                    &dx, &dy);
264       tmpx = floor (dx + 0.5);
265       tmpy = floor (dy + 0.5);
266       gdk_window_get_root_coords (offscreen->embedder,
267                                   tmpx, tmpy,
268                                   &tmpx, &tmpy);
269
270     }
271
272   if (root_x)
273     *root_x = tmpx;
274   if (root_y)
275     *root_y = tmpy;
276
277   return TRUE;
278 }
279
280 static gboolean
281 gdk_offscreen_window_get_device_state (GdkWindow       *window,
282                                        GdkDevice       *device,
283                                        gint            *x,
284                                        gint            *y,
285                                        GdkModifierType *mask)
286 {
287   GdkOffscreenWindow *offscreen;
288   int tmpx, tmpy;
289   double dtmpx, dtmpy;
290   GdkModifierType tmpmask;
291
292   tmpx = 0;
293   tmpy = 0;
294   tmpmask = 0;
295
296   offscreen = GDK_OFFSCREEN_WINDOW (window->impl);
297   if (offscreen->embedder != NULL)
298     {
299       gdk_window_get_device_position (offscreen->embedder, device, &tmpx, &tmpy, &tmpmask);
300       from_embedder (window,
301                      tmpx, tmpy,
302                      &dtmpx, &dtmpy);
303       tmpx = floor (dtmpx + 0.5);
304       tmpy = floor (dtmpy + 0.5);
305     }
306
307   if (x)
308     *x = tmpx;
309   if (y)
310     *y = tmpy;
311   if (mask)
312     *mask = tmpmask;
313   return TRUE;
314 }
315
316 /**
317  * gdk_offscreen_window_get_surface:
318  * @window: a #GdkWindow
319  *
320  * Gets the offscreen surface that an offscreen window renders into.
321  * If you need to keep this around over window resizes, you need to
322  * add a reference to it.
323  *
324  * Returns: (transfer none): The offscreen surface, or %NULL if not offscreen
325  */
326 cairo_surface_t *
327 gdk_offscreen_window_get_surface (GdkWindow *window)
328 {
329   GdkOffscreenWindow *offscreen;
330
331   g_return_val_if_fail (GDK_IS_WINDOW (window), FALSE);
332
333   if (!GDK_IS_OFFSCREEN_WINDOW (window->impl))
334     return NULL;
335
336   offscreen = GDK_OFFSCREEN_WINDOW (window->impl);
337
338   return get_surface (offscreen);
339 }
340
341 static void
342 gdk_offscreen_window_raise (GdkWindow *window)
343 {
344   /* gdk_window_raise already changed the stacking order */
345   _gdk_synthesize_crossing_events_for_geometry_change (window);
346 }
347
348 static void
349 gdk_offscreen_window_lower (GdkWindow *window)
350 {
351   /* gdk_window_lower already changed the stacking order */
352   _gdk_synthesize_crossing_events_for_geometry_change (window);
353 }
354
355 static void
356 gdk_offscreen_window_move_resize_internal (GdkWindow *window,
357                                            gint       x,
358                                            gint       y,
359                                            gint       width,
360                                            gint       height,
361                                            gboolean   send_expose_events)
362 {
363   GdkOffscreenWindow *offscreen;
364
365   offscreen = GDK_OFFSCREEN_WINDOW (window->impl);
366
367   if (width < 1)
368     width = 1;
369   if (height < 1)
370     height = 1;
371
372   if (window->destroyed)
373     return;
374
375   window->x = x;
376   window->y = y;
377
378   if (window->width != width ||
379       window->height != height)
380     {
381       window->width = width;
382       window->height = height;
383
384       if (offscreen->surface)
385         {
386           cairo_surface_t *old_surface;
387           cairo_t *cr;
388
389           old_surface = offscreen->surface;
390           offscreen->surface = NULL;
391
392           offscreen->surface = get_surface (offscreen);
393
394           cr = cairo_create (offscreen->surface);
395           cairo_set_source_surface (cr, old_surface, 0, 0);
396           cairo_paint (cr);
397           cairo_destroy (cr);
398
399           cairo_surface_destroy (old_surface);
400         }
401     }
402
403   if (GDK_WINDOW_IS_MAPPED (window))
404     {
405       /* TODO: Only invalidate new area, i.e. for larger windows */
406       gdk_window_invalidate_rect (window, NULL, TRUE);
407       _gdk_synthesize_crossing_events_for_geometry_change (window);
408     }
409 }
410
411 static void
412 gdk_offscreen_window_move_resize (GdkWindow *window,
413                                   gboolean   with_move,
414                                   gint       x,
415                                   gint       y,
416                                   gint       width,
417                                   gint       height)
418 {
419   if (!with_move)
420     {
421       x = window->x;
422       y = window->y;
423     }
424
425   if (width < 0)
426     width = window->width;
427
428   if (height < 0)
429     height = window->height;
430
431   gdk_offscreen_window_move_resize_internal (window,
432                                              x, y, width, height,
433                                              TRUE);
434 }
435
436 static void
437 gdk_offscreen_window_show (GdkWindow *window,
438                            gboolean already_mapped)
439 {
440   GdkRectangle area = { 0, 0, window->width, window->height };
441
442   gdk_window_invalidate_rect (window, &area, FALSE);
443 }
444
445
446 static void
447 gdk_offscreen_window_hide (GdkWindow *window)
448 {
449   /* TODO: This needs updating to the new grab world */
450 #if 0
451   GdkOffscreenWindow *offscreen;
452   GdkDisplay *display;
453
454   g_return_if_fail (window != NULL);
455
456   offscreen = GDK_OFFSCREEN_WINDOW (window->impl);
457
458   /* May need to break grabs on children */
459   display = gdk_window_get_display (window);
460
461   if (display->pointer_grab.window != NULL)
462     {
463       if (is_parent_of (window, display->pointer_grab.window))
464         {
465           /* Call this ourselves, even though gdk_display_pointer_ungrab
466              does so too, since we want to pass implicit == TRUE so the
467              broken grab event is generated */
468           _gdk_display_unset_has_pointer_grab (display,
469                                                TRUE,
470                                                FALSE,
471                                                GDK_CURRENT_TIME);
472           gdk_display_pointer_ungrab (display, GDK_CURRENT_TIME);
473         }
474     }
475 #endif
476 }
477
478 static void
479 gdk_offscreen_window_withdraw (GdkWindow *window)
480 {
481 }
482
483 static GdkEventMask
484 gdk_offscreen_window_get_events (GdkWindow *window)
485 {
486   return 0;
487 }
488
489 static void
490 gdk_offscreen_window_set_events (GdkWindow       *window,
491                                  GdkEventMask     event_mask)
492 {
493 }
494
495 static void
496 gdk_offscreen_window_set_background (GdkWindow      *window,
497                                      cairo_pattern_t *pattern)
498 {
499 }
500
501 static void
502 gdk_offscreen_window_shape_combine_region (GdkWindow       *window,
503                                            const cairo_region_t *shape_region,
504                                            gint             offset_x,
505                                            gint             offset_y)
506 {
507 }
508
509 static void
510 gdk_offscreen_window_input_shape_combine_region (GdkWindow       *window,
511                                                  const cairo_region_t *shape_region,
512                                                  gint             offset_x,
513                                                  gint             offset_y)
514 {
515 }
516
517 static gboolean
518 gdk_offscreen_window_set_static_gravities (GdkWindow *window,
519                                            gboolean   use_static)
520 {
521   return TRUE;
522 }
523
524 static void
525 gdk_offscreen_window_get_geometry (GdkWindow *window,
526                                    gint      *x,
527                                    gint      *y,
528                                    gint      *width,
529                                    gint      *height)
530 {
531   if (!GDK_WINDOW_DESTROYED (window))
532     {
533       if (x)
534         *x = window->x;
535       if (y)
536         *y = window->y;
537       if (width)
538         *width = window->width;
539       if (height)
540         *height = window->height;
541     }
542 }
543
544 static gboolean
545 gdk_offscreen_window_queue_antiexpose (GdkWindow *window,
546                                        cairo_region_t *area)
547 {
548   return FALSE;
549 }
550
551 static void
552 gdk_offscreen_window_translate (GdkWindow      *window,
553                                 cairo_region_t *area,
554                                 gint            dx,
555                                 gint            dy)
556 {
557   GdkOffscreenWindow *offscreen = GDK_OFFSCREEN_WINDOW (window->impl);
558
559   if (offscreen->surface)
560     {
561       cairo_t *cr;
562
563       cr = cairo_create (offscreen->surface);
564
565       area = cairo_region_copy (area);
566
567       gdk_cairo_region (cr, area);
568       cairo_clip (cr);
569
570       /* NB: This is a self-copy and Cairo doesn't support that yet.
571        * So we do a litle trick.
572        */
573       cairo_push_group (cr);
574
575       cairo_set_source_surface (cr, offscreen->surface, dx, dy);
576       cairo_paint (cr);
577
578       cairo_pop_group_to_source (cr);
579       cairo_paint (cr);
580
581       cairo_destroy (cr);
582     }
583
584   _gdk_window_add_damage (window, area);
585 }
586
587 static cairo_surface_t *
588 gdk_offscreen_window_resize_cairo_surface (GdkWindow       *window,
589                                            cairo_surface_t *surface,
590                                            gint             width,
591                                            gint             height)
592 {
593   /* No-op.  The surface gets resized in
594    * gdk_offscreen_window_move_resize_internal().
595    */
596   return surface;
597 }
598
599 /**
600  * gdk_offscreen_window_set_embedder:
601  * @window: a #GdkWindow
602  * @embedder: the #GdkWindow that @window gets embedded in
603  *
604  * Sets @window to be embedded in @embedder.
605  *
606  * To fully embed an offscreen window, in addition to calling this
607  * function, it is also necessary to handle the #GdkWindow::pick-embedded-child
608  * signal on the @embedder and the #GdkWindow::to-embedder and
609  * #GdkWindow::from-embedder signals on @window.
610  *
611  * Since: 2.18
612  */
613 void
614 gdk_offscreen_window_set_embedder (GdkWindow     *window,
615                                    GdkWindow     *embedder)
616 {
617   GdkOffscreenWindow *offscreen;
618
619   g_return_if_fail (GDK_IS_WINDOW (window));
620
621   if (!GDK_IS_OFFSCREEN_WINDOW (window->impl))
622     return;
623
624   offscreen = GDK_OFFSCREEN_WINDOW (window->impl);
625
626   if (embedder)
627     {
628       g_object_ref (embedder);
629       embedder->num_offscreen_children++;
630     }
631
632   if (offscreen->embedder)
633     {
634       g_object_unref (offscreen->embedder);
635       offscreen->embedder->num_offscreen_children--;
636     }
637
638   offscreen->embedder = embedder;
639 }
640
641 /**
642  * gdk_offscreen_window_get_embedder:
643  * @window: a #GdkWindow
644  *
645  * Gets the window that @window is embedded in.
646  *
647  * Returns: (transfer none): the embedding #GdkWindow, or %NULL
648  *     if @window is not an mbedded offscreen window
649  *
650  * Since: 2.18
651  */
652 GdkWindow *
653 gdk_offscreen_window_get_embedder (GdkWindow *window)
654 {
655   GdkOffscreenWindow *offscreen;
656
657   g_return_val_if_fail (GDK_IS_WINDOW (window), NULL);
658
659   if (!GDK_IS_OFFSCREEN_WINDOW (window->impl))
660     return NULL;
661
662   offscreen = GDK_OFFSCREEN_WINDOW (window->impl);
663
664   return offscreen->embedder;
665 }
666
667 static void
668 gdk_offscreen_window_do_nothing (GdkWindow *window)
669 {
670 }
671
672 static void
673 gdk_offscreen_window_set_boolean (GdkWindow *window,
674                                   gboolean   setting)
675 {
676 }
677
678 static void
679 gdk_offscreen_window_set_string (GdkWindow *window,
680                                  const gchar *setting)
681 {
682 }
683
684 static void
685 gdk_offscreen_window_set_list (GdkWindow *window,
686                                GList *list)
687 {
688 }
689
690 static void
691 gdk_offscreen_window_set_wmfunctions (GdkWindow     *window,
692                                       GdkWMFunction  functions)
693 {
694 }
695
696 static void
697 gdk_offscreen_window_set_transient_for (GdkWindow *window,
698                                         GdkWindow *another)
699 {
700 }
701
702 static void
703 gdk_offscreen_window_process_updates_recurse (GdkWindow *window,
704                                               cairo_region_t *region)
705 {
706   _gdk_window_process_updates_recurse (window, region);
707 }
708
709 static void
710 gdk_offscreen_window_class_init (GdkOffscreenWindowClass *klass)
711 {
712   GdkWindowImplClass *impl_class = GDK_WINDOW_IMPL_CLASS (klass);
713   GObjectClass *object_class = G_OBJECT_CLASS (klass);
714
715   object_class->finalize = gdk_offscreen_window_finalize;
716
717   impl_class->ref_cairo_surface = gdk_offscreen_window_ref_cairo_surface;
718   impl_class->show = gdk_offscreen_window_show;
719   impl_class->hide = gdk_offscreen_window_hide;
720   impl_class->withdraw = gdk_offscreen_window_withdraw;
721   impl_class->set_events = gdk_offscreen_window_set_events;
722   impl_class->get_events = gdk_offscreen_window_get_events;
723   impl_class->raise = gdk_offscreen_window_raise;
724   impl_class->lower = gdk_offscreen_window_lower;
725   impl_class->restack_under = NULL;
726   impl_class->restack_toplevel = NULL;
727   impl_class->move_resize = gdk_offscreen_window_move_resize;
728   impl_class->set_background = gdk_offscreen_window_set_background;
729   impl_class->reparent = gdk_offscreen_window_reparent;
730   impl_class->set_device_cursor = NULL;
731   impl_class->get_geometry = gdk_offscreen_window_get_geometry;
732   impl_class->get_root_coords = gdk_offscreen_window_get_root_coords;
733   impl_class->get_device_state = gdk_offscreen_window_get_device_state;
734   impl_class->shape_combine_region = gdk_offscreen_window_shape_combine_region;
735   impl_class->input_shape_combine_region = gdk_offscreen_window_input_shape_combine_region;
736   impl_class->set_static_gravities = gdk_offscreen_window_set_static_gravities;
737   impl_class->queue_antiexpose = gdk_offscreen_window_queue_antiexpose;
738   impl_class->translate = gdk_offscreen_window_translate;
739   impl_class->destroy = gdk_offscreen_window_destroy;
740   impl_class->destroy_foreign = NULL;
741   impl_class->resize_cairo_surface = gdk_offscreen_window_resize_cairo_surface;
742   impl_class->get_shape = NULL;
743   impl_class->get_input_shape = NULL;
744   impl_class->beep = NULL;
745
746   impl_class->focus = NULL;
747   impl_class->set_type_hint = NULL;
748   impl_class->get_type_hint = NULL;
749   impl_class->set_modal_hint = NULL;
750   impl_class->set_skip_taskbar_hint = gdk_offscreen_window_set_boolean;
751   impl_class->set_skip_pager_hint = gdk_offscreen_window_set_boolean;
752   impl_class->set_urgency_hint = gdk_offscreen_window_set_boolean;
753   impl_class->set_geometry_hints = NULL;
754   impl_class->set_title = gdk_offscreen_window_set_string;
755   impl_class->set_role = gdk_offscreen_window_set_string;
756   impl_class->set_startup_id = gdk_offscreen_window_set_string;
757   impl_class->set_transient_for = gdk_offscreen_window_set_transient_for;
758   impl_class->get_root_origin = NULL;
759   impl_class->get_frame_extents = NULL;
760   impl_class->set_override_redirect = NULL;
761   impl_class->set_accept_focus = NULL;
762   impl_class->set_focus_on_map = gdk_offscreen_window_set_boolean;
763   impl_class->set_icon_list = gdk_offscreen_window_set_list;
764   impl_class->set_icon_name = gdk_offscreen_window_set_string;
765   impl_class->iconify = gdk_offscreen_window_do_nothing;
766   impl_class->deiconify = gdk_offscreen_window_do_nothing;
767   impl_class->stick = gdk_offscreen_window_do_nothing;
768   impl_class->unstick = gdk_offscreen_window_do_nothing;
769   impl_class->maximize = gdk_offscreen_window_do_nothing;
770   impl_class->unmaximize = gdk_offscreen_window_do_nothing;
771   impl_class->fullscreen = gdk_offscreen_window_do_nothing;
772   impl_class->unfullscreen = gdk_offscreen_window_do_nothing;
773   impl_class->set_keep_above = gdk_offscreen_window_set_boolean;
774   impl_class->set_keep_below = gdk_offscreen_window_set_boolean;
775   impl_class->get_group = NULL;
776   impl_class->set_group = NULL;
777   impl_class->set_decorations = NULL;
778   impl_class->get_decorations = NULL;
779   impl_class->set_functions = gdk_offscreen_window_set_wmfunctions;
780   impl_class->begin_resize_drag = NULL;
781   impl_class->begin_move_drag = NULL;
782   impl_class->enable_synchronized_configure = gdk_offscreen_window_do_nothing;
783   impl_class->configure_finished = NULL;
784   impl_class->set_opacity = NULL;
785   impl_class->set_composited = NULL;
786   impl_class->destroy_notify = NULL;
787   impl_class->register_dnd = gdk_offscreen_window_do_nothing;
788   impl_class->drag_begin = NULL;
789   impl_class->process_updates_recurse = gdk_offscreen_window_process_updates_recurse;
790   impl_class->sync_rendering = NULL;
791   impl_class->simulate_key = NULL;
792   impl_class->simulate_button = NULL;
793   impl_class->get_property = NULL;
794   impl_class->change_property = NULL;
795   impl_class->delete_property = NULL;
796 }