diff options
author | J-P Nurmi <jpnurmi@digia.com> | 2012-12-20 14:02:03 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-01-03 22:17:11 +0100 |
commit | 24d8bcf93a14545769154dae9ce06de2ef4c2430 (patch) | |
tree | 2ebb7404c08456ab9568b474f44b3ea9e4176672 /src/widgets | |
parent | cf5264fd6732a34a79f9a67a423fdd77fbeca19f (diff) |
QGtkStyle: exclude Xlib calls on Mac
Task-number: QTBUG-28769
Change-Id: I3f83b6011acf43e5136a762d0f8841b3a910cecb
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Diffstat (limited to 'src/widgets')
-rw-r--r-- | src/widgets/styles/qgtkstyle_p.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/widgets/styles/qgtkstyle_p.cpp b/src/widgets/styles/qgtkstyle_p.cpp index ba41482ec5..782ef8d483 100644 --- a/src/widgets/styles/qgtkstyle_p.cpp +++ b/src/widgets/styles/qgtkstyle_p.cpp @@ -75,6 +75,7 @@ #include <QtWidgets/QToolBar> #include <QtWidgets/QToolButton> +#ifndef Q_OS_MAC // X11 Includes: // the following is necessary to work around breakage in many versions @@ -90,6 +91,7 @@ #undef XRegisterIMInstantiateCallback #undef XUnregisterIMInstantiateCallback #undef XSetIMValues +#endif QT_BEGIN_NAMESPACE @@ -210,7 +212,9 @@ Ptr_gconf_client_get_bool QGtkStylePrivate::gconf_client_get_bool = 0; Ptr_gnome_icon_lookup_sync QGtkStylePrivate::gnome_icon_lookup_sync = 0; Ptr_gnome_vfs_init QGtkStylePrivate::gnome_vfs_init = 0; +#ifndef Q_OS_MAC typedef int (*x11ErrorHandler)(Display*, XErrorEvent*); +#endif QT_END_NAMESPACE @@ -540,10 +544,14 @@ void QGtkStylePrivate::initGtkWidgets() const } if (QGtkStylePrivate::gtk_init) { +#ifndef Q_OS_MAC // Gtk will set the Qt error handler so we have to reset it afterwards x11ErrorHandler qt_x_errhandler = XSetErrorHandler(0); +#endif QGtkStylePrivate::gtk_init (NULL, NULL); +#ifndef Q_OS_MAC XSetErrorHandler(qt_x_errhandler); +#endif // make a window GtkWidget* gtkWindow = QGtkStylePrivate::gtk_window_new(GTK_WINDOW_POPUP); @@ -967,13 +975,14 @@ void QGtkStylePrivate::setupGtkFileChooser(GtkWidget* gtkFileChooser, QWidget *p QWidget *modalFor = parent ? parent->window() : qApp->activeWindow(); if (modalFor) { QGtkStylePrivate::gtk_widget_realize(gtkFileChooser); // Creates X window +#ifndef Q_OS_MAC XSetTransientForHint(QGtkStylePrivate::gdk_x11_drawable_get_xdisplay(gtkFileChooser->window), QGtkStylePrivate::gdk_x11_drawable_get_xid(gtkFileChooser->window), modalFor->winId()); #ifdef Q_WS_X11 QGtkStylePrivate::gdk_x11_window_set_user_time (gtkFileChooser->window, QX11Info::appUserTime()); #endif - +#endif } QFileInfo fileinfo(dir); |