Changeset 239


Ignore:
Timestamp:
Jan 11, 2011, 11:20:51 PM (15 years ago)
Author:
dmik
Message:

jdk: Fixed wrong message order during Drag & Drop that could lead to a stuck drag operation (the user could not start a new drag session because the previous one would never finish despite the processed drop action).

Location:
trunk/openjdk/jdk/src/windows/native/sun/windows
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/openjdk/jdk/src/windows/native/sun/windows/awt_Toolkit.cpp

    r195 r239  
    11661166}
    11671167
     1168BOOL
     1169AwtToolkit::SecondaryPeekMessageFunc(MSG& msg) {
     1170    /*
     1171     * During DnD, it is possible that while running a secondary message loop
     1172     * waiting for a quit message from the Java event handler thread (that is
     1173     * processing the IDropSource::GiveFeedback() callback), another
     1174     * WM_MOUSEMOVE message comes to the AWT thread's message queue before the
     1175     * quit message from the Java event handler thread (sent as a result of the
     1176     * WToolkit::quitSecondaryEventLoop call). This will create another nested
     1177     * secondary message loop that will eat this outer quit message (together
     1178     * with its own quit message) which will a) break the message flow and b)
     1179     * leave the outer loop running forever (so that no new DnD session will be
     1180     * possible). A solution is similar to the one from
     1181     * AwtDataTransferer::SecondaryMessageLoop(). Given that
     1182     * WToolkit::startSecondaryEventLoop() isn't actually used for anything else
     1183     * but DnD, this solution should work fine.
     1184     */
     1185    return ::PeekMessage(&msg, NULL, WM_QUIT, WM_QUIT, PM_REMOVE) ||
     1186           ::PeekMessage(&msg, NULL, WM_AWT_INVOKE_METHOD, WM_AWT_INVOKE_VOID_METHOD, PM_REMOVE) ||
     1187           ::PeekMessage(&msg, NULL, WM_PAINT, WM_PAINT, PM_REMOVE);
     1188}
     1189
    11681190/*
    11691191 * Perform pre-processing on a message before it is translated &
     
    17351757
    17361758    AwtToolkit::GetInstance().MessageLoop(AwtToolkit::SecondaryIdleFunc,
    1737                                           AwtToolkit::CommonPeekMessageFunc);
     1759                                          AwtToolkit::SecondaryPeekMessageFunc);
    17381760
    17391761    CATCH_BAD_ALLOC;
  • trunk/openjdk/jdk/src/windows/native/sun/windows/awt_Toolkit.h

    r181 r239  
    374374    static VOID CALLBACK SecondaryIdleFunc();
    375375    static BOOL CALLBACK CommonPeekMessageFunc(MSG& msg);
     376    static BOOL CALLBACK SecondaryPeekMessageFunc(MSG& msg);
    376377    static BOOL activateKeyboardLayout(HKL hkl);
    377378
Note: See TracChangeset for help on using the changeset viewer.