BYOND Version:440
Operating System:Windows Vista Home Premium
Web Browser:
Status: Unverified

Thus far we've been unable to verify or reproduce this bug. Or, it has been observed but it cannot be triggered with a reliable test case. You can help us out by editing your report or adding a comment with more information.
Descriptive Problem Summary:

When dynamically resizing windows at runtime using the is-maximized property, you can make a window extend beyond screen boundaries just a little bit if you remove the titlebar from a window that has one by default.

There are also some oddities with titlebar UI in vista. The borders never appear for a titlebar that was added to a window while it was maximized at runtime.

Numbered steps to reproduce this problem:

1) Make an interface file.
2) Make the window minimized, and give it a title bar.
3) Anchor a label to the bottom right corner
4) Anchor a second label to the top right corner
5) Put a single output in the window.
6) Run the following code snippet.

Code Snippet (if applicable) to Reproduce Problem:
titlebar_height = 0
res_x = 800
res_y = 600
var/s = winget(src,"window1.label1","pos;")
var/s2 = winget(src,"window1.label1","size;")
var/s3 = winget(src,"window1.label1","pos;")
src.res_x = text2num(copytext(s,1,findtext(s,",",1,0))) + text2num(copytext(s2,1,findtext(s2,",",1,0)))
src.res_y = text2num(copytext(s,findtext(s,",",1,0)+1,0)) + text2num(copytext(s2,findtext(s2,",",1,0)+1,0))
src.titlebar_height = text2num(copytext(s3,findtext(s,",",1,0)+1,0))-text2num(copytext(s,findtext(s,",",1,0)+1,0))
src << output("[src.res_x],[src.res_y] [src.titlebar_height]","window1.output1")
return 0


Expected Results:

The output should state: (with a resolution of 1280x800)


Actual Results:

The output instead states:


When looking at a maximized window whose titlebar has been disabled, it seems to extend 3 pixels beyond the screen area on all sides. This accounts for our extra six pixels!

Does the problem occur:
Every time? Or how often? Every time with these parameters
On other computers? Yes.
In other user accounts? WTF? Yes.

When does the problem NOT occur?

When you instead add a titlebar to a window that previously did not have one.

Just found a new aspect to this bug. Apparently, giving the window a titlebar when it didn't have one before, and maximizing the window at the same time also has the same effect.

However, you can get around this by taking away the title bar immediately before you maximize the window, using two winsets instead of one.

Anchors also seem to be affected by this. If you add a window element with an anchor while there is no title bar, it will not reposition or resize properly when there is a title bar.

In general, title bars screw up positioning bad in vista.
I did not see any unusual behavior in XP, so this may be a Vista-only bug. However, a couple of things:

1) There's a bug in your code where titlebar_height is calculated; the first findtext() call is using the wrong string (s instead of s3).

2) The position of the controls inside the window should not change regardless of whether a titlebar is present. Position is calculated relative to the client area, not the window area, so it should be the same regardless.

Overall this issue is probably going to be difficult to verify without Vista, but it's not really clear what the code snippet is calculating or how, so a simpler demo and possibly some screenshots would help narrow things down. UI issues in Vista are particularly sensitive to whether Aero is in use.