Merged from branch deedra after conflict fixes.
This commit is contained in:
commit
2dfd5b200a
15 files changed
+494
-152
No files matched your search
+37
-13
@@ -81,17 +81,10 @@ static void notify_text(HWND window, UINT kind, const WCHAR *text, DWORD start,
|
||||
wine_access_notify_text(window, kind, text, start, end, 0);
|
||||
}
|
||||
|
||||
static LRESULT CALLBACK edit_proc(HWND window, UINT message, WPARAM wp, LPARAM lp,
|
||||
UINT_PTR id, DWORD_PTR reference) {
|
||||
EditState *state = (EditState *)reference;
|
||||
if (message == WM_NCDESTROY) {
|
||||
RemoveWindowSubclass(window, edit_proc, id);
|
||||
RemovePropW(window, EDIT_STATE_PROPERTY);
|
||||
state->destroyed = TRUE;
|
||||
if (!state->busy) { free(state->text); free(state); }
|
||||
return DefSubclassProc(window, message, wp, lp);
|
||||
}
|
||||
if (state->busy) return DefSubclassProc(window, message, wp, lp);
|
||||
// Keep the text buffers off the stack when forwarding ignored or reentrant
|
||||
// messages. Inlining this handler would put them back in every subclass call.
|
||||
static __attribute__((noinline)) LRESULT handle_edit(HWND window, UINT message,
|
||||
WPARAM wp, LPARAM lp, EditState *state) {
|
||||
BOOL navigation = message == WM_KEYDOWN &&
|
||||
(wp == VK_LEFT || wp == VK_RIGHT || wp == VK_UP || wp == VK_DOWN ||
|
||||
wp == VK_HOME || wp == VK_END || wp == VK_PRIOR || wp == VK_NEXT);
|
||||
@@ -113,8 +106,6 @@ static LRESULT CALLBACK edit_proc(HWND window, UINT message, WPARAM wp, LPARAM l
|
||||
if (navigation || focus || message == WM_KILLFOCUS || remote_replacement)
|
||||
state->history_key = state->history_replaced = FALSE;
|
||||
BOOL history_replacement = message == WM_SETTEXT && state->history_key;
|
||||
if (!navigation && !changing && !focus && !selected && message != EM_SETPASSWORDCHAR)
|
||||
return DefSubclassProc(window, message, wp, lp);
|
||||
|
||||
state->busy = TRUE;
|
||||
WCHAR pending_high = state->pending_high;
|
||||
@@ -249,6 +240,39 @@ static LRESULT CALLBACK edit_proc(HWND window, UINT message, WPARAM wp, LPARAM l
|
||||
return result;
|
||||
}
|
||||
|
||||
static LRESULT CALLBACK edit_proc(HWND window, UINT message, WPARAM wp, LPARAM lp,
|
||||
UINT_PTR id, DWORD_PTR reference) {
|
||||
EditState *state = (EditState *)reference;
|
||||
if (message == WM_NCDESTROY) {
|
||||
RemoveWindowSubclass(window, edit_proc, id);
|
||||
RemovePropW(window, EDIT_STATE_PROPERTY);
|
||||
state->destroyed = TRUE;
|
||||
if (!state->busy) { free(state->text); free(state); }
|
||||
return DefSubclassProc(window, message, wp, lp);
|
||||
}
|
||||
if (state->busy) return DefSubclassProc(window, message, wp, lp);
|
||||
if (message == WM_KILLFOCUS)
|
||||
state->history_key = state->history_replaced = FALSE;
|
||||
BOOL relevant = FALSE;
|
||||
switch (message) {
|
||||
case WM_KEYDOWN:
|
||||
relevant = wp == VK_LEFT || wp == VK_RIGHT || wp == VK_UP || wp == VK_DOWN ||
|
||||
wp == VK_HOME || wp == VK_END || wp == VK_PRIOR || wp == VK_NEXT || wp == VK_DELETE;
|
||||
break;
|
||||
case WM_CHAR: case WM_PASTE: case WM_CUT: case WM_CLEAR:
|
||||
case WM_UNDO: case EM_UNDO: case EM_REPLACESEL: case WM_SETTEXT:
|
||||
case EM_SETHANDLE: case EM_FMTLINES: case WM_SETFOCUS: case EM_SETSEL:
|
||||
case EM_SETPASSWORDCHAR:
|
||||
relevant = TRUE;
|
||||
break;
|
||||
default:
|
||||
relevant = message == RegisterWindowMessageW(EDIT_FOCUS_MESSAGE);
|
||||
break;
|
||||
}
|
||||
if (!relevant) return DefSubclassProc(window, message, wp, lp);
|
||||
return handle_edit(window, message, wp, lp, state);
|
||||
}
|
||||
|
||||
static BOOL watch_edit(HWND window, EditState **edit_state) {
|
||||
if (edit_state) *edit_state = NULL;
|
||||
WCHAR class_name[64];
|
||||
|
||||
Reference in new issue
Block a user