mirror of
https://github.com/davatorium/rofi.git
synced 2024-11-25 13:55:34 -05:00
Ask window manager to hide decoration in normal-window mode.
Issue #485
This commit is contained in:
parent
abc190fd7c
commit
e3fb17a843
7 changed files with 78 additions and 43 deletions
|
@ -39,6 +39,7 @@ void window_set_atom_prop ( xcb_window_t w, xcb_atom_t prop, xcb_atom_t *atoms,
|
|||
X ( STRING ), \
|
||||
X ( WM_WINDOW_ROLE ), \
|
||||
X ( _XROOTPMAP_ID ), \
|
||||
X ( _MOTIF_WM_HINTS ), \
|
||||
X ( ESETROOT_PMAP_ID )
|
||||
|
||||
enum { EWMH_ATOMS ( ATOM_ENUM ), NUM_NETATOMS };
|
||||
|
@ -168,5 +169,13 @@ cairo_surface_t * x11_helper_get_bg_surface ( void );
|
|||
void x11_build_monitor_layout ( void );
|
||||
void x11_dump_monitor_layout ( void );
|
||||
int x11_modifier_active ( unsigned int mask, int key );
|
||||
|
||||
/**
|
||||
* @param window The X11 window to modify
|
||||
*
|
||||
* Set the right hints to disable the window decoration.
|
||||
* (Set MOTIF_WM_HINTS, decoration field)
|
||||
*/
|
||||
void x11_disable_decoration ( xcb_window_t window );
|
||||
/*@}*/
|
||||
#endif
|
||||
|
|
|
@ -611,6 +611,7 @@ void __create_window ( MenuFlags menu_flags )
|
|||
}
|
||||
else{
|
||||
window_set_atom_prop ( box, xcb->ewmh._NET_WM_WINDOW_TYPE, &( xcb->ewmh._NET_WM_WINDOW_TYPE_NORMAL ), 1 );
|
||||
x11_disable_decoration ( box );
|
||||
}
|
||||
if ( config.fullscreen ) {
|
||||
xcb_atom_t atoms[] = {
|
||||
|
|
|
@ -68,7 +68,6 @@ struct _xcb_stuff xcb_int = {
|
|||
};
|
||||
xcb_stuff *xcb = &xcb_int;
|
||||
|
||||
|
||||
xcb_depth_t *depth = NULL;
|
||||
xcb_visualtype_t *visual = NULL;
|
||||
xcb_colormap_t map = XCB_COLORMAP_NONE;
|
||||
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue