提交 7dd8e5de 编写于 作者: D dav

Merge

......@@ -257,21 +257,27 @@ public abstract class EmbeddedFrame extends Frame
Set toTest;
Component currentFocused = e.getComponent();
Component last = getFocusTraversalPolicy().getLastComponent(this);
toTest = getFocusTraversalKeys(KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS);
if (toTest.contains(stroke) && (currentFocused == last || last == null)) {
if (traverseOut(FORWARD)) {
e.consume();
return true;
if (toTest.contains(stroke)) {
// 6581899: performance improvement for SortingFocusTraversalPolicy
Component last = getFocusTraversalPolicy().getLastComponent(this);
if (currentFocused == last || last == null) {
if (traverseOut(FORWARD)) {
e.consume();
return true;
}
}
}
Component first = getFocusTraversalPolicy().getFirstComponent(this);
toTest = getFocusTraversalKeys(KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS);
if (toTest.contains(stroke) && (currentFocused == first || first == null)) {
if (traverseOut(BACKWARD)) {
e.consume();
return true;
if (toTest.contains(stroke)) {
// 6581899: performance improvement for SortingFocusTraversalPolicy
Component first = getFocusTraversalPolicy().getFirstComponent(this);
if (currentFocused == first || first == null) {
if (traverseOut(BACKWARD)) {
e.consume();
return true;
}
}
}
return false;
......
......@@ -40,6 +40,7 @@
#include <langinfo.h>
#include <locale.h>
#include <fcntl.h>
#include <poll.h>
static Bool shapeSupported;
static int shapeEventBase, shapeErrorBase;
......@@ -534,40 +535,34 @@ void
SplashEventLoop(Splash * splash) {
/* Different from win32 implementation - this loop
uses select timeouts instead of a timer */
uses poll timeouts instead of a timer */
/* we should have splash _locked_ on entry!!! */
int xconn = XConnectionNumber(splash->display);
while (1) {
struct pollfd pfd[2];
int timeout = -1;
int ctl = splash->controlpipe[0];
fd_set fds[2];
int n = 0;
struct timeval tv, *ptv;
int rc;
int time;
int pipes_empty;
FD_ZERO(fds);
FD_SET(xconn, fds);
if (xconn+1 > n)
n = xconn+1;
FD_SET(ctl, fds);
if (ctl+1 > n)
n = ctl+1;
pfd[0].fd = xconn;
pfd[0].events = POLLIN | POLLPRI;
pfd[1].fd = ctl;
pfd[1].events = POLLIN | POLLPRI;
errno = 0;
if (splash->isVisible>0 && SplashIsStillLooping(splash)) {
time = splash->time + splash->frames[splash->currentFrame].delay
timeout = splash->time + splash->frames[splash->currentFrame].delay
- SplashTime();
if (time < 0)
time = 0;
msec2timeval(time, &tv);
ptv = &tv;
} else {
ptv = NULL;
if (timeout < 0) {
timeout = 0;
}
}
SplashUnlock(splash);
rc = select(n, fds, NULL, NULL, ptv);
rc = poll(pfd, 2, timeout);
SplashLock(splash);
if (splash->isVisible>0 && SplashTime() >= splash->time +
splash->frames[splash->currentFrame].delay) {
......
......@@ -49,6 +49,9 @@ void ComCtl32Util::InitLibraries() {
m_bNewSubclassing = (m_lpfnSetWindowSubclass != NULL) &&
(m_lpfnRemoveWindowSubclass != NULL) &&
(m_lpfnDefSubclassProc != NULL);
fn_InitCommonControlsEx = (ComCtl32Util::InitCommonControlsExType)::GetProcAddress(hModComCtl32, "InitCommonControlsEx");
InitCommonControls();
}
}
}
......@@ -108,3 +111,15 @@ LRESULT ComCtl32Util::SharedWindowProc(HWND hwnd, UINT msg,
CATCH_BAD_ALLOC_RET(0);
}
void ComCtl32Util::InitCommonControls()
{
if (fn_InitCommonControlsEx == NULL) {
return;
}
INITCOMMONCONTROLSEX iccex;
memset(&iccex, 0, sizeof(INITCOMMONCONTROLSEX));
iccex.dwSize = sizeof(INITCOMMONCONTROLSEX);
fn_InitCommonControlsEx(&iccex);
}
......@@ -25,6 +25,8 @@
#include "awt_Component.h"
#include <commctrl.h>
#ifndef _COMCTL32UTIL_H
#define _COMCTL32UTIL_H
......@@ -81,6 +83,11 @@ class ComCtl32Util
PFNREMOVEWINDOWSUBCLASS m_lpfnRemoveWindowSubclass;
PFNDEFSUBCLASSPROC m_lpfnDefSubclassProc;
typedef BOOL (WINAPI * InitCommonControlsExType)(const LPINITCOMMONCONTROLSEX lpInitCtrls);
InitCommonControlsExType fn_InitCommonControlsEx;
void InitCommonControls();
BOOL m_bNewSubclassing;
// comctl32.dll version 6 window proc
......
......@@ -1107,6 +1107,10 @@ Java_sun_awt_Win32GraphicsDevice_exitFullScreenExclusive(
}
}
} else {
jobject target = env->GetObjectField(windowPeer, AwtObject::targetID);
jboolean alwaysOnTop = JNU_GetFieldByName(env, NULL, target, "alwaysOnTop", "Z").z;
env->DeleteLocalRef(target);
if (!::SetWindowPos(hWnd, HWND_NOTOPMOST, 0, 0, 0, 0,
SWP_NOMOVE|SWP_NOOWNERZORDER|SWP_NOSIZE))
{
......@@ -1114,6 +1118,9 @@ Java_sun_awt_Win32GraphicsDevice_exitFullScreenExclusive(
"Error %d unsetting topmost attribute to fs window",
::GetLastError());
}
// We should restore alwaysOnTop state as it's anyway dropped here
Java_sun_awt_windows_WWindowPeer_setAlwaysOnTopNative(env, windowPeer, alwaysOnTop);
}
CATCH_BAD_ALLOC;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册