surpress activate,zorder change

Think CEF could benefit from a new feature or capability? Discuss CEF feature requests here.

surpress activate,zorder change

Postby david » Fri Jul 29, 2011 5:00 am

normally, a window embeds a browser in MDI enviroment or mutiple popup windows.
In this case, controlling zorder of windows is important.

when a window embedding cef is navigating, the cef's inner window implementation make the window activating and top zorder.
so, zorders of windows are disordered.

so, It is very useful to supress activate,zorder change of embedding window by cef's setting.
david
Newbie
 
Posts: 6
Joined: Fri Jul 29, 2011 4:05 am

Re: surpress activate,zorder change

Postby magreenblatt » Fri Jul 29, 2011 9:16 am

When a window is given keyboard focus I believe it must also be activated. So I'm not sure what you're requesting. Can you provide a detailed example of the current behavior and how you think it should behave instead?
magreenblatt
Site Admin
 
Posts: 12404
Joined: Fri May 29, 2009 6:57 pm

Re: surpress activate,zorder change

Postby david » Fri Jul 29, 2011 9:51 pm

window A,B,C have ws_popup style.
--------------------------------
Figure 1 environment

current zorder : A > B > C
current activated window : A
A has a focus.
---------------------------------
A is the working window of some task.
User just wants to see information in C as a bakground window without activation , wants to keep the focus in A , and wants to keep zorder of windows.

In Figure 1 environment, Programatically A send a navigation command to C' cef embed to show information related with data in A.

C' cef embed navigated and it's implementation makes C window activate and be top zorder.
eventually C takes the focus that A had.
but user want to keep input focus in A.
See Figure 2.

---------------------------------
Figure 2 environment

current zorder: C > A > B
current activated window : C
C has a focus.
---------------------------------


CEF embed window is like a control.
control is used in various enviroments.
control' behavior must be predictable.

so, CEF embed window should have the ability that programatically prevent activation and zoder change of container window ( C widnow) by optional on/off flag.

ex)
when call setwindowpos , it check the option.
if activation,zorder option is off, call setwindowpos with SWP_NOACTIVATE , SWP_NOZORDER
Attachments
1.jpg
figure
1.jpg (77.65 KiB) Viewed 10588 times
david
Newbie
 
Posts: 6
Joined: Fri Jul 29, 2011 4:05 am

Re: surpress activate,zorder change

Postby magreenblatt » Sat Jul 30, 2011 3:47 am

Thanks for the explanation. Did you try returning true from CefFocusHandler::OnSetFocus()?
magreenblatt
Site Admin
 
Posts: 12404
Joined: Fri May 29, 2009 6:57 pm

Re: surpress activate,zorder change

Postby david » Sat Jul 30, 2011 10:46 pm

Great ... It works.
Thank you for your insightful implementation.

cef could control focus change from javascript.

cef could intercept focus change by flash?
Because cef is like a control. I think cef should control all focus changes including plugin.

------------------------------------------------------------------------------------------------
another issue : cefclient example' popup crash.

---------------------------------------
(1) click a link -> cef make a popup
repeat (1) several times.

click close button of cefclient example with popup windows aliving.
It crashs occasionally.
---------------------------------------

This crash came from Popup window.
I think cef example don't control the life of popup wndows.

Because popup window don't have the owner window,
when cefclient window is close, Windows don't close the popup winows automatically.
so, when exit program, some object should close it manually.

current my code:
ClientHandler has vector<HWND> for popup window
OnAfterCreated : if popup window, add hwnd to vector.
OnBeforeClose: if popup window, remvoe hwnd from vector.
closeBrowser: close all popup window in vector berfore closing main browser window.

if my code is right, cef sould have some graceful closing mechanism of popup window.
david
Newbie
 
Posts: 6
Joined: Fri Jul 29, 2011 4:05 am


Return to Feature Request Forum

Who is online

Users browsing this forum: No registered users and 12 guests