File mozilla-scrollbars.patch of Package kde3-gtk-qt-engine
--- src/qt_qt_wrapper.cpp.orig 2007-08-27 22:44:17.000000000 +0700
+++ src/qt_qt_wrapper.cpp 2007-08-27 23:14:38.000000000 +0700
@@ -19,6 +19,7 @@
#include <cstdlib>
#include <fcntl.h>
+#include <dlfcn.h>
#ifdef USE_FREEBSD
#include <kvm.h>
@@ -148,6 +149,29 @@
{
return 0;
}
+
+typedef void (*kstyle_fn)( void* );
+
+static kstyle_fn get_set_scrollbar_fn()
+{
+ void* handle = dlopen( "libkdefx.so.4", RTLD_LAZY );
+ if( handle == NULL )
+ return NULL;
+ kstyle_fn ret = (kstyle_fn) dlsym( handle, "kde_kstyle_set_scrollbar_type_windows" );
+ dlclose( handle );
+ return ret;
+}
+
+static void initStyle( QStyle* style )
+{
+ if( !style->inherits("KStyle" ) || !mozillaFix )
+ return;
+ if( QCString(style->name()).lower() == "thinkeramik" )
+ return; // this one has its own kdefx :-/
+ static kstyle_fn set_scrollbar = get_set_scrollbar_fn();
+ if( set_scrollbar != NULL )
+ set_scrollbar( style );
+}
void createQApp()
{
@@ -317,7 +341,7 @@
#endif // USE_FREEBSD
#endif // USE_SOLARIS
- mozillaFix = (cmdLine.contains("mozilla") || cmdLine.contains("firefox"));
+ mozillaFix = (cmdLine.contains("mozilla") || cmdLine.contains("firefox") || cmdLine.contains("thunderbird"));
openOfficeFix = (cmdLine.endsWith("soffice.bin"))
| (cmdLine.endsWith("swriter.bin"))
@@ -431,6 +455,8 @@
backgroundTile = meepWidget->paletteBackgroundPixmap();
if (backgroundTile != NULL)
backgroundTileGdk = gdk_pixmap_foreign_new(backgroundTile->handle());
+
+ initStyle( &qApp->style());
}
void destroyQApp()
@@ -473,6 +499,7 @@
// Tell the QApplication about this new style
qApp->setStyle(style);
+ initStyle(style);
// Now we need to update GTK's properties
setRcProperties(gtkRcStyle, 1); // Rewrite our cache file