Skip to content

Commit

Permalink
Merge
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinrushforth committed Dec 20, 2019
2 parents 2e0d01c + 935e99d commit 8a5344c
Show file tree
Hide file tree
Showing 20 changed files with 1,226 additions and 260 deletions.
26 changes: 8 additions & 18 deletions buildSrc/linux.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ def gtk2CCFlags = [ ];
def gtk3CCFlags = [ "-Wno-deprecated-declarations" ];
def gtk2LinkFlags = [ ];
def gtk3LinkFlags = [ ];
LINUX.buildGTK3 = true

// Create $buildDir/linux_tools.properties file and load props from it
setupTools("linux_gtk2",
Expand Down Expand Up @@ -120,28 +119,25 @@ setupTools("linux_gtk3",
exec {
commandLine("${toolchainDir}pkg-config", "--cflags", "gtk+-3.0", "gthread-2.0", "xtst")
setStandardOutput(results2);
ignoreExitValue(true)
}
propFile << "cflagsGTK3=" << results2.toString().trim() << "\n";

ByteArrayOutputStream results4 = new ByteArrayOutputStream();
exec {
commandLine("${toolchainDir}pkg-config", "--libs", "gtk+-3.0", "gthread-2.0", "xtst")
setStandardOutput(results4);
ignoreExitValue(true)
}
propFile << "libsGTK3=" << results4.toString().trim() << "\n";

},
{ properties ->
def ccflags = properties.getProperty("cflagsGTK3")
def ldflags = properties.getProperty("libsGTK3")
if (ccflags && ldflags) {
gtk3CCFlags.addAll(ccflags.split(" "))
gtk3LinkFlags.addAll(ldflags.split(" "))
def cflagsGTK3 = properties.getProperty("cflagsGTK3")
def libsGTK3 = properties.getProperty("libsGTK3")
if (cflagsGTK3 && libsGTK3) {
gtk3CCFlags.addAll(cflagsGTK3.split(" "))
gtk3LinkFlags.addAll(libsGTK3.split(" "))
} else {
logger.info("Warning: GTK3 development packages not found, not building GTK3 support");
LINUX.buildGTK3 = false
throw new IllegalStateException("GTK3 development packages not found. If GTK3 packages are installed, please remove the build directory and try again.")
}
}
)
Expand Down Expand Up @@ -213,13 +209,7 @@ def compiler = IS_COMPILE_PARFAIT ? "parfait-gcc" : "${toolchainDir}gcc";
def linker = IS_STATIC_BUILD ? "ar" : IS_COMPILE_PARFAIT ? "parfait-g++" : "${toolchainDir}g++";

LINUX.glass = [:]
LINUX.glass.variants = ["glass", "glassgtk2"]
if (LINUX.buildGTK3) {
logger.info("Building libglassgtk3")
LINUX.glass.variants += "glassgtk3"
} else {
logger.warn("NOT Building libglassgtk3")
}
LINUX.glass.variants = ["glass", "glassgtk2", "glassgtk3"]

FileTree ft_gtk_launcher = fileTree("${project(":graphics").projectDir}/src/main/native-glass/gtk/") {
include("**/launcher.c")
Expand All @@ -232,7 +222,7 @@ FileTree ft_gtk = fileTree("${project(":graphics").projectDir}/src/main/native-g
LINUX.glass.glass = [:]
LINUX.glass.glass.nativeSource = ft_gtk_launcher.getFiles()
LINUX.glass.glass.compiler = compiler
LINUX.glass.glass.ccFlags = [ccFlags, gtk2CCFlags, "-Werror"].flatten()
LINUX.glass.glass.ccFlags = [ccFlags, "-Werror"].flatten()
LINUX.glass.glass.linker = linker
LINUX.glass.glass.linkFlags = IS_STATIC_BUILD? linkFlags : [linkFlags, "-lX11", "-ldl"].flatten()
LINUX.glass.glass.lib = "glass"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,16 @@

package com.sun.javafx.scene.control.behavior;


import com.sun.javafx.PlatformUtil;
import com.sun.javafx.geom.transform.Affine3D;
import com.sun.javafx.scene.NodeHelper;
import com.sun.javafx.scene.control.Properties;
import com.sun.javafx.scene.control.skin.Utils;
import com.sun.javafx.stage.WindowHelper;

import static com.sun.javafx.PlatformUtil.*;

import javafx.beans.value.ChangeListener;
import javafx.beans.value.WeakChangeListener;
import javafx.event.ActionEvent;
Expand All @@ -35,23 +44,14 @@
import javafx.geometry.Rectangle2D;
import javafx.scene.Node;
import javafx.scene.Scene;
import javafx.scene.control.ContextMenu;
import javafx.scene.control.TextField;
import javafx.scene.control.skin.TextFieldSkin;
import com.sun.javafx.scene.control.skin.Utils;
import javafx.scene.input.ContextMenuEvent;
import javafx.scene.input.KeyEvent;
import javafx.scene.input.MouseEvent;
import javafx.scene.text.HitInfo;
import javafx.stage.Screen;
import javafx.stage.Window;
import com.sun.javafx.PlatformUtil;
import com.sun.javafx.geom.transform.Affine3D;

import static com.sun.javafx.PlatformUtil.isMac;
import static com.sun.javafx.PlatformUtil.isWindows;
import com.sun.javafx.scene.NodeHelper;
import com.sun.javafx.stage.WindowHelper;

/**
* Text field behavior.
Expand Down Expand Up @@ -183,9 +183,10 @@ public void setTextFieldSkin(TextFieldSkin skin) {

textField.commitValue();
textField.fireEvent(actionEvent);

if (onAction == null && !actionEvent.isConsumed()) {
forwardToParent(event);
// fix of JDK-8207759: reverted logic
// mapping not auto-consume and consume if handled by action
if (onAction != null || actionEvent.isConsumed()) {
event.consume();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ public TextInputControlBehavior(T c) {
final Predicate<KeyEvent> validOnLinux = e -> !PlatformUtil.isLinux();

KeyMapping cancelEditMapping;
KeyMapping fireMapping;
KeyMapping consumeMostPressedEventsMapping;

// create a child input map for mappings which are applicable on all
Expand All @@ -136,7 +137,7 @@ public TextInputControlBehavior(T c) {
keyMapping(HOME, e -> c.home()),
keyMapping(DOWN, e -> c.end()),
keyMapping(END, e -> c.end()),
keyMapping(ENTER, this::fire),
fireMapping = keyMapping(ENTER, this::fire),

keyMapping(new KeyBinding(HOME).shortcut(), e -> c.home()),
keyMapping(new KeyBinding(END).shortcut(), e -> c.end()),
Expand Down Expand Up @@ -213,6 +214,8 @@ public TextInputControlBehavior(T c) {
);

cancelEditMapping.setAutoConsume(false);
// fix of JDK-8207759: don't auto-consume
fireMapping.setAutoConsume(false);
consumeMostPressedEventsMapping.setAutoConsume(false);

// mac os specific mappings
Expand Down Expand Up @@ -620,18 +623,7 @@ private void rightWord() {
}

protected void fire(KeyEvent event) { } // TODO move to TextFieldBehavior
protected void cancelEdit(KeyEvent event) { forwardToParent(event);} // not autoconsumed

protected void forwardToParent(KeyEvent event) {
// fix for JDK-8145515
if (getNode().getProperties().containsKey(DISABLE_FORWARD_TO_PARENT)) {
return;
}

if (getNode().getParent() != null) {
getNode().getParent().fireEvent(event);
}
}
protected void cancelEdit(KeyEvent event) { };

protected void selectHome() {
getNode().selectHome();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,28 +25,28 @@

package javafx.scene.control.skin;

import com.sun.javafx.scene.control.skin.Utils;
import javafx.beans.property.ObjectProperty;
import javafx.collections.WeakListChangeListener;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.WeakHashMap;
import java.util.concurrent.atomic.AtomicBoolean;

import javafx.collections.FXCollections;
import javafx.collections.ListChangeListener;
import javafx.collections.ObservableList;
import javafx.collections.WeakListChangeListener;
import javafx.event.EventHandler;
import javafx.geometry.NodeOrientation;
import javafx.scene.Cursor;
import javafx.scene.Node;
import javafx.scene.control.*;
import javafx.scene.control.ResizeFeaturesBase;
import javafx.scene.control.TableColumnBase;
import javafx.scene.control.TableView;
import javafx.scene.control.TreeTableView;
import javafx.scene.input.MouseEvent;
import javafx.scene.paint.Color;
import javafx.scene.shape.Rectangle;
import javafx.util.Callback;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.WeakHashMap;

/**
* <p>This class is used to construct the header of a TableView. We take the approach
* that every TableView header is nested - even if it isn't. This allows for us
Expand Down Expand Up @@ -165,7 +165,11 @@ public NestedTableColumnHeader(final TableColumnBase tc) {
if (me.getClickCount() == 2 && me.isPrimaryButtonDown()) {
// the user wants to resize the column such that its
// width is equal to the widest element in the column
TableSkinUtils.resizeColumnToFitContent(header.getTableSkin(), column, -1);
TableHeaderRow tableHeader = header.getTableHeaderRow();
TableColumnHeader columnHeader = tableHeader.getColumnHeaderFor(column);
if (columnHeader != null) {
columnHeader.resizeColumnToFitContent(-1);
}
} else {
// rather than refer to the rect variable, we just grab
// it from the source to prevent a small memory leak.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public ProgressBarSkin(ProgressBar control) {

barWidth = ((int) (control.getWidth() - snappedLeftInset() - snappedRightInset()) * 2 * Math.min(1, Math.max(0, control.getProgress()))) / 2.0F;

control.widthProperty().addListener(observable -> updateProgress());
registerChangeListener(control.widthProperty(), o -> updateProgress());

initialize();
getSkinnable().requestLayout();
Expand Down
Loading

0 comments on commit 8a5344c

Please sign in to comment.