Skip to content

Remove isPlusMinusTreeClick in OSSupport #1302

@ptziegler

Description

@ptziegler

This method is only used in the TreeEventManager to skip all events that are fired when clicking on the expand/collapse button.

@Override
public void mouseDown(MouseEvent event) {
if (isPlusMinusClick(m_tree, event.x, event.y)) {
return;
}
// OK, send to domain
if (m_domain != null) {
m_domain.mouseDown(event, m_viewer);
}
}

This method is not implemented on MacOS:

@Override
public boolean isPlusMinusTreeClick(Tree tree, int x, int y) {
return false;
}

This method is implemented on Linux, but doesn't actually work:

@Override
public boolean isPlusMinusTreeClick(Tree tree, int x, int y) {
int[] cell_x = new int[1];
int[] cell_y = new int[1];
long[] /* GtkTreePath */ path = new long[1];
long[] /* GtkTreeViewColumn */ column = new long[1];
long /* GtkTreeView */ tree_view = getHandleValue(tree, "handle");
//
try {
if (_gtk_tree_view_get_path_at_pos(tree_view, x, y, path, column, cell_x, cell_y)) {
long expanderColumn = _gtk_tree_view_get_expander_column(tree_view);
if (expanderColumn == column[0]) {
GdkRectangle rect = new GdkRectangle();
_gtk_tree_view_get_cell_area(tree_view, path[0], column[0], rect);
if (x < rect.x) {
return true;
}
}
}
return false;
} finally {
if (path[0] != 0) {
_gtk_tree_path_free(path[0]);
}
}
}

It works on Windows, but I really don't see why it's needed and the lack of documentation doesn't really help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions