Gtk: Behavior of events sending changed

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P3
    • 8
    • Affects Version/s: 8
    • Component/s: javafx
    • Environment:

      8.0b65x64, linux ubuntu 12.04x64. d3d

      Changed between 8.0b64 and 8.0b65.

      Run the application:

      import javafx.application.Application;
      import javafx.collections.FXCollections;
      import javafx.collections.ObservableList;
      import javafx.event.EventHandler;
      import javafx.scene.Scene;
      import javafx.scene.control.MenuButton;
      import javafx.scene.control.MenuItem;
      import javafx.scene.input.MouseEvent;
      import javafx.scene.layout.VBox;
      import javafx.stage.Stage;

      public class JavaApplication6 extends Application {

          public static void main(String[] args) {
              launch(args);
          }

          @Override
          public void start(Stage stage) throws Exception {
              final MenuButton testMenuButton = new MenuButton();

              ObservableList<MenuItem> testMenuItems = FXCollections.observableArrayList();

              for (int indx = 1; indx <= 5; indx++) {
                  MenuItem mi = new MenuItem();
                  mi.setText("Test Menu Item-" + indx);
                  testMenuItems.add(mi);
              }

              testMenuButton.getItems().addAll(testMenuItems);
              testMenuButton.setOnMousePressed(new EventHandler<MouseEvent>() {

                  @Override
                  public void handle(MouseEvent t) {
                      System.out.println("A");
                      testMenuButton.show();
                  }
              });
              testMenuButton.setOnMouseReleased(new EventHandler<MouseEvent>() {

                  @Override
                  public void handle(MouseEvent me) {
                      System.out.println("B");
                      testMenuButton.hide();
                  }
              });
              
              VBox vb = new VBox();
              vb.getChildren().addAll(testMenuButton);
              Scene scene = new Scene(vb, 300, 300);
              stage.setScene(scene);
              stage.show();
          }
      }

      Click on the button, and click somewhere on the scene (according to some bug, popup doesn't appear at first click).
      Press on button, and move cursor somewhere on the scene.
      Release button. Release event didn't come (but it comes on b64) and popup was not closed.

            Assignee:
            Alexander Zvegintsev
            Reporter:
            Alexander Kirov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: