2 <!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
3 "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
5 <chapter id="gtk-migrating-ClientSideWindows">
7 <title>Migrating to client-side windows</title>
10 In version 2.18, GDK has been changed to use client-side windows. This
11 means that there is no longer a 1-1 correspondence between #GdkWindows
12 and windows in the underlying window system. In particular, it is no
13 longer correct to assume that each window has an associated XID.
14 Code that makes this assumption can sometimes be fixed by calling
15 gdk_window_ensure_native() on the windows in question.
16 Calling gdk_x11_drawable_get_xid() from the X11-specific API on a
17 non-native window will explicitly call gdk_window_ensure_native(),
18 so old code using this will continue to work.
22 GDK looks for the <envvar>GDK_NATIVE_WINDOWS</envvar> environment variable
23 and makes all windows native if it is set. It also tries to be more
24 compatible with the way prior versions worked in some other ways.
28 Some applications assume that they can just operate on the X windows
29 corresponding to their GDK windows without ever telling GDK. One
30 example that we've seen is changing the child window stacking order
31 using XRestackWindows(). Fixing this properly requires to fix the code
32 to use GDK functions to achieve whatever it is trying to achieve.
36 One change that can cause problems for some applications is that GDK
37 is more aggressive about optimizing away expose events. Code that does
38 more than just repainting exposed areas in response to expose events
39 may be affected by this.