window: use _NET_WM_STATE_FULLSCREEN before window is mapped

This commit is contained in:
Robo 2015-06-29 19:23:33 +05:30
parent ebfbbc0801
commit b5c5cce725
2 changed files with 12 additions and 3 deletions

View file

@ -189,10 +189,12 @@ void NativeWindow::InitFromOptions(const mate::Dictionary& options) {
if (options.Get(switches::kAlwaysOnTop, &top) && top) {
SetAlwaysOnTop(true);
}
#if defined(OS_MACOSX) || defined(OS_WIN)
bool fullscreen;
if (options.Get(switches::kFullscreen, &fullscreen) && fullscreen) {
SetFullScreen(true);
}
#endif
bool skip;
if (options.Get(switches::kSkipTaskbar, &skip) && skip) {
SetSkipTaskbar(skip);

View file

@ -285,14 +285,21 @@ NativeWindowViews::NativeWindowViews(
// Before the window is mapped the SetWMSpecState can not work, so we have
// to manually set the _NET_WM_STATE.
std::vector<::Atom> state_atom_list;
bool skip_taskbar = false;
if (options.Get(switches::kSkipTaskbar, &skip_taskbar) && skip_taskbar) {
std::vector<::Atom> state_atom_list;
state_atom_list.push_back(GetAtom("_NET_WM_STATE_SKIP_TASKBAR"));
ui::SetAtomArrayProperty(GetAcceleratedWidget(), "_NET_WM_STATE", "ATOM",
state_atom_list);
}
// Before the window is mapped, there is no SHOW_FULLSCREEN_STATE.
bool fullscreen = false;
if (options.Get(switches::kFullscreen, & fullscreen) && fullscreen) {
state_atom_list.push_back(GetAtom("_NET_WM_STATE_FULLSCREEN"));
}
ui::SetAtomArrayProperty(GetAcceleratedWidget(), "_NET_WM_STATE", "ATOM",
state_atom_list);
// Set the _NET_WM_WINDOW_TYPE.
std::string window_type;
if (options.Get(switches::kType, &window_type))