Closed Bug 506997 Opened 15 years ago Closed 15 years ago

OS/2 linking problem after mDeferredPositioner removal

Categories

(Core Graveyard :: Widget: OS/2, defect)

x86
OS/2
defect
Not set
major

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: wuno, Assigned: mozilla)

References

Details

Attachments

(3 files)

User-Agent:       Mozilla/5.0 (OS/2; U; Warp 4.5; en-US; rv:1.9.2a1pre) Gecko/20090725 Minefield/3.6a1pre
Build Identifier: 

E:\mozbuild1\staticlib\components\wdgtos2.lib(nsWindow.o) : error LNK2029: "nsWindow::DeferPosition(unsigned long, unsigned long, long, long, long, long, unsigned long)" : unresolved external
Seems that bug506103 either removed too much or too less
Those files still have references to DeferPosition
http://mxr.mozilla.org/mozilla-central/source/widget/src/os2/nsWindow.h#305
http://mxr.mozilla.org/mozilla-central/source/widget/src/os2/nsWindow.cpp#3355

Reproducible: Always
Blocks: 506103
Version: unspecified → Trunk
Uh oh, I guess I missed something in OS/2. Walter, do you have an OS/2 build you can use to dosome clean up or should I try and roll something myself?
The only use is in nsWindow::SetWindowPos and the if branch where DeferPosition is called can no longer occur, because mSWPs was only ever set in the now removed BeginResizingChildren.
So I guess we can get rid of SetWindowPos completely and use WinSetWindowPos directly. I'm trying to make a patch for that.
This at least builds in widget again and links xul.dll and besides directly related stuff also removes an unused global variable.

On startup I get a crash, somewhere in Thebes, most likely because I only did a partial rebuild (don't have time tonight for full build). I don't think the crash is related to the code in question here.
Assignee: mozilla → mozilla
Status: NEW → ASSIGNED
Attachment #391197 - Flags: review?(dragtext)
Comment on attachment 391197 [details] [diff] [review]
try v1 [checkin comment 6]

Actually, I got a chance to complete the build after all. It runs and I don't see a difference compared to before.
Comment on attachment 391197 [details] [diff] [review]
try v1 [checkin comment 6]

This is a build break fix, so I don't know why I was asking for review at all...
Attachment #391197 - Flags: review?(dragtext) → review+
Attachment #391197 - Flags: review+
http://hg.mozilla.org/mozilla-central/rev/5db7a9e88542
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
I'm sorry I didn't have the time to respond sooner because a couple of minor changes are needed:

1. there's a comment on lines 106-107 about deferred positioning that should be removed

2.
-      if( !SetWindowPos( 0, ptl.x, ptl.y, w, h, SWP_MOVE | SWP_SIZE))
-         if( aRepaint)
-            Invalidate(PR_FALSE);
+      WinSetWindowPos(GetMainWindow(), 0, ptl.x, ptl.y, w, h, SWP_MOVE | SWP_SIZE);
+      if (aRepaint)
+         Invalidate(PR_FALSE);

The original 'if (aRepaint)' was conditional on SetWindowPos() failing.  If that call succeeded it was unnecessary because the underlying WinSetWindowPos() invalidates the affected area by default.
No problem, I can still fix things. Comments are always welcome!

> 1. there's a comment on lines 106-107 about deferred positioning that should be
> removed

Will do.

> 2.
> -      if( !SetWindowPos( 0, ptl.x, ptl.y, w, h, SWP_MOVE | SWP_SIZE))
> -         if( aRepaint)
> -            Invalidate(PR_FALSE);
> +      WinSetWindowPos(GetMainWindow(), 0, ptl.x, ptl.y, w, h, SWP_MOVE |
> SWP_SIZE);
> +      if (aRepaint)
> +         Invalidate(PR_FALSE);
> 
> The original 'if (aRepaint)' was conditional on SetWindowPos() failing.  If
> that call succeeded it was unnecessary because the underlying WinSetWindowPos()
> invalidates the affected area by default.

But SetWindowPos() never failed, or at least never returned a possible failure of WinSetWindowPos(), but instead returned FALSE because it was not deferred. So I guess we were always doing more work than necessary...
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
I think this is what you meant. I didn't find any understandable info about the return codes of WinSetWindowPos() (what does FALSE really mean?), but I trust your expertise. And I didn't see any repaint problems with this patch.
Attachment #391974 - Flags: review?(dragtext)
I wonder if we should then do a similar optimization on the 1.9.1 branch.

P.S.: Am I missing something or did the function GetSWPFlags() that
      returns its own argument never make sense? It's unchanged since 1999.
Attachment #392067 - Flags: review?(dragtext)
Attachment #391974 - Flags: review?(dragtext) → review+
Comment on attachment 392067 [details] [diff] [review]
for 1.9.1? [checked in comment 15]

Don't change this patch, but what's the point of adding braces to single-line conditionals?  They strike me as visual clutter and invite mismatches during subsequent editing.
Attachment #392067 - Flags: review?(dragtext) → review+
Without braces it looks so asymmetric and that always confuses me. I also like the braces because it allows to more easily add printfs for debugging. And when adding more code later I found that it indeed reduces the cases where I then forget to add braces which sometimes led to wrong logic.
http://hg.mozilla.org/mozilla-central/rev/4e10c020e0b6
Status: REOPENED → RESOLVED
Closed: 15 years ago15 years ago
Resolution: --- → FIXED
http://hg.mozilla.org/mozilla-central/rev/4e10c020e0b6
Status: REOPENED → RESOLVED
Closed: 15 years ago15 years ago
Resolution: --- → FIXED
Attachment #391974 - Attachment description: address Rich's comments → address Rich's comments [checkin comment 13]
Attachment #391197 - Attachment description: try v1 → try v1 [checkin comment 6]
Attachment #392067 - Attachment description: for 1.9.1? → for 1.9.1? [checked in comment 15]
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: