Closed
Bug 83493
Opened 24 years ago
Closed 24 years ago
[FIX]Mfcembed leaves garbage when combo is rolled up
Categories
(Core :: Layout: Form Controls, defect, P1)
Tracking
()
VERIFIED
FIXED
mozilla0.9.2
People
(Reporter: rods, Assigned: rods)
References
Details
Attachments
(3 files)
(deleted),
patch
|
Details | Diff | Splinter Review | |
(deleted),
patch
|
Details | Diff | Splinter Review | |
(deleted),
text/html
|
Details |
When the combo gets rolled up from the special "hook" functions (like clicking
on the URL in MFCEmbed) sometimes it leaves garbage.
Assignee | ||
Updated•24 years ago
|
Status: NEW → ASSIGNED
Priority: -- → P1
Target Milestone: --- → mozilla0.9.2
Assignee | ||
Comment 1•24 years ago
|
||
Assignee | ||
Comment 2•24 years ago
|
||
The problem is you can't do the roll up in the middle of a "hook" function call.
So a timer is native created and the DealWithPopups is called there.
For example, when you click on the MFCEmbed URLbar we do the rollup but the
SetFocus of the CBX wants to do the roll up and this is where we run into
problems.
Also, the CBX now needs to make sure that all the views in the content area are
updated, not just its view. This is because there may be a absolutely
positioned div just under the CBX. So I will attach a new patch for this.
Assignee | ||
Comment 3•24 years ago
|
||
Assignee | ||
Comment 4•24 years ago
|
||
Assignee | ||
Updated•24 years ago
|
Summary: Mfcembed leaves garbage when combo is rolled up → [FIX]Mfcembed leaves garbage when combo is rolled up
Comment 5•24 years ago
|
||
// Make sure the content area gets updated for where the dropdown was
+ // This is only needed for embedding, the focus may go to
+ // the chrome that is not part of the Gecko system (Bug 83493)
+ nsIFrame* parent;
+ GetParentWithView(mPresContext, &parent);
+ if (parent != nsnull) {
+ nsIView* view = nsnull;
+ parent->GetView(mPresContext, &view);
+ if (view != nsnull) {
+ nsCOMPtr<nsIPresShell> presShell;
+ mPresContext->GetShell(getter_AddRefs(presShell));
+ if (presShell) {
+ nsCOMPtr<nsIViewManager> vm;
+ presShell->GetViewManager(getter_AddRefs(vm));
+ if (vm) {
+ vm->UpdateAllViews(NS_VMREFRESH_NO_SYNC);
+ }
+ }
+ }
+ }
}
I'm confused by this part of the patch. You can get the view manager by asking
the view for its viewmanager directly, there is no need to use the mPresContext,
or you can just ask the mPresContext for the viewmanager directly and eliminate
the code that gets the view from the frame.
nsIFrame* parent;
GetParentWithView(mPresContext, &parent);
if (parent != nsnull) {
nsIView* view = nsnull;
parent->GetView(mPresContext, &view);
if (view != nsnull) {
nsCOMPtr<nsIViewManager> vm;
if (vm) {
vm->UpdateAllViews(NS_VMREFRESH_NO_SYNC);
}
or
nsCOMPtr<nsIPresShell> presShell;
mPresContext->GetShell(getter_AddRefs(presShell));
if (presShell) {
nsCOMPtr<nsIViewManager> vm;
presShell->GetViewManager(getter_AddRefs(vm));
if (vm) {
vm->UpdateAllViews(NS_VMREFRESH_NO_SYNC);
}
Both of these will cause the entire content area to be refreshed however.
We may want to consider calculating the exact rect occupied by the drop-down if
this proves to be a performance issue.
Nit: You may want to factor the following to lines into a separate function
ScheduleRollup passing in the MsgId instead of replicating this code in several
places.
gRollupMsgId = wParam;
+ ::SetTimer( ms->hwnd, NS_HOOK_TIMER_ID, 0, (TIMERPROC)HookTimerForPopups );
Comment 6•24 years ago
|
||
Oops... I missed the line to get the viewmanager
nsIFrame* parent;
GetParentWithView(mPresContext, &parent);
if (parent != nsnull) {
nsIView* view = nsnull;
parent->GetView(mPresContext, &view);
if (view != nsnull) {
+ view->GetViewManager(vm);
nsCOMPtr<nsIViewManager> vm;
if (vm) {
vm->UpdateAllViews(NS_VMREFRESH_NO_SYNC);
}
Assumming you resolve this issue, the rest of the patch looks good.
r=kmcclusk@netscape.com
Assignee | ||
Comment 7•24 years ago
|
||
I have made the changes for your suggestions. I will open a bug for optimizing
the updating of all the views, that is a little bit too much to do here and now.
Comment 8•24 years ago
|
||
sr=attinasi (based on conversation with Rod over phone)
Comment 9•24 years ago
|
||
a= asa@mozilla.org for checkin to the trunk.
(on behalf of drivers)
Blocks: 83989
Assignee | ||
Comment 10•24 years ago
|
||
fixed
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Comment 11•24 years ago
|
||
verifying build 2001-07-10-05-0.9.2 windows 2000
Status: RESOLVED → VERIFIED
You need to log in
before you can comment on or make changes to this bug.
Description
•