Add "type" option to change window type
This commit is contained in:
parent
6b37f30bd6
commit
f0924df68a
5 changed files with 29 additions and 0 deletions
|
@ -4,6 +4,9 @@
|
|||
|
||||
#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 {
|
||||
|
@ -31,4 +34,16 @@ void SetWMSpecState(::Window xwindow, bool enabled, ::Atom state) {
|
|||
&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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue