Implement the popup_during_fullscreen option, set default to leave_fullscreen

Fixes #333
This commit is contained in:
Michael Stapelberg 2011-03-06 15:45:42 +01:00
parent 51ff0f80a6
commit 7154fecbbf
4 changed files with 38 additions and 1 deletions

View File

@ -127,6 +127,12 @@ struct Config {
struct Colortriple unfocused; struct Colortriple unfocused;
struct Colortriple urgent; struct Colortriple urgent;
} bar; } bar;
/** What should happen when a new popup is opened during fullscreen mode */
enum {
PDF_LEAVE_FULLSCREEN = 0,
PDF_IGNORE = 1
} popup_during_fullscreen;
}; };
/** /**

View File

@ -99,6 +99,9 @@ none { return TOK_NONE; }
1pixel { return TOK_1PIXEL; } 1pixel { return TOK_1PIXEL; }
focus_follows_mouse { return TOKFOCUSFOLLOWSMOUSE; } focus_follows_mouse { return TOKFOCUSFOLLOWSMOUSE; }
workspace_bar { return TOKWORKSPACEBAR; } 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; } default { /* yylval.number = MODE_DEFAULT; */return TOKCONTAINERMODE; }
stacking { /* yylval.number = MODE_STACK; */return TOKCONTAINERMODE; } stacking { /* yylval.number = MODE_STACK; */return TOKCONTAINERMODE; }
tabbed { /* yylval.number = MODE_TABBED; */return TOKCONTAINERMODE; } tabbed { /* yylval.number = MODE_TABBED; */return TOKCONTAINERMODE; }

View File

@ -233,6 +233,9 @@ void parse_file(const char *f) {
%token TOKWORKSPACEBAR "workspace_bar" %token TOKWORKSPACEBAR "workspace_bar"
%token TOKCONTAINERMODE "default/stacking/tabbed" %token TOKCONTAINERMODE "default/stacking/tabbed"
%token TOKSTACKLIMIT "stack-limit" %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 | terminal
| font | font
| comment | comment
| popup_during_fullscreen
; ;
comment: comment:
@ -641,3 +645,16 @@ binding_modifier:
| TOKCONTROL { $<number>$ = BIND_CONTROL; } | TOKCONTROL { $<number>$ = BIND_CONTROL; }
| TOKSHIFT { $<number>$ = BIND_SHIFT; } | 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; }
;

View File

@ -247,9 +247,20 @@ void manage_window(xcb_window_t window, xcb_get_window_attributes_cookie_t cooki
if (cwindow->transient_for != XCB_NONE || if (cwindow->transient_for != XCB_NONE ||
(cwindow->leader != XCB_NONE && (cwindow->leader != XCB_NONE &&
cwindow->leader != cwindow->id && 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; 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 */ /* dock clients cannot be floating, that makes no sense */
if (cwindow->dock) if (cwindow->dock)
want_floating = false; want_floating = false;