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
parent 01d8b15eb3
commit c36d5ea27d
4 changed files with 16 additions and 42 deletions

View file

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

View file

@ -37,15 +37,13 @@
* *
* ***** END LICENSE BLOCK ***** */ * ***** END LICENSE BLOCK ***** */
#include <QX11Info>
#include "nsIdleServiceQt.h" #include "nsIdleServiceQt.h"
#include "nsIServiceManager.h" #include "nsIServiceManager.h"
#include "nsDebug.h" #include "nsDebug.h"
#include "prlink.h" #include "prlink.h"
#ifdef Q_WS_X11
#include <QX11Info>
typedef PRBool (*_XScreenSaverQueryExtension_fn)(Display* dpy, int* event_base, typedef PRBool (*_XScreenSaverQueryExtension_fn)(Display* dpy, int* event_base,
int* error_base); int* error_base);
@ -134,27 +132,3 @@ nsIdleServiceQt::GetIdleTime(PRUint32 *aTimeDiff)
return NS_ERROR_FAILURE; 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

View file

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

View file

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