Qt: initialize pallettes only if we are under KDE3 installation, since selection and disable

colors are mismatched only in this case.

git-svn-id: trunk@28846 -
This commit is contained in:
zeljko 2010-12-31 08:55:25 +00:00
parent b62fd7a34e
commit b27fe29d35
3 changed files with 27 additions and 1 deletions

View File

@ -192,6 +192,8 @@ type
function IsCurrentDesktop(AWidget: QWidgetH): Boolean;
function GetWindowManager: String;
procedure SetSkipX11Taskbar(Widget: QWidgetH; const ASkipTaskBar: Boolean);
{check if we are running under kde3 installation}
function IsOldKDEInstallation: Boolean;
{$ENDIF}
const

View File

@ -97,7 +97,8 @@ begin
FEatNextDeactivate := False;
{$IFDEF HASX11}
FLastMinimizeEvent := 0;
QtX11InitializePalettes;
if ((QtVersionMajor = 4) and (QtVersionMinor < 6)) or IsOldKDEInstallation then
QtX11InitializePalettes;
{$ENDIF}
end;

View File

@ -1,4 +1,27 @@
{%MainUnit qtint.pp}
function IsOldKDEInstallation: Boolean;
var
Display: PDisplay;
i: longint;
begin
//if we are under KDE4, it's already recent one.
Result := not ((GetEnvironmentVariable('KDE_SESSION_VERSION') = '4')
or QX11Info_isCompositingManagerRunning);
if Result then
exit;
//if we are under other WM KDE_SESSION_VERSION does not exist
//so we must check for XOrg version.
Display := QX11Info_display();
i := XVendorRelease(Display);
//X, XOrg between 5.0 - 7.04 are old ones and contains KDE-3.5
//Fedora marks XOrg 7.XX as 1.XX, so we have to check that too.
Result := ((i >= 50000000) and (i <= 70040000)) or
((i > 0) and (i <= 10400000));
end;
function IsCurrentDesktop(AWidget: QWidgetH): Boolean;
var
Display: PDisplay;