mirror of https://github.com/davatorium/rofi.git
only allow normal mode in dmenu mode.
This commit is contained in:
parent
1a23add631
commit
ec1f399e32
|
@ -73,6 +73,8 @@ GC gc = NULL;
|
|||
Colormap map = None;
|
||||
XVisualInfo vinfo;
|
||||
|
||||
unsigned int normal_window_mode = FALSE;
|
||||
|
||||
typedef struct _Mode
|
||||
{
|
||||
Switcher *sw;
|
||||
|
@ -213,7 +215,7 @@ static Window create_window ( Display *display )
|
|||
XSetLineAttributes ( display, gc, 2, line_style, CapButt, JoinMiter );
|
||||
XSetForeground ( display, gc, color_separator ( display ) );
|
||||
// make it an unmanaged window
|
||||
if ( find_arg ( "-normal-window" ) < 0 ) {
|
||||
if ( !normal_window_mode ) {
|
||||
window_set_atom_prop ( display, box, netatoms[_NET_WM_STATE], &netatoms[_NET_WM_STATE_ABOVE], 1 );
|
||||
XSetWindowAttributes sattr = { .override_redirect = True };
|
||||
XChangeWindowAttributes ( display, box, CWOverrideRedirect, &sattr );
|
||||
|
@ -1164,11 +1166,11 @@ MenuReturn menu ( Switcher *sw, char **input, char *prompt,
|
|||
}
|
||||
}
|
||||
}
|
||||
else if ( ev.type == FocusIn) {
|
||||
take_keyboard(display, main_window);
|
||||
else if ( ev.type == FocusIn ) {
|
||||
take_keyboard ( display, main_window );
|
||||
}
|
||||
else if ( ev.type == FocusOut) {
|
||||
release_keyboard(display);
|
||||
else if ( ev.type == FocusOut ) {
|
||||
release_keyboard ( display );
|
||||
}
|
||||
// Handle event.
|
||||
else if ( ev.type == Expose ) {
|
||||
|
@ -1998,6 +2000,7 @@ int main ( int argc, char *argv[] )
|
|||
|
||||
// Dmenu mode.
|
||||
if ( dmenu_mode == TRUE ) {
|
||||
normal_window_mode = find_arg ( "-normal-window" ) >= 0;
|
||||
// force off sidebar mode:
|
||||
config.sidebar_mode = FALSE;
|
||||
int retv = run_dmenu ();
|
||||
|
|
Loading…
Reference in New Issue