Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6584657

GTK Look and Feel: Bugs in menu item layout

    Details

    • Subcomponent:
    • Resolved In Build:
      b38
    • CPU:
      generic
    • OS:
      generic
    • Verification:
      Not verified

      Backports

        Description

        There is a fix for 6458123 CR: Bugs in menu item layout. It fixes menu item bugs for several L&Fs, but doesn't for GTK L&F. This CR is targeted to solve menu item problems under GTK L&F.

        There are the following problems in GTK L&F (a test case and screen shots are in the attachment):
        1. Menu item width is too small when a top-level item has an icon. (bug_1.png)
        2. Horizontal text position and vertical text position are not processed correctly. (bug_2.png)
        3. Horizontal alignment and vertical alignment are not processed correctly. (bug_3.png)

        Testing strategy:
        1. Run the GTKMenuItems.main()
        2. Select the GTK L&F with a radio button
        3. Try to open each drop-down menu to see the problems
        Copied from the description of a duplicate CR 6687241:

        Platform: Solaris 11, Redhat Linux 5
        locale: Arabic and Hebrew
        build: 6u10 b21.

        This problem exists since 1.4.2_17.

        To reproduce the bug:
        Choose Solaris or Redhat Linux platform.
        1. Install jdk6u10 b21
        2. Install test tools GS-Tonga_12.zip
        3.Set test environment
        4. run runnit.sh script: sh runnit.sh -keywords:"ar&&manual"
        5. Follow to JMenuItemTest. Change LAF to GTK+ from LookAndFeel menu. Click "TestMenu". Then focus mouse to "Radio Button Menu Item" of right-to-left menuitem.
        6. Note "Alt-1" , the word has been truncated.

        Or compiled and run the application separately: i18n_mustang_ws\i18n\src\GS-Manual\ComponentOrientationTest\JMenuItemTest.java
        I have compiled and archived it as JMenuItemTest.jar in attachment. Execute "$JAVA_HOME/bin/java -jar JMenuItemTest.jar" to reproduce the bug:
        1. Execute "$JAVA_HOME/bin/java -jar JMenuItemTest.jar"
        2. Change LAF to GTK+ from LookAndFeel menu. Click "TestMenu". Then focus mouse to "Radio Button Menu Item" of right-to-left menuitem.
        3. Note "Alt-1" , the word has been truncated.

        src.zip file is source code of JMenuItemTest.jar in attachemt.
        *** (#1 of 2): 2008-04-11 10:57:56 MSD ###@###.###

        I can reproduce this in any locale. So, it's not specific to Arabic/Hebrew. But it looks like related to rendering or layout related to right-to-left component-orientation and/or gtk, shown by the following part of the code:

          menu.add(menuItem);
                menuItem = new JRadioButtonMenuItem("Radio Button Menu Item");
                menuItem.setComponentOrientation(o);
                menuItem.setSelected(true);
                menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_1,
                                                               ActionEvent.ALT_MASK));
        Also, the RadioButton looks like a checkbox in this test case in all 3 look and feels.
        *** (#2 of 2): 2008-04-11 20:45:21 MSD ###@###.###

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  mlapshin Mikhail Lapshin (Inactive)
                  Reporter:
                  mlapshin Mikhail Lapshin (Inactive)
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  0 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Imported:
                    Indexed: