Focus fullscreen windows.
commitdf7fb014e59630653d06387a28b80688384b68d3
authorIain Patterson <wm@iain.cx>
Thu, 17 Oct 2013 10:08:19 +0000 (17 11:08 +0100)
committerCarlos R. Mafra <crmafra@gmail.com>
Thu, 17 Oct 2013 17:11:00 +0000 (17 18:11 +0100)
treed4504506f81e77be0e2b5252dd009ac19d95471d
parent86fbf8baaab98b4a71563ff9eb45df0a602fcacb
Focus fullscreen windows.

Windows which enter fullscreen mode were not automatically given focus.
Usually that didn't matter because they already had focus when they
switched modes.  An example of unexpected behaviour is opening a media
file in an already-running vlc from the commandline or via a file manager.
vlc would fullscreen mode but the launching application would retain focus.

Note that if vlc were not already running and it was launched as
described above, it would receive focus when it was opened and thus
retain focus going into fullscreen.

We now track which window had focus before a window enters fullscreen
mode and focus the original window afterwards.  In the (usual) case
where the window going fullscreen already had focus, nothing changes.
In the rarer case where the window going fullscreen didn't
have focus, it will gain focus temporarily then yield to the originally
focussed window when it leaves fullscreen mode.

To reproduce:

  * Launch vlc and configure it to switch to fullscreen when playing a
movie and to disallow multiple instances.

  * Switch to a terminal and type 'vlc /media/funny_cats.mp4' or use a
file manager to open funny_cats.mp4 with vlc.

  * Press space to pause the movie.  Nothing happens because the
terminal/file manager still has focus.
src/actions.c
src/screen.h
src/window.c