Implement the popup_during_fullscreen option, set default to leave_fullscreen
Fixes #333
This commit is contained in:
parent
51ff0f80a6
commit
7154fecbbf
|
@ -127,6 +127,12 @@ struct Config {
|
|||
struct Colortriple unfocused;
|
||||
struct Colortriple urgent;
|
||||
} bar;
|
||||
|
||||
/** What should happen when a new popup is opened during fullscreen mode */
|
||||
enum {
|
||||
PDF_LEAVE_FULLSCREEN = 0,
|
||||
PDF_IGNORE = 1
|
||||
} popup_during_fullscreen;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
@ -99,6 +99,9 @@ none { return TOK_NONE; }
|
|||
1pixel { return TOK_1PIXEL; }
|
||||
focus_follows_mouse { return TOKFOCUSFOLLOWSMOUSE; }
|
||||
workspace_bar { return TOKWORKSPACEBAR; }
|
||||
popup_during_fullscreen { return TOK_POPUP_DURING_FULLSCREEN; }
|
||||
ignore { return TOK_IGNORE; }
|
||||
leave_fullscreen { return TOK_LEAVE_FULLSCREEN; }
|
||||
default { /* yylval.number = MODE_DEFAULT; */return TOKCONTAINERMODE; }
|
||||
stacking { /* yylval.number = MODE_STACK; */return TOKCONTAINERMODE; }
|
||||
tabbed { /* yylval.number = MODE_TABBED; */return TOKCONTAINERMODE; }
|
||||
|
|
|
@ -233,6 +233,9 @@ void parse_file(const char *f) {
|
|||
%token TOKWORKSPACEBAR "workspace_bar"
|
||||
%token TOKCONTAINERMODE "default/stacking/tabbed"
|
||||
%token TOKSTACKLIMIT "stack-limit"
|
||||
%token TOK_POPUP_DURING_FULLSCREEN "popup_during_fullscreen"
|
||||
%token TOK_IGNORE "ignore"
|
||||
%token TOK_LEAVE_FULLSCREEN "leave_fullscreen"
|
||||
|
||||
%%
|
||||
|
||||
|
@ -260,6 +263,7 @@ line:
|
|||
| terminal
|
||||
| font
|
||||
| comment
|
||||
| popup_during_fullscreen
|
||||
;
|
||||
|
||||
comment:
|
||||
|
@ -641,3 +645,16 @@ binding_modifier:
|
|||
| TOKCONTROL { $<number>$ = BIND_CONTROL; }
|
||||
| TOKSHIFT { $<number>$ = BIND_SHIFT; }
|
||||
;
|
||||
|
||||
popup_during_fullscreen:
|
||||
TOK_POPUP_DURING_FULLSCREEN WHITESPACE popup_setting
|
||||
{
|
||||
DLOG("popup_during_fullscreen setting: %d\n", $<number>3);
|
||||
config.popup_during_fullscreen = $<number>3;
|
||||
}
|
||||
;
|
||||
|
||||
popup_setting:
|
||||
TOK_IGNORE { $<number>$ = PDF_IGNORE; }
|
||||
| TOK_LEAVE_FULLSCREEN { $<number>$ = PDF_LEAVE_FULLSCREEN; }
|
||||
;
|
||||
|
|
13
src/manage.c
13
src/manage.c
|
@ -247,9 +247,20 @@ void manage_window(xcb_window_t window, xcb_get_window_attributes_cookie_t cooki
|
|||
if (cwindow->transient_for != XCB_NONE ||
|
||||
(cwindow->leader != XCB_NONE &&
|
||||
cwindow->leader != cwindow->id &&
|
||||
con_by_window_id(cwindow->leader) != NULL))
|
||||
con_by_window_id(cwindow->leader) != NULL)) {
|
||||
LOG("This window is transiert for another window, setting floating\n");
|
||||
want_floating = true;
|
||||
|
||||
if (config.popup_during_fullscreen == PDF_LEAVE_FULLSCREEN) {
|
||||
Con *ws = con_get_workspace(nc);
|
||||
Con *fs = con_get_fullscreen_con(ws);
|
||||
if (fs != NULL) {
|
||||
LOG("There is a fullscreen window, leaving fullscreen mode\n");
|
||||
con_toggle_fullscreen(fs);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* dock clients cannot be floating, that makes no sense */
|
||||
if (cwindow->dock)
|
||||
want_floating = false;
|
||||
|
|
Loading…
Reference in New Issue