Enable RGBA windows on W32

Desktop / GNOME / GTK - Руслан Ижбулатов [gmail.com] - 29 April 2015 16:12 UTC

Requires Vista and newer.

- Create surfaces with cairo_win32_surface_create_with_format
- Provide an rgba visual that can be distinguished from the system visual
- Make rgba visual the best available visual
- Enable alpha-transparency for all windows that we control
- Check for appropriate cairo capabilities at configure time (W32 - 1.14.3 newer than 2015-04-14; others - 1.14.0)

- Check for composition support before enabling CSDs
- Re-enable transparency on WM_DWMCOMPOSITIONCHANGED Windows that were created while composition was enabled and that were CSDed as a result and will look ugly (thick black borders or no borders at all) once composition is disabled. If composition is enabled afterwards, they will return back to normal. This happens, for example, when RDP session is opened to a desktop where a GTK application is running. For W7/Vista windows will only re-gain transparency after the RDP session is closed. For W8 transparency will only be gone momentarily.

Windows that were created while composition was disabled will not be CSDed automatically and will use SSD (WM decorations), while windows that are CSDed manually will get a thin square border. If composition is enabled afterwards, these windows will not change. This is most noticeable for system menus (popup menus are often generated on the fly, system menus are created once) and some dialogues (About dialogue, for example).

https://bugzilla.gnome.org/show_bug.cgi?id=727316

d44921a Enable RGBA windows on W32
configure.ac | 15 ++++
gdk/win32/gdkevents-win32.c | 4 ++
gdk/win32/gdkprivate-win32.h | 4 ++
gdk/win32/gdkscreen-win32.c | 10 +--
gdk/win32/gdkvisual-win32.c | 160 +++++++++++++++++++++++++-----------------
gdk/win32/gdkwindow-win32.c | 53 +++++++++++++-
gtk/gtkwindow.c | 3 +
7 files changed, 174 insertions(+), 75 deletions(-)

Upstream: git.gnome.org


  • Share