Backed out changeset b71c8c052463 (bug 1943846) for causing mass failures. CLOSED...
[gecko.git] / widget / gtk / mozgtk / mozgtk.c
blobd95746fc0bf5b77c68078bb54888693021be96e0
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #include "mozilla/Types.h"
9 #include <gdk/gdk.h>
11 // Dummy call to gtk3 library to prevent the linker from removing
12 // the gtk3 dependency with --as-needed.
13 // see toolkit/library/moz.build for details.
14 MOZ_EXPORT void mozgtk_linker_holder() { gdk_display_get_default(); }
16 #ifdef MOZ_X11
17 # include <X11/Xlib.h>
18 // Bug 1271100
19 // We need to trick system Cairo into not using the XShm extension due to
20 // a race condition in it that results in frequent BadAccess errors. Cairo
21 // relies upon XShmQueryExtension to initially detect if XShm is available.
22 // So we define our own stub that always indicates XShm not being present.
23 // mozgtk loads before libXext/libcairo and so this stub will take priority.
24 // Our tree usage goes through xcb and remains unaffected by this.
26 // This is also used to force libxul to depend on the mozgtk library. If we
27 // ever can remove this workaround for system Cairo, we'll need something
28 // to replace it for that purpose.
29 MOZ_EXPORT Bool XShmQueryExtension(Display* aDisplay) { return False; }
30 #endif