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
5baf587c
Commit
5baf587c
authored
Jun 22, 2007
by
Jacek Caban
Committed by
Alexandre Julliard
Jun 25, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Notify IOleControlSite about focus changes.
parent
946acd06
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
66 additions
and
0 deletions
+66
-0
mshtml_private.h
dlls/mshtml/mshtml_private.h
+4
-0
nsevents.c
dlls/mshtml/nsevents.c
+48
-0
view.c
dlls/mshtml/view.c
+14
-0
No files found.
dlls/mshtml/mshtml_private.h
View file @
5baf587c
...
...
@@ -116,6 +116,7 @@ struct HTMLDocument {
BOOL
window_active
;
BOOL
has_key_path
;
BOOL
container_locked
;
BOOL
focus
;
DWORD
update
;
...
...
@@ -141,6 +142,8 @@ struct NSContainer {
const
nsIWeakReferenceVtbl
*
lpWeakReferenceVtbl
;
const
nsISupportsWeakReferenceVtbl
*
lpSupportsWeakReferenceVtbl
;
nsEventListener
blur_listener
;
nsEventListener
focus_listener
;
nsEventListener
keypress_listener
;
nsEventListener
load_listener
;
...
...
@@ -327,6 +330,7 @@ void NSContainer_Release(NSContainer*);
void
HTMLDocument_LockContainer
(
HTMLDocument
*
,
BOOL
);
void
show_context_menu
(
HTMLDocument
*
,
DWORD
,
POINT
*
);
void
notif_focus
(
HTMLDocument
*
);
void
show_tooltip
(
HTMLDocument
*
,
DWORD
,
DWORD
,
LPCWSTR
);
void
hide_tooltip
(
HTMLDocument
*
);
...
...
dlls/mshtml/nsevents.c
View file @
5baf587c
...
...
@@ -72,6 +72,46 @@ static nsrefcnt NSAPI nsDOMEventListener_Release(nsIDOMEventListener *iface)
return
nsIWebBrowserChrome_Release
(
NSWBCHROME
(
This
));
}
static
BOOL
is_doc_child_focus
(
NSContainer
*
This
)
{
HWND
hwnd
;
if
(
!
This
->
doc
)
return
FALSE
;
for
(
hwnd
=
GetFocus
();
hwnd
&&
hwnd
!=
This
->
doc
->
hwnd
;
hwnd
=
GetParent
(
hwnd
));
return
hwnd
==
This
->
doc
->
hwnd
;
}
static
nsresult
NSAPI
handle_blur
(
nsIDOMEventListener
*
iface
,
nsIDOMEvent
*
event
)
{
NSContainer
*
This
=
NSEVENTLIST_THIS
(
iface
)
->
This
;
TRACE
(
"(%p)
\n
"
,
This
);
if
(
This
->
doc
&&
This
->
doc
->
focus
&&
!
is_doc_child_focus
(
This
))
{
This
->
doc
->
focus
=
FALSE
;
notif_focus
(
This
->
doc
);
}
return
NS_OK
;
}
static
nsresult
NSAPI
handle_focus
(
nsIDOMEventListener
*
iface
,
nsIDOMEvent
*
event
)
{
NSContainer
*
This
=
NSEVENTLIST_THIS
(
iface
)
->
This
;
TRACE
(
"(%p)
\n
"
,
This
);
if
(
This
->
doc
&&
!
This
->
doc
->
focus
)
{
This
->
doc
->
focus
=
TRUE
;
notif_focus
(
This
->
doc
);
}
return
NS_OK
;
}
static
nsresult
NSAPI
handle_keypress
(
nsIDOMEventListener
*
iface
,
nsIDOMEvent
*
event
)
{
...
...
@@ -129,6 +169,8 @@ static nsresult NSAPI handle_load(nsIDOMEventListener *iface, nsIDOMEvent *event
handler, \
};
static
const
nsIDOMEventListenerVtbl
blur_vtbl
=
EVENTLISTENER_VTBL
(
handle_blur
);
static
const
nsIDOMEventListenerVtbl
focus_vtbl
=
EVENTLISTENER_VTBL
(
handle_focus
);
static
const
nsIDOMEventListenerVtbl
keypress_vtbl
=
EVENTLISTENER_VTBL
(
handle_keypress
);
static
const
nsIDOMEventListenerVtbl
load_vtbl
=
EVENTLISTENER_VTBL
(
handle_load
);
...
...
@@ -159,9 +201,13 @@ void init_nsevents(NSContainer *This)
nsIDOMEventTarget
*
target
;
nsresult
nsres
;
static
const
PRUnichar
wsz_blur
[]
=
{
'b'
,
'l'
,
'u'
,
'r'
,
0
};
static
const
PRUnichar
wsz_focus
[]
=
{
'f'
,
'o'
,
'c'
,
'u'
,
's'
,
0
};
static
const
PRUnichar
wsz_keypress
[]
=
{
'k'
,
'e'
,
'y'
,
'p'
,
'r'
,
'e'
,
's'
,
's'
,
0
};
static
const
PRUnichar
wsz_load
[]
=
{
'l'
,
'o'
,
'a'
,
'd'
,
0
};
init_listener
(
&
This
->
blur_listener
,
This
,
&
blur_vtbl
);
init_listener
(
&
This
->
focus_listener
,
This
,
&
focus_vtbl
);
init_listener
(
&
This
->
keypress_listener
,
This
,
&
keypress_vtbl
);
init_listener
(
&
This
->
load_listener
,
This
,
&
load_vtbl
);
...
...
@@ -178,6 +224,8 @@ void init_nsevents(NSContainer *This)
return
;
}
init_event
(
target
,
wsz_blur
,
NSEVENTLIST
(
&
This
->
blur_listener
),
TRUE
);
init_event
(
target
,
wsz_focus
,
NSEVENTLIST
(
&
This
->
focus_listener
),
TRUE
);
init_event
(
target
,
wsz_keypress
,
NSEVENTLIST
(
&
This
->
keypress_listener
),
FALSE
);
init_event
(
target
,
wsz_load
,
NSEVENTLIST
(
&
This
->
load_listener
),
TRUE
);
...
...
dlls/mshtml/view.c
View file @
5baf587c
...
...
@@ -164,6 +164,19 @@ static LRESULT on_timer(HTMLDocument *This)
return
0
;
}
void
notif_focus
(
HTMLDocument
*
This
)
{
IOleControlSite
*
site
;
HRESULT
hres
;
hres
=
IOleClientSite_QueryInterface
(
This
->
client
,
&
IID_IOleControlSite
,
(
void
**
)
&
site
);
if
(
FAILED
(
hres
))
return
;
IOleControlSite_OnFocus
(
site
,
This
->
focus
);
IOleControlSite_Release
(
site
);
}
static
LRESULT
WINAPI
serverwnd_proc
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wParam
,
LPARAM
lParam
)
{
HTMLDocument
*
This
;
...
...
@@ -771,6 +784,7 @@ void HTMLDocument_View_Init(HTMLDocument *This)
This
->
in_place_active
=
FALSE
;
This
->
ui_active
=
FALSE
;
This
->
window_active
=
FALSE
;
This
->
focus
=
FALSE
;
This
->
update
=
0
;
}
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