Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
c49e894e
Commit
c49e894e
authored
Nov 12, 2007
by
Jacek Caban
Committed by
Alexandre Julliard
Nov 12, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Reset focus after loading the page in edit mode.
parent
0e29f314
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
8 deletions
+28
-8
editor.c
dlls/mshtml/editor.c
+1
-0
mshtml_private.h
dlls/mshtml/mshtml_private.h
+1
-0
nsembed.c
dlls/mshtml/nsembed.c
+24
-6
nsevents.c
dlls/mshtml/nsevents.c
+2
-2
No files found.
dlls/mshtml/editor.c
View file @
c49e894e
...
...
@@ -524,6 +524,7 @@ void handle_edit_event(HTMLDocument *This, nsIDOMEvent *event)
void
handle_edit_load
(
HTMLDocument
*
This
)
{
This
->
nscontainer
->
reset_focus
=
GetFocus
();
get_editor_controller
(
This
->
nscontainer
);
}
...
...
dlls/mshtml/mshtml_private.h
View file @
c49e894e
...
...
@@ -209,6 +209,7 @@ struct NSContainer {
HWND
hwnd
;
BSCallback
*
bscallback
;
/* hack */
HWND
reset_focus
;
/* hack */
};
typedef
struct
{
...
...
dlls/mshtml/nsembed.c
View file @
c49e894e
...
...
@@ -81,6 +81,8 @@ static const WCHAR wszNsContainer[] = {'N','s','C','o','n','t','a','i','n','e','
static
ATOM
nscontainer_class
;
#define WM_RESETFOCUS_HACK WM_USER+600
static
LRESULT
WINAPI
nsembed_proc
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wParam
,
LPARAM
lParam
)
{
NSContainer
*
This
;
...
...
@@ -96,13 +98,25 @@ static LRESULT WINAPI nsembed_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP
}
switch
(
msg
)
{
case
WM_SIZE
:
TRACE
(
"(%p)->(WM_SIZE)
\n
"
,
This
);
case
WM_SIZE
:
TRACE
(
"(%p)->(WM_SIZE)
\n
"
,
This
);
nsres
=
nsIBaseWindow_SetSize
(
This
->
window
,
LOWORD
(
lParam
),
HIWORD
(
lParam
),
TRUE
);
if
(
NS_FAILED
(
nsres
))
WARN
(
"SetSize failed: %08x
\n
"
,
nsres
);
break
;
nsres
=
nsIBaseWindow_SetSize
(
This
->
window
,
LOWORD
(
lParam
),
HIWORD
(
lParam
),
TRUE
);
if
(
NS_FAILED
(
nsres
))
WARN
(
"SetSize failed: %08x
\n
"
,
nsres
);
case
WM_RESETFOCUS_HACK
:
/*
* FIXME
* Gecko grabs focus in edit mode and some apps don't like it.
* We should somehow prevent grabbing focus.
*/
if
(
This
->
reset_focus
)
{
SetFocus
(
This
->
reset_focus
);
This
->
reset_focus
=
NULL
;
}
}
return
DefWindowProcW
(
hwnd
,
msg
,
wParam
,
lParam
);
...
...
@@ -1293,6 +1307,9 @@ static nsresult NSAPI nsEmbeddingSiteWindow_SetFocus(nsIEmbeddingSiteWindow *ifa
TRACE
(
"(%p)
\n
"
,
This
);
if
(
This
->
reset_focus
)
PostMessageW
(
This
->
hwnd
,
WM_RESETFOCUS_HACK
,
0
,
0
);
return
nsIBaseWindow_SetFocus
(
This
->
window
);
}
...
...
@@ -1558,6 +1575,7 @@ NSContainer *NSContainer_Create(HTMLDocument *doc, NSContainer *parent)
ret
->
content_listener
=
NULL
;
ret
->
editor_controller
=
NULL
;
ret
->
editor
=
NULL
;
ret
->
reset_focus
=
NULL
;
if
(
parent
)
nsIWebBrowserChrome_AddRef
(
NSWBCHROME
(
parent
));
...
...
dlls/mshtml/nsevents.c
View file @
c49e894e
...
...
@@ -90,7 +90,7 @@ static nsresult NSAPI handle_blur(nsIDOMEventListener *iface, nsIDOMEvent *event
TRACE
(
"(%p)
\n
"
,
This
);
if
(
This
->
doc
&&
This
->
doc
->
focus
&&
!
is_doc_child_focus
(
This
))
{
if
(
!
This
->
reset_focus
&&
This
->
doc
&&
This
->
doc
->
focus
&&
!
is_doc_child_focus
(
This
))
{
This
->
doc
->
focus
=
FALSE
;
notif_focus
(
This
->
doc
);
}
...
...
@@ -104,7 +104,7 @@ static nsresult NSAPI handle_focus(nsIDOMEventListener *iface, nsIDOMEvent *even
TRACE
(
"(%p)
\n
"
,
This
);
if
(
This
->
doc
&&
!
This
->
doc
->
focus
)
{
if
(
!
This
->
reset_focus
&&
This
->
doc
&&
!
This
->
doc
->
focus
)
{
This
->
doc
->
focus
=
TRUE
;
notif_focus
(
This
->
doc
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment