From ac694015ba9a1d7cf8fc6346c6e51d4c35a62962 Mon Sep 17 00:00:00 2001 From: Jan Zerebecki Date: Sat, 25 Jul 2009 15:39:54 +0200 Subject: [PATCH] server: Hack to prevent focus loss in full screen games while using virtual desktop mode. This pach is disable by default by an #ifndef NOFOCUSLOSS . This patch breaks focus related stuff. So don't use it if you are unsure. commit dcdf7c55d642bf584678ca44054f410f0634ec05 server: Treat desktop as a top-level window. --- server/window.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/server/window.c b/server/window.c index a0e0788cc36..01b714b1f20 100644 --- a/server/window.c +++ b/server/window.c @@ -551,6 +551,14 @@ int is_child_window( user_handle_t parent, user_handle_t child ) int is_top_level_window( user_handle_t window ) { struct window *win = get_user_object( window, USER_WINDOW ); + #ifndef NOFOCUSLOSS + /* set to 1 to not loose focus (e.g. when playing a game + * in virtual desktop mode) */ + #define NOFOCUSLOSS 0 + #endif + if(NOFOCUSLOSS) + return (win && win->parent && is_desktop_window(win->parent)); + else return (win && (is_desktop_window(win) || is_desktop_window(win->parent))); } -- 2.11.4.GIT