Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Chrome packaged app window maximizes to full-screen on Windows 8

When I maximize a packaged app window (created using chrome.app.window.create) on Windows 8 it is maximized to full-screen (hiding the taskbar).

Is there a way for the chrome window to be maximized normally and not in full-screen ? (leaving the taskbar visible)

like image 627
Stefania Avatar asked Nov 12 '22 08:11

Stefania


1 Answers

I realize this is somewhat outdated, but somehow the issue still persists, and I think I found a temporary solution.

You can use the chrome.system.display API to query the usable area of the screen, and then set that as the width/height of the window:

chrome.system.display.getInfo(function(info) {
    var width = info[0].workArea.width;
    var height = info[0].workArea.height;
    chrome.app.window.create(url, {
        bounds: {
            width: width,
            height: height
        },
    });
});

chrome.system.display.getInfo() returns an object with data regarding the display(s), inside of which the workArea property specifies the usable height/width. Just remember to include the system.display permission in the app manifest! You can read more here.

Definitely a hack, but it works.

like image 58
Kincaid Avatar answered Dec 21 '22 21:12

Kincaid