Index: ui/base/x/x11_util.cc |
diff --git a/ui/base/x/x11_util.cc b/ui/base/x/x11_util.cc |
index e51faaaf940c2de31dff802f74a0bef6e3e348e5..d892cb62bf4788aef057075fbadaee77968aa475 100644 |
--- a/ui/base/x/x11_util.cc |
+++ b/ui/base/x/x11_util.cc |
@@ -463,6 +463,37 @@ void HideHostCursor() { |
return invisible_cursor; |
} |
+void SetUseOSWindowFrame(XID window, bool use_os_window_frame) { |
+ // This data structure represents additional hints that we send to the window |
+ // manager and has a direct lineage back to Motif, which defined this de facto |
+ // standard. This struct doesn't seem 64-bit safe though, but it's what GDK |
+ // does. |
+ typedef struct { |
+ unsigned long flags; |
+ unsigned long functions; |
+ unsigned long decorations; |
+ long input_mode; |
+ unsigned long status; |
+ } MotifWmHints; |
+ |
+ MotifWmHints motif_hints; |
+ memset(&motif_hints, 0, sizeof(motif_hints)); |
+ // Signals that the reader of the _MOTIF_WM_HINTS property should pay |
+ // attention to the value of |decorations|. |
+ motif_hints.flags = (1L << 1); |
+ motif_hints.decorations = use_os_window_frame ? 1 : 0; |
+ |
+ ::Atom hint_atom = GetAtom("_MOTIF_WM_HINTS"); |
+ XChangeProperty(gfx::GetXDisplay(), |
+ window, |
+ hint_atom, |
+ hint_atom, |
+ 32, |
+ PropModeReplace, |
+ reinterpret_cast<unsigned char*>(&motif_hints), |
+ sizeof(MotifWmHints)/sizeof(long)); |
+} |
+ |
bool IsShapeExtensionAvailable() { |
int dummy; |
static bool is_shape_available = |