Skip to content

Commit

Permalink
Revert "JBR-6372: implement detecting of OS theme on linux"
Browse files Browse the repository at this point in the history
This reverts commit 51d6761.
  • Loading branch information
vprovodin committed May 4, 2024
1 parent 9bd0b74 commit 2b4af61
Show file tree
Hide file tree
Showing 7 changed files with 0 additions and 712 deletions.
2 changes: 0 additions & 2 deletions make/modules/java.desktop/lib/Awt2dLibraries.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,6 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBAWT, \
DISABLED_WARNINGS_clang_debug_trace.c := format-nonliteral, \
DISABLED_WARNINGS_clang_Trace.c := format-nonliteral, \
DISABLED_WARNINGS_clang_TransformHelper.c := sign-compare, \
DISABLED_WARNINGS_clang_system_properties.c := format-nonliteral, \
DISABLED_WARNINGS_microsoft := 4244 4996, \
DISABLED_WARNINGS_microsoft_awt_Toolkit.cpp := 4267, \
LDFLAGS := $(LDFLAGS_JDKLIB) $(call SET_SHARED_LIBRARY_ORIGIN), \
Expand Down Expand Up @@ -1112,7 +1111,6 @@ ifeq ($(call isTargetOs, macosx), true)
DISABLED_WARNINGS_clang_OGLPaints.c := format-nonliteral, \
DISABLED_WARNINGS_clang_PrinterView.m := enum-conversion, \
DISABLED_WARNINGS_clang_SystemHotkey.m := format-nonliteral, \
DISABLED_WARNINGS_clang_system_properties.c := format-nonliteral, \
LDFLAGS := $(LDFLAGS_JDKLIB) \
$(call SET_SHARED_LIBRARY_ORIGIN) \
-L$(INSTALL_LIBRARIES_HERE), \
Expand Down
46 changes: 0 additions & 46 deletions src/java.desktop/unix/classes/sun/awt/UNIXToolkit.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
package sun.awt;

import java.awt.RenderingHints;
import java.awt.Toolkit;

import static java.awt.RenderingHints.KEY_TEXT_ANTIALIASING;
import static java.awt.RenderingHints.VALUE_TEXT_ANTIALIAS_DEFAULT;
Expand Down Expand Up @@ -56,13 +55,11 @@
import java.security.PrivilegedAction;
import java.util.Arrays;

import jdk.internal.misc.InnocuousThread;
import sun.awt.X11.XBaseWindow;
import sun.security.action.GetIntegerAction;
import com.sun.java.swing.plaf.gtk.GTKConstants.TextDirection;
import sun.java2d.opengl.OGLRenderQueue;
import sun.security.action.GetPropertyAction;
import sun.util.logging.PlatformLogger;

public abstract class UNIXToolkit extends SunToolkit
{
Expand Down Expand Up @@ -115,18 +112,6 @@ public int getNumber() {
private Boolean nativeGTKAvailable;
private Boolean nativeGTKLoaded;
private BufferedImage tmpImage = null;
private static final PlatformLogger log = PlatformLogger.getLogger("sun.awt.UNIXToolkit");

private static void printError(String str) {
log.fine(str);
}

private static native void toolkitInit();

protected UNIXToolkit() {
toolkitInit();
initSystemPropertyWatcher();
}

public static int getDatatransferTimeout() {
@SuppressWarnings("removal")
Expand Down Expand Up @@ -563,8 +548,6 @@ private static boolean isOnXWayland() {
return result;
}

private static native int isSystemDarkColorScheme();

@Override
public boolean isRunningOnXWayland() {
return isOnXWayland();
Expand All @@ -583,35 +566,6 @@ public boolean isRunningOnXWayland() {
// application icons).
private static final WindowFocusListener waylandWindowFocusListener;

private static final String OS_THEME_IS_DARK = "awt.os.theme.isDark";

private static Thread systemPropertyWatcher = null;

private void initSystemPropertyWatcher() {
int initialSystemDarkColorScheme = isSystemDarkColorScheme();

if (initialSystemDarkColorScheme >= 0) {
setDesktopProperty(OS_THEME_IS_DARK, initialSystemDarkColorScheme != 0);

systemPropertyWatcher = InnocuousThread.newThread("SystemPropertyWatcher",
() -> {
while (true) {
try {
int isSystemDarkColorScheme = isSystemDarkColorScheme();
if (isSystemDarkColorScheme >= 0) {
setDesktopProperty(OS_THEME_IS_DARK, isSystemDarkColorScheme != 0);
}

Thread.sleep(1000);
} catch (Exception ignored) {
}
}
});
systemPropertyWatcher.setDaemon(true);
systemPropertyWatcher.start();
}
}

static {
if (isOnXWayland()) {
waylandWindowFocusListener = new WindowAdapter() {
Expand Down
108 changes: 0 additions & 108 deletions src/java.desktop/unix/native/common/awt/dbus_interface.c

This file was deleted.

179 changes: 0 additions & 179 deletions src/java.desktop/unix/native/common/awt/dbus_interface.h

This file was deleted.

Loading

0 comments on commit 2b4af61

Please sign in to comment.