From: Simon Elsbrock Date: Thu, 6 Sep 2012 06:08:46 +0000 (+0200) Subject: toggle fullscreen on 'scratchpad show' X-Git-Tag: 4.3~9^2^2 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=fe6e1f496a1c2a0f1fcd2018ef131537c0363452;p=i3%2Fi3 toggle fullscreen on 'scratchpad show' If the focused application is in fullscreen mode and 'scratchpad show' is executed, toggle the fullscreen mode before showing the scratchpad application. Otherwise, the scratchpad app would not be visible anyways but focus would be stolen. fixes #613 --- diff --git a/src/scratchpad.c b/src/scratchpad.c index c54b1ada..508d4a82 100644 --- a/src/scratchpad.c +++ b/src/scratchpad.c @@ -76,6 +76,16 @@ void scratchpad_show(Con *con) { Con *__i3_scratch = workspace_get("__i3_scratch", NULL); Con *floating; + /* If the current con or any of its parents are in fullscreen mode, we + * first need to disable it before showing the scratchpad con. */ + Con *fs = focused; + while (fs && fs->fullscreen_mode == CF_NONE) + fs = fs->parent; + + if (fs->type != CT_WORKSPACE) { + con_toggle_fullscreen(focused, CF_OUTPUT); + } + /* If this was 'scratchpad show' without criteria, we check if the * currently focused window is a scratchpad window and should be hidden * again. */