[FIXED] [#1565] [4.5.0] Desktop - open window maximized

  1. #1

    [FIXED] [#1565] [4.5.0] Desktop - open window maximized

    Hello support team,
    the maximized window is not opened at the position [0,0]. However, window restore is OK.

    @using Ext.Net;
    @using Ext.Net.MVC;
        Layout = null;
        var X = Html.X();
    <!DOCTYPE html>
        <title>Ext.NET MVC Test Case - Open Window Maximized</title>
            .x-default-shortcut {
                background: url("http://www.nlm.cz/img/logoNewlink.png");
                background-position: center;
                background-repeat: no-repeat;
                background-size: cover;
                .ShortcutDefaults(defaults => defaults.IconCls = "x-default-shortcut")
                    .Shortcut(new DesktopShortcut {
                        Name = "Notepad",
                        IconCls = "x-default-shortcut",
                        X = "100",
                        Y = "100",
                        Handler = "var win = App._nelisDesktop.desktop.createWindow({ autoRender: false, x: 250, y: 250, width: 300, height: 300, xtype: 'window', title: 'Notepad', iconCls: '#ApplicationAdd', defaultRenderTo: 'form', maximized: true }); win.show();"
    Steps to reproduce:
    1. Open notepad window -> positioning is incorrect
    2. Restore to initial size -> correct

    Thank you for your help.

    Last edited by NewLink; Oct 08, 2017 at 4:29 PM.
  2. #2
    Hello Dan!

    Yes, that's an issue. Thanks again for the straightforward test case. The desktop should really support specifying both the normal window size/position and starting maximized.

    Here's a workaround, breaking down your client-side code to a function and just setting Handler="sw();" in the shortcut:

    var sw = function () {
        var win = App._nelisDesktop.desktop.createWindow({
            x: 250,
            y: 250,
            width: 300,
            height: 300,
            title: 'Notepad',
    Noticed I simplified the example to the bare minimum necessary settings to reproduce the issue. This helps ensuring no "fancy" settings are triggering it. We're going to further investigate this issue and add another post here with the issue number and more details if applicable.

    Hope this helps!
    Fabrício Murta
    Developer & Support Expert
  3. #3
    Hello Fabrício,
    thank you again for your help. Yes, this is the solution that works. Interestingly, if I change the environment to Azzurra 6 theme by Codaxy, it works well. So maybe a style related problem? Just for the record...

  4. #4
    Hello Dan!

    Sorry, but I must admit I have no idea what you're talking about when you say you switched to "Azzurra 6 theme by Codaxy" so, no clue what's involved on the change to "address" the issue.
    Fabrício Murta
    Developer & Support Expert
  5. #5
    Hello Fabrício,
    no problem. I have just mentioned it as an interesting fact that when using Azzurra then maximized works as it should. It's nothing essential for this issue.

    Thanks for your help.

  6. #6
    Hello Dan! Alright, it may make sense the theme fixes it, but I tried with different Ext.NET themes and didn't.

    Anyway, the trouble seems to be deep within window's show() and afterRender() events, maybe it just works with the custom theme "by chance", so we've given the desktop a double check when it displays an initially maximized window, instead of fiddling in within the window (as it somehow works when there's no desktop at all).

    I noticed the window is not broken y-coordinate-wise because it sets constrainHeader to true in the window -- so ExtJS own layout assures the window is moved back so that full title is displayed.

    The fix is available right now from sources and will be also publicly available once we release Ext.NET 4.5.0.
    Fabrício Murta
    Developer & Support Expert
  7. #7
    Hello Fabrício,
    thank you for letting me know. I will test it once Ext.NET 4.5.0 is installed on our server.

    Thank you for your help.

  8. #8
    Hello Fabrício, tested and works as expected. Thank you for your assistance.

  9. #9
    Hello Dan! And thanks for the feedback! Glad it worked for you!
    Fabrício Murta
    Developer & Support Expert

Similar Threads

  1. [CLOSED] Initially maximized window does not restore to fixed size
    By AaronDev in forum 2.x Legacy Premium Help
    Replies: 4
    Last Post: Oct 22, 2014, 8:23 AM
  2. Replies: 11
    Last Post: Apr 29, 2013, 4:03 AM
  3. [CLOSED] How to position a window into a desktop on window open
    By feanor91 in forum 2.x Legacy Premium Help
    Replies: 4
    Last Post: Nov 26, 2012, 1:59 PM
  4. [CLOSED] Show Desktop window maximized - strange behavior
    By FAS in forum 1.x Legacy Premium Help
    Replies: 10
    Last Post: Apr 03, 2012, 5:58 PM
  5. [CLOSED] Maximized window doesn't remain maximized
    By vadym.f in forum 1.x Legacy Premium Help
    Replies: 9
    Last Post: Feb 07, 2012, 3:32 PM

Tags for this Thread

Posting Permissions