Commit 692aa804 authored by Fredrik Söderqvist's avatar Fredrik Söderqvist Committed by Commit Bot

Fix setting the _MOTIF_WM_HINTS property

Since we no longer pass through XLib's XChangeProperty() but
rather our own X protocol encoder we should define the MotifWmHints
struct using protocol/wire-format types instead (CARD32?).

Bug: 1066670
Change-Id: I3c0180b094ea796a23a7dfe24758828c33c2f084
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2210465Reviewed-by: default avatarThomas Anderson <thomasanderson@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#770692}
parent eb7a3b28
......@@ -466,21 +466,21 @@ void HideHostCursor() {
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.
// standard. We define this struct to match the wire-format (32-bit fields)
// rather than the Xlib API (XChangeProperty) format (long fields).
typedef struct {
unsigned long flags;
unsigned long functions;
unsigned long decorations;
long input_mode;
unsigned long status;
uint32_t flags;
uint32_t functions;
uint32_t decorations;
int32_t input_mode;
uint32_t 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.flags = (1u << 1);
motif_hints.decorations = use_os_window_frame ? 1 : 0;
std::vector<uint32_t> hints(sizeof(MotifWmHints) / sizeof(uint32_t));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment