Bug 553508 - Remove the define Q_WS_X11. It overlaps with existing defines that we have and is not always set by sdk. r=oleg

This commit is contained in:
Doug Turner 2010-03-18 21:48:35 -07:00
Родитель c717c0e54d
Коммит bb28e86ac9
4 изменённых файлов: 16 добавлений и 42 удалений

Просмотреть файл

@ -121,7 +121,7 @@ typedef struct {
cairo_bool_t supports_porter_duff;
#if defined(Q_WS_X11) && defined(CAIRO_HAS_XLIB_XRENDER_SURFACE)
#if defined(CAIRO_HAS_XLIB_XRENDER_SURFACE)
/* temporary, so that we can share the xlib surface's glyphs code */
bool xlib_has_clipping;
cairo_surface_t *xlib_equiv;
@ -438,7 +438,7 @@ _cairo_qpainter_surface_finish (void *abstract_surface)
if (qs->image_equiv)
cairo_surface_destroy ((cairo_surface_t*) qs->image_equiv);
#if defined(Q_WS_X11) && defined(CAIRO_HAS_XLIB_XRENDER_SURFACE)
#if defined(CAIRO_HAS_XLIB_XRENDER_SURFACE)
if (qs->xlib_equiv)
cairo_surface_destroy (qs->xlib_equiv);
#endif
@ -1365,7 +1365,7 @@ _cairo_qpainter_surface_show_glyphs (void *abstract_surface,
Q_UNUSED(extends);
cairo_qpainter_surface_t *qs = (cairo_qpainter_surface_t *) abstract_surface;
#if defined(Q_WS_X11) && defined(CAIRO_HAS_XLIB_XRENDER_SURFACE)
#if defined(CAIRO_HAS_XLIB_XRENDER_SURFACE)
/* If we have an equivalent X surface, let the xlib surface handle this
* until we figure out how to do this natively with Qt.
*/
@ -1587,7 +1587,7 @@ static const cairo_surface_backend_t cairo_qpainter_surface_backend = {
NULL, /* show_text_glyphs */
};
#if defined(Q_WS_X11) && defined(CAIRO_HAS_XLIB_XRENDER_SURFACE)
#if defined(CAIRO_HAS_XLIB_XRENDER_SURFACE)
void
_cairo_qpainter_create_xlib_surface (cairo_qpainter_surface_t *qs)
{
@ -1661,7 +1661,7 @@ cairo_qpainter_surface_create (QPainter *painter)
qs->window = painter->window();
#if defined(Q_WS_X11) && defined(CAIRO_HAS_XLIB_XRENDER_SURFACE)
#if defined(CAIRO_HAS_XLIB_XRENDER_SURFACE)
_cairo_qpainter_create_xlib_surface (qs);
#endif
@ -1748,7 +1748,7 @@ cairo_qpainter_surface_create_with_qpixmap (cairo_content_t content,
qs->window = QRect(0, 0, width, height);
#if defined(Q_WS_X11) && defined(CAIRO_HAS_XLIB_XRENDER_SURFACE)
#if defined(CAIRO_HAS_XLIB_XRENDER_SURFACE)
_cairo_qpainter_create_xlib_surface (qs);
#endif

Просмотреть файл

@ -37,15 +37,13 @@
*
* ***** END LICENSE BLOCK ***** */
#include <QX11Info>
#include "nsIdleServiceQt.h"
#include "nsIServiceManager.h"
#include "nsDebug.h"
#include "prlink.h"
#ifdef Q_WS_X11
#include <QX11Info>
typedef PRBool (*_XScreenSaverQueryExtension_fn)(Display* dpy, int* event_base,
int* error_base);
@ -134,27 +132,3 @@ nsIdleServiceQt::GetIdleTime(PRUint32 *aTimeDiff)
return NS_ERROR_FAILURE;
}
#else
NS_IMPL_ISUPPORTS1(nsIdleServiceQt, nsIIdleService)
nsIdleServiceQt::nsIdleServiceQt()
{
}
static void Initialize()
{
}
nsIdleServiceQt::~nsIdleServiceQt()
{
}
NS_IMETHODIMP
nsIdleServiceQt::GetIdleTime(PRUint32 *aTimeDiff)
{
return NS_ERROR_FAILURE;
}
#endif

Просмотреть файл

@ -160,12 +160,10 @@ static const nsModuleComponentInfo components[] =
NS_BIDIKEYBOARD_CID,
"@mozilla.org/widget/bidikeyboard;1",
nsBidiKeyboardConstructor },
#ifdef Q_WS_X11
{ "Qt Idle Service",
NS_IDLE_SERVICE_CID,
"@mozilla.org/widget/idleservice;1",
nsIdleServiceQtConstructor },
#endif
{ "Qt Sound",
NS_SOUND_CID,
"@mozilla.org/sound;1",

Просмотреть файл

@ -548,6 +548,10 @@ nsWindow::SetSizeMode(PRInt32 aMode)
widget->showMinimized();
break;
case nsSizeMode_Fullscreen:
// Some versions of Qt (4.6.x) crash in XSetInputFocus due to
// unsynchronized window activation. Sync here to avoid such
// cases.
XSync(QX11Info().display(), False);
widget->showFullScreen();
break;
@ -765,14 +769,12 @@ nsWindow::GetNativeData(PRUint32 aDataType)
return SetupPluginPort();
break;
#ifdef Q_WS_X11
case NS_NATIVE_DISPLAY:
{
QWidget *widget = GetViewWidget();
return widget ? widget->x11Info().display() : nsnull;
}
break;
#endif
case NS_NATIVE_GRAPHIC: {
NS_ASSERTION(nsnull != mToolkit, "NULL toolkit, unable to get a GC");
@ -1770,7 +1772,6 @@ nsWindow::SetWindowClass(const nsAString &xulWinType)
nsXPIDLString brandName;
GetBrandName(brandName);
#ifdef Q_WS_X11
XClassHint *class_hint = XAllocClassHint();
if (!class_hint)
return NS_ERROR_OUT_OF_MEMORY;
@ -1812,7 +1813,6 @@ nsWindow::SetWindowClass(const nsAString &xulWinType)
nsMemory::Free(class_hint->res_class);
nsMemory::Free(class_hint->res_name);
XFree(class_hint);
#endif
return NS_OK;
}
@ -1925,6 +1925,10 @@ nsWindow::MakeFullScreen(PRBool aFullScreen)
mLastSizeMode = mSizeMode;
mSizeMode = nsSizeMode_Fullscreen;
// Some versions of Qt (4.6.x) crash in XSetInputFocus due to
// unsynchronized window activation. Sync here to avoid such
// cases.
XSync(QX11Info().display(), False);
widget->showFullScreen();
}
else {
@ -1980,11 +1984,9 @@ nsWindow::HideWindowChrome(PRBool aShouldHide)
// and flush the queue here so that we don't end up with a BadWindow
// error later when this happens (when the persistence timer fires
// and GetWindowPos is called)
#ifdef Q_WS_X11
QWidget *widget = GetViewWidget();
NS_ENSURE_TRUE(widget, NS_ERROR_FAILURE);
XSync(widget->x11Info().display(), False);
#endif
return NS_OK;
}