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))
+ SetWindowType(GetAcceleratedWidget(), window_type);
#endif
// Add web view.
#include "atom/browser/ui/x/x_window_utils.h"
+#include <X11/Xatom.h>
+
+#include "base/strings/string_util.h"
#include "ui/base/x/x11_util.h"
namespace atom {
&xclient);
}
+void SetWindowType(::Window xwindow, const std::string& type) {
+ XDisplay* xdisplay = gfx::GetXDisplay();
+ std::string type_prefix = "_NET_WM_WINDOW_TYPE_";
+ ::Atom window_type = XInternAtom(
+ xdisplay, (type_prefix + StringToUpperASCII(type)).c_str(), False);
+ XChangeProperty(xdisplay, xwindow,
+ XInternAtom(xdisplay, "_NET_WM_WINDOW_TYPE", False),
+ XA_ATOM,
+ 32, PropModeReplace,
+ reinterpret_cast<unsigned char*>(&window_type), 1);
+}
+
} // namespace atom
#include <X11/extensions/Xrandr.h>
#include <X11/Xlib.h>
+#include <string>
+
namespace atom {
::Atom GetAtom(const char* name);
// for _NET_WM_STATE.
void SetWMSpecState(::Window xwindow, bool enabled, ::Atom state);
+// Sets the _NET_WM_WINDOW_TYPE of window.
+void SetWindowType(::Window xwindow, const std::string& type);
+
} // namespace atom
#endif // ATOM_BROWSER_UI_X_X_WINDOW_UTILS_H_
// Whether the window should be transparent.
const char kTransparent[] = "transparent";
+// Window type hint.
+const char kType[] = "type";
+
// Web runtime features.
const char kExperimentalFeatures[] = "experimental-features";
const char kExperimentalCanvasFeatures[] = "experimental-canvas-features";
extern const char kGuestInstanceID[];
extern const char kPreloadScript[];
extern const char kTransparent[];
+extern const char kType[];
extern const char kExperimentalFeatures[];
extern const char kExperimentalCanvasFeatures[];