This commit is contained in:
J. Duke 2017-07-05 16:53:56 +02:00
commit 3cd535c3d2
144 changed files with 2114 additions and 1114 deletions

View File

@ -33,3 +33,4 @@ aea0ace7a1e43619800931d42bbf69c579361c2d jdk7-b55
ba12117a5e6c918578d6b2a8c693232a33289024 jdk7-b56
ffd09e767dfa6d21466183a400f72cf62d53297f jdk7-b57
59b497130f82ec809c245ffb5e521e3a5fabf8af jdk7-b58
030142474602b4a067662fffc0c8e541de5a78df jdk7-b59

View File

@ -33,3 +33,4 @@ bec82237d694f9802b820fa11bbb4f7fa9bf8e77 jdk7-b52
553a664b807bb3a3c93f3b5a3c20ff0a90e08371 jdk7-b56
972c6157fae57850694675da82fd58a17930db0a jdk7-b57
2e3b8edab3ef55406494d3dd562e06882e6fc15e jdk7-b58
7e6b2b55c00cc523b468272353ada3979adbbf16 jdk7-b59

View File

@ -1,14 +0,0 @@
README:
This file should be located at the top of the corba Mercurial repository.
See http://openjdk.java.net/ for more information about the OpenJDK.
See ../README-builds.html for complete details on build machine requirements.
Simple Build Instructions:
cd make && gnumake
The files that will be imported into the jdk build will be in the "dist"
directory.

View File

@ -73,23 +73,18 @@ ifeq ($(PLATFORM), linux)
ifneq ("$(findstring sparc,$(ARCH))", "")
# sparc or sparcv9
REQUIRED_CC_VER = 4.0
REQUIRED_GCC_VER = 4.0.*
else
ifeq ($(ARCH_DATA_MODEL), 32)
# i586
REQUIRED_CC_VER = 3.2
REQUIRED_GCC_VER = 3.2.1*
REQUIRED_GCC_VER_INT = 3.2.1-7a
else
ifeq ($(ARCH), amd64)
# amd64
REQUIRED_CC_VER = 3.2
REQUIRED_GCC_VER = 3.2.*
endif
ifeq ($(ARCH), ia64)
# ia64
REQUIRED_CC_VER = 3.2
REQUIRED_GCC_VER = 2.9[56789].*
endif
endif
endif
@ -109,13 +104,6 @@ ifeq ($(PLATFORM), solaris)
# Option used to create a shared library
SHARED_LIBRARY_FLAG = -G
# But gcc is still needed no matter what on 32bit
ifeq ($(ARCH_DATA_MODEL), 32)
REQUIRED_GCC_VER = 2.95
GCC =$(GCC_COMPILER_PATH)gcc
_GCC_VER :=$(shell $(GCC) -dumpversion 2>&1 )
GCC_VER :=$(call GetVersion,"$(_GCC_VER)")
endif
endif

View File

@ -39,13 +39,6 @@ ifeq ($(PLATFORM), solaris)
LINT = $(COMPILER_PATH)lint
# Option used to create a shared library
SHARED_LIBRARY_FLAG = -G
# But gcc is still needed no matter what on 32bit
ifeq ($(ARCH_DATA_MODEL), 32)
REQUIRED_GCC_VER = 2.95
GCC =$(GCC_COMPILER_PATH)gcc
_GCC_VER :=$(shell $(GCC) -dumpversion 2>&1 )
GCC_VER :=$(call GetVersion,"$(_GCC_VER)")
endif
endif
# Sun Studio Compiler settings specific to Linux

View File

@ -288,11 +288,22 @@ ifeq ($(PLATFORM), windows)
TEMP_DISK=C:/temp
# GNU Make or MKS overrides $(PROCESSOR_ARCHITECTURE) to always
# return "x86". Use the first word of $(PROCESSOR_IDENTIFIER) instead.
PROC_ARCH:=$(word 1, $(PROCESSOR_IDENTIFIER))
PROC_ARCH:=$(subst x86,X86,$(PROC_ARCH))
PROC_ARCH:=$(subst x64,X64,$(PROC_ARCH))
PROC_ARCH:=$(subst intel64,X64,$(PROC_ARCH))
PROC_ARCH:=$(subst Intel64,X64,$(PROC_ARCH))
PROC_ARCH:=$(subst INTEL64,X64,$(PROC_ARCH))
PROC_ARCH:=$(subst em64t,X64,$(PROC_ARCH))
PROC_ARCH:=$(subst EM64T,X64,$(PROC_ARCH))
PROC_ARCH:=$(subst amd64,X64,$(PROC_ARCH))
PROC_ARCH:=$(subst AMD64,X64,$(PROC_ARCH))
PROC_ARCH:=$(subst ia64,IA64,$(PROC_ARCH))
ifndef ARCH_DATA_MODEL
ifeq ($(word 1, $(PROCESSOR_IDENTIFIER)),ia64)
ifeq ($(PROC_ARCH),IA64)
ARCH_DATA_MODEL=64
else
ifeq ($(word 1, $(PROCESSOR_IDENTIFIER)),AMD64)
ifeq ($(PROC_ARCH),X64)
ARCH_DATA_MODEL=64
else
ARCH_DATA_MODEL=32
@ -313,10 +324,12 @@ ifeq ($(PLATFORM), windows)
# + set ARCH to ia64 or amd64, or
REQUIRED_WINDOWS_NAME=Windows Server 2003
REQUIRED_WINDOWS_VERSION=5 2 Service Pack 1
ifeq ($(word 1, $(PROCESSOR_IDENTIFIER)), AMD64)
ifeq ($(PROC_ARCH),X64)
ARCH=amd64
else
ARCH=ia64
ifeq ($(PROC_ARCH),IA64)
ARCH=ia64
endif
endif
LIBARCH=$(ARCH)
# Value of Java os.arch property

View File

@ -33,3 +33,4 @@ f8e839c086152da70d6ec5913ba6f9f509282e8d jdk7-b55
a3fd9e40ff2e854f6169eb6d09d491a28634d04f jdk7-b56
f4cbf78110c726919f46b59a3b054c54c7e889b4 jdk7-b57
53d9bf689e80fcc76b221bbe6c5d58e08b80cbc6 jdk7-b58
c55be0c7bd32c016c52218eb4c8b5da8a75450b5 jdk7-b59

View File

@ -1,14 +0,0 @@
README:
This file should be located at the top of the hotspot Mercurial repository.
See http://openjdk.java.net/ for more information about the OpenJDK.
See ../README-builds.html for complete details on build machine requirements.
Simple Build Instructions:
cd make && gnumake
The files that will be imported into the jdk build will be in the "build"
directory.

View File

@ -171,3 +171,9 @@ DEBUG_CFLAGS += $(DEBUG_CFLAGS/$(BUILDARCH))
ifeq ($(DEBUG_CFLAGS/$(BUILDARCH)),)
DEBUG_CFLAGS += -gstabs
endif
# DEBUG_BINARIES overrides everything, use full -g debug information
ifeq ($(DEBUG_BINARIES), true)
DEBUG_CFLAGS = -g
CFLAGS += $(DEBUG_CFLAGS)
endif

View File

@ -41,10 +41,15 @@ LIBJSIG_MAPFILE = $(MAKEFILES_DIR)/mapfile-vers-jsig
LFLAGS_JSIG += -D_GNU_SOURCE -D_REENTRANT $(LDFLAGS_HASH_STYLE)
# DEBUG_BINARIES overrides everything, use full -g debug information
ifeq ($(DEBUG_BINARIES), true)
JSIG_DEBUG_CFLAGS = -g
endif
$(LIBJSIG): $(JSIGSRCDIR)/jsig.c $(LIBJSIG_MAPFILE)
@echo Making signal interposition lib...
$(QUIETLY) $(CC) $(SYMFLAG) $(ARCHFLAG) $(SHARED_FLAG) $(PICFLAG) \
$(LFLAGS_JSIG) -o $@ $< -ldl
$(LFLAGS_JSIG) $(JSIG_DEBUG_CFLAGS) -o $@ $< -ldl
install_jsig: $(LIBJSIG)
@echo "Copying $(LIBJSIG) to $(DEST_JSIG)"

View File

@ -43,6 +43,11 @@ SAMAPFILE = $(SASRCDIR)/mapfile
DEST_SAPROC = $(JDK_LIBDIR)/$(LIBSAPROC)
# DEBUG_BINARIES overrides everything, use full -g debug information
ifeq ($(DEBUG_BINARIES), true)
SA_DEBUG_CFLAGS = -g
endif
# if $(AGENT_DIR) does not exist, we don't build SA
# also, we don't build SA on Itanium.
@ -67,6 +72,7 @@ $(LIBSAPROC): $(SASRCFILES) $(SAMAPFILE)
-I$(BOOT_JAVA_HOME)/include/$(Platform_os_family) \
$(SASRCFILES) \
$(SA_LFLAGS) \
$(SA_DEBUG_CFLAGS) \
-o $@ \
-lthread_db

View File

@ -73,7 +73,7 @@ class FileBuff {
// This converts a pointer into the buffer to a file offset. It only works
// when the pointer is valid (i.e. just obtained from getline()).
long getoff(const char* s) { return _bufoff + (s - _buf); }
long getoff(const char* s) { return _bufoff + (long)(s - _buf); }
};
//------------------------------FileBuffRegion---------------------------------

View File

@ -33,3 +33,4 @@ e8837366d3fd72f7c7a47ebfdbd5106c16156f12 jdk7-b53
c197c6801271c60f9c9f5d18fcc95b59e76dcd54 jdk7-b56
e4851e9f7be26fc52a628be06ffa8aaea0919bd7 jdk7-b57
13bf67d8c6341b841d268985cabaf747f2652bc8 jdk7-b58
75113d7ce083048e7576b9d0d60a4e80db6b181f jdk7-b59

View File

@ -69,6 +69,10 @@ else
endif
endif
ifeq ($(DEBUG_CLASSFILES), true)
ANT_OPTIONS += -Djavac.debug=true
endif
# Note: jdk/make/common/Defs.gmk uses LANGUAGE_VERSION (-source NN)
# and the somewhat misnamed CLASS_VERSION (-target NN)
ifdef TARGET_CLASS_VERSION

View File

@ -1,14 +0,0 @@
README:
This file should be located at the top of the jaxp Mercurial repository.
See http://openjdk.java.net/ for more information about the OpenJDK.
See ../README-builds.html for complete details on build machine requirements.
Simple Build Instructions:
cd make && gnumake
The files that will be imported into the jdk build will be in the "dist"
directory.

View File

@ -32,7 +32,6 @@
# options for the <javac> tasks used to compile the tools
javac.target = 5
javac.debug = true
javac.debuglevel = source,lines
javac.no.jdk.warnings = -XDignore.symbol.file=true
# set the following to -version to verify the versions of javac being used
javac.version.opt =

View File

@ -85,6 +85,7 @@
destdir="${build.classes.dir}"
memoryInitialSize="${javac.memoryInitialSize}"
memoryMaximumSize="${javac.memoryMaximumSize}"
debug="${javac.debug}"
target="${javac.target}">
<compilerarg value="-J-Xbootclasspath/p:${bootstrap.dir}/lib/javac.jar"/>
<compilerarg line="${javac.version.opt}"/>

View File

@ -33,3 +33,4 @@ e0eebd978b830c09e7862cff3f77a914c15651c9 jdk7-b55
0f7fbf85f7a1d9c027a863b9955c623352ed1292 jdk7-b56
68257a5eb19afc11aee7eb19f7250f9b9eec7c05 jdk7-b57
5fb4fbea81c3609916da00417fdd15dbd9e39e97 jdk7-b58
f64566bf4c2bc92e65ab2b9fab51b119f0d493d1 jdk7-b59

View File

@ -69,6 +69,10 @@ else
endif
endif
ifeq ($(DEBUG_CLASSFILES), true)
ANT_OPTIONS += -Djavac.debug=true
endif
# Note: jdk/make/common/Defs.gmk uses LANGUAGE_VERSION (-source NN)
# and the somewhat misnamed CLASS_VERSION (-target NN)
ifdef TARGET_CLASS_VERSION

View File

@ -1,14 +0,0 @@
README:
This file should be located at the top of the jaxws Mercurial repository.
See http://openjdk.java.net/ for more information about the OpenJDK.
See ../README-builds.html for complete details on build machine requirements.
Simple Build Instructions:
cd make && gnumake
The files that will be imported into the jdk build will be in the "dist"
directory.

View File

@ -32,7 +32,6 @@
# options for the <javac> tasks used to compile the tools
javac.target = 5
javac.debug = true
javac.debuglevel = source,lines
javac.no.jdk.warnings = -XDignore.symbol.file=true
# set the following to -version to verify the versions of javac being used
javac.version.opt =

View File

@ -107,6 +107,7 @@
destdir="${build.classes.dir}"
memoryInitialSize="${javac.memoryInitialSize}"
memoryMaximumSize="${javac.memoryMaximumSize}"
debug="${javac.debug}"
target="${javac.target}"
excludes="com/sun/tools/internal/txw2/**">
<compilerarg value="-J-Xbootclasspath/p:${bootstrap.dir}/lib/javac.jar"/>

View File

@ -33,3 +33,4 @@ d1c43d1f5676a24ba86221ac7cad5694f3a9afda jdk7-b54
7fd3bc37afe36f8f6165ba679db1229716db822a jdk7-b56
d5a1223e961891564de25c39fba6f2442d0fb045 jdk7-b57
9ba256e2e5c161b89e638390f998baa175ec9abe jdk7-b58
2a5a1b269e89f27ebe419ef4cf6e66a3face0df1 jdk7-b59

View File

@ -165,6 +165,12 @@ ifeq ($(FASTDEBUG), true)
endif
endif
# DEBUG_BINARIES overrides everything, use full -g debug information
ifeq ($(DEBUG_BINARIES), true)
DEBUG_FLAG = -g
CFLAGS_REQUIRED += $(DEBUG_FLAG)
endif
CFLAGS_OPT = $(CC_OPT)
CFLAGS_DBG = $(DEBUG_FLAG)
CFLAGS_COMMON += $(CFLAGS_REQUIRED)
@ -240,8 +246,11 @@ AUTOMATIC_PCH_OPTION =
#
ifeq ($(VARIANT), OPT)
ifneq ($(NO_STRIP), true)
# Debug 'strip -g' leaves local function Elf symbols (better stack traces)
POST_STRIP_PROCESS = $(STRIP) -g
ifneq ($(DEBUG_BINARIES), true)
# Debug 'strip -g' leaves local function Elf symbols (better stack
# traces)
POST_STRIP_PROCESS = $(STRIP) -g
endif
endif
endif

View File

@ -92,6 +92,7 @@ sanity-all:: sanity-base \
sane-ld_run_path \
sane-alt_bootdir \
sane-bootdir \
sane-local-bootdir \
sane-alsa-headers \
sane-jibx

View File

@ -277,9 +277,9 @@ ifeq ($(ARCH_DATA_MODEL), 32)
# Assume PlatformSDK is in VS71 (will be empty if VS90)
_ms_sdk :=$(call FullPath,$(_msvc_dir)/PlatformSDK)
# Assume VS90, then VS80, then VS71
_redist_sdk :=$(call FullPath,$(_msvc_dir)/../SDK/v3.5/Bin)
_redist_sdk :=$(call FullPath,$(_msvc_dir)/redist/x86/Microsoft.VC90.CRT)
ifeq ($(_redist_sdk),)
_redist_sdk :=$(call FullPath,$(_msvc_dir)/../SDK/v2.0/Bin)
_redist_sdk :=$(call FullPath,$(_msvc_dir)/redist/x86/Microsoft.VC80.CRT)
ifeq ($(_redist_sdk),)
_redist_sdk :=$(call FullPath,$(_msvc_dir)/../SDK/v1.1/Bin)
endif
@ -431,9 +431,11 @@ DEVTOOLS_PATH:=$(call AltCheckSpaces,DEVTOOLS_PATH)
# _BOOTDIR1: First choice for a Bootstrap JDK, previous released JDK.
# _BOOTDIR2: Second choice
# The _BOOTDIR3 is defind optionally.
ifndef ALT_BOOTDIR
_BOOTDIR1 =$(_system_drive)/jdk$(PREVIOUS_JDK_VERSION)
_BOOTDIR2 =$(USRJDKINSTANCES_PATH)/jdk$(PREVIOUS_JDK_VERSION)
_BOOTDIR3 =$(SLASH_JAVA)/re/jdk/$(PREVIOUS_JDK_VERSION)/archive/fcs/binaries/$(PLATFORM)-$(ARCH)
endif
# 32 bit always needs 2 runtimes, 64 bit usually does too

View File

@ -94,6 +94,21 @@ $(shell \
fi)
endef
# Select a directory if it exists, or the alternate 2, or the alternate 3, or the alternate 4
define DirExists4
$(shell \
if [ -d "$1" ]; then \
echo "$1"; \
elif [ -d "$2" ]; then \
echo "$2"; \
elif [ -d "$3" ]; then \
echo "$3"; \
else \
echo "$4"; \
fi)
endef
# Select a writable directory if it exists and is writable, or the alternate
define WriteDirExists
$(shell \
@ -356,10 +371,15 @@ endif
# BOOTDIR: Bootstrap JDK, previous released JDK.
# _BOOTDIR1 and _BOOTDIR2 picked by platform
# Platform may optionally define _BOOTDIR3 as well.
ifdef ALT_BOOTDIR
BOOTDIR =$(ALT_BOOTDIR)
else
BOOTDIR :=$(call DirExists,$(_BOOTDIR1),$(_BOOTDIR2),/NO_BOOTDIR)
ifdef _BOOTDIR3
BOOTDIR :=$(call DirExists4,$(_BOOTDIR1),$(_BOOTDIR2),$(_BOOTDIR3),/NO_BOOTDIR)
else
BOOTDIR :=$(call DirExists,$(_BOOTDIR1),$(_BOOTDIR2),/NO_BOOTDIR)
endif
endif
export BOOTDIR
BOOTDIR:=$(call AltCheckSpaces,BOOTDIR)

View File

@ -194,7 +194,8 @@ include $(JDK_MAKE_SHARED_DIR)/Sanity-Settings.gmk
sane-outputdir \
sane-alt_bootdir \
sane-bootdir \
sane-cups \
sane-local-bootdir \
sane-cups \
sane-devtools_path \
sane-compiler_path \
sane-unixcommand_path \
@ -766,6 +767,23 @@ sane-bootdir:
"" >> $(ERROR_FILE) ; \
fi
######################################################
# BOOTDIR is recommended to reside on a local drive
######################################################
sane-local-bootdir:
ifeq ($(PLATFORM), windows)
@if [ `$(ECHO) $(BOOTDIR) | $(EGREP) -ci '^J:'` -ne 0 ]; then \
$(ECHO) "WARNING: Your BOOTDIR is located on the J: drive. Often the J:\n" \
" drive is mapped over a network. Using a mapped drive for\n" \
" the BOOTDIR may significantly slow down the build process.\n" \
" You may want to consider using the ALT_BOOTDIR variable\n" \
" to point the build to another location for the BOOTDIR instead. \n" \
" Your current BOOTDIR is:\n" \
" $(BOOTDIR) \n" \
"" >> $(WARNING_FILE) ; \
fi
endif
######################################################
# CACERTS_FILE must be absoulte path and readable
######################################################
@ -1502,6 +1520,9 @@ endif
# JIBX_LIBS_PATH must be valid
######################################################
sane-jibx:
ifdef DISABLE_NIMBUS
$(call SanityWarning,Disabling Nimbus will remove public API in javax.swing.plaf.nimbus.)
else
@if [ ! -r $(subst \,/,$(JIBX_LIBS_PATH))/jibx-run.jar ]; then \
$(ECHO) "ERROR: You do not have access to valid JIBX library files. \n" \
" Please check your access to \n" \
@ -1509,6 +1530,7 @@ sane-jibx:
" and/or check your value of ALT_JDK_DEVTOOLS_DIR, ALT_JIBX_LIBS_PATH \n" \
"" >> $(ERROR_FILE) ; \
fi
endif
######################################################
# MOZILLA_HEADERS_PATH must be valid

View File

@ -323,6 +323,30 @@ HTTPSERVER_DOCTITLE = "Java$(TRADEMARK) HTTP Server"
HTTPSERVER_JAVADOCHEADER = "Java HTTP Server"
# HTTPSERVER_PKGS is located in NON_CORE_PKGS.gmk
#
# Variables used by sctp target
#
SCTPAPI_SOURCEPATH = $(TOPDIR)/src/share/classes
SCTPAPI_DOCDIR = $(DOCSDIR)/jre/api/nio/sctp/spec
SCTPAPI_JAVADOCFLAGS = $(COMMON_JAVADOCFLAGS) \
-encoding ascii \
-nodeprecatedlist \
-d $(SCTPAPI_DOCDIR) \
-sourcepath $(SCTPAPI_SOURCEPATH) \
-windowtitle $(SCTPAPI_WINDOWTITLE) \
-doctitle $(SCTPAPI_DOCTITLE) \
-header $(SCTPAPI_JAVADOCHEADER) \
-bottom $(SCTPAPI_JAVADOCBOTTOM) \
-linkoffline ../../../../../api $(DOCSDIR)/api/
SCTPAPI_WINDOWTITLE = "SCTP API"
SCTPAPI_DOCTITLE = "SCTP API"
SCTPAPI_JAVADOCHEADER = "SCTP API"
SCTPAPI_JAVADOCBOTTOM = '<font size="-1"><a href="http://bugs.sun.com/services/bugreport/index.jsp">Report a bug or request a feature.</a><br>Copyright $(THIS_YEAR) Sun Microsystems, Inc. All Rights Reserved. Use is subject to license terms.</font>'
# SCTPAPI_PKGS is located in NON_CORE_PKGS.gmk
#
# Variables used by jvmti target
#
@ -451,6 +475,7 @@ ALL_OTHER_TARGETS = \
smartcardiodocs \
tracingdocs \
httpserverdocs \
sctpdocs \
mgmtdocs \
attachdocs \
jconsoledocs \
@ -631,6 +656,14 @@ httpserverdocs:
$(JAVADOC_CMD) $(HTTPSERVER_JAVADOCFLAGS) \
$(HTTPSERVER_PKGS)
.PHONY: sctpdocs
sctpdocs:
@# ######## api-sctp #######################
$(RM) -r $(SCTPAPI_DOCDIR)
$(MKDIR) -p $(SCTPAPI_DOCDIR)
$(JAVADOC_CMD) $(SCTPAPI_JAVADOCFLAGS) \
$(SCTPAPI_PKGS)
.PHONY: mgmtdocs
mgmtdocs: $(COPY-MIB-TARGET)
@# ######## api-management ############################

View File

@ -34,7 +34,9 @@ include $(BUILDDIR)/common/Defs.gmk
#
include FILES.gmk
AUTO_FILES_JAVA_DIRS = javax/swing/plaf sun/swing com/sun/java/swing/plaf
SUBDIRS = nimbus
ifndef DISABLE_NIMBUS
SUBDIRS = nimbus
endif
# Nimbus is handled in its own directory
AUTO_JAVA_PRUNE = nimbus

View File

@ -53,19 +53,19 @@ jprt.solaris_x64.build.platform.match32=solaris_i586_5.10
# Standard list of jprt test targets for this workspace
jprt.test.targets=*-*-*-jvm98
jprt.regression.test.targets= \
*-*-*-java/lang, \
*-*-*-java/security, \
*-*-*-java/text, \
*-*-*-java/util
jprt.regression.test.targets= \
*-product-*-java/lang, \
*-product-*-java/security, \
*-product-*-java/text, \
*-product-*-java/util
#jprt.regression.test.targets= \
# *-*-*-java/awt, \
# *-*-*-java/beans, \
# *-*-*-java/io, \
# *-*-*-java/net, \
# *-*-*-java/nio, \
# *-*-*-java/rmi, \
# *-product-*-java/awt, \
# *-product-*-java/beans, \
# *-product-*-java/io, \
# *-product-*-java/net, \
# *-product-*-java/nio, \
# *-product-*-java/rmi, \
# Directories needed to build
jprt.bundle.exclude.src.dirs=build

View File

@ -108,7 +108,9 @@ vpath %.c $(PLATFORM_SRC)/native/$(PKGDIR)/robot_child
#
#CFLAGS += -g
ifeq ($(DEBUG_BINARIES), true)
CFLAGS += -g
endif
ifeq ($(HEADLESS),true)
CFLAGS += -DHEADLESS=$(HEADLESS)
CPPFLAGS += -DHEADLESS=$(HEADLESS)

View File

@ -21,4 +21,4 @@
# CA 95054 USA or visit www.sun.com if you need additional information or
# have any questions.
#
tzdata2009a
tzdata2009g

View File

@ -258,7 +258,46 @@ Rule Egypt 2007 only - Sep Thu>=1 23:00s 0 -
# unless discontinued, next DST may end Thursday 28 August 2008.
# From Paul Eggert (2007-08-17):
# For lack of better info, assume the new rule is last Thursday in August.
Rule Egypt 2008 max - Aug lastThu 23:00s 0 -
# From Petr Machata (2009-04-06):
# The following appeared in Red Hat bugzilla[1] (edited):
#
# > $ zdump -v /usr/share/zoneinfo/Africa/Cairo | grep 2009
# > /usr/share/zoneinfo/Africa/Cairo Thu Apr 23 21:59:59 2009 UTC =3D Thu =
# Apr 23
# > 23:59:59 2009 EET isdst=3D0 gmtoff=3D7200
# > /usr/share/zoneinfo/Africa/Cairo Thu Apr 23 22:00:00 2009 UTC =3D Fri =
# Apr 24
# > 01:00:00 2009 EEST isdst=3D1 gmtoff=3D10800
# > /usr/share/zoneinfo/Africa/Cairo Thu Aug 27 20:59:59 2009 UTC =3D Thu =
# Aug 27
# > 23:59:59 2009 EEST isdst=3D1 gmtoff=3D10800
# > /usr/share/zoneinfo/Africa/Cairo Thu Aug 27 21:00:00 2009 UTC =3D Thu =
# Aug 27
# > 23:00:00 2009 EET isdst=3D0 gmtoff=3D7200
#
# > end date should be Thu Sep 24 2009 (Last Thursday in September at 23:59=
# :59)
# > http://support.microsoft.com/kb/958729/
#
# timeanddate[2] and another site I've found[3] also support that.
#
# [1] <a href="https://bugzilla.redhat.com/show_bug.cgi?id=3D492263">
# https://bugzilla.redhat.com/show_bug.cgi?id=3D492263
# </a>
# [2] <a href="http://www.timeanddate.com/worldclock/clockchange.html?n=3D53">
# http://www.timeanddate.com/worldclock/clockchange.html?n=3D53
# </a>
# [3] <a href="http://wwp.greenwichmeantime.com/time-zone/africa/egypt/">
# http://wwp.greenwichmeantime.com/time-zone/africa/egypt/
# </a>
# From Arthur David Olson (2009-04-20):
# In 2009 (and for the next several years), Ramadan ends before the fourth
# Thursday in September; Egypt is expected to revert to the last Thursday
# in September.
Rule Egypt 2008 only - Aug lastThu 23:00s 0 -
Rule Egypt 2009 max - Sep lastThu 23:00s 0 -
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Africa/Cairo 2:05:00 - LMT 1900 Oct
@ -586,6 +625,40 @@ Zone Indian/Mayotte 3:00:56 - LMT 1911 Jul # Mamoutzou
# <a href="http://www.timeanddate.com/news/time/morocco-ends-dst-early-2008.html">
# http://www.timeanddate.com/news/time/morocco-ends-dst-early-2008.html
# </a>
# From Steffen Thorsen (2009-03-17):
# Morocco will observe DST from 2009-06-01 00:00 to 2009-08-21 00:00 according
# to many sources, such as
# <a href="http://news.marweb.com/morocco/entertainment/morocco-daylight-saving.html">
# http://news.marweb.com/morocco/entertainment/morocco-daylight-saving.html
# </a>
# <a href="http://www.medi1sat.ma/fr/depeche.aspx?idp=2312">
# http://www.medi1sat.ma/fr/depeche.aspx?idp=2312
# </a>
# (French)
#
# Our summary:
# <a href="http://www.timeanddate.com/news/time/morocco-starts-dst-2009.html">
# http://www.timeanddate.com/news/time/morocco-starts-dst-2009.html
# </a>
# From Alexander Krivenyshev (2009-03-17):
# Here is a link to official document from Royaume du Maroc Premier Ministre,
# Ministere de la Modernisation des Secteurs Publics
#
# Under Article 1 of Royal Decree No. 455-67 of Act 23 safar 1387 (2 june 1967)
# concerning the amendment of the legal time, the Ministry of Modernization of
# Public Sectors announced that the official time in the Kingdom will be
# advanced 60 minutes from Sunday 31 May 2009 at midnight.
#
# <a href="http://www.mmsp.gov.ma/francais/Actualites_fr/PDF_Actualites_Fr/HeureEte_FR.pdf">
# http://www.mmsp.gov.ma/francais/Actualites_fr/PDF_Actualites_Fr/HeureEte_FR.pdf
# </a>
#
# <a href="http://www.worldtimezone.com/dst_news/dst_news_morocco03.html">
# http://www.worldtimezone.com/dst_news/dst_news_morocco03.html
# </a>
# RULE NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule Morocco 1939 only - Sep 12 0:00 1:00 S
@ -605,6 +678,8 @@ Rule Morocco 1978 only - Jun 1 0:00 1:00 S
Rule Morocco 1978 only - Aug 4 0:00 0 -
Rule Morocco 2008 only - Jun 1 0:00 1:00 S
Rule Morocco 2008 only - Sep 1 0:00 0 -
Rule Morocco 2009 only - Jun 1 0:00 1:00 S
Rule Morocco 2009 only - Aug 21 0:00 0 -
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Africa/Casablanca -0:30:20 - LMT 1913 Oct 26
0:00 Morocco WE%sT 1984 Mar 16
@ -809,6 +884,43 @@ Zone Africa/Lome 0:04:52 - LMT 1893
# Ending : the last Sunday of October at 03:00 ...
# http://www.tap.info.tn/en/index.php?option=com_content&task=view&id=1188&Itemid=50
# From Steffen Thorsen (2009-03-16):
# According to several news sources, Tunisia will not observe DST this year.
# (Arabic)
# <a href="http://www.elbashayer.com/?page=viewn&nid=42546">
# http://www.elbashayer.com/?page=viewn&nid=42546
# </a>
# <a href="http://www.babnet.net/kiwidetail-15295.asp">
# http://www.babnet.net/kiwidetail-15295.asp
# </a>
#
# We have also confirmed this with the US embassy in Tunisia.
# We have a wrap-up about this on the following page:
# <a href="http://www.timeanddate.com/news/time/tunisia-cancels-dst-2009.html">
# http://www.timeanddate.com/news/time/tunisia-cancels-dst-2009.html
# </a>
# From Alexander Krivenyshev (2009-03-17):
# Here is a link to Tunis Afrique Presse News Agency
#
# Standard time to be kept the whole year long (tap.info.tn):
#
# (in English)
# <a href="http://www.tap.info.tn/en/index.php?option=com_content&task=view&id=26813&Itemid=157">
# http://www.tap.info.tn/en/index.php?option=com_content&task=view&id=26813&Itemid=157
# </a>
#
# (in Arabic)
# <a href="http://www.tap.info.tn/ar/index.php?option=com_content&task=view&id=61240&Itemid=1">
# http://www.tap.info.tn/ar/index.php?option=com_content&task=view&id=61240&Itemid=1
# </a>
# From Arthur David Olson (2009--3-18):
# The Tunis Afrique Presse News Agency notice contains this: "This measure is due to the fact
# that the fasting month of ramadan coincides with the period concerned by summer time.
# Therefore, the standard time will be kept unchanged the whole year long."
# So foregoing DST seems to be an exception (albeit one that may be repeated in the future).
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule Tunisia 1939 only - Apr 15 23:00s 1:00 S
Rule Tunisia 1939 only - Nov 18 23:00s 0 -
@ -833,8 +945,10 @@ Rule Tunisia 1989 only - Mar 26 0:00s 1:00 S
Rule Tunisia 1990 only - May 1 0:00s 1:00 S
Rule Tunisia 2005 only - May 1 0:00s 1:00 S
Rule Tunisia 2005 only - Sep 30 1:00s 0 -
Rule Tunisia 2006 max - Mar lastSun 2:00s 1:00 S
Rule Tunisia 2006 max - Oct lastSun 2:00s 0 -
Rule Tunisia 2006 2008 - Mar lastSun 2:00s 1:00 S
Rule Tunisia 2006 2008 - Oct lastSun 2:00s 0 -
Rule Tunisia 2010 max - Mar lastSun 2:00s 1:00 S
Rule Tunisia 2010 max - Oct lastSun 2:00s 0 -
# Shanks & Pottenger give 0:09:20 for Paris Mean Time; go with Howse's
# more precise 0:09:21.
# Shanks & Pottenger say the 1911 switch was on Mar 9; go with Howse's Mar 11.

View File

@ -1071,6 +1071,40 @@ Zone Asia/Tokyo 9:18:59 - LMT 1887 Dec 31 15:00u
# http://www.petranews.gov.jo/nepras/2006/Sep/05/4000.htm
# "Jordan will switch to winter time on Friday, October 27".
#
# From Phil Pizzey (2009-04-02):
# ...I think I may have spotted an error in the timezone data for
# Jordan.
# The current (2009d) asia file shows Jordan going to daylight
# saving
# time on the last Thursday in March.
#
# Rule Jordan 2000 max - Mar lastThu 0:00s 1:00 S
#
# However timeanddate.com, which I usually find reliable, shows Jordan
# going to daylight saving time on the last Friday in March since 2002.
# Please see
# <a href="http://www.timeanddate.com/worldclock/timezone.html?n=11">
# http://www.timeanddate.com/worldclock/timezone.html?n=11
# </a>
# From Steffen Thorsen (2009-04-02):
# This single one might be good enough, (2009-03-24, Arabic):
# <a href="http://petra.gov.jo/Artical.aspx?Lng=2&Section=8&Artical=95279">
# http://petra.gov.jo/Artical.aspx?Lng=2&Section=8&Artical=95279
# </a>
#
# Google's translation:
#
# > The Council of Ministers decided in 2002 to adopt the principle of timely
# > submission of the summer at 60 minutes as of midnight on the last Thursday
# > of the month of March of each year.
#
# So - this means the midnight between Thursday and Friday since 2002.
# From Arthur David Olson (2009-04-06):
# We still have Jordan switching to DST on Thursdays in 2000 and 2001.
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule Jordan 1973 only - Jun 6 0:00 1:00 S
Rule Jordan 1973 1975 - Oct 1 0:00 0 -
@ -1093,8 +1127,9 @@ Rule Jordan 1993 1998 - Apr Fri>=1 0:00 1:00 S
Rule Jordan 1994 only - Sep Fri>=15 0:00 0 -
Rule Jordan 1995 1998 - Sep Fri>=15 0:00s 0 -
Rule Jordan 1999 only - Jul 1 0:00s 1:00 S
Rule Jordan 1999 2002 - Sep lastThu 0:00s 0 -
Rule Jordan 2000 max - Mar lastThu 0:00s 1:00 S
Rule Jordan 1999 2002 - Sep lastFri 0:00s 0 -
Rule Jordan 2000 2001 - Mar lastThu 0:00s 1:00 S
Rule Jordan 2002 max - Mar lastFri 0:00s 1:00 S
Rule Jordan 2003 only - Oct 24 0:00s 0 -
Rule Jordan 2004 only - Oct 15 0:00s 0 -
Rule Jordan 2005 only - Sep lastFri 0:00s 0 -
@ -1576,11 +1611,46 @@ Zone Asia/Muscat 3:54:20 - LMT 1920
# http://dailymailnews.com/200808/28/news/dmbrn03.html
# </a>
# From Alexander Krivenyshev (2009-04-08):
# Based on previous media reports that "... proposed plan to
# advance clocks by one hour from May 1 will cause disturbance
# to the working schedules rather than bringing discipline in
# official working."
# <a href="http://www.thenews.com.pk/daily_detail.asp?id=171280">
# http://www.thenews.com.pk/daily_detail.asp?id=171280
# </a>
#
# recent news that instead of May 2009 - Pakistan plan to
# introduce DST from April 15, 2009
#
# FYI: Associated Press Of Pakistan
# April 08, 2009
# Cabinet okays proposal to advance clocks by one hour from April 15
# <a href="http://www.app.com.pk/en_/index.php?option=com_content&task=view&id=73043&Itemid=1">
# http://www.app.com.pk/en_/index.php?option=com_content&task=view&id=73043&Itemid=1
# </a>
#
# or
#
# <a href="http://www.worldtimezone.com/dst_news/dst_news_pakistan05.html">
# http://www.worldtimezone.com/dst_news/dst_news_pakistan05.html
# </a>
#
# ....
# The Federal Cabinet on Wednesday approved the proposal to
# advance clocks in the country by one hour from April 15 to
# conserve energy"
# From Arthur David Olson (2009-04-10):
# Assume for now that Pakistan will end DST in 2009 as it did in 2008.
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule Pakistan 2002 only - Apr Sun>=2 0:01 1:00 S
Rule Pakistan 2002 only - Oct Sun>=2 0:01 0 -
Rule Pakistan 2008 only - Jun 1 0:00 1:00 S
Rule Pakistan 2008 only - Nov 1 0:00 0 -
Rule Pakistan 2009 only - Apr 15 0:00 1:00 S
Rule Pakistan 2009 only - Nov 1 0:00 0 -
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Asia/Karachi 4:28:12 - LMT 1907
5:30 - IST 1942 Sep
@ -1717,6 +1787,22 @@ Zone Asia/Karachi 4:28:12 - LMT 1907
# http://www.worldtimezone.com/dst_news/dst_news_gazastrip01.html
# </a>
# From Alexander Krivenyshev (2009-03-26):
# According to the Palestine News Network (arabic.pnn.ps), Palestinian
# government decided to start Daylight Time on Thursday night March
# 26 and continue until the night of 27 September 2009.
#
# (in Arabic)
# <a href="http://arabic.pnn.ps/index.php?option=com_content&task=view&id=50850">
# http://arabic.pnn.ps/index.php?option=com_content&task=view&id=50850
# </a>
#
# or
# (English translation)
# <a href="http://www.worldtimezone.com/dst_news/dst_news_westbank01.html">
# http://www.worldtimezone.com/dst_news/dst_news_westbank01.html
# </a>
# The rules for Egypt are stolen from the `africa' file.
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule EgyptAsia 1957 only - May 10 0:00 1:00 S
@ -1730,10 +1816,12 @@ Rule Palestine 1999 2005 - Apr Fri>=15 0:00 1:00 S
Rule Palestine 1999 2003 - Oct Fri>=15 0:00 0 -
Rule Palestine 2004 only - Oct 1 1:00 0 -
Rule Palestine 2005 only - Oct 4 2:00 0 -
Rule Palestine 2006 max - Apr 1 0:00 1:00 S
Rule Palestine 2006 2008 - Apr 1 0:00 1:00 S
Rule Palestine 2006 only - Sep 22 0:00 0 -
Rule Palestine 2007 only - Sep Thu>=8 2:00 0 -
Rule Palestine 2008 max - Aug lastThu 2:00 0 -
Rule Palestine 2008 only - Aug lastFri 2:00 0 -
Rule Palestine 2009 max - Mar lastFri 0:00 1:00 S
Rule Palestine 2009 max - Sep lastMon 2:00 0 -
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Asia/Gaza 2:17:52 - LMT 1900 Oct
@ -1991,8 +2079,29 @@ Rule Syria 2007 only - Nov Fri>=1 0:00 0 -
# http://sana.sy/ara/2/2008/10/07/195459.htm
# </a>
Rule Syria 2008 max - Apr Fri>=1 0:00 1:00 S
# From Steffen Thorsen (2009-03-19):
# Syria will start DST on 2009-03-27 00:00 this year according to many sources,
# two examples:
#
# <a href="http://www.sana.sy/eng/21/2009/03/17/217563.htm">
# http://www.sana.sy/eng/21/2009/03/17/217563.htm
# </a>
# (English, Syrian Arab News # Agency)
# <a href="http://thawra.alwehda.gov.sy/_View_news2.asp?FileName=94459258720090318012209">
# http://thawra.alwehda.gov.sy/_View_news2.asp?FileName=94459258720090318012209
# </a>
# (Arabic, gov-site)
#
# We have not found any sources saying anything about when DST ends this year.
#
# Our summary
# <a href="http://www.timeanddate.com/news/time/syria-dst-starts-march-27-2009.html">
# http://www.timeanddate.com/news/time/syria-dst-starts-march-27-2009.html
# </a>
Rule Syria 2008 only - Apr Fri>=1 0:00 1:00 S
Rule Syria 2008 max - Nov 1 0:00 0 -
Rule Syria 2009 max - Mar lastFri 0:00 1:00 S
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Asia/Damascus 2:25:12 - LMT 1920 # Dimashq

View File

@ -75,40 +75,32 @@ Leap 2008 Dec 31 23:59:60 + S
# SERVICE DE LA ROTATION TERRESTRE
# OBSERVATOIRE DE PARIS
# 61, Av. de l'Observatoire 75014 PARIS (France)
# Tel. : 33 (0) 1 40 51 22 26
# Tel. : 33 (0) 1 40 51 22 29
# FAX : 33 (0) 1 40 51 22 91
# e-mail : services.iers@obspm.fr
# http://hpiers.obspm.fr/eop-pc
# Internet : services.iers@obspm.fr
#
# Paris, 4 July 2008
# Paris, 15 January 2009
#
# Bulletin C 36
# Bulletin C 37
#
# To authorities responsible
# for the measurement and
# distribution of time
#
# UTC TIME STEP
# on the 1st of January 2009
# INFORMATION ON UTC - TAI
#
# A positive leap second will be introduced at the end of December 2008.
# The sequence of dates of the UTC second markers will be:
# NO positive leap second will be introduced at the end of June 2009.
# The difference between Coordinated Universal Time UTC and the
# International Atomic Time TAI is :
#
# 2008 December 31, 23h 59m 59s
# 2008 December 31, 23h 59m 60s
# 2009 January 1, 0h 0m 0s
#
# The difference between UTC and the International Atomic Time TAI is:
#
# from 2006 January 1, 0h UTC, to 2009 January 1 0h UTC : UTC-TAI = - 33s
# from 2009 January 1, 0h UTC, until further notice : UTC-TAI = - 34s
# from 2009 January 1, 0h UTC, until further notice : UTC-TAI = -34 s
#
# Leap seconds can be introduced in UTC at the end of the months of December
# or June, depending on the evolution of UT1-TAI. Bulletin C is mailed every
# six months, either to announce a time step in UTC or to confirm that there
# or June, depending on the evolution of UT1-TAI. Bulletin C is mailed every
# six months, either to announce a time step in UTC, or to confirm that there
# will be no time step at the next possible date.
#
# Daniel GAMBIS
# Head
# Earth Orientation Center of IERS
# Head
# Earth Orientation Center of the IERS
# Observatoire de Paris, France

View File

@ -2280,6 +2280,25 @@ Zone America/Costa_Rica -5:36:20 - LMT 1890 # San Jose
# From Arthur David Olson (2008-03-12):
# Assume Sun>=15 (third Sunday) going forward.
# From Alexander Krivenyshev (2009-03-04)
# According to the Radio Reloj - Cuba will start Daylight Saving Time on
# midnight between Saturday, March 07, 2009 and Sunday, March 08, 2009-
# not on midnight March 14 / March 15 as previously thought.
#
# <a href="http://www.worldtimezone.com/dst_news/dst_news_cuba05.html">
# http://www.worldtimezone.com/dst_news/dst_news_cuba05.html
# (in Spanish)
# </a>
# From Arthur David Olson (2009-03-09)
# I listened over the Internet to
# <a href="http://media.enet.cu/readioreloj">
# http://media.enet.cu/readioreloj
# </a>
# this morning; when it was 10:05 a. m. here in Bethesda, Maryland the
# the time was announced as "diez cinco"--the same time as here, indicating
# that has indeed switched to DST. Assume second Sunday from 2009 forward.
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule Cuba 1928 only - Jun 10 0:00 1:00 D
Rule Cuba 1928 only - Oct 10 0:00 0 S
@ -2312,7 +2331,8 @@ Rule Cuba 1998 2003 - Oct lastSun 0:00s 0 S
Rule Cuba 2000 2004 - Apr Sun>=1 0:00s 1:00 D
Rule Cuba 2006 max - Oct lastSun 0:00s 0 S
Rule Cuba 2007 only - Mar Sun>=8 0:00s 1:00 D
Rule Cuba 2008 max - Mar Sun>=15 0:00s 1:00 D
Rule Cuba 2008 only - Mar Sun>=15 0:00s 1:00 D
Rule Cuba 2009 max - Mar Sun>=8 0:00s 1:00 D
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone America/Havana -5:29:28 - LMT 1890

View File

@ -373,6 +373,50 @@ Rule Arg 2008 max - Oct Sun>=15 0:00 1:00 S
# keep America/Cordoba a single region rather than splitting it into the
# other 5 subregions.
# From Mariano Absatz (2009-03-13):
# Yesterday (with our usual 2-day notice) the Province of San Luis
# decided that next Sunday instead of "staying" @utc-03:00 they will go
# to utc-04:00 until the second Saturday in October...
#
# The press release is at
# <a href="http://www.sanluis.gov.ar/SL/Paginas/NoticiaDetalle.asp?TemaId=1&InfoPrensaId=3102">
# http://www.sanluis.gov.ar/SL/Paginas/NoticiaDetalle.asp?TemaId=1&InfoPrensaId=3102
# </a>
# (I couldn't find the decree, but
# <a href="http://www.sanluis.gov.ar">
# www.sanluis.gov.ar
# <a/>
# is the official page for the Province Government).
#
# There's also a note in only one of the major national papers (La Nación) at
# <a href="http://www.lanacion.com.ar/nota.asp?nota_id=1107912">
# http://www.lanacion.com.ar/nota.asp?nota_id=1107912
# </a>
#
# The press release says:
# (...) anunció que el próximo domingo a las 00:00 los puntanos deberán
# atrasar una hora sus relojes.
#
# A partir de entonces, San Luis establecerá el huso horario propio de
# la Provincia. De esta manera, durante el periodo del calendario anual
# 2009, el cambio horario quedará comprendido entre las 00:00 del tercer
# domingo de marzo y las 24:00 del segundo sábado de octubre.
# Quick&dirty translation
# (...) announced that next Sunday, at 00:00, Puntanos (the San Luis
# inhabitants) will have to turn back one hour their clocks
#
# Since then, San Luis will establish its own Province timezone. Thus,
# during 2009, this timezone change will run from 00:00 the third Sunday
# in March until 24:00 of the second Saturday in October.
# From Arthur David Olson (2009-03-16):
# The unofficial claim at
# <a href="http://www.timeanddate.com/news/time/san-luis-new-time-zone.html">
# http://www.timeanddate.com/news/time/san-luis-new-time-zone.html
# </a>
# is that "The province will most likely follow the next daylight saving schedule,
# which is planned for the second Sunday in October."
#
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
#
@ -520,7 +564,8 @@ Zone America/Argentina/San_Luis -4:25:24 - LMT 1894 Oct 31
-3:00 - ART 2004 May 31
-4:00 - WART 2004 Jul 25
-3:00 Arg AR%sT 2008 Jan 21
-3:00 - ART
-3:00 - ART 2009 Mar 15
-4:00 Arg WAR%sT
#
# Santa Cruz (SC)
Zone America/Argentina/Rio_Gallegos -4:36:52 - LMT 1894 Oct 31

View File

@ -128,6 +128,7 @@ SUNWprivate_1.1 {
Java_sun_awt_X11_XlibWrapper_SetToolkitErrorHandler;
Java_sun_awt_X11_XlibWrapper_XSetErrorHandler;
Java_sun_awt_X11_XlibWrapper_CallErrorHandler;
Java_sun_awt_X11_XlibWrapper_PrintXErrorEvent;
Java_sun_awt_X11_XlibWrapper_XInternAtoms;
Java_sun_awt_X11_XlibWrapper_XChangeWindowAttributes;
Java_sun_awt_X11_XlibWrapper_XDeleteProperty;
@ -154,7 +155,7 @@ SUNWprivate_1.1 {
Java_sun_awt_X11_XRobotPeer_mouseReleaseImpl;
Java_sun_awt_X11_XRobotPeer_mouseWheelImpl;
Java_sun_awt_X11_XRobotPeer_setup;
Java_sun_awt_X11_XRobotPeer_getNumberOfButtonsImpl;
Java_sun_awt_X11_XToolkit_getNumberOfButtonsImpl;
Java_java_awt_Component_initIDs;
Java_java_awt_Container_initIDs;
Java_java_awt_Button_initIDs;
@ -276,7 +277,6 @@ SUNWprivate_1.1 {
Java_sun_awt_X11_XToolkit_getDefaultXColormap;
Java_sun_awt_X11_XToolkit_getDefaultScreenData;
Java_sun_awt_X11_XToolkit_getEnv;
Java_sun_awt_X11_XToolkit_setNoisyXErrorHandler;
Java_sun_awt_X11_XlibWrapper_XCreateBitmapFromData;
Java_sun_awt_X11_XlibWrapper_XFreePixmap;
Java_sun_awt_X11_XlibWrapper_XAllocColor;

View File

@ -51,9 +51,12 @@ SUBDIRS = \
makeclasslist \
strip_properties \
spp \
swing-nimbus \
CharsetMapping
ifndef DISABLE_NIMBUS
SUBDIRS += swing-nimbus
endif
all build clean clobber::
$(SUBDIRS-loop)

View File

@ -1038,15 +1038,25 @@ public abstract class Component implements ImageObserver, MenuContainer,
void setGraphicsConfiguration(GraphicsConfiguration gc) {
synchronized(getTreeLock()) {
graphicsConfig = gc;
ComponentPeer peer = getPeer();
if (peer != null) {
peer.updateGraphicsData(gc);
if (updateGraphicsData(gc)) {
removeNotify();
addNotify();
}
}
}
boolean updateGraphicsData(GraphicsConfiguration gc) {
checkTreeLock();
graphicsConfig = gc;
ComponentPeer peer = getPeer();
if (peer != null) {
return peer.updateGraphicsData(gc);
}
return false;
}
/**
* Checks that this component's <code>GraphicsDevice</code>
* <code>idString</code> matches the string argument.

View File

@ -1113,16 +1113,17 @@ public class Container extends Component {
}
@Override
void setGraphicsConfiguration(GraphicsConfiguration gc) {
synchronized (getTreeLock()) {
super.setGraphicsConfiguration(gc);
boolean updateGraphicsData(GraphicsConfiguration gc) {
checkTreeLock();
for (Component comp : component) {
if (comp != null) {
comp.setGraphicsConfiguration(gc);
}
boolean ret = super.updateGraphicsData(gc);
for (Component comp : component) {
if (comp != null) {
ret |= comp.updateGraphicsData(gc);
}
}
return ret;
}
/**

View File

@ -436,7 +436,7 @@ public abstract class GraphicsConfiguration {
}
/**
* Returns whether this GraphicsConfiguration supports
* Returns whether this {@code GraphicsConfiguration} supports
* the {@link GraphicsDevice.WindowTranslucency#PERPIXEL_TRANSLUCENT
* PERPIXEL_TRANSLUCENT} kind of translucency.
*

View File

@ -246,7 +246,7 @@ public abstract class GraphicsDevice {
* Simulated full-screen mode resizes
* the window to the size of the screen and positions it at (0,0).
* <p>
* When entering full-screen mode, if the window to be used as the
* When entering full-screen mode, if the window to be used as a
* full-screen window is not visible, this method will make it visible.
* It will remain visible when returning to windowed mode.
* <p>
@ -261,9 +261,9 @@ public abstract class GraphicsDevice {
*
* @param w a window to use as the full-screen window; {@code null}
* if returning to windowed mode. Some platforms expect the
* fullscreen window to be a top-level component (i.e., a Frame);
* therefore it is preferable to use a Frame here rather than a
* Window.
* fullscreen window to be a top-level component (i.e., a {@code Frame});
* therefore it is preferable to use a {@code Frame} here rather than a
* {@code Window}.
*
* @see #isFullScreenSupported
* @see #getFullScreenWindow

View File

@ -96,9 +96,13 @@ public class Robot {
init(GraphicsEnvironment.getLocalGraphicsEnvironment()
.getDefaultScreenDevice());
int tmpMask = 0;
if (Toolkit.getDefaultToolkit().areExtraMouseButtonsEnabled()){
for (int i = 0; i < peer.getNumberOfButtons(); i++){
tmpMask |= InputEvent.getMaskForButton(i+1);
if (Toolkit.getDefaultToolkit() instanceof SunToolkit) {
final int buttonsNumber = ((SunToolkit)(Toolkit.getDefaultToolkit())).getNumberOfButtons();
for (int i = 0; i < buttonsNumber; i++){
tmpMask |= InputEvent.getMaskForButton(i+1);
}
}
}
tmpMask |= InputEvent.BUTTON1_MASK|

View File

@ -296,7 +296,7 @@ public class Window extends Container implements Accessible {
transient boolean isInShow = false;
/*
* Opacity level of the window
* The opacity level of the window
*
* @serial
* @see #setOpacity(float)
@ -306,7 +306,7 @@ public class Window extends Container implements Accessible {
private float opacity = 1.0f;
/*
* The shape assigned to this window. This field is set to null if
* The shape assigned to this window. This field is set to {@code null} if
* no shape is set (rectangular window).
*
* @serial
@ -3592,10 +3592,10 @@ public class Window extends Container implements Accessible {
@Override
public void setBackground(Color bgColor) {
Color oldBg = getBackground();
super.setBackground(bgColor);
if (oldBg != null && oldBg.equals(bgColor)) {
return;
}
super.setBackground(bgColor);
int oldAlpha = oldBg != null ? oldBg.getAlpha() : 255;
int alpha = bgColor.getAlpha();
if ((oldAlpha == 255) && (alpha < 255)) { // non-opaque window
@ -3623,16 +3623,37 @@ public class Window extends Container implements Accessible {
}
}
private void updateWindow(BufferedImage backBuffer) {
private void updateWindow() {
synchronized (getTreeLock()) {
WindowPeer peer = (WindowPeer)getPeer();
if (peer != null) {
peer.updateWindow(backBuffer);
peer.updateWindow();
}
}
}
private static final Color TRANSPARENT_BACKGROUND_COLOR = new Color(0, 0, 0, 0);
/**
* {@inheritDoc}
*
* @since 1.7
*/
@Override
public void paint(Graphics g) {
Color bgColor = getBackground();
if ((bgColor != null) && (bgColor.getAlpha() < 255)) {
Graphics gg = g.create();
try {
if (gg instanceof Graphics2D) {
gg.setColor(bgColor);
((Graphics2D)gg).setComposite(AlphaComposite.getInstance(AlphaComposite.SRC));
gg.fillRect(0, 0, getWidth(), getHeight());
}
} finally {
gg.dispose();
}
}
super.paint(g);
}
private static void setLayersOpaque(Component component, boolean isOpaque) {
// Shouldn't use instanceof to avoid loading Swing classes
@ -3644,18 +3665,10 @@ public class Window extends Container implements Accessible {
Container c = root.getContentPane();
javax.swing.JComponent content =
(c instanceof javax.swing.JComponent) ? (javax.swing.JComponent)c : null;
javax.swing.JComponent gp =
(rpc.getGlassPane() instanceof javax.swing.JComponent) ?
(javax.swing.JComponent)rpc.getGlassPane() : null;
if (gp != null) {
gp.setDoubleBuffered(isOpaque);
}
lp.setOpaque(isOpaque);
root.setOpaque(isOpaque);
root.setDoubleBuffered(isOpaque);
if (content != null) {
content.setOpaque(isOpaque);
content.setDoubleBuffered(isOpaque);
// Iterate down one level to see whether we have a JApplet
// (which is also a RootPaneContainer) which requires processing
@ -3748,8 +3761,8 @@ public class Window extends Container implements Accessible {
window.setBackground(new Color(bg.getRed(), bg.getGreen(), bg.getBlue(),
opaque ? 255 : 0));
}
public void updateWindow(Window window, BufferedImage backBuffer) {
window.updateWindow(backBuffer);
public void updateWindow(Window window) {
window.updateWindow();
}
public Dimension getSecurityWarningSize(Window window) {

View File

@ -157,6 +157,8 @@ public abstract class InputEvent extends ComponentEvent {
/**
* An array of extended modifiers for additional buttons.
* @see getButtonDownMasks
* There are twenty buttons fit into 4byte space.
* one more bit is reserved for FIRST_HIGH_BIT.
* @since 7.0
*/
private static final int [] BUTTON_DOWN_MASK = new int [] { BUTTON1_DOWN_MASK,
@ -169,7 +171,16 @@ public abstract class InputEvent extends ComponentEvent {
1<<18,
1<<19,
1<<20,
1<<21 };
1<<21,
1<<22,
1<<23,
1<<24,
1<<25,
1<<26,
1<<27,
1<<28,
1<<29,
1<<30};
/**
* A method to access an array of extended modifiers for additional buttons.
@ -240,7 +251,7 @@ public abstract class InputEvent extends ComponentEvent {
// in fact, it is undesirable to add modifier bits
// to the same field as this may break applications
// see bug# 5066958
static final int FIRST_HIGH_BIT = 1 << 22;
static final int FIRST_HIGH_BIT = 1 << 31;
static final int JDK_1_3_MODIFIERS = SHIFT_DOWN_MASK - 1;
static final int HIGH_MODIFIERS = ~( FIRST_HIGH_BIT - 1 );

View File

@ -33,6 +33,7 @@ import java.io.IOException;
import java.io.ObjectInputStream;
import java.awt.IllegalComponentStateException;
import java.awt.MouseInfo;
import sun.awt.SunToolkit;
/**
* An event which indicates that a mouse action occurred in a component.
@ -379,12 +380,25 @@ public class MouseEvent extends InputEvent {
*/
private static final long serialVersionUID = -991214153494842848L;
/**
* A number of buttons available on the mouse at the {@code Toolkit} machinery startup.
*/
private static int cachedNumberOfButtons;
static {
/* ensure that the necessary native libraries are loaded */
NativeLibLoader.loadLibraries();
if (!GraphicsEnvironment.isHeadless()) {
initIDs();
}
final Toolkit tk = Toolkit.getDefaultToolkit();
if (tk instanceof SunToolkit) {
cachedNumberOfButtons = ((SunToolkit)tk).getNumberOfButtons();
} else {
//It's expected that some toolkits (Headless,
//whatever besides SunToolkit) could also operate.
cachedNumberOfButtons = 3;
}
}
/**
@ -411,15 +425,6 @@ public class MouseEvent extends InputEvent {
return new Point(xAbs, yAbs);
}
/**
* A number of buttons available on the mouse at the {@code Toolkit} machinery startup.
*/
private static int cachedNumberOfButtons;
static {
cachedNumberOfButtons = MouseInfo.getNumberOfButtons();
}
/**
* Returns the absolute horizontal x position of the event.
* In a virtual device multi-screen environment in which the
@ -735,7 +740,6 @@ public class MouseEvent extends InputEvent {
if (button < NOBUTTON){
throw new IllegalArgumentException("Invalid button value :" + button);
}
//TODO: initialize MouseInfo.cachedNumber on toolkit creation.
if (button > BUTTON3) {
if (!Toolkit.getDefaultToolkit().areExtraMouseButtonsEnabled()){
throw new IllegalArgumentException("Extra mouse events are disabled " + button);

View File

@ -548,7 +548,8 @@ public interface ComponentPeer {
/**
* Updates internal data structures related to the component's GC.
*
* @return if the peer needs to be recreated for the changes to take effect
* @since 1.7
*/
void updateGraphicsData(GraphicsConfiguration gc);
boolean updateGraphicsData(GraphicsConfiguration gc);
}

View File

@ -121,11 +121,4 @@ public interface RobotPeer
* Disposes the robot peer when it is not needed anymore.
*/
void dispose();
/**
* Returns the number of buttons that the robot simulates.
*
* @return the number of buttons that the robot simulates
*/
int getNumberOfButtons();
}

View File

@ -110,12 +110,11 @@ public interface WindowPeer extends ContainerPeer {
void setOpaque(boolean isOpaque);
/**
* Updates the native part of non-opaque window using
* the given image with color+alpha values for each pixel.
* Updates the native part of non-opaque window.
*
* @see Window#setBackground(Color)
*/
void updateWindow(BufferedImage backBuffer);
void updateWindow();
/**
* Instructs the peer to update the position of the security warning.

View File

@ -34,6 +34,9 @@ import java.awt.event.ComponentListener;
import java.awt.event.ComponentAdapter;
import java.awt.event.ComponentEvent;
import sun.awt.AWTAccessor;
import sun.awt.SunToolkit;
/** This is an implementation of the <code>DesktopManager</code>.
* It currently implements the basic behaviors for managing
* <code>JInternalFrame</code>s in an arbitrary parent.
@ -361,7 +364,7 @@ public class DefaultDesktopManager implements DesktopManager, java.io.Serializab
g.dispose();
}
} else if (dragMode == FASTER_DRAG_MODE) {
dragFrameFaster(f, newX, newY);
dragFrameFaster(f, newX, newY);
} else {
setBoundsForFrame(f, newX, newY, f.getWidth(), f.getHeight());
}
@ -634,13 +637,8 @@ public class DefaultDesktopManager implements DesktopManager, java.io.Serializab
boolean floaterCollision = isFloaterCollision(previousBounds, currentBounds);
// System.out.println(previousBounds);
JComponent parent = (JComponent)f.getParent();
Rectangle visBounds = previousBounds.intersection(desktopBounds);
// System.out.println(previousBounds);
// System.out.println(visBounds);
RepaintManager currentManager = RepaintManager.currentManager(f);
@ -682,7 +680,6 @@ public class DefaultDesktopManager implements DesktopManager, java.io.Serializab
} else {
dirtyRects = new Rectangle[1];
dirtyRects[0] = previousBounds;
// System.out.println("no intersection");
};
// Fix the damage
@ -701,14 +698,22 @@ public class DefaultDesktopManager implements DesktopManager, java.io.Serializab
parent.paintImmediately(dirtyRects[i]);
((JInternalFrame)f).isDragging = true;
// System.out.println(dirtyRects[i]);
}
}
} finally {
currentManager.endPaint();
}
// update window if it's non-opaque
Window topLevel = SwingUtilities.getWindowAncestor(f);
Toolkit tk = Toolkit.getDefaultToolkit();
if (!AWTAccessor.getWindowAccessor().isOpaque(topLevel) &&
(tk instanceof SunToolkit) &&
((SunToolkit)tk).needUpdateWindow())
{
AWTAccessor.getWindowAccessor().updateWindow(topLevel);
}
}
private boolean isFloaterCollision(Rectangle moveFrom, Rectangle moveTo) {

View File

@ -1021,8 +1021,10 @@ public abstract class JComponent extends Container implements Serializable,
int bw,bh;
boolean printing = getFlag(IS_PRINTING);
if(!printing && repaintManager.isDoubleBufferingEnabled() &&
!getFlag(ANCESTOR_USING_BUFFER) && isDoubleBuffered()) {
if (!printing && repaintManager.isDoubleBufferingEnabled() &&
!getFlag(ANCESTOR_USING_BUFFER) && isDoubleBuffered() &&
(getFlag(IS_REPAINTING) || repaintManager.isPainting()))
{
repaintManager.beginPaint();
try {
repaintManager.paint(this, this, co, clipX, clipY, clipW,

View File

@ -43,7 +43,6 @@ import sun.security.action.GetPropertyAction;
import com.sun.java.swing.SwingUtilities3;
/**
* This class manages repaint requests, allowing the number
* of repaints to be minimized, for example by collapsing multiple
@ -717,14 +716,12 @@ public class RepaintManager
}
}
private Map<Component,Rectangle>
updateWindows(Map<Component,Rectangle> dirtyComponents)
{
private void updateWindows(Map<Component,Rectangle> dirtyComponents) {
Toolkit toolkit = Toolkit.getDefaultToolkit();
if (!(toolkit instanceof SunToolkit &&
((SunToolkit)toolkit).needUpdateWindow()))
{
return dirtyComponents;
return;
}
Set<Window> windows = new HashSet<Window>();
@ -734,25 +731,20 @@ public class RepaintManager
Window window = dirty instanceof Window ?
(Window)dirty :
SwingUtilities.getWindowAncestor(dirty);
if (window != null &&
!AWTAccessor.getWindowAccessor().isOpaque(window))
{
// if this component's toplevel is perpixel translucent, it will
// be repainted below
it.remove();
// add to the set of windows to update (so that we don't update
// the window many times for each component to be repainted that
// belongs to this window)
windows.add(window);
}
}
for (Window window : windows) {
AWTAccessor.getWindowAccessor().updateWindow(window, null);
AWTAccessor.getWindowAccessor().updateWindow(window);
}
}
return dirtyComponents;
boolean isPainting() {
return painting;
}
/**
@ -788,10 +780,6 @@ public class RepaintManager
int localBoundsW;
Enumeration keys;
// the components belonging to perpixel-translucent windows will be
// removed from the list
tmpDirtyComponents = updateWindows(tmpDirtyComponents);
roots = new ArrayList<Component>(count);
for (Component dirty : tmpDirtyComponents.keySet()) {
@ -799,13 +787,11 @@ public class RepaintManager
}
count = roots.size();
// System.out.println("roots size is " + count);
painting = true;
try {
for(i=0 ; i < count ; i++) {
dirtyComponent = roots.get(i);
rect = tmpDirtyComponents.get(dirtyComponent);
// System.out.println("Should refresh :" + rect);
localBoundsH = dirtyComponent.getHeight();
localBoundsW = dirtyComponent.getWidth();
@ -848,6 +834,9 @@ public class RepaintManager
} finally {
painting = false;
}
updateWindows(tmpDirtyComponents);
tmpDirtyComponents.clear();
}
@ -1004,6 +993,16 @@ public class RepaintManager
return delegate.getVolatileOffscreenBuffer(c, proposedWidth,
proposedHeight);
}
// If the window is non-opaque, it's double-buffered at peer's level
Window w = (c instanceof Window) ? (Window)c : SwingUtilities.getWindowAncestor(c);
if (!AWTAccessor.getWindowAccessor().isOpaque(w)) {
Toolkit tk = Toolkit.getDefaultToolkit();
if ((tk instanceof SunToolkit) && (((SunToolkit)tk).needUpdateWindow())) {
return null;
}
}
GraphicsConfiguration config = c.getGraphicsConfiguration();
if (config == null) {
config = GraphicsEnvironment.getLocalGraphicsEnvironment().
@ -1031,6 +1030,15 @@ public class RepaintManager
DoubleBufferInfo doubleBuffer;
int width, height;
// If the window is non-opaque, it's double-buffered at peer's level
Window w = (c instanceof Window) ? (Window)c : SwingUtilities.getWindowAncestor(c);
if (!AWTAccessor.getWindowAccessor().isOpaque(w)) {
Toolkit tk = Toolkit.getDefaultToolkit();
if ((tk instanceof SunToolkit) && (((SunToolkit)tk).needUpdateWindow())) {
return null;
}
}
if (standardDoubleBuffer == null) {
standardDoubleBuffer = new DoubleBufferInfo();
}

View File

@ -230,51 +230,46 @@ public class BasicDirectoryModel extends AbstractListModel implements PropertyCh
}
public void run0() {
FileSystemView fileSystem = filechooser.getFileSystemView();
File[] list = fileSystem.getFiles(currentDirectory, filechooser.isFileHidingEnabled());
if (isInterrupted()) {
return;
}
final Vector<File> newFileCache = new Vector<File>();
Vector<File> newFiles = new Vector<File>();
// run through the file list, add directories and selectable files to fileCache
// Note that this block must be OUTSIDE of Invoker thread because of
// deadlock possibility with custom synchronized FileSystemView
for (File file : list) {
if (filechooser.accept(file)) {
boolean isTraversable = filechooser.isTraversable(file);
if (isTraversable) {
newFileCache.addElement(file);
} else if (filechooser.isFileSelectionEnabled()) {
newFiles.addElement(file);
}
if (isInterrupted()) {
return;
}
}
}
// First sort alphabetically by filename
sort(newFileCache);
sort(newFiles);
newFileCache.addAll(newFiles);
// To avoid loads of synchronizations with Invoker and improve performance we
// execute the whole block on the COM thread
DoChangeContents doChangeContents = ShellFolder.getInvoker().invoke(new Callable<DoChangeContents>() {
public DoChangeContents call() throws Exception {
FileSystemView fileSystem = filechooser.getFileSystemView();
File[] list = fileSystem.getFiles(currentDirectory, filechooser.isFileHidingEnabled());
Vector<File> acceptsList = new Vector<File>();
if (isInterrupted()) {
return null;
}
// run through the file list, add directories and selectable files to fileCache
for (File file : list) {
if (filechooser.accept(file)) {
acceptsList.addElement(file);
}
}
if (isInterrupted()) {
return null;
}
// First sort alphabetically by filename
sort(acceptsList);
Vector<File> newDirectories = new Vector<File>(50);
Vector<File> newFiles = new Vector<File>();
// run through list grabbing directories in chunks of ten
for (int i = 0; i < acceptsList.size(); i++) {
File f = acceptsList.elementAt(i);
boolean isTraversable = filechooser.isTraversable(f);
if (isTraversable) {
newDirectories.addElement(f);
} else if (!isTraversable && filechooser.isFileSelectionEnabled()) {
newFiles.addElement(f);
}
if (isInterrupted()) {
return null;
}
}
Vector<File> newFileCache = new Vector<File>(newDirectories);
newFileCache.addAll(newFiles);
int newSize = newFileCache.size();
int oldSize = fileCache.size();

View File

@ -4201,8 +4201,9 @@
<stateType key="Disabled"/>
<stateType key="Focused"/>
<stateType key="Editable">
<codeSnippet><![CDATA[
return ((JComboBox)c).isEditable();]]></codeSnippet>
<codeSnippet><![CDATA[
return c instanceof JComboBox && ((JComboBox)c).isEditable();
]]></codeSnippet>
</stateType>
</stateTypes>
<contentMargins top="0" bottom="0" left="0" right="0"/>
@ -16160,12 +16161,14 @@
<stateType key="Disabled"/>
<stateType key="Indeterminate">
<codeSnippet><![CDATA[
return ((JProgressBar)c).isIndeterminate();
return c instanceof JProgressBar &&
((JProgressBar)c).isIndeterminate();
]]></codeSnippet>
</stateType>
<stateType key="Finished">
<codeSnippet><![CDATA[
return ((JProgressBar)c).getPercentComplete() == 1.0;
return c instanceof JProgressBar &&
((JProgressBar)c).getPercentComplete() == 1.0;
]]></codeSnippet>
</stateType>
</stateTypes>
@ -25845,26 +25848,26 @@
<stateTypes>
<stateType key="North">
<codeSnippet><![CDATA[
JToolBar toolbar = (JToolBar)c;
return NimbusLookAndFeel.resolveToolbarConstraint(toolbar) == BorderLayout.NORTH;
return (c instanceof JToolBar) &&
NimbusLookAndFeel.resolveToolbarConstraint((JToolBar)c) == BorderLayout.NORTH;
]]></codeSnippet>
</stateType>
<stateType key="East">
<codeSnippet><![CDATA[
JToolBar toolbar = (JToolBar)c;
return NimbusLookAndFeel.resolveToolbarConstraint(toolbar) == BorderLayout.EAST;
return (c instanceof JToolBar) &&
NimbusLookAndFeel.resolveToolbarConstraint((JToolBar)c) == BorderLayout.EAST;
]]></codeSnippet>
</stateType>
<stateType key="West">
<codeSnippet><![CDATA[
JToolBar toolbar = (JToolBar)c;
return NimbusLookAndFeel.resolveToolbarConstraint(toolbar) == BorderLayout.WEST;
return (c instanceof JToolBar) &&
NimbusLookAndFeel.resolveToolbarConstraint((JToolBar)c) == BorderLayout.WEST;
]]></codeSnippet>
</stateType>
<stateType key="South">
<codeSnippet><![CDATA[
JToolBar toolbar = (JToolBar)c;
return NimbusLookAndFeel.resolveToolbarConstraint(toolbar) == BorderLayout.SOUTH;
return (c instanceof JToolBar) &&
NimbusLookAndFeel.resolveToolbarConstraint((JToolBar)c) == BorderLayout.SOUTH;
]]></codeSnippet>
</stateType>
</stateTypes>

View File

@ -132,7 +132,7 @@ public final class AWTAccessor {
/*
* Update the image of a non-opaque (translucent) window.
*/
void updateWindow(Window window, BufferedImage backBuffer);
void updateWindow(Window window);
/** Get the size of the security warning.
*/

View File

@ -592,8 +592,9 @@ public abstract class EmbeddedFrame extends Frame
public void setOpaque(boolean isOpaque) {
}
public void updateWindow(BufferedImage bi) {
public void updateWindow() {
}
public void repositionSecurityWarning() {
}
}

View File

@ -179,9 +179,15 @@ public class HeadlessToolkit extends Toolkit
throw new HeadlessException();
}
public KeyboardFocusManagerPeer createKeyboardFocusManagerPeer(KeyboardFocusManager manager)
throws HeadlessException {
throw new HeadlessException();
public KeyboardFocusManagerPeer createKeyboardFocusManagerPeer(KeyboardFocusManager manager) {
// See 6833019.
return
new KeyboardFocusManagerPeer() {
public Window getCurrentFocusedWindow() { return null; }
public void setCurrentFocusOwner(Component comp) {}
public Component getCurrentFocusOwner() { return null; }
public void clearGlobalFocusOwner(Window activeWindow) {}
};
}
public TrayIconPeer createTrayIcon(TrayIcon target)

View File

@ -300,7 +300,9 @@ public class NullComponentPeer implements LightweightPeer,
public void setZOrder(ComponentPeer above) {
}
public void updateGraphicsData(GraphicsConfiguration gc) {}
public boolean updateGraphicsData(GraphicsConfiguration gc) {
return false;
}
public GraphicsConfiguration getAppropriateGraphicsConfiguration(
GraphicsConfiguration gc)

View File

@ -89,6 +89,25 @@ public abstract class SunToolkit extends Toolkit
*/
private static final String POST_EVENT_QUEUE_KEY = "PostEventQueue";
/**
* Number of buttons.
* By default it's taken from the system. If system value does not
* fit into int type range, use our own MAX_BUTTONS_SUPPORT value.
*/
protected static int numberOfButtons = 0;
/* XFree standard mention 24 buttons as maximum:
* http://www.xfree86.org/current/mouse.4.html
* We workaround systems supporting more than 24 buttons.
* Otherwise, we have to use long type values as masks
* which leads to API change.
* InputEvent.BUTTON_DOWN_MASK may contain only 21 masks due to
* the 4-bytes limit for the int type. (CR 6799099)
* One more bit is reserved for FIRST_HIGH_BIT.
*/
public final static int MAX_BUTTONS_SUPPORTED = 20;
public SunToolkit() {
/* If awt.threadgroup is set to class name the instance of
* this class is created (should be subclass of ThreadGroup)
@ -2079,6 +2098,12 @@ public abstract class SunToolkit extends Toolkit
return false;
}
/**
* Descendants of the SunToolkit should override and put their own logic here.
*/
public int getNumberOfButtons(){
return 3;
}
} // class SunToolkit

View File

@ -274,45 +274,61 @@ public abstract class ShellFolder extends File {
// Override File methods
public static void sort(List<? extends File> files) {
public static void sort(final List<? extends File> files) {
if (files == null || files.size() <= 1) {
return;
}
// Check that we can use the ShellFolder.sortChildren() method:
// 1. All files have the same non-null parent
// 2. All files is ShellFolders
File commonParent = null;
// To avoid loads of synchronizations with Invoker and improve performance we
// synchronize the whole code of the sort method once
getInvoker().invoke(new Callable<Void>() {
public Void call() throws Exception {
// Check that we can use the ShellFolder.sortChildren() method:
// 1. All files have the same non-null parent
// 2. All files is ShellFolders
File commonParent = null;
for (File file : files) {
File parent = file.getParentFile();
for (File file : files) {
File parent = file.getParentFile();
if (parent == null || !(file instanceof ShellFolder)) {
commonParent = null;
if (parent == null || !(file instanceof ShellFolder)) {
commonParent = null;
break;
}
break;
}
if (commonParent == null) {
commonParent = parent;
} else {
if (commonParent != parent && !commonParent.equals(parent)) {
commonParent = null;
if (commonParent == null) {
commonParent = parent;
} else {
if (commonParent != parent && !commonParent.equals(parent)) {
commonParent = null;
break;
break;
}
}
}
}
}
if (commonParent instanceof ShellFolder) {
((ShellFolder) commonParent).sortChildren(files);
} else {
Collections.sort(files, FILE_COMPARATOR);
}
if (commonParent instanceof ShellFolder) {
((ShellFolder) commonParent).sortChildren(files);
} else {
Collections.sort(files, FILE_COMPARATOR);
}
return null;
}
});
}
public void sortChildren(List<? extends File> files) {
Collections.sort(files, FILE_COMPARATOR);
public void sortChildren(final List<? extends File> files) {
// To avoid loads of synchronizations with Invoker and improve performance we
// synchronize the whole code of the sort method once
getInvoker().invoke(new Callable<Void>() {
public Void call() throws Exception {
Collections.sort(files, FILE_COMPARATOR);
return null;
}
});
}
public boolean isAbsolute() {

View File

@ -402,6 +402,11 @@ public class GTKKeybindings {
"released SPACE", "released",
"RETURN", "pressed"
}),
"RootPane.ancestorInputMap",
new UIDefaults.LazyInputMap(new Object[]{
"shift F10", "postPopup",
"CONTEXT_MENU", "postPopup"
}),
// These bindings are only enabled when there is a default
// button set on the rootpane.
"RootPane.defaultButtonWindowKeyBindings", new Object[]{

View File

@ -360,6 +360,11 @@ public class WindowsKeybindings {
"DOWN", "decrement",
"KP_DOWN", "decrement",
}),
"RootPane.ancestorInputMap",
new UIDefaults.LazyInputMap(new Object[]{
"shift F10", "postPopup",
"CONTEXT_MENU", "postPopup"
}),
// These bindings are only enabled when there is a default
// button set on the rootpane.
"RootPane.defaultButtonWindowKeyBindings", new Object[]{

View File

@ -171,6 +171,8 @@ public final class TimeZoneNames extends TimeZoneNamesBundle {
"Truk Summer Time", "TRUST"};
String ULAT[]= new String[] {"Ulaanbaatar Time", "ULAT",
"Ulaanbaatar Summer Time", "ULAST"};
String WART[] = new String[] {"Western Argentine Time", "WART",
"Western Argentine Summer Time", "WARST"};
String WAT[] = new String[] {"Western African Time", "WAT",
"Western African Summer Time", "WAST"};
String WET[] = new String[] {"Western European Time", "WET",
@ -296,7 +298,7 @@ public final class TimeZoneNames extends TimeZoneNamesBundle {
{"America/Argentina/Rio_Gallegos", AGT},
{"America/Argentina/Salta", AGT},
{"America/Argentina/San_Juan", AGT},
{"America/Argentina/San_Luis", AGT},
{"America/Argentina/San_Luis", WART},
{"America/Argentina/Tucuman", AGT},
{"America/Argentina/Ushuaia", AGT},
{"America/Aruba", AST},

View File

@ -171,6 +171,8 @@ public final class TimeZoneNames_de extends TimeZoneNamesBundle {
"Truk Sommerzeit", "TRUST"};
String ULAT[]= new String[] {"Ulaanbaatar Zeit", "ULAT",
"Ulaanbaatar Sommerzeit", "ULAST"};
String WART[] = new String[] {"Argentinische Zeit", "WART",
"Argentinische Sommerzeit", "WARST"};
String WAT[] = new String[] {"Westafrikanische Zeit", "WAT",
"Westafrikanische Sommerzeit", "WAST"};
String WET[] = new String[] {"Westeurop\u00e4ische Zeit", "WET",
@ -296,7 +298,7 @@ public final class TimeZoneNames_de extends TimeZoneNamesBundle {
{"America/Argentina/Rio_Gallegos", AGT},
{"America/Argentina/Salta", AGT},
{"America/Argentina/San_Juan", AGT},
{"America/Argentina/San_Luis", AGT},
{"America/Argentina/San_Luis", WART},
{"America/Argentina/Tucuman", AGT},
{"America/Argentina/Ushuaia", AGT},
{"America/Aruba", AST},

View File

@ -171,6 +171,8 @@ public final class TimeZoneNames_es extends TimeZoneNamesBundle {
"Hora de verano de Truk", "TRUST"};
String ULAT[]= new String[] {"Hora de Ulan Bator", "ULAT",
"Hora de verano de Ulan Bator", "ULAST"};
String WART[] = new String[] {"Hora de Argentina", "WART",
"Hora de verano de Argentina", "WARST"};
String WAT[] = new String[] {"Hora de \u00c1frica Occidental", "WAT",
"Hora de verano de \u00c1frica Occidental", "WAST"};
String WET[] = new String[] {"Hora de Europa Occidental", "WET",
@ -296,7 +298,7 @@ public final class TimeZoneNames_es extends TimeZoneNamesBundle {
{"America/Argentina/Rio_Gallegos", AGT},
{"America/Argentina/Salta", AGT},
{"America/Argentina/San_Juan", AGT},
{"America/Argentina/San_Luis", AGT},
{"America/Argentina/San_Luis", WART},
{"America/Argentina/Tucuman", AGT},
{"America/Argentina/Ushuaia", AGT},
{"America/Aruba", AST},

View File

@ -171,6 +171,8 @@ public final class TimeZoneNames_fr extends TimeZoneNamesBundle {
"Heure d'\u00e9t\u00e9 de Truk", "TRUST"};
String ULAT[]= new String[] {"Heure de l'Ulaanbaatar", "ULAT",
"Heure d'\u00e9t\u00e9 de l'Ulaanbaatar", "ULAST"} ;
String WART[] = new String[] {"Heure D'Argentine", "WART",
"Heure d'\u00e9t\u00e9 D'Argentine", "WARST"} ;
String WAT[] = new String[] {"Heure d'Afrique de l'Ouest", "WAT",
"Heure d'\u00e9t\u00e9 d'Afrique de l'Ouest", "WAST"} ;
String WET[] = new String[] {"Heure d'Europe de l'Ouest", "WET",
@ -296,7 +298,7 @@ public final class TimeZoneNames_fr extends TimeZoneNamesBundle {
{"America/Argentina/Rio_Gallegos", AGT},
{"America/Argentina/Salta", AGT},
{"America/Argentina/San_Juan", AGT},
{"America/Argentina/San_Luis", AGT},
{"America/Argentina/San_Luis", WART},
{"America/Argentina/Tucuman", AGT},
{"America/Argentina/Ushuaia", AGT},
{"America/Aruba", AST},

View File

@ -171,6 +171,8 @@ public final class TimeZoneNames_it extends TimeZoneNamesBundle {
"Ora estiva di Truk", "TRUST"};
String ULAT[]= new String[] {"Ora di Ulaanbaatar", "ULAT",
"Ora estiva di Ulaanbaatar", "ULAST"};
String WART[] = new String[] {"Ora dell'Argentina", "WART",
"Ora estiva dell'Argentina", "WARST"};
String WAT[] = new String[] {"Ora dell'Africa occidentale", "WAT",
"Ora estiva dell'Africa occidentale", "WAST"};
String WET[] = new String[] {"Ora dell'Europa occidentale", "WET",
@ -296,7 +298,7 @@ public final class TimeZoneNames_it extends TimeZoneNamesBundle {
{"America/Argentina/Rio_Gallegos", AGT},
{"America/Argentina/Salta", AGT},
{"America/Argentina/San_Juan", AGT},
{"America/Argentina/San_Luis", AGT},
{"America/Argentina/San_Luis", WART},
{"America/Argentina/Tucuman", AGT},
{"America/Argentina/Ushuaia", AGT},
{"America/Aruba", AST},

View File

@ -171,6 +171,8 @@ public final class TimeZoneNames_ja extends TimeZoneNamesBundle {
"\u30c8\u30e9\u30c3\u30af\u590f\u6642\u9593", "TRUST"};
String ULAT[]= new String[] {"\u30a6\u30e9\u30fc\u30f3\u30d0\u30fc\u30c8\u30eb\u6642\u9593", "ULAT",
"\u30a6\u30e9\u30fc\u30f3\u30d0\u30fc\u30c8\u30eb\u590f\u6642\u9593", "ULAST"};
String WART[] = new String[] {"\u30a2\u30eb\u30bc\u30f3\u30c1\u30f3\u6642\u9593", "WART",
"\u30a2\u30eb\u30bc\u30f3\u30c1\u30f3\u590f\u6642\u9593", "WARST"};
String WAT[] = new String[] {"\u897f\u30a2\u30d5\u30ea\u30ab\u6642\u9593", "WAT",
"\u897f\u30a2\u30d5\u30ea\u30ab\u590f\u6642\u9593", "WAST"};
String WET[] = new String[] {"\u897f\u30e8\u30fc\u30ed\u30c3\u30d1\u6642\u9593", "WET",
@ -296,7 +298,7 @@ public final class TimeZoneNames_ja extends TimeZoneNamesBundle {
{"America/Argentina/Rio_Gallegos", AGT},
{"America/Argentina/Salta", AGT},
{"America/Argentina/San_Juan", AGT},
{"America/Argentina/San_Luis", AGT},
{"America/Argentina/San_Luis", WART},
{"America/Argentina/Tucuman", AGT},
{"America/Argentina/Ushuaia", AGT},
{"America/Aruba", AST},

View File

@ -171,6 +171,8 @@ public final class TimeZoneNames_ko extends TimeZoneNamesBundle {
"\ud2b8\ub8e8\ud06c \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "TRUST"};
String ULAT[]= new String[] {"\uc6b8\ub780\ubc14\ud0c0\ub974 \uc2dc\uac04", "ULAT",
"\uc6b8\ub780\ubc14\ud0c0\ub974 \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "ULAST"};
String WART[] = new String[] {"\uc544\ub974\ud5e8\ud2f0\ub098 \uc2dc\uac04", "WART",
"\uc544\ub974\ud5e8\ud2f0\ub098 \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "WARST"};
String WAT[] = new String[] {"\uc11c\ubd80 \uc544\ud504\ub9ac\uce74 \uc2dc\uac04", "WAT",
"\uc11c\ubd80 \uc544\ud504\ub9ac\uce74 \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "WAST"};
String WET[] = new String[] {"\uc11c\uc720\ub7fd \uc2dc\uac04", "WET",
@ -296,7 +298,7 @@ public final class TimeZoneNames_ko extends TimeZoneNamesBundle {
{"America/Argentina/Rio_Gallegos", AGT},
{"America/Argentina/Salta", AGT},
{"America/Argentina/San_Juan", AGT},
{"America/Argentina/San_Luis", AGT},
{"America/Argentina/San_Luis", WART},
{"America/Argentina/Tucuman", AGT},
{"America/Argentina/Ushuaia", AGT},
{"America/Aruba", AST},

View File

@ -171,6 +171,8 @@ public final class TimeZoneNames_sv extends TimeZoneNamesBundle {
"Truk, sommartid", "TRUST"};
String ULAT[]= new String[] {"Ulaanbaatar, normaltid", "ULAT",
"Ulaanbaatar, sommartid", "ULAST"};
String WART[] = new String[] {"Argentina, normaltid", "WART",
"Argentina, sommartid", "WARST"};
String WAT[] = new String[] {"V\u00e4stafrikansk tid", "WAT",
"V\u00e4stafrikansk sommartid", "WAST"};
String WET[] = new String[] {"V\u00e4steuropeisk tid", "WET",
@ -296,7 +298,7 @@ public final class TimeZoneNames_sv extends TimeZoneNamesBundle {
{"America/Argentina/Rio_Gallegos", AGT},
{"America/Argentina/Salta", AGT},
{"America/Argentina/San_Juan", AGT},
{"America/Argentina/San_Luis", AGT},
{"America/Argentina/San_Luis", WART},
{"America/Argentina/Tucuman", AGT},
{"America/Argentina/Ushuaia", AGT},
{"America/Aruba", AST},

View File

@ -171,6 +171,8 @@ public final class TimeZoneNames_zh_CN extends TimeZoneNamesBundle {
"\u7279\u9c81\u514b\u590f\u4ee4\u65f6", "TRUST"};
String ULAT[]= new String[] {"\u5e93\u4f26\u65f6\u95f4", "ULAT",
"\u5e93\u4f26\u590f\u4ee4\u65f6", "ULAST"};
String WART[] = new String[] {"\u963f\u6839\u5ef7\u65f6\u95f4", "WART",
"\u963f\u6839\u5ef7\u590f\u4ee4\u65f6", "WARST"};
String WAT[] = new String[] {"\u897f\u975e\u65f6\u95f4", "WAT",
"\u897f\u975e\u590f\u4ee4\u65f6", "WAST"};
String WET[] = new String[] {"\u897f\u6b27\u65f6\u95f4", "WET",
@ -296,7 +298,7 @@ public final class TimeZoneNames_zh_CN extends TimeZoneNamesBundle {
{"America/Argentina/Rio_Gallegos", AGT},
{"America/Argentina/Salta", AGT},
{"America/Argentina/San_Juan", AGT},
{"America/Argentina/San_Luis", AGT},
{"America/Argentina/San_Luis", WART},
{"America/Argentina/Tucuman", AGT},
{"America/Argentina/Ushuaia", AGT},
{"America/Aruba", AST},

View File

@ -171,6 +171,8 @@ public final class TimeZoneNames_zh_TW extends TimeZoneNamesBundle {
"\u7279\u9b6f\u514b\u590f\u4ee4\u6642\u9593", "TRUST"};
String ULAT[]= new String[] {"\u5eab\u502b\u6642\u9593", "ULAT",
"\u5eab\u502b\u590f\u4ee4\u6642\u9593", "ULAST"};
String WART[] = new String[] {"\u963f\u6839\u5ef7\u6642\u9593", "WART",
"\u963f\u6839\u5ef7\u590f\u4ee4\u6642\u9593", "WARST"};
String WAT[] = new String[] {"\u897f\u975e\u6642\u9593", "WAT",
"\u897f\u975e\u590f\u4ee4\u6642\u9593", "WAST"};
String WET[] = new String[] {"\u897f\u6b50\u6642\u9593", "WET",
@ -296,7 +298,7 @@ public final class TimeZoneNames_zh_TW extends TimeZoneNamesBundle {
{"America/Argentina/Rio_Gallegos", AGT},
{"America/Argentina/Salta", AGT},
{"America/Argentina/San_Juan", AGT},
{"America/Argentina/San_Luis", AGT},
{"America/Argentina/San_Luis", WART},
{"America/Argentina/Tucuman", AGT},
{"America/Argentina/Ushuaia", AGT},
{"America/Aruba", AST},

View File

@ -610,14 +610,19 @@ LCMSBOOL _cmsModifyTagData(cmsHPROFILE hProfile, icTagSignature sig,
return FALSE;
}
if (!Icc->Grow(Icc, delta)) {
free(ptr);
if(isNew) {
Icc->TagCount--;
/* We change the size of Icc here only if we know it'll actually
* grow: if Icc is about to shrink we must wait until we've read
* the previous data. */
if (delta > 0) {
if (!Icc->Grow(Icc, delta)) {
free(ptr);
if(isNew) {
Icc->TagCount--;
}
J2dRlsTraceLn(J2D_TRACE_ERROR,
"_cmsModifyTagData: Icc->Grow() == FALSE");
return FALSE;
}
J2dRlsTraceLn(J2D_TRACE_ERROR,
"_cmsModifyTagData: Icc->Grow() == FALSE");
return FALSE;
}
/* Compute size of tag data before/after the modified tag */
@ -680,6 +685,18 @@ LCMSBOOL _cmsModifyTagData(cmsHPROFILE hProfile, icTagSignature sig,
temp = TransportValue32(profileSize);
Icc->Write(Icc, sizeof(icUInt32Number), &temp);
/* Shrink Icc, if needed. */
if (delta < 0) {
if (!Icc->Grow(Icc, delta)) {
free(ptr);
if(isNew) {
Icc->TagCount--;
}
J2dRlsTraceLn(J2D_TRACE_ERROR,
"_cmsModifyTagData: Icc->Grow() == FALSE");
return FALSE;
}
}
/* Adjust tag offsets: if the tag is new, we must account
for the new tag table entry; otherwise, only those tags after

View File

@ -120,7 +120,7 @@ class MotifDnDConstants {
false,
XConstants.AnyPropertyType);
try {
int status = wpg.execute(XToolkit.IgnoreBadWindowHandler);
int status = wpg.execute(XErrorHandler.IgnoreBadWindowHandler.getInstance());
if (status == XConstants.Success &&
wpg.getData() != 0 &&
@ -190,7 +190,7 @@ class MotifDnDConstants {
try {
Native.putLong(data, motifWindow);
XToolkit.WITH_XERROR_HANDLER(XWM.VerifyChangePropertyHandler);
XToolkit.WITH_XERROR_HANDLER(XErrorHandler.VerifyChangePropertyHandler.getInstance());
XlibWrapper.XChangeProperty(XToolkit.getDisplay(),
defaultRootWindow,
XA_MOTIF_DRAG_WINDOW.getAtom(),
@ -280,7 +280,7 @@ class MotifDnDConstants {
false,
XA_MOTIF_DRAG_TARGETS.getAtom());
try {
int status = wpg.execute(XToolkit.IgnoreBadWindowHandler);
int status = wpg.execute(XErrorHandler.IgnoreBadWindowHandler.getInstance());
if (status != XConstants.Success
|| wpg.getActualType() != XA_MOTIF_DRAG_TARGETS.getAtom()
@ -394,7 +394,7 @@ class MotifDnDConstants {
}
}
XToolkit.WITH_XERROR_HANDLER(XWM.VerifyChangePropertyHandler);
XToolkit.WITH_XERROR_HANDLER(XErrorHandler.VerifyChangePropertyHandler.getInstance());
XlibWrapper.XChangeProperty(XToolkit.getDisplay(),
motifWindow,
XA_MOTIF_DRAG_TARGETS.getAtom(),
@ -410,7 +410,7 @@ class MotifDnDConstants {
// Create a new motif window and retry.
motifWindow = createMotifWindow();
XToolkit.WITH_XERROR_HANDLER(XWM.VerifyChangePropertyHandler);
XToolkit.WITH_XERROR_HANDLER(XErrorHandler.VerifyChangePropertyHandler.getInstance());
XlibWrapper.XChangeProperty(XToolkit.getDisplay(),
motifWindow,
XA_MOTIF_DRAG_TARGETS.getAtom(),
@ -534,7 +534,7 @@ class MotifDnDConstants {
// CARD32 icc_handle
unsafe.putInt(structData + 4, (int)XA_MOTIF_ATOM_0.getAtom());
XToolkit.WITH_XERROR_HANDLER(XWM.VerifyChangePropertyHandler);
XToolkit.WITH_XERROR_HANDLER(XErrorHandler.VerifyChangePropertyHandler.getInstance());
XlibWrapper.XChangeProperty(XToolkit.getDisplay(), window,
XA_MOTIF_ATOM_0.getAtom(),
XA_MOTIF_DRAG_INITIATOR_INFO.getAtom(),
@ -567,7 +567,7 @@ class MotifDnDConstants {
unsafe.putShort(data + 10, (short)0); /* pad */
unsafe.putInt(data + 12, dataSize);
XToolkit.WITH_XERROR_HANDLER(XWM.VerifyChangePropertyHandler);
XToolkit.WITH_XERROR_HANDLER(XErrorHandler.VerifyChangePropertyHandler.getInstance());
XlibWrapper.XChangeProperty(XToolkit.getDisplay(), window,
XA_MOTIF_DRAG_RECEIVER_INFO.getAtom(),
XA_MOTIF_DRAG_RECEIVER_INFO.getAtom(),

View File

@ -184,7 +184,7 @@ class MotifDnDDragSourceProtocol extends XDragSourceProtocol
XConstants.AnyPropertyType);
try {
int status = wpg.execute(XToolkit.IgnoreBadWindowHandler);
int status = wpg.execute(XErrorHandler.IgnoreBadWindowHandler.getInstance());
/*
* DragICCI.h:

View File

@ -102,7 +102,7 @@ class MotifDnDDropTargetProtocol extends XDropTargetProtocol {
XConstants.AnyPropertyType);
try {
status = wpg.execute(XToolkit.IgnoreBadWindowHandler);
status = wpg.execute(XErrorHandler.IgnoreBadWindowHandler.getInstance());
/*
* DragICCI.h:
@ -162,7 +162,7 @@ class MotifDnDDropTargetProtocol extends XDropTargetProtocol {
unsafe.putInt(data + 12, dataSize);
}
XToolkit.WITH_XERROR_HANDLER(XWM.VerifyChangePropertyHandler);
XToolkit.WITH_XERROR_HANDLER(XErrorHandler.VerifyChangePropertyHandler.getInstance());
XlibWrapper.XChangeProperty(XToolkit.getDisplay(), embedder,
MotifDnDConstants.XA_MOTIF_DRAG_RECEIVER_INFO.getAtom(),
MotifDnDConstants.XA_MOTIF_DRAG_RECEIVER_INFO.getAtom(),
@ -204,7 +204,7 @@ class MotifDnDDropTargetProtocol extends XDropTargetProtocol {
XConstants.AnyPropertyType);
try {
status = wpg.execute(XToolkit.IgnoreBadWindowHandler);
status = wpg.execute(XErrorHandler.IgnoreBadWindowHandler.getInstance());
/*
* DragICCI.h:
@ -236,7 +236,7 @@ class MotifDnDDropTargetProtocol extends XDropTargetProtocol {
unsafe.putInt(data + 4, tproxy);
XToolkit.WITH_XERROR_HANDLER(XWM.VerifyChangePropertyHandler);
XToolkit.WITH_XERROR_HANDLER(XErrorHandler.VerifyChangePropertyHandler.getInstance());
XlibWrapper.XChangeProperty(XToolkit.getDisplay(), embedder,
MotifDnDConstants.XA_MOTIF_DRAG_RECEIVER_INFO.getAtom(),
MotifDnDConstants.XA_MOTIF_DRAG_RECEIVER_INFO.getAtom(),
@ -276,7 +276,7 @@ class MotifDnDDropTargetProtocol extends XDropTargetProtocol {
XConstants.AnyPropertyType);
try {
status = wpg.execute(XToolkit.IgnoreBadWindowHandler);
status = wpg.execute(XErrorHandler.IgnoreBadWindowHandler.getInstance());
/*
* DragICCI.h:
@ -325,7 +325,7 @@ class MotifDnDDropTargetProtocol extends XDropTargetProtocol {
XConstants.AnyPropertyType);
try {
int status = wpg.execute(XToolkit.IgnoreBadWindowHandler);
int status = wpg.execute(XErrorHandler.IgnoreBadWindowHandler.getInstance());
if (status == (int)XConstants.Success && wpg.getData() != 0 &&
wpg.getActualType() != 0 && wpg.getActualFormat() == 8 &&
@ -375,7 +375,7 @@ class MotifDnDDropTargetProtocol extends XDropTargetProtocol {
MotifDnDConstants.XA_MOTIF_DRAG_INITIATOR_INFO.getAtom());
try {
int status = wpg.execute(XToolkit.IgnoreBadWindowHandler);
int status = wpg.execute(XErrorHandler.IgnoreBadWindowHandler.getInstance());
if (status == XConstants.Success && wpg.getData() != 0 &&
wpg.getActualType() ==
@ -412,7 +412,7 @@ class MotifDnDDropTargetProtocol extends XDropTargetProtocol {
*/
XWindowAttributes wattr = new XWindowAttributes();
try {
XToolkit.WITH_XERROR_HANDLER(XToolkit.IgnoreBadWindowHandler);
XToolkit.WITH_XERROR_HANDLER(XErrorHandler.IgnoreBadWindowHandler.getInstance());
int status = XlibWrapper.XGetWindowAttributes(XToolkit.getDisplay(),
source_win, wattr.pData);
@ -429,7 +429,7 @@ class MotifDnDDropTargetProtocol extends XDropTargetProtocol {
wattr.dispose();
}
XToolkit.WITH_XERROR_HANDLER(XToolkit.IgnoreBadWindowHandler);
XToolkit.WITH_XERROR_HANDLER(XErrorHandler.IgnoreBadWindowHandler.getInstance());
XlibWrapper.XSelectInput(XToolkit.getDisplay(), source_win,
source_win_mask |
XConstants.StructureNotifyMask);
@ -1020,7 +1020,7 @@ class MotifDnDDropTargetProtocol extends XDropTargetProtocol {
if (sourceWindow != 0) {
XToolkit.awtLock();
try {
XToolkit.WITH_XERROR_HANDLER(XToolkit.IgnoreBadWindowHandler);
XToolkit.WITH_XERROR_HANDLER(XErrorHandler.IgnoreBadWindowHandler.getInstance());
XlibWrapper.XSelectInput(XToolkit.getDisplay(), sourceWindow,
sourceWindowMask);
XToolkit.RESTORE_XERROR_HANDLER();

View File

@ -75,7 +75,7 @@ public class WindowPropertyGetter {
public int execute() {
return execute(null);
}
public int execute(XToolkit.XErrorHandler errorHandler) {
public int execute(XErrorHandler errorHandler) {
XToolkit.awtLock();
try {
@ -94,7 +94,7 @@ public class WindowPropertyGetter {
// Fix for performance problem - IgnodeBadWindowHandler is
// used too much without reason, just ignore it
if (errorHandler == XToolkit.IgnoreBadWindowHandler) {
if (errorHandler instanceof XErrorHandler.IgnoreBadWindowHandler) {
errorHandler = null;
}

View File

@ -126,7 +126,7 @@ class XAWTXSettings extends XSettings implements XMSelectionListener {
new WindowPropertyGetter(owner, xSettingsPropertyAtom, 0, MAX_LENGTH,
false, xSettingsPropertyAtom.getAtom() );
try {
int status = getter.execute(XToolkit.IgnoreBadWindowHandler);
int status = getter.execute(XErrorHandler.IgnoreBadWindowHandler.getInstance());
if (status != XConstants.Success || getter.getData() == 0) {
if (log.isLoggable(Level.FINE)) log.fine("OH OH : getter failed status = " + status );

View File

@ -989,8 +989,17 @@ public class XBaseWindow {
*/
public void handleButtonPressRelease(XEvent xev) {
XButtonEvent xbe = xev.get_xbutton();
/*
* Ignore the buttons above 20 due to the bit limit for
* InputEvent.BUTTON_DOWN_MASK.
* One more bit is reserved for FIRST_HIGH_BIT.
*/
if (xbe.get_button() > SunToolkit.MAX_BUTTONS_SUPPORTED) {
return;
}
int buttonState = 0;
for (int i = 0; i<XToolkit.getNumMouseButtons(); i++){
final int buttonsNumber = ((SunToolkit)(Toolkit.getDefaultToolkit())).getNumberOfButtons();
for (int i = 0; i<buttonsNumber; i++){
// A bug in WM implementation: extra buttons doesn't have state!=0 as they should on Release message.
if ((i != 4) && (i != 5)){
buttonState |= (xbe.get_state() & XConstants.buttonsMask[i]);
@ -1026,7 +1035,9 @@ public class XBaseWindow {
* Checks ButtonRelease released all Mouse buttons
*/
static boolean isFullRelease(int buttonState, int button) {
if (button < 0 || button > XToolkit.getNumMouseButtons()) {
final int buttonsNumber = ((SunToolkit)(Toolkit.getDefaultToolkit())).getNumberOfButtons();
if (button < 0 || button > buttonsNumber) {
return buttonState == 0;
} else {
return buttonState == XConstants.buttonsMask[button - 1];

View File

@ -1429,7 +1429,26 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget
}
}
public void updateGraphicsData(GraphicsConfiguration gc) {
public boolean updateGraphicsData(GraphicsConfiguration gc) {
int oldVisual = -1, newVisual = -1;
if (graphicsConfig != null) {
oldVisual = graphicsConfig.getVisual();
}
if (gc != null && gc instanceof X11GraphicsConfig) {
newVisual = ((X11GraphicsConfig)gc).getVisual();
}
// If the new visual differs from the old one, the peer must be
// recreated because X11 does not allow changing the visual on the fly.
// So we even skip the initGraphicsConfiguration() call.
// The initial assignment should happen though, hence the != -1 thing.
if (oldVisual != -1 && oldVisual != newVisual) {
return true;
}
initGraphicsConfiguration();
doValidateSurface();
return false;
}
}

View File

@ -1100,7 +1100,8 @@ abstract class XDecoratedPeer extends XWindowPeer {
}
boolean isOverrideRedirect() {
return false;
// return false;
return ((XToolkit)Toolkit.getDefaultToolkit()).isOverrideRedirect((Window)target);
}
public boolean requestWindowFocus(long time, boolean timeProvided) {

View File

@ -96,7 +96,7 @@ class XDnDDragSourceProtocol extends XDragSourceProtocol {
action_count++;
}
XToolkit.WITH_XERROR_HANDLER(XWM.VerifyChangePropertyHandler);
XToolkit.WITH_XERROR_HANDLER(XErrorHandler.VerifyChangePropertyHandler.getInstance());
XDnDConstants.XA_XdndActionList.setAtomData(window,
XAtom.XA_ATOM,
data, action_count);
@ -117,7 +117,7 @@ class XDnDDragSourceProtocol extends XDragSourceProtocol {
try {
Native.put(data, formats);
XToolkit.WITH_XERROR_HANDLER(XWM.VerifyChangePropertyHandler);
XToolkit.WITH_XERROR_HANDLER(XErrorHandler.VerifyChangePropertyHandler.getInstance());
XDnDConstants.XA_XdndTypeList.setAtomData(window,
XAtom.XA_ATOM,
data, formats.length);
@ -195,7 +195,7 @@ class XDnDDragSourceProtocol extends XDragSourceProtocol {
new WindowPropertyGetter(window, XDnDConstants.XA_XdndAware, 0, 1,
false, XConstants.AnyPropertyType);
int status = wpg1.execute(XToolkit.IgnoreBadWindowHandler);
int status = wpg1.execute(XErrorHandler.IgnoreBadWindowHandler.getInstance());
if (status == XConstants.Success &&
wpg1.getData() != 0 && wpg1.getActualType() == XAtom.XA_ATOM) {
@ -215,7 +215,7 @@ class XDnDDragSourceProtocol extends XDragSourceProtocol {
0, 1, false, XAtom.XA_WINDOW);
try {
status = wpg2.execute(XToolkit.IgnoreBadWindowHandler);
status = wpg2.execute(XErrorHandler.IgnoreBadWindowHandler.getInstance());
if (status == XConstants.Success &&
wpg2.getData() != 0 &&
@ -233,7 +233,7 @@ class XDnDDragSourceProtocol extends XDragSourceProtocol {
0, 1, false, XAtom.XA_WINDOW);
try {
status = wpg3.execute(XToolkit.IgnoreBadWindowHandler);
status = wpg3.execute(XErrorHandler.IgnoreBadWindowHandler.getInstance());
if (status != XConstants.Success ||
wpg3.getData() == 0 ||
@ -249,7 +249,7 @@ class XDnDDragSourceProtocol extends XDragSourceProtocol {
XConstants.AnyPropertyType);
try {
status = wpg4.execute(XToolkit.IgnoreBadWindowHandler);
status = wpg4.execute(XErrorHandler.IgnoreBadWindowHandler.getInstance());
if (status != XConstants.Success ||
wpg4.getData() == 0 ||

View File

@ -88,7 +88,7 @@ class XDnDDropTargetProtocol extends XDropTargetProtocol {
try {
Native.putLong(data, 0, XDnDConstants.XDND_PROTOCOL_VERSION);
XToolkit.WITH_XERROR_HANDLER(XWM.VerifyChangePropertyHandler);
XToolkit.WITH_XERROR_HANDLER(XErrorHandler.VerifyChangePropertyHandler.getInstance());
XDnDConstants.XA_XdndAware.setAtomData(window, XAtom.XA_ATOM, data, 1);
XToolkit.RESTORE_XERROR_HANDLER();
@ -122,7 +122,7 @@ class XDnDDropTargetProtocol extends XDropTargetProtocol {
false, XConstants.AnyPropertyType);
try {
status = wpg1.execute(XToolkit.IgnoreBadWindowHandler);
status = wpg1.execute(XErrorHandler.IgnoreBadWindowHandler.getInstance());
if (status == XConstants.Success &&
wpg1.getData() != 0 && wpg1.getActualType() == XAtom.XA_ATOM) {
@ -141,7 +141,7 @@ class XDnDDropTargetProtocol extends XDropTargetProtocol {
0, 1, false, XAtom.XA_WINDOW);
try {
status = wpg2.execute(XToolkit.IgnoreBadWindowHandler);
status = wpg2.execute(XErrorHandler.IgnoreBadWindowHandler.getInstance());
if (status == XConstants.Success &&
wpg2.getData() != 0 &&
@ -159,7 +159,7 @@ class XDnDDropTargetProtocol extends XDropTargetProtocol {
0, 1, false, XAtom.XA_WINDOW);
try {
status = wpg3.execute(XToolkit.IgnoreBadWindowHandler);
status = wpg3.execute(XErrorHandler.IgnoreBadWindowHandler.getInstance());
if (status != XConstants.Success ||
wpg3.getData() == 0 ||
@ -175,7 +175,7 @@ class XDnDDropTargetProtocol extends XDropTargetProtocol {
XConstants.AnyPropertyType);
try {
status = wpg4.execute(XToolkit.IgnoreBadWindowHandler);
status = wpg4.execute(XErrorHandler.IgnoreBadWindowHandler.getInstance());
if (status != XConstants.Success ||
wpg4.getData() == 0 ||
@ -205,7 +205,7 @@ class XDnDDropTargetProtocol extends XDropTargetProtocol {
/* The proxy window must have the XdndAware set, as XDnD protocol
prescribes to check the proxy window for XdndAware. */
XToolkit.WITH_XERROR_HANDLER(XWM.VerifyChangePropertyHandler);
XToolkit.WITH_XERROR_HANDLER(XErrorHandler.VerifyChangePropertyHandler.getInstance());
XDnDConstants.XA_XdndAware.setAtomData(newProxy, XAtom.XA_ATOM,
data, 1);
XToolkit.RESTORE_XERROR_HANDLER();
@ -219,7 +219,7 @@ class XDnDDropTargetProtocol extends XDropTargetProtocol {
Native.putLong(data, 0, newProxy);
/* The proxy window must have the XdndProxy set to point to itself.*/
XToolkit.WITH_XERROR_HANDLER(XWM.VerifyChangePropertyHandler);
XToolkit.WITH_XERROR_HANDLER(XErrorHandler.VerifyChangePropertyHandler.getInstance());
XDnDConstants.XA_XdndProxy.setAtomData(newProxy, XAtom.XA_WINDOW,
data, 1);
XToolkit.RESTORE_XERROR_HANDLER();
@ -232,7 +232,7 @@ class XDnDDropTargetProtocol extends XDropTargetProtocol {
Native.putLong(data, 0, XDnDConstants.XDND_PROTOCOL_VERSION);
XToolkit.WITH_XERROR_HANDLER(XWM.VerifyChangePropertyHandler);
XToolkit.WITH_XERROR_HANDLER(XErrorHandler.VerifyChangePropertyHandler.getInstance());
XDnDConstants.XA_XdndAware.setAtomData(embedder, XAtom.XA_ATOM,
data, 1);
XToolkit.RESTORE_XERROR_HANDLER();
@ -245,7 +245,7 @@ class XDnDDropTargetProtocol extends XDropTargetProtocol {
Native.putLong(data, 0, newProxy);
XToolkit.WITH_XERROR_HANDLER(XWM.VerifyChangePropertyHandler);
XToolkit.WITH_XERROR_HANDLER(XErrorHandler.VerifyChangePropertyHandler.getInstance());
XDnDConstants.XA_XdndProxy.setAtomData(embedder, XAtom.XA_WINDOW,
data, 1);
XToolkit.RESTORE_XERROR_HANDLER();
@ -278,7 +278,7 @@ class XDnDDropTargetProtocol extends XDropTargetProtocol {
try {
Native.putLong(data, 0, entry.getVersion());
XToolkit.WITH_XERROR_HANDLER(XWM.VerifyChangePropertyHandler);
XToolkit.WITH_XERROR_HANDLER(XErrorHandler.VerifyChangePropertyHandler.getInstance());
XDnDConstants.XA_XdndAware.setAtomData(embedder, XAtom.XA_ATOM,
data, 1);
XToolkit.RESTORE_XERROR_HANDLER();
@ -291,7 +291,7 @@ class XDnDDropTargetProtocol extends XDropTargetProtocol {
Native.putLong(data, 0, (int)entry.getProxy());
XToolkit.WITH_XERROR_HANDLER(XWM.VerifyChangePropertyHandler);
XToolkit.WITH_XERROR_HANDLER(XErrorHandler.VerifyChangePropertyHandler.getInstance());
XDnDConstants.XA_XdndProxy.setAtomData(embedder, XAtom.XA_WINDOW,
data, 1);
XToolkit.RESTORE_XERROR_HANDLER();
@ -329,7 +329,7 @@ class XDnDDropTargetProtocol extends XDropTargetProtocol {
false, XConstants.AnyPropertyType);
try {
status = wpg1.execute(XToolkit.IgnoreBadWindowHandler);
status = wpg1.execute(XErrorHandler.IgnoreBadWindowHandler.getInstance());
if (status == XConstants.Success &&
wpg1.getData() != 0 && wpg1.getActualType() == XAtom.XA_ATOM) {
@ -348,7 +348,7 @@ class XDnDDropTargetProtocol extends XDropTargetProtocol {
0, 1, false, XAtom.XA_WINDOW);
try {
status = wpg2.execute(XToolkit.IgnoreBadWindowHandler);
status = wpg2.execute(XErrorHandler.IgnoreBadWindowHandler.getInstance());
if (status == XConstants.Success &&
wpg2.getData() != 0 &&
@ -366,7 +366,7 @@ class XDnDDropTargetProtocol extends XDropTargetProtocol {
0, 1, false, XAtom.XA_WINDOW);
try {
status = wpg3.execute(XToolkit.IgnoreBadWindowHandler);
status = wpg3.execute(XErrorHandler.IgnoreBadWindowHandler.getInstance());
if (status != XConstants.Success ||
wpg3.getData() == 0 ||
@ -382,7 +382,7 @@ class XDnDDropTargetProtocol extends XDropTargetProtocol {
XConstants.AnyPropertyType);
try {
status = wpg4.execute(XToolkit.IgnoreBadWindowHandler);
status = wpg4.execute(XErrorHandler.IgnoreBadWindowHandler.getInstance());
if (status != XConstants.Success ||
wpg4.getData() == 0 ||
@ -411,7 +411,7 @@ class XDnDDropTargetProtocol extends XDropTargetProtocol {
false, XConstants.AnyPropertyType);
try {
int status = wpg1.execute(XToolkit.IgnoreBadWindowHandler);
int status = wpg1.execute(XErrorHandler.IgnoreBadWindowHandler.getInstance());
if (status == XConstants.Success &&
wpg1.getData() != 0 && wpg1.getActualType() == XAtom.XA_ATOM) {
@ -473,7 +473,7 @@ class XDnDDropTargetProtocol extends XDropTargetProtocol {
0, 0xFFFF, false,
XAtom.XA_ATOM);
try {
wpg.execute(XToolkit.IgnoreBadWindowHandler);
wpg.execute(XErrorHandler.IgnoreBadWindowHandler.getInstance());
if (wpg.getActualType() == XAtom.XA_ATOM &&
wpg.getActualFormat() == 32) {
@ -505,7 +505,7 @@ class XDnDDropTargetProtocol extends XDropTargetProtocol {
0, 0xFFFF, false,
XAtom.XA_ATOM);
try {
wpg.execute(XToolkit.IgnoreBadWindowHandler);
wpg.execute(XErrorHandler.IgnoreBadWindowHandler.getInstance());
if (wpg.getActualType() == XAtom.XA_ATOM &&
wpg.getActualFormat() == 32) {
@ -541,7 +541,7 @@ class XDnDDropTargetProtocol extends XDropTargetProtocol {
*/
XWindowAttributes wattr = new XWindowAttributes();
try {
XToolkit.WITH_XERROR_HANDLER(XToolkit.IgnoreBadWindowHandler);
XToolkit.WITH_XERROR_HANDLER(XErrorHandler.IgnoreBadWindowHandler.getInstance());
int status = XlibWrapper.XGetWindowAttributes(XToolkit.getDisplay(),
source_win, wattr.pData);
@ -558,7 +558,7 @@ class XDnDDropTargetProtocol extends XDropTargetProtocol {
wattr.dispose();
}
XToolkit.WITH_XERROR_HANDLER(XToolkit.IgnoreBadWindowHandler);
XToolkit.WITH_XERROR_HANDLER(XErrorHandler.IgnoreBadWindowHandler.getInstance());
XlibWrapper.XSelectInput(XToolkit.getDisplay(), source_win,
source_win_mask |
XConstants.StructureNotifyMask);
@ -963,7 +963,7 @@ class XDnDDropTargetProtocol extends XDropTargetProtocol {
if (sourceWindow != 0) {
XToolkit.awtLock();
try {
XToolkit.WITH_XERROR_HANDLER(XToolkit.IgnoreBadWindowHandler);
XToolkit.WITH_XERROR_HANDLER(XErrorHandler.IgnoreBadWindowHandler.getInstance());
XlibWrapper.XSelectInput(XToolkit.getDisplay(), sourceWindow,
sourceWindowMask);
XToolkit.RESTORE_XERROR_HANDLER();
@ -1104,14 +1104,14 @@ class XDnDDropTargetProtocol extends XDropTargetProtocol {
0, 0xFFFF, false,
XAtom.XA_ATOM);
try {
wpg.execute(XToolkit.IgnoreBadWindowHandler);
wpg.execute(XErrorHandler.IgnoreBadWindowHandler.getInstance());
if (wpg.getActualType() == XAtom.XA_ATOM &&
wpg.getActualFormat() == 32) {
XToolkit.awtLock();
try {
XToolkit.WITH_XERROR_HANDLER(XWM.VerifyChangePropertyHandler);
XToolkit.WITH_XERROR_HANDLER(XErrorHandler.VerifyChangePropertyHandler.getInstance());
XDnDConstants.XA_XdndTypeList.setAtomData(xclient.get_window(),
XAtom.XA_ATOM,
wpg.getData(),

View File

@ -42,6 +42,7 @@ import sun.awt.ComponentAccessor;
import sun.awt.dnd.SunDragSourceContextPeer;
import sun.awt.dnd.SunDropTargetContextPeer;
import sun.awt.SunToolkit;
/**
* The XDragSourceContextPeer class is the class responsible for handling
@ -665,6 +666,15 @@ public final class XDragSourceContextPeer
return true;
case XConstants.ButtonRelease: {
XButtonEvent xbutton = ev.get_xbutton();
/*
* Ignore the buttons above 20 due to the bit limit for
* InputEvent.BUTTON_DOWN_MASK.
* One more bit is reserved for FIRST_HIGH_BIT.
*/
if (xbutton.get_button() > SunToolkit.MAX_BUTTONS_SUPPORTED) {
return true;
}
/*
* On some X servers it could happen that ButtonRelease coordinates
* differ from the latest MotionNotify coordinates, so we need to

View File

@ -181,7 +181,7 @@ abstract class XDragSourceProtocol {
long time) {
XWindowAttributes wattr = new XWindowAttributes();
try {
XToolkit.WITH_XERROR_HANDLER(XToolkit.IgnoreBadWindowHandler);
XToolkit.WITH_XERROR_HANDLER(XErrorHandler.IgnoreBadWindowHandler.getInstance());
int status = XlibWrapper.XGetWindowAttributes(XToolkit.getDisplay(),
targetWindow, wattr.pData);
@ -198,7 +198,7 @@ abstract class XDragSourceProtocol {
wattr.dispose();
}
XToolkit.WITH_XERROR_HANDLER(XToolkit.IgnoreBadWindowHandler);
XToolkit.WITH_XERROR_HANDLER(XErrorHandler.IgnoreBadWindowHandler.getInstance());
XlibWrapper.XSelectInput(XToolkit.getDisplay(), targetWindow,
targetWindowMask |
XConstants.StructureNotifyMask);
@ -214,7 +214,7 @@ abstract class XDragSourceProtocol {
}
protected final void finalizeDrop() {
XToolkit.WITH_XERROR_HANDLER(XToolkit.IgnoreBadWindowHandler);
XToolkit.WITH_XERROR_HANDLER(XErrorHandler.IgnoreBadWindowHandler.getInstance());
XlibWrapper.XSelectInput(XToolkit.getDisplay(), targetWindow,
targetWindowMask);
XToolkit.RESTORE_XERROR_HANDLER();

View File

@ -168,7 +168,7 @@ final class XDropTargetRegistry {
if (dest_x >= 0 && dest_y >= 0) {
XWindowAttributes wattr = new XWindowAttributes();
try {
XToolkit.WITH_XERROR_HANDLER(XToolkit.IgnoreBadWindowHandler);
XToolkit.WITH_XERROR_HANDLER(XErrorHandler.IgnoreBadWindowHandler.getInstance());
int status = XlibWrapper.XGetWindowAttributes(XToolkit.getDisplay(),
window, wattr.pData);
XToolkit.RESTORE_XERROR_HANDLER();
@ -222,7 +222,7 @@ final class XDropTargetRegistry {
long event_mask = 0;
XWindowAttributes wattr = new XWindowAttributes();
try {
XToolkit.WITH_XERROR_HANDLER(XToolkit.IgnoreBadWindowHandler);
XToolkit.WITH_XERROR_HANDLER(XErrorHandler.IgnoreBadWindowHandler.getInstance());
int status = XlibWrapper.XGetWindowAttributes(XToolkit.getDisplay(),
embedder, wattr.pData);
XToolkit.RESTORE_XERROR_HANDLER();
@ -240,7 +240,7 @@ final class XDropTargetRegistry {
}
if ((event_mask & XConstants.PropertyChangeMask) == 0) {
XToolkit.WITH_XERROR_HANDLER(XToolkit.IgnoreBadWindowHandler);
XToolkit.WITH_XERROR_HANDLER(XErrorHandler.IgnoreBadWindowHandler.getInstance());
XlibWrapper.XSelectInput(XToolkit.getDisplay(), embedder,
event_mask | XConstants.PropertyChangeMask);
XToolkit.RESTORE_XERROR_HANDLER();
@ -394,7 +394,7 @@ final class XDropTargetRegistry {
/* Restore the original event mask for the embedder. */
if ((event_mask & XConstants.PropertyChangeMask) == 0) {
XToolkit.WITH_XERROR_HANDLER(XToolkit.IgnoreBadWindowHandler);
XToolkit.WITH_XERROR_HANDLER(XErrorHandler.IgnoreBadWindowHandler.getInstance());
XlibWrapper.XSelectInput(XToolkit.getDisplay(), embedder,
event_mask);
XToolkit.RESTORE_XERROR_HANDLER();

View File

@ -301,7 +301,7 @@ public class XEmbedCanvasPeer extends XCanvasPeer implements WindowFocusListener
try {
XWindowAttributes wattr = new XWindowAttributes();
try {
XToolkit.WITH_XERROR_HANDLER(XToolkit.IgnoreBadWindowHandler);
XToolkit.WITH_XERROR_HANDLER(XErrorHandler.IgnoreBadWindowHandler.getInstance());
int status = XlibWrapper.XGetWindowAttributes(XToolkit.getDisplay(),
xembed.handle, wattr.pData);

View File

@ -386,5 +386,7 @@ public class XEmbedChildProxyPeer implements ComponentPeer, XEventDispatcher{
public void setZOrder(ComponentPeer above) {
}
public void updateGraphicsData(GraphicsConfiguration gc) {}
public boolean updateGraphicsData(GraphicsConfiguration gc) {
return false;
}
}

View File

@ -0,0 +1,79 @@
/*
* Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
package sun.awt.X11;
public abstract class XErrorHandler {
/*
* Called under AWT lock
*/
public abstract int handleError(long display, XErrorEvent err);
/*
* Forwards all the errors to saved error handler (which was
* set before XToolkit had been initialized).
*/
public static class XBaseErrorHandler extends XErrorHandler {
@Override
public int handleError(long display, XErrorEvent err) {
return XToolkit.SAVED_ERROR_HANDLER(display, err);
}
}
/*
* Instead of validating window id, we simply call XGetWindowProperty,
* but temporary install this function as the error handler to ignore
* BadWindow error.
*/
public static class IgnoreBadWindowHandler extends XBaseErrorHandler {
@Override
public int handleError(long display, XErrorEvent err) {
if (err.get_error_code() == XConstants.BadWindow) {
return 0;
}
return super.handleError(display, err);
}
// Shared instance
private static IgnoreBadWindowHandler theInstance = new IgnoreBadWindowHandler();
public static IgnoreBadWindowHandler getInstance() {
return theInstance;
}
}
public static class VerifyChangePropertyHandler extends XBaseErrorHandler {
@Override
public int handleError(long display, XErrorEvent err) {
if (err.get_request_code() == XProtocolConstants.X_ChangeProperty) {
return 0;
}
return super.handleError(display, err);
}
// Shared instance
private static IgnoreBadWindowHandler theInstance = new IgnoreBadWindowHandler();
public static IgnoreBadWindowHandler getInstance() {
return theInstance;
}
}
}

View File

@ -29,6 +29,9 @@ package sun.awt.X11;
import java.util.Hashtable;
import sun.misc.Unsafe;
import java.util.logging.Level;
import java.util.logging.Logger;
public class XKeysym {
public static void main( String args[] ) {
@ -67,6 +70,7 @@ public class XKeysym {
static Hashtable<Integer, Long> javaKeycode2KeysymHash = new Hashtable<Integer, Long>();
static long keysym_lowercase = unsafe.allocateMemory(Native.getLongSize());
static long keysym_uppercase = unsafe.allocateMemory(Native.getLongSize());
private static Logger keyEventLog = Logger.getLogger("sun.awt.X11.kye.XKeysym");
public static char convertKeysym( long ks, int state ) {
/* First check for Latin-1 characters (1:1 mapping) */
@ -107,8 +111,15 @@ public class XKeysym {
// clearly means that caller needs a so called primary keysym.
mods ^= XConstants.ShiftMask;
}
XlibWrapper.XkbTranslateKeyCode(XToolkit.getXKBKbdDesc(), ev.get_keycode(),
long kbdDesc = XToolkit.getXKBKbdDesc();
if( kbdDesc != 0 ) {
XlibWrapper.XkbTranslateKeyCode(kbdDesc, ev.get_keycode(),
mods, XlibWrapper.iarg1, XlibWrapper.larg3);
}else{
// xkb resources already gone
keyEventLog.fine("Thread race: Toolkit shutdown before the end of a key event processing.");
return 0;
}
//XXX unconsumed modifiers?
return Native.getLong(XlibWrapper.larg3);
} finally {

View File

@ -35,20 +35,6 @@ class XProtocol {
private Map<XAtom, XAtomList> atomToList = new HashMap<XAtom, XAtomList>();
private Map<XAtom, Long> atomToAnchor = new HashMap<XAtom, Long>();
/*
* Temporary error handler that ensures that we know if
* XChangeProperty succeeded or not.
*/
static XToolkit.XErrorHandler VerifyChangePropertyHandler = new XToolkit.XErrorHandler() {
public int handleError(long display, XErrorEvent err) {
XToolkit.XERROR_SAVE(err);
if (err.get_request_code() == XProtocolConstants.X_ChangeProperty) {
return 0;
} else {
return XToolkit.SAVED_ERROR_HANDLER(display, err);
}
}
};
volatile boolean firstCheck = true;
/*
* Check that that the list of protocols specified by WM in property

View File

@ -52,7 +52,7 @@ public class XQueryTree {
public int execute() {
return execute(null);
}
public int execute(XToolkit.XErrorHandler errorHandler) {
public int execute(XErrorHandler errorHandler) {
XToolkit.awtLock();
try {
if (isDisposed()) {

View File

@ -81,16 +81,11 @@ class XRobotPeer implements RobotPeer {
return pixelArray;
}
public int getNumberOfButtons(){
return getNumberOfButtonsImpl();
}
private static native synchronized void setup();
private static native synchronized void mouseMoveImpl(X11GraphicsConfig xgc, int x, int y);
private static native synchronized void mousePressImpl(int buttons);
private static native synchronized void mouseReleaseImpl(int buttons);
private static native synchronized int getNumberOfButtonsImpl();
private static native synchronized void mouseWheelImpl(int wheelAmt);
private static native synchronized void keyPressImpl(int keycode);

View File

@ -84,21 +84,6 @@ public final class XToolkit extends UNIXToolkit implements Runnable {
//Set to true by default.
private static boolean areExtraMouseButtonsEnabled = true;
/**
* Number of buttons.
* By default it's taken from the system. If system value does not
* fit into int type range, use our own MAX_BUTTONS_SUPPORT value.
*/
private static int numberOfButtons = 0;
/* XFree standard mention 24 buttons as maximum:
* http://www.xfree86.org/current/mouse.4.html
* We workaround systems supporting more than 24 buttons.
* Otherwise, we have to use long type values as masks
* which leads to API change.
*/
private static int MAX_BUTTONS_SUPPORT = 24;
/**
* True when the x settings have been loaded.
*/
@ -149,63 +134,78 @@ public final class XToolkit extends UNIXToolkit implements Runnable {
setBackingStoreType();
}
m_removeSourceEvents = SunToolkit.getMethod(EventQueue.class, "removeSourceEvents", new Class[] {Object.class, Boolean.TYPE}) ;
noisyAwtHandler = AccessController.doPrivileged(new GetBooleanAction("sun.awt.noisyerrorhandler"));
}
// Error handler stuff
static XErrorEvent saved_error;
static long saved_error_handler;
static XErrorHandler curErrorHandler;
// Should be called under LOCK, before releasing LOCK RESTORE_XERROR_HANDLER should be called
static void WITH_XERROR_HANDLER(XErrorHandler handler) {
//---- ERROR HANDLER CODE ----//
/*
* Error handler at the moment of XToolkit initialization
*/
private static long saved_error_handler;
/*
* XErrorEvent being handled
*/
static volatile XErrorEvent saved_error;
/*
* Current error handler or null if no error handler is set
*/
private static XErrorHandler current_error_handler;
/*
* Value of sun.awt.noisyerrorhandler system property
*/
private static boolean noisyAwtHandler;
public static void WITH_XERROR_HANDLER(XErrorHandler handler) {
saved_error = null;
curErrorHandler = handler;
XSync();
saved_error_handler = XlibWrapper.SetToolkitErrorHandler();
current_error_handler = handler;
}
static void XERROR_SAVE(XErrorEvent event) {
saved_error = event;
public static void RESTORE_XERROR_HANDLER() {
current_error_handler = null;
}
// Should be called under LOCK
static void RESTORE_XERROR_HANDLER() {
XSync();
XlibWrapper.XSetErrorHandler(saved_error_handler);
curErrorHandler = null;
public static int SAVED_ERROR_HANDLER(long display, XErrorEvent error) {
if (saved_error_handler != 0) {
// Default XErrorHandler may just terminate the process. Don't call it.
// return XlibWrapper.CallErrorHandler(saved_error_handler, display, error.pData);
}
if (log.isLoggable(Level.FINE)) {
log.log(Level.FINE, "Unhandled XErrorEvent: " +
"id=" + error.get_resourceid() + ", " +
"serial=" + error.get_serial() + ", " +
"ec=" + error.get_error_code() + ", " +
"rc=" + error.get_request_code() + ", " +
"mc=" + error.get_minor_code());
}
return 0;
}
// Should be called under LOCK
static int SAVED_ERROR_HANDLER(long display, XErrorEvent error) {
return XlibWrapper.CallErrorHandler(saved_error_handler, display, error.pData);
}
interface XErrorHandler {
int handleError(long display, XErrorEvent err);
}
static int GlobalErrorHandler(long display, long event_ptr) {
// Called from the native code when an error occurs
private static int globalErrorHandler(long display, long event_ptr) {
if (noisyAwtHandler) {
XlibWrapper.PrintXErrorEvent(display, event_ptr);
}
XErrorEvent event = new XErrorEvent(event_ptr);
saved_error = event;
try {
if (curErrorHandler != null) {
return curErrorHandler.handleError(display, event);
if (current_error_handler != null) {
return current_error_handler.handleError(display, event);
} else {
return SAVED_ERROR_HANDLER(display, event);
}
} finally {
} catch (Throwable z) {
log.log(Level.FINE, "Error in GlobalErrorHandler", z);
}
return 0;
}
/*
* Instead of validating window id, we simply call XGetWindowProperty,
* but temporary install this function as the error handler to ignore
* BadWindow error.
*/
static XErrorHandler IgnoreBadWindowHandler = new XErrorHandler() {
public int handleError(long display, XErrorEvent err) {
XERROR_SAVE(err);
if (err.get_error_code() == XConstants.BadWindow) {
return 0;
} else {
return SAVED_ERROR_HANDLER(display, err);
}
}
};
//---- END OF ERROR HANDLER CODE ----//
private native static void initIDs();
native static void waitForEvents(long nextTaskTime);
@ -302,25 +302,34 @@ public final class XToolkit extends UNIXToolkit implements Runnable {
areExtraMouseButtonsEnabled = Boolean.parseBoolean(System.getProperty("sun.awt.enableExtraMouseButtons", "true"));
//set system property if not yet assigned
System.setProperty("sun.awt.enableExtraMouseButtons", ""+areExtraMouseButtonsEnabled);
saved_error_handler = XlibWrapper.SetToolkitErrorHandler();
} finally {
awtUnlock();
}
Runtime.getRuntime().addShutdownHook(new Thread() {
public void run() {
XSystemTrayPeer peer = XSystemTrayPeer.getPeerInstance();
if (peer != null) {
peer.dispose();
}
if (xs != null) {
((XAWTXSettings)xs).dispose();
}
freeXKB();
if (log.isLoggable(Level.FINE)) {
dumpPeers();
}
public void run() {
XSystemTrayPeer peer = XSystemTrayPeer.getPeerInstance();
if (peer != null) {
peer.dispose();
}
});
if (xs != null) {
((XAWTXSettings)xs).dispose();
}
freeXKB();
if (log.isLoggable(Level.FINE)) {
dumpPeers();
}
awtLock();
try {
XlibWrapper.XSetErrorHandler(saved_error_handler);
} finally {
awtUnlock();
}
}
});
}
static String getCorrectXIDString(String val) {
@ -1434,19 +1443,26 @@ public final class XToolkit extends UNIXToolkit implements Runnable {
desktopProperties.put("awt.multiClickInterval",
Integer.valueOf(getMultiClickTime()));
desktopProperties.put("awt.mouse.numButtons",
Integer.valueOf(getNumMouseButtons()));
Integer.valueOf(getNumberOfButtons()));
}
}
public static int getNumMouseButtons() {
/**
* This method runs through the XPointer and XExtendedPointer array.
* XExtendedPointer has priority because on some systems XPointer
* (which is assigned to the virtual pointer) reports the maximum
* capabilities of the mouse pointer (i.e. 32 physical buttons).
*/
private native synchronized int getNumberOfButtonsImpl();
@Override
public int getNumberOfButtons(){
awtLock();
try {
if (numberOfButtons == 0) {
numberOfButtons = Math.min(
XlibWrapper.XGetPointerMapping(XToolkit.getDisplay(), 0, 0),
MAX_BUTTONS_SUPPORT);
numberOfButtons = getNumberOfButtonsImpl();
}
return numberOfButtons;
return (numberOfButtons > MAX_BUTTONS_SUPPORTED)? MAX_BUTTONS_SUPPORTED : numberOfButtons;
} finally {
awtUnlock();
}
@ -2239,6 +2255,7 @@ public final class XToolkit extends UNIXToolkit implements Runnable {
try {
if (awt_UseXKB_Calls && awt_XKBDescPtr != 0) {
XlibWrapper.XkbFreeKeyboard(awt_XKBDescPtr, 0xFF, true);
awt_XKBDescPtr = 0;
}
} finally {
awtUnlock();
@ -2409,8 +2426,6 @@ public final class XToolkit extends UNIXToolkit implements Runnable {
return new XDesktopPeer();
}
public static native void setNoisyXErrorHandler();
public boolean areExtraMouseButtonsEnabled() throws HeadlessException {
return areExtraMouseButtonsEnabled;
}

View File

@ -57,7 +57,7 @@ public class XTranslateCoordinates {
public int execute() {
return execute(null);
}
public int execute(XToolkit.XErrorHandler errorHandler) {
public int execute(XErrorHandler errorHandler) {
XToolkit.awtLock();
try {
if (isDisposed()) {

View File

@ -276,7 +276,7 @@ final class XWM
winmgr_running = false;
substruct.set_event_mask(XConstants.SubstructureRedirectMask);
XToolkit.WITH_XERROR_HANDLER(DetectWMHandler);
XToolkit.WITH_XERROR_HANDLER(detectWMHandler);
XlibWrapper.XChangeWindowAttributes(XToolkit.getDisplay(),
XToolkit.getDefaultRootWindow(),
XConstants.CWEventMask,
@ -321,7 +321,7 @@ final class XWM
new WindowPropertyGetter(window, XA_ENLIGHTENMENT_COMMS, 0, 14, false,
XAtom.XA_STRING);
try {
int status = getter.execute(XToolkit.IgnoreBadWindowHandler);
int status = getter.execute(XErrorHandler.IgnoreBadWindowHandler.getInstance());
if (status != XConstants.Success || getter.getData() == 0) {
return 0;
}
@ -439,7 +439,7 @@ final class XWM
new WindowPropertyGetter(wmwin, XA_DT_SM_STATE_INFO, 0, 1,
false, XA_DT_SM_STATE_INFO);
try {
status = getter2.execute(XToolkit.IgnoreBadWindowHandler);
status = getter2.execute(XErrorHandler.IgnoreBadWindowHandler.getInstance());
if (status != XConstants.Success || getter2.getData() == 0) {
@ -570,21 +570,6 @@ final class XWM
return (XWM.getWMID() == XWM.COMPIZ_WM || XWM.getWMID() == XWM.LG3D_WM);
}
/*
* Temporary error handler that ensures that we know if
* XChangeProperty succeeded or not.
*/
static XToolkit.XErrorHandler VerifyChangePropertyHandler = new XToolkit.XErrorHandler() {
public int handleError(long display, XErrorEvent err) {
XToolkit.XERROR_SAVE(err);
if (err.get_request_code() == XProtocolConstants.X_ChangeProperty) {
return 0;
} else {
return XToolkit.SAVED_ERROR_HANDLER(display, err);
}
}
};
/*
* Prepare IceWM check.
*
@ -617,7 +602,7 @@ final class XWM
XToolkit.awtLock();
try {
XToolkit.WITH_XERROR_HANDLER(VerifyChangePropertyHandler);
XToolkit.WITH_XERROR_HANDLER(XErrorHandler.VerifyChangePropertyHandler.getInstance());
XlibWrapper.XChangePropertyS(XToolkit.getDisplay(), XToolkit.getDefaultRootWindow(),
XA_ICEWM_WINOPTHINT.getAtom(),
XA_ICEWM_WINOPTHINT.getAtom(),
@ -682,20 +667,19 @@ final class XWM
* Temporary error handler that checks if selecting for
* SubstructureRedirect failed.
*/
static boolean winmgr_running = false;
static XToolkit.XErrorHandler DetectWMHandler = new XToolkit.XErrorHandler() {
public int handleError(long display, XErrorEvent err) {
XToolkit.XERROR_SAVE(err);
if (err.get_request_code() == XProtocolConstants.X_ChangeWindowAttributes
&& err.get_error_code() == XConstants.BadAccess)
{
winmgr_running = true;
return 0;
} else {
return XToolkit.SAVED_ERROR_HANDLER(display, err);
}
private static boolean winmgr_running = false;
private static XErrorHandler detectWMHandler = new XErrorHandler.XBaseErrorHandler() {
@Override
public int handleError(long display, XErrorEvent err) {
if ((err.get_request_code() == XProtocolConstants.X_ChangeWindowAttributes) &&
(err.get_error_code() == XConstants.BadAccess))
{
winmgr_running = true;
return 0;
}
};
return super.handleError(display, err);
}
};
/*
* Make an educated guess about running window manager.

View File

@ -34,74 +34,68 @@ import sun.awt.AWTAccessor;
import sun.awt.SunToolkit;
class XWarningWindow extends XWindow {
private final static int showingDelay = 330;
private final static int hidingDelay = 2000;
private final static int SHOWING_DELAY = 330;
private final static int HIDING_DELAY = 2000;
private final Window ownerWindow;
private WeakReference<XWindowPeer> ownerPeer;
public final Window getOwnerWindow() {
return ownerWindow;
}
private long parentWindow;
private final static String OWNER = "OWNER";
private static XIconInfo[][] icons;
private InfoWindow.Tooltip tooltip;
private static synchronized XIconInfo getSecurityIconInfo(int size, int num) {
if (icons == null) {
icons = new XIconInfo[4][3];
if (XlibWrapper.dataModel == 32) {
icons[0][0] = new XIconInfo(XAWTIcon32_security_icon_bw16_png.security_icon_bw16_png);
icons[0][1] = new XIconInfo(XAWTIcon32_security_icon_interim16_png.security_icon_interim16_png);
icons[0][2] = new XIconInfo(XAWTIcon32_security_icon_yellow16_png.security_icon_yellow16_png);
icons[1][0] = new XIconInfo(XAWTIcon32_security_icon_bw24_png.security_icon_bw24_png);
icons[1][1] = new XIconInfo(XAWTIcon32_security_icon_interim24_png.security_icon_interim24_png);
icons[1][2] = new XIconInfo(XAWTIcon32_security_icon_yellow24_png.security_icon_yellow24_png);
icons[2][0] = new XIconInfo(XAWTIcon32_security_icon_bw32_png.security_icon_bw32_png);
icons[2][1] = new XIconInfo(XAWTIcon32_security_icon_interim32_png.security_icon_interim32_png);
icons[2][2] = new XIconInfo(XAWTIcon32_security_icon_yellow32_png.security_icon_yellow32_png);
icons[3][0] = new XIconInfo(XAWTIcon32_security_icon_bw48_png.security_icon_bw48_png);
icons[3][1] = new XIconInfo(XAWTIcon32_security_icon_interim48_png.security_icon_interim48_png);
icons[3][2] = new XIconInfo(XAWTIcon32_security_icon_yellow48_png.security_icon_yellow48_png);
} else {
icons[0][0] = new XIconInfo(XAWTIcon64_security_icon_bw16_png.security_icon_bw16_png);
icons[0][1] = new XIconInfo(XAWTIcon64_security_icon_interim16_png.security_icon_interim16_png);
icons[0][2] = new XIconInfo(XAWTIcon64_security_icon_yellow16_png.security_icon_yellow16_png);
icons[1][0] = new XIconInfo(XAWTIcon64_security_icon_bw24_png.security_icon_bw24_png);
icons[1][1] = new XIconInfo(XAWTIcon64_security_icon_interim24_png.security_icon_interim24_png);
icons[1][2] = new XIconInfo(XAWTIcon64_security_icon_yellow24_png.security_icon_yellow24_png);
icons[2][0] = new XIconInfo(XAWTIcon64_security_icon_bw32_png.security_icon_bw32_png);
icons[2][1] = new XIconInfo(XAWTIcon64_security_icon_interim32_png.security_icon_interim32_png);
icons[2][2] = new XIconInfo(XAWTIcon64_security_icon_yellow32_png.security_icon_yellow32_png);
icons[3][0] = new XIconInfo(XAWTIcon64_security_icon_bw48_png.security_icon_bw48_png);
icons[3][1] = new XIconInfo(XAWTIcon64_security_icon_interim48_png.security_icon_interim48_png);
icons[3][2] = new XIconInfo(XAWTIcon64_security_icon_yellow48_png.security_icon_yellow48_png);
/**
* Animation stage.
*/
private volatile int currentIcon = 0;
/* -1 - uninitialized.
* 0 - 16x16
* 1 - 24x24
* 2 - 32x32
* 3 - 48x48
*/
private int currentSize = -1;
private static XIconInfo[][] icons;
private static XIconInfo getSecurityIconInfo(int size, int num) {
synchronized (XWarningWindow.class) {
if (icons == null) {
icons = new XIconInfo[4][3];
if (XlibWrapper.dataModel == 32) {
icons[0][0] = new XIconInfo(XAWTIcon32_security_icon_bw16_png.security_icon_bw16_png);
icons[0][1] = new XIconInfo(XAWTIcon32_security_icon_interim16_png.security_icon_interim16_png);
icons[0][2] = new XIconInfo(XAWTIcon32_security_icon_yellow16_png.security_icon_yellow16_png);
icons[1][0] = new XIconInfo(XAWTIcon32_security_icon_bw24_png.security_icon_bw24_png);
icons[1][1] = new XIconInfo(XAWTIcon32_security_icon_interim24_png.security_icon_interim24_png);
icons[1][2] = new XIconInfo(XAWTIcon32_security_icon_yellow24_png.security_icon_yellow24_png);
icons[2][0] = new XIconInfo(XAWTIcon32_security_icon_bw32_png.security_icon_bw32_png);
icons[2][1] = new XIconInfo(XAWTIcon32_security_icon_interim32_png.security_icon_interim32_png);
icons[2][2] = new XIconInfo(XAWTIcon32_security_icon_yellow32_png.security_icon_yellow32_png);
icons[3][0] = new XIconInfo(XAWTIcon32_security_icon_bw48_png.security_icon_bw48_png);
icons[3][1] = new XIconInfo(XAWTIcon32_security_icon_interim48_png.security_icon_interim48_png);
icons[3][2] = new XIconInfo(XAWTIcon32_security_icon_yellow48_png.security_icon_yellow48_png);
} else {
icons[0][0] = new XIconInfo(XAWTIcon64_security_icon_bw16_png.security_icon_bw16_png);
icons[0][1] = new XIconInfo(XAWTIcon64_security_icon_interim16_png.security_icon_interim16_png);
icons[0][2] = new XIconInfo(XAWTIcon64_security_icon_yellow16_png.security_icon_yellow16_png);
icons[1][0] = new XIconInfo(XAWTIcon64_security_icon_bw24_png.security_icon_bw24_png);
icons[1][1] = new XIconInfo(XAWTIcon64_security_icon_interim24_png.security_icon_interim24_png);
icons[1][2] = new XIconInfo(XAWTIcon64_security_icon_yellow24_png.security_icon_yellow24_png);
icons[2][0] = new XIconInfo(XAWTIcon64_security_icon_bw32_png.security_icon_bw32_png);
icons[2][1] = new XIconInfo(XAWTIcon64_security_icon_interim32_png.security_icon_interim32_png);
icons[2][2] = new XIconInfo(XAWTIcon64_security_icon_yellow32_png.security_icon_yellow32_png);
icons[3][0] = new XIconInfo(XAWTIcon64_security_icon_bw48_png.security_icon_bw48_png);
icons[3][1] = new XIconInfo(XAWTIcon64_security_icon_interim48_png.security_icon_interim48_png);
icons[3][2] = new XIconInfo(XAWTIcon64_security_icon_yellow48_png.security_icon_yellow48_png);
}
}
}
final int sizeIndex = size % icons.length;
return icons[sizeIndex][num % icons[sizeIndex].length];
}
private volatile int currentIcon = 0;
/* -1 - uninitialized yet
* 0 - 16x16
* 1 - 24x24
* 2 - 32x32
* 3 - 48x48
*/
private volatile int currentSize = -1;
/** Indicates whether the shape of the window must be updated
*/
private volatile boolean sizeUpdated = true;
private synchronized boolean updateIconSize() {
int newSize = currentSize;
private void updateIconSize() {
int newSize = -1;
if (ownerWindow != null) {
Insets insets = ownerWindow.getInsets();
@ -117,14 +111,32 @@ class XWarningWindow extends XWindow {
newSize = 3;
}
}
if (newSize != currentSize) {
currentSize = newSize;
sizeUpdated = true;
// Make sure we have a valid size
if (newSize == -1) {
newSize = 0;
}
// Note: this is not the most wise solution to use awtLock here,
// this should have been sync'ed with the stateLock. However,
// the awtLock must be taken first (see XBaseWindow.getStateLock()),
// and we need the awtLock anyway to update the shape of the icon.
// So it's easier to use just one lock instead.
XToolkit.awtLock();
try {
if (newSize != currentSize) {
currentSize = newSize;
XIconInfo ico = getSecurityIconInfo(currentSize, 0);
XlibWrapper.SetBitmapShape(XToolkit.getDisplay(), getWindow(),
ico.getWidth(), ico.getHeight(), ico.getIntData());
AWTAccessor.getWindowAccessor().setSecurityWarningSize(
ownerWindow, ico.getWidth(), ico.getHeight());
}
} finally {
XToolkit.awtUnlock();
}
return sizeUpdated;
}
private synchronized XIconInfo getSecurityIconInfo() {
private XIconInfo getSecurityIconInfo() {
updateIconSize();
return getSecurityIconInfo(currentSize, currentIcon);
}
@ -183,28 +195,6 @@ class XWarningWindow extends XWindow {
}
}
private void updateWarningWindowBounds() {
XWindowPeer peer = ownerPeer.get();
if (peer != null) {
synchronized (this) {
if (updateIconSize()) {
XIconInfo ico = getSecurityIconInfo();
XToolkit.awtLock();
try {
XlibWrapper.SetBitmapShape(XToolkit.getDisplay(), getWindow(),
ico.getWidth(), ico.getHeight(), ico.getIntData());
} finally {
XToolkit.awtUnlock();
}
sizeUpdated = false;
AWTAccessor.getWindowAccessor().setSecurityWarningSize(
ownerWindow, ico.getWidth(), ico.getHeight());
}
}
peer.repositionSecurityWarning();
}
}
/**
* @param x,y,w,h coordinates of the untrusted window
*/
@ -376,25 +366,22 @@ class XWarningWindow extends XWindow {
private final Runnable showingTask = new Runnable() {
public void run() {
new Thread() {
public void run() {
if (!isVisible()) {
xSetVisible(true);
updateWarningWindowBounds();
}
repaint();
if (currentIcon > 0) {
currentIcon--;
XToolkit.schedule(showingTask, showingDelay);
}
}}.start();
if (!isVisible()) {
xSetVisible(true);
updateIconSize();
XWindowPeer peer = ownerPeer.get();
if (peer != null) {
peer.repositionSecurityWarning();
}
}
repaint();
if (currentIcon > 0) {
currentIcon--;
XToolkit.schedule(showingTask, SHOWING_DELAY);
}
}
};
public void setSecurityWarningVisible(boolean visible) {
setSecurityWarningVisible(visible, true);
}
public void setSecurityWarningVisible(boolean visible, boolean doSchedule) {
if (visible) {
XToolkit.remove(hidingTask);
@ -416,7 +403,7 @@ class XWarningWindow extends XWindow {
return;
}
if (doSchedule) {
XToolkit.schedule(hidingTask, hidingDelay);
XToolkit.schedule(hidingTask, HIDING_DELAY);
} else {
hidingTask.run();
}

View File

@ -677,6 +677,14 @@ public class XWindow extends XBaseWindow implements X11ComponentPeer {
int button=0;
boolean wheel_mouse = false;
int lbutton = xbe.get_button();
/*
* Ignore the buttons above 20 due to the bit limit for
* InputEvent.BUTTON_DOWN_MASK.
* One more bit is reserved for FIRST_HIGH_BIT.
*/
if (lbutton > SunToolkit.MAX_BUTTONS_SUPPORTED) {
return;
}
int type = xev.get_type();
when = xbe.get_time();
long jWhen = XToolkit.nowMillisUTC_offset(when);
@ -795,8 +803,9 @@ public class XWindow extends XBaseWindow implements X11ComponentPeer {
//this doesn't work for extra buttons because Xsystem is sending state==0 for every extra button event.
// we can't correct it in MouseEvent class as we done it with modifiers, because exact type (DRAG|MOVE)
// should be passed from XWindow.
//TODO: eliminate it with some other value obtained w/o AWTLock.
for (int i = 0; i < XToolkit.getNumMouseButtons(); i++){
final int buttonsNumber = ((SunToolkit)(Toolkit.getDefaultToolkit())).getNumberOfButtons();
for (int i = 0; i < buttonsNumber; i++){
// TODO : here is the bug in WM: extra buttons doesn't have state!=0 as they should.
if ((i != 4) && (i != 5)) {
mouseKeyState = mouseKeyState | (xme.get_state() & XConstants.buttonsMask[i]);
@ -1343,18 +1352,23 @@ public class XWindow extends XBaseWindow implements X11ComponentPeer {
setSizeHints(flags, x, y, width, height);
}
void validateSurface() {
void validateSurface() {
if ((width != oldWidth) || (height != oldHeight)) {
SurfaceData oldData = surfaceData;
if (oldData != null) {
surfaceData = graphicsConfig.createSurfaceData(this);
oldData.invalidate();
}
doValidateSurface();
oldWidth = width;
oldHeight = height;
}
}
final void doValidateSurface() {
SurfaceData oldData = surfaceData;
if (oldData != null) {
surfaceData = graphicsConfig.createSurfaceData(this);
oldData.invalidate();
}
}
public SurfaceData getSurfaceData() {
return surfaceData;
}

Some files were not shown because too many files have changed in this diff Show More