From 542c8a2ed149bf5bf2d1dffa51beca29f621b324 Mon Sep 17 00:00:00 2001 From: William Bourque Date: Fri, 9 Apr 2010 20:00:18 +0000 Subject: [PATCH] Workwaround to SWT not recporting to correct itemHeight in "not gnome desktop". Allow reverting a very ugly hack in TmfTimeStatesCtrl --- .../ui/views/controlflow/ControlFlowView.java | 28 +++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/org.eclipse.linuxtools.lttng.ui/src/org/eclipse/linuxtools/lttng/ui/views/controlflow/ControlFlowView.java b/org.eclipse.linuxtools.lttng.ui/src/org/eclipse/linuxtools/lttng/ui/views/controlflow/ControlFlowView.java index fe6adac8bc..eb420e9cfc 100644 --- a/org.eclipse.linuxtools.lttng.ui/src/org/eclipse/linuxtools/lttng/ui/views/controlflow/ControlFlowView.java +++ b/org.eclipse.linuxtools.lttng.ui/src/org/eclipse/linuxtools/lttng/ui/views/controlflow/ControlFlowView.java @@ -519,7 +519,10 @@ public class ControlFlowView extends AbsTimeUpdateView implements // Traces shall not be grouped to allow synchronisation tsfviewer.groupTraces(false); - tsfviewer.setItemHeight(itemHeight); + + int swtBugAjustment = checkForSWTBugItemHeightAdjustement(); + tsfviewer.setItemHeight(itemHeight + swtBugAjustment); + tsfviewer.setBorderWidth(borderWidth); tsfviewer.setHeaderHeight(headerHeight); tsfviewer.setVisibleVerticalScroll(false); @@ -1235,4 +1238,25 @@ public class ControlFlowView extends AbsTimeUpdateView implements TraceDebug.debug(sb.toString()); } } -} \ No newline at end of file + + // *** HACK *** + // + // + // + public int checkForSWTBugItemHeightAdjustement() { + int returnedAjustement = 0; + String desktopSessionName = System.getenv("DESKTOP_SESSION"); + + // Gnome : most common case, no adjustement + if ( desktopSessionName.equals("gnome") ) { + returnedAjustement = 0; + } + // Kde : ajustement of 2 is needed + else if ( desktopSessionName.equals("kde") ) { + returnedAjustement = 2; + } + + return returnedAjustement; + } +} + -- 2.34.1