summaryrefslogtreecommitdiffstats
path: root/source/x11-helper.c
diff options
context:
space:
mode:
authorDave Davenport <qball@gmpclient.org>2016-09-08 08:53:14 +0200
committerDave Davenport <qball@gmpclient.org>2016-09-08 08:57:35 +0200
commite3fb17a843602df47ccf417c051e811e2da60ce1 (patch)
tree63868f52441a0808bd9c0b1fed5afe885fe57806 /source/x11-helper.c
parentabc190fd7cf50ca373ab71c675195c6280418bb6 (diff)
Ask window manager to hide decoration in normal-window mode.
Issue #485
Diffstat (limited to 'source/x11-helper.c')
-rw-r--r--source/x11-helper.c45
1 files changed, 35 insertions, 10 deletions
diff --git a/source/x11-helper.c b/source/x11-helper.c
index 096d82d4..98aabcf1 100644
--- a/source/x11-helper.c
+++ b/source/x11-helper.c
@@ -58,7 +58,7 @@
#define LOG_DOMAIN "X11Helper"
-struct _xcb_stuff xcb_int = {
+struct _xcb_stuff xcb_int = {
.connection = NULL,
.screen = NULL,
.screen_nbr = -1,
@@ -66,14 +66,13 @@ struct _xcb_stuff xcb_int = {
.sncontext = NULL,
.monitors = NULL
};
-xcb_stuff *xcb = &xcb_int;
+xcb_stuff *xcb = &xcb_int;
-
-xcb_depth_t *depth = NULL;
-xcb_visualtype_t *visual = NULL;
-xcb_colormap_t map = XCB_COLORMAP_NONE;
-xcb_depth_t *root_depth = NULL;
-xcb_visualtype_t *root_visual = NULL;
+xcb_depth_t *depth = NULL;
+xcb_visualtype_t *visual = NULL;
+xcb_colormap_t map = XCB_COLORMAP_NONE;
+xcb_depth_t *root_depth = NULL;
+xcb_visualtype_t *root_visual = NULL;
xcb_atom_t netatoms[NUM_NETATOMS];
const char *netatom_names[] = { EWMH_ATOMS ( ATOM_CHAR ) };
static unsigned int x11_mod_masks[NUM_X11MOD];
@@ -587,9 +586,9 @@ static void x11_figure_out_masks ( xkb_stuff *xkb )
}
}
-int x11_modifier_active ( unsigned int mask, int key )
+int x11_modifier_active ( unsigned int mask, int key )
{
- return (x11_mod_masks[key]&mask) != 0;
+ return ( x11_mod_masks[key] & mask ) != 0;
}
unsigned int x11_canonalize_mask ( unsigned int mask )
@@ -949,3 +948,29 @@ void xcb_stuff_wipe ( xcb_stuff *xcb )
xcb->screen_nbr = 0;
}
}
+
+void x11_disable_decoration ( xcb_window_t window )
+{
+#define MWM_HINTS_FUNCTIONS ( 1 << 0 )
+#define MWM_HINTS_DECORATIONS ( 1 << 1 )
+ struct MotifWMHints
+ {
+ uint32_t flags;
+ uint32_t functions;
+ uint32_t decorations;
+ int32_t inputMode;
+ uint32_t state;
+ };
+
+ struct MotifWMHints hints;
+ hints.flags = /*MWM_HINTS_FUNCTIONS |*/ MWM_HINTS_DECORATIONS;
+ hints.decorations = 0;
+ hints.functions = 0;
+ hints.inputMode = 0;
+ hints.state = 0;
+
+ xcb_atom_t ha = netatoms[_MOTIF_WM_HINTS];
+ xcb_change_property ( xcb->connection, XCB_PROP_MODE_REPLACE, window, ha, ha, 32, 5, &hints );
+#undef MWM_HINTS_DECORATIONS
+#undef MWM_HINTS_FUNCTIONS
+}