PATCH: Honor size and coordinates when creating new Konqueror windows

Review Request #101477 - Created May 31, 2011 and submitted

Information
Dawit Alemayehu
kde-baseapps
master
Reviewers
kde-baseapps
dfaure
Currently new window creation in KonqMainWindow::slotCreateNewWindow does not honor the supplied cooridnate and size information under certain circumstances. For example, if you click on a javascript link that opens a new window, then the new window will always be maximized, regardless of the size information supplied by the javascript window.open call, as long as the Konqueror window where you clicked on the link is also maximized. Even when the original window is not maximized, if you maximize and close the newly created window, then clicking on the javscript window.open link again will result in a maximized window.

The attached patch addresses all of the above issues by making sure the coordinate and size information are always honored during new window creation.

<html>
  <head>
    <title>Javascript window.open Test</title>
  </head>
  <body>
    <a href="javascript:window.open('about:blank', 'NewWindowTest1', 'width=300, height=400')">window.open test</a>
  </body>
</html>

Test #1:
=======
1.) Copy the HTML snippet above into a file and open it with konqueror.
2.) Maximize the Konqueror window.
3.) Click on the link.  
4.) Notice new window is opened maximized.

Test #2:
=======
5.) Repeat steps 2-4 above, but do not maximize the Konqueror window in step 2.
6.) The new window opened when you clicked on the link should be of correct size.
7.) Maximize this new window, then close it.
8.) Click on the javascript link again.
9.) Notice how the new window is opened maximized.

After applying the patch, none of the above test scenarios should be reproducible.

Dawit Alemayehu
Review request changed

Change Summary:

Added a test case for anyone that wants to test the scenario outlined in the description section.

Testing Done:

  +

<html>

  + <head>
  + <title>Javascript window.open Test</title>
  + </head>
  + <body>
  + <a href="javascript:window.open('about:blank', 'NewWindowTest1', 'width=300, height=400')">window.open test</a>
  + </body>
  + </html>

  +
  +

Test #1:

  +
  +

1.) Copy the HTML snippet above into a file and open it with konqueror.

  + 2.) Maximize the Konqueror window.
  + 3.) Click on the link.
  + 4.) Notice new window is opened maximized.

  +
  +

Test #2:

  +
  +

5.) Repeat steps 2-4 above, but do not maximize the Konqueror window in step 2.

  + 6.) The new window opened when you clicked on the link should be of correct size.
  + 7.) Maximize this new window, then close it.
  + 8.) Click on the javascript link again.
  + 9.) Notice how the new window is opened maximized.

  +
  +

After applying the patch, none of the above test scenarios should be reproducible.

Commit Hook
This review has been submitted with commit 8ea273f60ef6b55609dd38383ea69e7558133d1d by Dawit Alemayehu.
Commit Hook
This review has been submitted with commit 67625dcea346e1f54da49809d38e9db528ac7ef5 by Dawit Alemayehu.
Loading...