| Summary: | using the setMenuBar() seems to 'push' the bottom of the shell out of its actual visual border/edge | ||
|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Hubert Virtos <hvirtos> |
| Component: | SWT | Assignee: | Platform-SWT-Inbox <platform-swt-inbox> |
| Status: | RESOLVED WORKSFORME | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | ericwill |
| Version: | 3.7.2 | Keywords: | triaged |
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| Whiteboard: | |||
It seems that the shell 'bottom' goes back to the actual bottom of the window when the shell is maximised. Further information on this: the problem does not occur when I am running the executable jar of the project with sudo rights. The problem does however occurs every time that I run the executable jars with basic user rights or in Eclipse (when running or debugging app).
For the moment, I have gone around the problem with the following code:
if(System.getProperty("os.name").startsWith("Windows")) {
shell.setSize(1000,550);
}
else {
//relies on the fact that when starting maximised, the problem does not occur.
shell.setMaximized(true);
}
My installation details can be found below (truncated because otherwise it is absolutely huge):
*** Date: Thursday, 2 August 2012 23:48:30 British Summer Time
*** Platform Details:
*** System properties:
__wbp.linux.disableScreenshotWorkarounds=false
applicationXMI=org.eclipse.ui.workbench/LegacyIDE.e4xmi
com.genuitec.pulse.client.basedir.location.override=/home/XXXX/Genuitec
com.genuitec.pulse.client.blueprint.id=rmb-3838812
com.genuitec.pulse.client.credentials=M9n+PpSG3g5K9LB45ghGa4iELMrpzWRW4uJlGLgCCO24skerI9Vne15Z0mNUc+b+8EZJ+L0S+tIG T9E+GK/UmBJZudhJu0+8WL37VZbyVS4jJsutKNDBTcjax4sbbZloRb8blrHbRtDiHoOJuuoolJ8H DZD3LtPtGkXWnZFN+uE=
com.genuitec.pulse.client.handshake.id=a7f2c08c-e1ca-4185-9e0b-385f41f82759
com.genuitec.pulse.client.migrated.id=rb-7398170-1343251666018
com.genuitec.pulse.client.oslevel.overrides.filename.override=pulse2.conf
com.genuitec.pulse.common.server.url=https://www.poweredbypulse.com:443
eclipse.application=org.eclipse.ui.ide.workbench
eclipse.commands=-os
linux
-ws
gtk
-arch
x86
-showsplash
/home/XXXX/Genuitec/Common/plugins/org.eclipse.platform_4.2.0.v201206081400/splash.bmp
-launcher
/home/XXXX/Genuitec/Eclipse 4.2 IDE for RCP and RAP/eclipse
-name
Eclipse
--launcher.library
/home/XXXX/Genuitec/Eclipse 4.2 IDE for RCP and RAP//../Common/plugins/org.eclipse.equinox.launcher.gtk.linux.x86_1.1.200.v20120522-1813/eclipse_1502.so
-startup
/home/XXXX/Genuitec/Eclipse 4.2 IDE for RCP and RAP//../Common/plugins/org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar
--launcher.overrideVmargs
-install
/home/XXXX/Genuitec/Eclipse 4.2 IDE for RCP and RAP
-configuration
/home/XXXX/Genuitec/Eclipse 4.2 IDE for RCP and RAP/configuration
-vm
/usr/lib/jvm/java-6-openjdk-i386/jre/bin/../lib/i386/client/libjvm.so
I cannot reproduce this issue on GTK3.22, 4.8 M6, Fedora 27. Please re-open this ticket if you continue to experience the issue. |
When attaching a control at the bottom of the shell, adding a menu using setMenuBar pushes the label further down so that it is no longer visible. This does not seem to be the case on Windows, only linux. Looking at the documentation, I cannot find any reason why this should be the case. Code example below: import org.eclipse.swt.SWT; import org.eclipse.swt.layout.FormAttachment; import org.eclipse.swt.layout.FormData; import org.eclipse.swt.layout.FormLayout; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Menu; import org.eclipse.swt.widgets.MenuItem; import org.eclipse.swt.widgets.Shell; public class TestBug { public static void main(String[] args) { Display display = new Display(); Shell shell = new Shell(display); shell.setText("Test Bug?"); shell.setSize(1000,550); shell.setLayout(new FormLayout()); Label testLabel = new Label(shell, SWT.BORDER); testLabel.setText("Some text"); FormData fdata = new FormData(); fdata.left = new FormAttachment(0); fdata.right = new FormAttachment(100); fdata.bottom = new FormAttachment(100); fdata.height = 15; testLabel.setLayoutData(fdata); /*When you uncomment the following line, the menu gets created * but the label is pushed back to the bottom and disappears from view. * To me, it seems that the 'bottom' is pushed further down outside the * bottom border shell. */ // shell.setMenuBar(returnMenu(shell)); shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); } display.dispose(); } private static Menu returnMenu(Shell shell) { Menu menu = new Menu(shell, SWT.BAR); MenuItem fileMenuHeader = new MenuItem(menu, SWT.CASCADE); fileMenuHeader.setText("&File"); Menu fileMenu = new Menu(shell, SWT.DROP_DOWN); fileMenuHeader.setMenu(fileMenu); MenuItem fileNewItem = new MenuItem(fileMenu, SWT.PUSH); fileNewItem.setText("&New\tCtrl+N"); fileNewItem.setAccelerator(SWT.CTRL + 'N'); return menu; } }